陈嘉乐
2021-03-16 e1ac4ab0e68024e6289e0b11756962d662749b04
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs
@@ -73,9 +73,9 @@
        /// </summary>
        private MostRightIconControl btnAnionSwitch = null;
        /// <summary>
        /// 滤芯复位开关控件 2021.03.09控件变更
        /// 滤芯复位开关控件
        /// </summary>
        //private MostRightIconControl btnResetSwitch = null;
        private MostRightIconControl btnResetSwitch = null;
        /// <summary>
        /// 空气质量数据
        /// </summary>
@@ -328,11 +328,12 @@
            rowReset.Height = Application.GetRealHeight(50);
            rowReset.Width = FrameWhiteCentet2.Width;
            rowReset.Y = rowAnion.Bottom;
            //FrameWhiteCentet2.AddChidren(rowReset);
            FrameWhiteCentet2.AddChidren(rowReset);
            rowReset.AddLeftCaption(Language.StringByID(StringId.FilterElementReset), 200);
            rowReset.AddBottomLine();
            rowReset.AddRightArrow();
            rowReset.ButtonClickEvent += (sender, e) =>
            this.btnResetSwitch = rowReset.AddMostRightSwitchIcon();
            btnResetSwitch.IsSelected = this.airCleanerData.FilterReset;
            btnResetSwitch.ButtonClickEvent += (sender, e) =>
            {
                if (this.btnSwitch.IsSelected == false)
                {
@@ -344,7 +345,7 @@
                this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                {
                    //发送使能命令
                    this.SendEnableComand(null, "filter_reset", "true");
                    this.SendEnableComand(btnResetSwitch, "filter_reset", btnResetSwitch.IsSelected == true ? "false" : "true");
                });
            };
        }
@@ -623,18 +624,12 @@
        /// </summary>
        private void SendEnableComand(MostRightIconControl btnSwitch, string sendKey, string value)
        {
            if (btnSwitch != null)
            {
                btnSwitch.CanClick = false;
            }
            btnSwitch.CanClick = false;
            HdlThreadLogic.Current.RunThread(() =>
            {
                var dic = new Dictionary<string, string>();
                dic.Add(sendKey, value);
                Control.Ins.SendWriteCommand(this.device, dic, true);
                if (btnSwitch == null) { return; }
                HdlThreadLogic.Current.RunMain(() =>
                {
                    btnSwitch.CanClick = true;
@@ -774,10 +769,10 @@
                this.btnAnionSwitch.IsSelected = this.airCleanerData.Anion;
            }
            //滤芯复位
            //if (this.btnResetSwitch.IsSelected != this.airCleanerData.FilterReset)
            //{
            //    this.btnResetSwitch.IsSelected = this.airCleanerData.FilterReset;
            //}
            if (this.btnResetSwitch.IsSelected != this.airCleanerData.FilterReset)
            {
                this.btnResetSwitch.IsSelected = this.airCleanerData.FilterReset;
            }
        }
        #endregion