From df8d4ab0ef17a7fab5dea9c47bbd9f4d4a2a40b0 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 15 三月 2021 14:55:49 +0800
Subject: [PATCH] 合并前上传一个版本

---
 HDL_ON/DAL/DriverLayer/Packet.cs |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index 0516c25..323b918 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -315,13 +315,13 @@
                             if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                             {
                                 ac.curTempType = receiveBytes[1];
-                                ac.trait_IndoorTemp.curValue = receiveBytes[2].ToString();
+                                ac.SetAttrState(FunctionAttributeKey.IndoorTemp, receiveBytes[2].ToString());
                                 ac.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
-                                ac.curModeIndex = receiveBytes[9];
-                                ac.curFanIndex = receiveBytes[10];
-                                ac.trait_temp.curValue = receiveBytes[11].ToString();
+                                ac.SetModeIndex(receiveBytes[9]);
+                                ac.SetFanIndex(receiveBytes[10]);
+                                ac.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[11].ToString());
                                 ac.lastState = "";
-                                switch (ac.trait_mode.curValue.ToString())
+                                switch (ac.GetAttrState(FunctionAttributeKey.Mode))
                                 {
                                     case "cool":
                                         ac.lastState = Language.StringByID(StringId.Cool);
@@ -339,7 +339,7 @@
                                         ac.lastState = Language.StringByID(StringId.AirSupply);
                                         break;
                                 }
-                                switch (ac.trait_fan.curValue.ToString())
+                                switch (ac.GetAttrState(FunctionAttributeKey.FanSpeed))
                                 {
                                     case "high":
                                         ac.lastState += " " + Language.StringByID(StringId.HighWindSpeed);
@@ -354,7 +354,7 @@
                                         ac.lastState += " " + Language.StringByID(StringId.Auto);
                                         break;
                                 }
-                                ac.lastState += " " + ac.trait_temp.curValue + ac.tempUnitString;
+                                ac.lastState += " " + ac.GetAttrState(FunctionAttributeKey.SetTemp) + ac.tempUnitString;
                                 RoomPage.UpdataStates(ac);
                                 FunctionPage.UpdataStates(ac);
                                 HomePage.UpdataFunctionStates(ac);
@@ -584,18 +584,18 @@
                                     case 7:
                                     case 8:
                                     case 19:
-                                        ac.trait_temp.curValue = receiveBytes[1].ToString();
+                                        ac.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[1].ToString());
                                         break;
                                     case 5:
-                                        ac.curFanIndex = receiveBytes[1];
+                                        ac.SetFanIndex ( receiveBytes[1]);
                                         break;
                                     case 6:
-                                        ac.curModeIndex = receiveBytes[1];
+                                        ac.SetModeIndex ( receiveBytes[1]);
                                         break;
 
                                 }
                                 ac.lastState = "";
-                                ac.lastState += " " + ac.trait_temp.curValue + ac.tempUnitString;
+                                ac.lastState += " " + ac.GetAttrState(FunctionAttributeKey.SetTemp) + ac.tempUnitString;
                                 RoomPage.UpdataStates(ac);
                                 FunctionPage.UpdataStates(ac);
                                 HomePage.UpdataFunctionStates(ac);
@@ -610,7 +610,7 @@
                         {
                             if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                             {
-                                ac.trait_IndoorTemp.curValue = receiveBytes[1].ToString();
+                                ac.SetAttrState(FunctionAttributeKey.IndoorTemp, receiveBytes[1].ToString());
                                 FunctionPage.UpdataStates(ac);
                             }
                         }
@@ -623,8 +623,7 @@
                         {
                             //鏈湴鎼滅储缃戝叧鎴愬姛
                             Control.Ins.IsSearchLocalGatewaySuccessful = true;
-                            Control.Ins.GatewayOnline = true;
-                            Control.Ins.IsRemote = false;
+                            Control.Ins.GatewayOnline_Local = true;
                             DAL.Mqtt.MqttClient.DisConnectRemote();//鏂紑mqtt
                         }
                         break;

--
Gitblit v1.8.0