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/2-Classification/FunctionControlZone.cs | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs index e0dbadc..f23e2f3 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs @@ -123,7 +123,7 @@ Height = Application.GetMinRealAverage(32), UnSelectedImagePath = "Public/PowerClose.png", SelectedImagePath = "Public/PowerOpen.png", - IsSelected = function.trait_on_off.curValue.ToString() == "on", + IsSelected = function.trait_on_off.state.ToString() == "on", Tag = function.sid + "_Switch", }; bodyDiv.AddChidren(btnSwitch); @@ -140,7 +140,7 @@ Height = Application.GetMinRealAverage(32), UnSelectedImagePath = "Public/PowerClose.png", SelectedImagePath = "Public/PowerOpen.png", - IsSelected = function.trait_on_off.curValue.ToString() == "on", + IsSelected = function.trait_on_off.state.ToString() == "on", Tag = function.sid + "_Switch", }; bodyDiv.AddChidren(btnSwitch); @@ -160,12 +160,11 @@ LoadLastStatesButton(); break; case FunctionCategory.Light: - //btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png"; - btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; + btnSwitch.IsSelected = function.trait_on_off.state.ToString() == "on"; LoadLightControl(); break; case FunctionCategory.Electric: - btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; + btnSwitch.IsSelected = function.trait_on_off.state.ToString() == "on"; break; } #endregion @@ -266,7 +265,7 @@ SeekBarViewHeight = Application.GetRealHeight(8), ThumbImagePath = "Public/ThumbImage.png", ThumbImageHeight = Application.GetRealHeight(54), - ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.PromptingColor2, + ProgressBarColor = function.trait_on_off.state.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.PromptingColor2, ProgressTextColor = CSS_Color.FirstLevelTitleColor, ProgressTextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, MaxValue = 100, @@ -309,7 +308,7 @@ Height = Application.GetMinRealAverage(32), UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", - IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0", + IsSelected = function.GetAttrState(FunctionAttributeKey.OnOff) == "off", Tag = function.sid + "_off" }; bodyDiv.AddChidren(btnCurtainClose); @@ -340,7 +339,7 @@ UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", Tag = function.sid + "_on", - IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0" + IsSelected = function.GetAttrState(FunctionAttributeKey.OnOff) == "on", }; bodyDiv.AddChidren(btnCurtainOpen); if (function.spk == SPK.CurtainRoller) @@ -449,7 +448,7 @@ TextColor = 0x00000000, TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, Tag = function.spk + "_laststates_" + function.sid, - IsSelected = function.trait_on_off.curValue.ToString() == "on" + IsSelected = function.trait_on_off.state.ToString() == "on" }; bodyDiv.AddChidren(btnLastStates); } -- Gitblit v1.8.0