wei
2021-07-09 068c68295cad1967f7aafb4e5e951260ef03d4ce
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
@@ -12,21 +12,21 @@
        /// </summary>
        public static void UpdataState(Function updateTemp)
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
                    if (bodyView == null)
                        return;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.curValue.ToString() == "on";
                    bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.curValue.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.state.ToString() == "on";
                    bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.state.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
                    bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.OpenLevel));
                }
                catch (Exception ex)
                {
                    MainPage.Log($"RelayPage error {ex.Message}");
                }
            });
            }));
        }
        /// <summary>
        /// 加载事件列表
@@ -66,10 +66,10 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.function);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
@@ -80,9 +80,9 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
@@ -92,9 +92,9 @@
                function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString());
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();