| | |
| | | |
| | | /// <summary> |
| | | /// 加载功能类型控制卡片 |
| | | /// Tag 功能属性显示 |
| | | /// </summary> |
| | | public void LoadFunctionDiv() |
| | | { |
| | |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | else if (function.spk == SPK.SenesorMegahealth) |
| | | { |
| | | var btnStatus = new Button() |
| | | { |
| | | X = Application.GetRealWidth(51), |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(18), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | Text = "", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Tag = function.sid + "_SenesorMegahealth_Status" |
| | | }; |
| | | bodyDiv.AddChidren(btnStatus); |
| | | |
| | | |
| | | |
| | | var tempStatus = function.attributes.Find((sta) => sta.key == FunctionAttributeKey.TargetStatus); |
| | | if (tempStatus != null) |
| | | { |
| | | |
| | | switch (tempStatus.state) |
| | | {//0空,1走,2跑,3坐,4跌倒,5站 |
| | | case "0": |
| | | btnStatus.TextID = StringId.SensorNormalState; |
| | | btnStatus.TextColor = CSS_Color.MainColor; |
| | | break; |
| | | case "1": |
| | | btnStatus.TextID = StringId.SomeoneIn; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | break; |
| | | case "2": |
| | | if (function.extSet.labModel) |
| | | { |
| | | btnStatus.TextID = StringId.SomeoneRunning; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | else |
| | | { |
| | | btnStatus.TextID = StringId.SomeoneIn; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | break; |
| | | case "3": |
| | | if (function.extSet.labModel) |
| | | { |
| | | btnStatus.TextID = StringId.SomeoneSitting; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | else |
| | | { |
| | | btnStatus.TextID = StringId.SomeoneIn; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | break; |
| | | case "4": |
| | | btnStatus.TextID = StringId.SomeoneFell; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | break; |
| | | case "5": |
| | | if (function.extSet.labModel) |
| | | { |
| | | btnStatus.TextID = StringId.SomeoneStanding; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | else |
| | | { |
| | | btnStatus.TextID = StringId.SomeoneIn; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | else if (function.spk == SPK.DoorLock) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | else if(SPK.PanelSpkList().Contains(function.spk))//智能面板设备 |
| | | else if (function.spk == SPK.HvacCac) |
| | | { |
| | | var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); |
| | | if (powerLowTipAttr != null) |
| | | var btnHumidityIcon = new Button() |
| | | { |
| | | if (powerLowTipAttr.state.ToLower() == "low") |
| | | { |
| | | Button btnTipPowerLow = new Button() |
| | | { |
| | | X = Application.GetRealWidth(307), |
| | | Y = Application.GetRealHeight(70), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | }; |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | var alarmStatusAttr = function.GetAttribute("alarm_status"); |
| | | if(alarmStatusAttr !=null) |
| | | X = Application.GetRealWidth(120), |
| | | Y = Application.GetRealHeight(66), |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(18), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacHumidityIcon.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnHumidityIcon); |
| | | var btnHumidityValues = new TextButton() |
| | | { |
| | | var btnAlarmStatus = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(53), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(24), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | Tag = "AlarmStatus" |
| | | }; |
| | | if (alarmStatusAttr.state == "alarm") |
| | | { |
| | | btnAlarmStatus.TextID = StringId.InAlarm; |
| | | btnAlarmStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | else |
| | | { |
| | | btnAlarmStatus.TextID = StringId.zhengchang; |
| | | btnAlarmStatus.TextColor = CSS_Color.MainColor; |
| | | } |
| | | X = Application.GetRealWidth(140), |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(18), |
| | | TextColor = 0xFF161616, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.GetAttrState(FunctionAttributeKey.RoomHumidity) + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Tag = function.sid + "_Humidity", |
| | | }; |
| | | btnHumidityValues.Width = btnHumidityValues.GetTextWidth(); |
| | | bodyDiv.AddChidren(btnHumidityValues); |
| | | |
| | | bodyDiv.AddChidren(btnAlarmStatus); |
| | | } |
| | | |
| | | //var tipScrView1 = new HorizontalScrolViewLayout() { |
| | | // X = Application.GetRealWidth(10), |
| | | // Y = Application.GetRealHeight(56), |
| | | // Height = Application.GetRealHeight(20), |
| | | // Width = Application.GetRealWidth(330), |
| | | // BackgroundColor = 0x22220022, |
| | | //}; |
| | | //var tipScrView2 = new HorizontalScrolViewLayout() |
| | | //{ |
| | | // X = Application.GetRealWidth(10), |
| | | // Y = Application.GetRealHeight(83), |
| | | // Height = Application.GetRealHeight(20), |
| | | // Width = Application.GetRealWidth(330), |
| | | // BackgroundColor = 0x22220022, |
| | | //}; |
| | | |
| | | |
| | | foreach (var target in function.targetSids) |
| | | Button btnTempIcon = new Button() |
| | | { |
| | | //bodyDiv.AddChidren(tipScrView1); |
| | | //bodyDiv.AddChidren(tipScrView2); |
| | | var targetObj = FunctionList.List.Functions.Find((obj) => target == obj.sid); |
| | | if(targetObj == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (SPK.AcSpkList().Contains(targetObj.spk)) |
| | | { |
| | | bodyDiv.Height = Application.GetRealHeight(126); |
| | | X = Application.GetRealWidth(51), |
| | | Y = Application.GetRealHeight(66), |
| | | Width = Application.GetMinRealAverage(17), |
| | | Height = Application.GetMinRealAverage(17), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacTempIcon.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnTempIcon); |
| | | |
| | | AC acDevice = new AC(); |
| | | var btnAcMode = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(56), |
| | | Width = Application.GetRealWidth(62), |
| | | Height = Application.GetRealHeight(19), |
| | | BackgroundColor = 0x334484F4, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = 10, |
| | | TextColor = 0xFF4484F4, |
| | | Text = Language.StringByID(StringId.AC) + acDevice.GetModeAttrText(targetObj.GetAttrState(FunctionAttributeKey.Mode)), |
| | | Tag = target + "screen.panel.ac.mode", |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | }; |
| | | bodyDiv.AddChidren(btnAcMode); |
| | | //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(16)}); |
| | | var btnTempValues = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(70), |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(18), |
| | | TextColor = 0xFF161616, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.GetAttrState(FunctionAttributeKey.RoomTemp) + "°C", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Tag = function.sid + "_Temp", |
| | | }; |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | bodyDiv.AddChidren(btnTempValues); |
| | | |
| | | var btnAcTemp = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10 + 72), |
| | | Y = Application.GetRealHeight(56), |
| | | Width = Application.GetRealWidth(62), |
| | | Height = Application.GetRealHeight(19), |
| | | BackgroundColor = 0x334484F4, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = 10, |
| | | TextColor = 0xFF4484F4, |
| | | Text = Language.StringByID(StringId.AC) + targetObj.GetAttrState(FunctionAttributeKey.Temperature) + "°C", |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | Tag = target + "screen.panel.ac.temp" |
| | | }; |
| | | bodyDiv.AddChidren(btnAcTemp); |
| | | //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(6) }); |
| | | } |
| | | else if (SPK.FhSpkList().Contains(targetObj.spk)) |
| | | { |
| | | var btnJinMaoIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(238), |
| | | Y = Application.GetRealHeight(64), |
| | | Width = Application.GetRealWidth(102), |
| | | Height = Application.GetRealHeight(29), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/JinMaoIcon.png" |
| | | }; |
| | | bodyDiv.AddChidren(btnJinMaoIcon); |
| | | |
| | | FloorHeating fhDevice = new FloorHeating(); |
| | | var btnFhMode = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10 + 72*2), |
| | | Y = Application.GetRealHeight(56), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(62), |
| | | Height = Application.GetRealHeight(19), |
| | | BackgroundColor = 0x33ff9d54, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = 10, |
| | | TextColor = 0xFFff9d54, |
| | | Text = Language.StringByID(StringId.FloorHeating) + fhDevice.GetModeAttrText(targetObj.GetAttrState(FunctionAttributeKey.Mode)), |
| | | Tag = target + "screen.panel.fh.mode" |
| | | }; |
| | | bodyDiv.AddChidren(btnFhMode); |
| | | //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(6) }); |
| | | |
| | | var btnFhTemp = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10 + 72 * 3), |
| | | Y = Application.GetRealHeight(56), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(62), |
| | | Height = Application.GetRealHeight(19), |
| | | BackgroundColor = 0x33ff9d54, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = 10, |
| | | TextColor = 0xFFff9d54, |
| | | Text = Language.StringByID(StringId.FloorHeating) + targetObj.GetAttrState(FunctionAttributeKey.Temperature) + "°C", |
| | | Tag = target + "screen.panel.fh.temp" |
| | | }; |
| | | bodyDiv.AddChidren(btnFhTemp); |
| | | //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(6) }); |
| | | } |
| | | else if (SPK.AirFreshSpkList().Contains(targetObj.spk)) |
| | | { |
| | | |
| | | AC acDevice = new AC(); |
| | | var btnAirFreshFanSpeed = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(83), |
| | | Width = Application.GetRealWidth(62), |
| | | Height = Application.GetRealHeight(19), |
| | | BackgroundColor = 0x3309bb07, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = 10, |
| | | TextColor = 0xFF09bb07, |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | Text = Language.StringByID(StringId.AirFresh) + acDevice.GetFanAttrText(targetObj.GetAttrState(FunctionAttributeKey.FanSpeed)), |
| | | Tag = target + "screen.panel.airFresh.mode" |
| | | }; |
| | | bodyDiv.AddChidren(btnAirFreshFanSpeed); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | | |
| | | //if (!function.online) |
| | | //{ |
| | | // bodyDiv.BackgroundColor = CSS_Color.PromptingColor2; |
| | | // btnOffline = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(8 + 10 + 32), |
| | | // Y = Application.GetRealHeight(28 + 24), |
| | | // Height = Application.GetRealHeight(30), |
| | | // TextID = StringId.DeviceOffline, |
| | | // TextColor = CSS_Color.WarningColor, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextAlignment = TextAlignment.CenterLeft |
| | | // }; |
| | | // bodyDiv.AddChidren(btnOffline); |
| | | //} |
| | | if(function.spk == SPK.SenesorMegahealth) |
| | | { |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | | |
| | | if (!function.online) |
| | | { |
| | | bodyDiv.BackgroundColor = CSS_Color.PromptingColor2; |
| | | btnOffline = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(28 + 24), |
| | | Height = Application.GetRealHeight(30), |
| | | TextID = StringId.DeviceOffline, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | bodyDiv.AddChidren(btnOffline); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |