From 4a83749337096aae6dd5ec4f44f16653fbc7268a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期三, 10 三月 2021 16:19:52 +0800 Subject: [PATCH] 2021-03-10 1.合并 --- HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs | 35 +++++++++++++---------------------- 1 files changed, 13 insertions(+), 22 deletions(-) diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs index 8c27dc8..b86e4c5 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs @@ -58,6 +58,7 @@ case FunctionCategory.Light: case FunctionCategory.AC: case FunctionCategory.FloorHeat: + case FunctionCategory.Electric: #region 鎸夐挳鐘舵�佹洿鏂� if (cTag == updataFunction.sid + "_Switch") { @@ -76,14 +77,13 @@ { try { + (fcView.GetChildren(j) as DiyImageSeekBar).Progress = Convert.ToInt32(updataFunction.GetAttrState(FunctionAttributeKey.Brightness)); if (updataFunction.trait_on_off.curValue.ToString() == "on") { - (fcView.GetChildren(j) as DiyImageSeekBar).Progress = (updataFunction as Light).brightness; (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; } else { - (fcView.GetChildren(j) as DiyImageSeekBar).Progress = (updataFunction as Light).brightness; (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.PromptingColor2; } } @@ -110,10 +110,14 @@ #endregion case FunctionCategory.Curtain: #region 绐楀笜鏇存柊 - var uCurtain = updataFunction as Curtain; - switch (uCurtain.trait_on_off.curValue.ToString()) + //var uCurtain = updataFunction as Curtain; + var percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent); + if (percentString != null) { - case "off": + int percent = 0; + int.TryParse(percentString, out percent); + if (percent == 0) + { if (cTag == updataFunction.sid + "_off") { try @@ -126,8 +130,9 @@ { (fcView.GetChildren(j) as Button).IsSelected = false; } - break; - case "on": + } + else + { if (cTag == updataFunction.sid + "_on") { try @@ -140,21 +145,7 @@ { (fcView.GetChildren(j) as Button).IsSelected = false; } - break; - case "stop": - if (cTag == updataFunction.sid + "_stop") - { - try - { - (fcView.GetChildren(j) as Button).IsSelected = true; - } - catch { } - } - else - { - (fcView.GetChildren(j) as Button).IsSelected = false; - } - break; + } } #endregion break; -- Gitblit v1.8.0