From cd1029a11d96f55337430cec97b7d4cd510f5d5f Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 17 十二月 2020 15:09:38 +0800
Subject: [PATCH] 2020-12-17 1.成员管理UI还原度修改。2.增加右键删除。3.增加无区域功能管理。

---
 HDL_ON/DAL/DriverLayer/Packet.cs |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index 78c1cd2..53c41fb 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -163,12 +163,12 @@
                     case Command.ReadLightAllLoopBrightnessACK:
                         for (int i = 0; i < receiveBytes[0]; i++)
                         {
-                            var light = FunctionList.List.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == (i + 1));
+                            var light = FunctionList.List.lights.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == (i + 1));
                             if (light != null)
                             {
                                 if (light.functionType != FunctionType.RGB)
                                 {
-                                    light.trait_on_off.curValue = receiveBytes[light.bus_Data.loopId] == 0 ? "off" : "on";
+                                    light.trait_on_off.curValue = receiveBytes[light.bus.loopId] == 0 ? "off" : "on";
                                     if (light.trait_on_off.curValue.ToString() == "on")
                                     {
                                         light.brightness = receiveBytes[2];
@@ -191,7 +191,7 @@
                             }
                             else
                             {
-                                var e = FunctionList.List.electricals.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == i);
+                                var e = FunctionList.List.electricals.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == i);
                                 if (e != null)
                                 {
                                     var fan = e as Fan;
@@ -249,7 +249,7 @@
                     case Command.ReadCurtainStutasACK:
                         foreach (var curtain in FunctionList.List.curtains)
                         {
-                            if (curtain.bus_Data.SubnetID == subnetID && curtain.bus_Data.DeviceID == deviceID)
+                            if (curtain.bus.SubnetID == subnetID && curtain.bus.DeviceID == deviceID)
                             {
                                 if (receiveBytes[0] == 17)
                                 {
@@ -266,7 +266,7 @@
                                 }
                                 else
                                 {
-                                    if (curtain.bus_Data.loopId != receiveBytes[0])
+                                    if (curtain.bus.loopId != receiveBytes[0])
                                         continue;
                                     switch (receiveBytes[1])
                                     {
@@ -309,7 +309,7 @@
                             if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                             {
                                 ac.curTempType = receiveBytes[1];
-                                ac.indoorTemp = receiveBytes[2];
+                                ac.trait_IndoorTemp.curValue = receiveBytes[2];
                                 ac.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
                                 ac.curModeIndex = receiveBytes[9];
                                 ac.curFanIndex = receiveBytes[10];
@@ -445,10 +445,10 @@
                         string tag = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2];
                         foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience)
                         {
-                            if (sensor.bus_Data != null)
+                            if (sensor.bus != null)
                             {
-                                if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus_Data.SubnetID == subnetID &&
-                                    sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.loopId == receiveBytes[2])
+                                if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID &&
+                                    sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2])
                                 {
                                     switch (dt)
                                     {
@@ -478,10 +478,10 @@
                         string tag1 = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2];
                         foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience)
                         {
-                            if (sensor.bus_Data != null)
+                            if (sensor.bus != null)
                             {
-                                if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus_Data.SubnetID == subnetID &&
-                                    sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.loopId == receiveBytes[2])
+                                if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID &&
+                                    sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2])
                                 {
                                     //0淇濈暀 1鏃犵鍙�4Byte鏁村舰  2鏈夌鍙�4Byte鏁村舰  3Float褰紙浠B憋級
                                     switch (receiveBytes[3])
@@ -563,7 +563,7 @@
                         {
                             if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                             {
-                                ac.indoorTemp = receiveBytes[1];
+                                ac.trait_IndoorTemp.curValue = receiveBytes[1];
                                 FunctionPage.UpdataStates(ac);
                             }
                         }
@@ -574,8 +574,8 @@
                         MainPage.Log($"name : {Name} ; mac : {mac}");
                         if (DB_ResidenceData.Instance.residenceGatewayMAC == mac)
                         {
-                            DriverLayer.Control.Ins.GatewayOnline = true;
-                            DriverLayer.Control.Ins.IsRemote = false;
+                            Control.Ins.GatewayOnline = true;
+                            Control.Ins.IsRemote = false;
                             DAL.Mqtt.MqttClient.DisConnectRemote();//鏂紑mqtt
                         }
                         break;

--
Gitblit v1.8.0