| | |
| | | case SPK.SensorDoorWindow: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorDoorIcon.png"; |
| | | break; |
| | | default: |
| | | |
| | | break; |
| | | } |
| | | var powerLowTipAttr = function.status.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); |
| | | if (powerLowTipAttr != null) |
| | | { |
| | | if (powerLowTipAttr.value.ToLower() == "low") |
| | | { |
| | | Button btnTipPowerLow = new Button() |
| | | { |
| | | X = Application.GetRealWidth(307), |
| | | Y = Application.GetRealHeight(25), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | }; |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | |
| | | break; |
| | | case FunctionCategory.Music: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png"; |
| | |
| | | } |
| | | else |
| | | { |
| | | #region 加载开关按钮 |
| | | /// <summary> |
| | | /// 开关按钮 |
| | | /// </summary> |
| | | Button btnSwitch; |
| | | if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | if (function.spk == SPK.ClothesHanger) |
| | | { |
| | | btnSwitch = new Button() |
| | | { |
| | | X = Application.GetRealWidth(303), |
| | | Y = Application.GetRealHeight(78), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on", |
| | | Tag = function.sid + "_Switch", |
| | | }; |
| | | bodyDiv.AddChidren(btnSwitch); |
| | | //加载开关按钮事件 |
| | | LoadEvent_SwitchFunction(btnSwitch, function.attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime)); |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerGrayIcon.png"; |
| | | ClothesHangerFragment(); |
| | | } |
| | | else |
| | | { |
| | | btnSwitch = new Button() |
| | | { |
| | | X = Application.GetRealWidth(303), |
| | | Y = Application.GetRealHeight(58), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on", |
| | | Tag = function.sid + "_Switch", |
| | | }; |
| | | bodyDiv.AddChidren(btnSwitch); |
| | | //加载开关按钮事件 |
| | | LoadEvent_SwitchFunction(btnSwitch); |
| | | } |
| | | #region 加载开关按钮 |
| | | |
| | | switch (function.Spk_Prefix) |
| | | { |
| | | case FunctionCategory.AC: |
| | | switch (function.spk) |
| | | /// <summary> |
| | | /// 开关按钮 |
| | | /// </summary> |
| | | Button btnSwitch; |
| | | if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | btnSwitch = new Button() |
| | | { |
| | | case SPK.AcStandard: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png"; |
| | | LoadLastStatesButton(); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | switch (function.spk) |
| | | X = Application.GetRealWidth(303), |
| | | Y = Application.GetRealHeight(78), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on", |
| | | Tag = function.sid + "_Switch", |
| | | }; |
| | | bodyDiv.AddChidren(btnSwitch); |
| | | //加载开关按钮事件 |
| | | LoadEvent_SwitchFunction(btnSwitch, function.attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime)); |
| | | } |
| | | else |
| | | { |
| | | btnSwitch = new Button() |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png"; |
| | | LoadLastStatesButton(); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Light: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png"; |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | LoadLightControl(); |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.ElectricSocket: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png"; |
| | | break; |
| | | case SPK.ElectricFan:
|
| | | case SPK.ElectricTuyaFan: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png"; |
| | | break; |
| | | case SPK.ElectricTV: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png";
|
| | | break;
|
| | | case SPK.ElectricTuyaAirCleaner: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/AirCleanerThiinIcon.png"; |
| | | break;
|
| | | case SPK.ElectricTuyaWeepRobot: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobotThinIcon.png"; |
| | | break; |
| | | case SPK.ElectricTuyaWaterValve: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WaterValve/WaterValveIcon.png"; |
| | | break; |
| | | } |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | break; |
| | | X = Application.GetRealWidth(303), |
| | | Y = Application.GetRealHeight(58), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on", |
| | | Tag = function.sid + "_Switch", |
| | | }; |
| | | bodyDiv.AddChidren(btnSwitch); |
| | | //加载开关按钮事件 |
| | | LoadEvent_SwitchFunction(btnSwitch); |
| | | } |
| | | |
| | | switch (function.Spk_Prefix) |
| | | { |
| | | case FunctionCategory.AC: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.AcStandard: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png"; |
| | | LoadLastStatesButton(); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png"; |
| | | LoadLastStatesButton(); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Light: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png"; |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | LoadLightControl(); |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.ElectricSocket: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png"; |
| | | break; |
| | | case SPK.ElectricFan: |
| | | case SPK.ElectricTuyaFan: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png"; |
| | | break; |
| | | case SPK.ElectricTV: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png"; |
| | | break; |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/AirCleanerThiinIcon.png"; |
| | | break; |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobotThinIcon.png"; |
| | | break; |
| | | case SPK.ElectricTuyaWaterValve: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WaterValve/WaterValveIcon.png"; |
| | | break; |
| | | } |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | break; |
| | | } |
| | | #endregion |
| | | } |
| | | #endregion |
| | | } |
| | | |
| | | LoadEvent_DivSkipEvent(); |
| | |
| | | LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function as Curtain); |
| | | #endregion |
| | | } |
| | | /// <summary> |
| | | /// 加载晾衣架功能控制卡片 |
| | | /// </summary> |
| | | void ClothesHangerFragment() |
| | | { |
| | | #region ClothesHanger |
| | | var btnClothesHangerUp = new Button() |
| | | { |
| | | X = Application.GetRealWidth(163), |
| | | Y = Application.GetRealHeight(58), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerUpIcon1.png", |
| | | SelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerUpIcon1On.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnClothesHangerUp); |
| | | |
| | | var btnClothesHangerDown = new Button() |
| | | { |
| | | X = Application.GetRealWidth(303), |
| | | Y = Application.GetRealHeight(58), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDownIcon1.png", |
| | | SelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDownIcon1On.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnClothesHangerDown); |
| | | LoadEvent_ControlClothesHanger(function, btnClothesHangerDown, btnClothesHangerUp); |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载音乐功能控制卡片 |