tzy
2021-03-29 8cd7b0fd1c53fc35a9817de31ab5d90f7dc7814b
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
@@ -291,7 +291,7 @@
            {
                frameBack.Close();
                //发送节能命令
                this.SendOtherComand(this.btnMode1, "energy", "true");
                this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "true");
            });
            //舒适
@@ -300,7 +300,7 @@
            {
                frameBack.Close();
                //发送舒适命令
                this.SendOtherComand(this.btnMode1, "energy", "false");
                this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "false");
            });
        }
@@ -338,7 +338,7 @@
            {
                frameBack.Close();
                //发送通风命令
                this.SendOtherComand(this.btnMode2, "mode", "fan");
                this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "fan");
            });
            //加湿
@@ -347,7 +347,7 @@
            {
                frameBack.Close();
                //发送加湿命令
                this.SendOtherComand(this.btnMode2, "mode", "humidification");
                this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "humidification");
            });
        }
@@ -385,7 +385,7 @@
            {
                frameBack.Close();
                //发送档位命令
                this.SendOtherComand(this.btnFan, "fan", "level_1");
                this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_1");
            });
            //2档
@@ -394,7 +394,7 @@
            {
                frameBack.Close();
                //发送档位命令
                this.SendOtherComand(this.btnFan, "fan", "level_2");
                this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_2");
            });
            //3档
@@ -403,7 +403,7 @@
            {
                frameBack.Close();
                //发送档位命令
                this.SendOtherComand(this.btnFan, "fan", "level_3");
                this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_3");
            });
        }
@@ -532,9 +532,10 @@
            HdlThreadLogic.Current.RunThread(() =>
            {
                var dic = new Dictionary<string, string>();
                dic.Add(comadKey, comadValue);
                Control.Ins.SendWriteCommand(this.device, dic, true);
                //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的)
                var dic = this.GetSendComandSample();
                dic[comadKey] = comadValue;
                Control.Ins.SendWriteCommand(this.device, dic);
                HdlThreadLogic.Current.RunMain(() =>
                {
                    btnIcon.CanClick = true;
@@ -552,14 +553,34 @@
            string statu = this.btnSwitch.IsSelected == true ? "off" : "on";
            HdlThreadLogic.Current.RunThread(() =>
            {
                var dic = new Dictionary<string, string>();
                dic.Add(FunctionAttributeKey.OnOff, statu);
                Control.Ins.SendWriteCommand(this.device, dic, true);
                //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的)
                var dic = this.GetSendComandSample();
                dic[FunctionAttributeKey.OnOff] = statu;
                Control.Ins.SendWriteCommand(this.device, dic);
                HdlThreadLogic.Current.RunMain(() =>
                {
                    this.btnSwitch.CanClick = true;
                });
            });
        }
        /// <summary>
        /// 获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的)
        /// </summary>
        /// <returns></returns>
        private Dictionary<string, string> GetSendComandSample()
        {
            var dic = new Dictionary<string, string>();
            //开关
            dic[FunctionAttributeKey.OnOff] = this.airFreshData.Open == true ? "on" : "off";
            //模式
            dic[FunctionAttributeKey.Mode] = this.airFreshData.Mode;
            //节能
            dic[FunctionAttributeKey.Energy] = this.airFreshData.Energy;
            //风速
            dic[FunctionAttributeKey.FanSpeed] = this.airFreshData.Fan ;
            return dic;
        }
        #endregion
@@ -575,15 +596,15 @@
            {
                var data = i_LocalDevice.attributes[i];
                //开关
                if (data.key == "on_off") { this.airFreshData.Open = data.state == "on"; }
                if (data.key == FunctionAttributeKey.OnOff) { this.airFreshData.Open = data.state == "on"; }
                //模式
                else if (data.key == "mode") { this.airFreshData.Mode = data.state; }
                else if (data.key == FunctionAttributeKey.Mode) { this.airFreshData.Mode = data.state; }
                //节能
                else if (data.key == "energy") { this.airFreshData.Energy = data.state; }
                else if (data.key == FunctionAttributeKey.Energy) { this.airFreshData.Energy = data.state; }
                //风速
                else if (data.key == "fan") { this.airFreshData.Fan = data.state; }
                else if (data.key == FunctionAttributeKey.FanSpeed) { this.airFreshData.Fan = data.state; }
                //湿度
                else if (data.key == "humidity")
                else if (data.key == FunctionAttributeKey.Humidity)
                {
                    if (data.state != string.Empty)
                    {
@@ -591,7 +612,7 @@
                    }
                }
                //室内温度
                else if (data.key == "indoor_temp")
                else if (data.key == FunctionAttributeKey.IndoorTemp)
                {
                    if (data.state != string.Empty)
                    {
@@ -599,7 +620,7 @@
                    }
                }
                //室内湿度
                else if (data.key == "indoor_humidity")
                else if (data.key == FunctionAttributeKey.IndoorHumidity)
                {
                    if (data.state != string.Empty)
                    {
@@ -607,7 +628,7 @@
                    }
                }
                //过滤网剩余量
                else if (data.key == "filter_remain")
                else if (data.key == FunctionAttributeKey.FilterRemain)
                {
                    if (data.state != string.Empty)
                    {