From 068c68295cad1967f7aafb4e5e951260ef03d4ce Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 09 七月 2021 09:16:43 +0800 Subject: [PATCH] 状态属性更改,不要轻易合并 --- HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs index bfa25c1..6dc85c6 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs @@ -198,7 +198,7 @@ Height = Application.GetRealWidth(32), UnSelectedImagePath = "Public/PowerClose.png", SelectedImagePath = "Public/PowerOpen.png", - IsSelected = device.trait_on_off.curValue.ToString() == "on" + IsSelected = device.trait_on_off.state.ToString() == "on" }; FrameWhiteCentet1.AddChidren(btnSwitch); @@ -360,7 +360,7 @@ { btnMinus.MouseUpEventHandler = (sender, e) => { - if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") { return; } @@ -379,7 +379,7 @@ }; btnPlus.MouseUpEventHandler = (sender, e) => { - if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") { return; } @@ -417,7 +417,7 @@ { btnMode.MouseUpEventHandler = (sender, e) => { - if (device.trait_on_off.curValue.ToString() == "off") + if (device.trait_on_off.state.ToString() == "off") { return; } @@ -427,8 +427,8 @@ btnSwitch.MouseUpEventHandler = (sender, e) => { btnSwitch.IsSelected = !btnSwitch.IsSelected; - device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; - if (device.trait_on_off.curValue.ToString() == "on") + device.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off"; + if (device.trait_on_off.state.ToString() == "on") { arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; btnSwitch.IsSelected = true; @@ -441,7 +441,7 @@ arcBar.IsOffline = true; } System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); + d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.state.ToString()); Control.Ins.SendWriteCommand(device, d); }; } @@ -455,13 +455,13 @@ /// </summary> private void RefreshFormStatu() { - Application.RunOnMainThread(() => + Application.RunOnMainThread((Action)(() => { btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp); btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "掳C"; btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); - if (device.trait_on_off.curValue.ToString() == "on") + if (device.trait_on_off.state.ToString() == "on") { arcBar.IsOffline = false; btnSwitch.IsSelected = true; @@ -482,7 +482,7 @@ arcBar.IsClickable = false; arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; } - }); + })); } #endregion -- Gitblit v1.8.0