From 592974441a4df95fffd9167c90192da1a390b1c2 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 06 六月 2023 11:51:12 +0800
Subject: [PATCH] Merge branch 'Dev-Branch'

---
 HDL_ON/DAL/DriverLayer/Packet.cs |   42 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index 3e07ff2..258939e 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -53,8 +53,11 @@
         /// </summary>
         public virtual void Manager()
         {
+#if DEBUG
+#else
             try
-            { 
+            {
+#endif
                 //瀵逛簬鎿嶄綔鏁版嵁搴撶殑鏃堕棿姣旇緝闀跨殑锛屽彲浠ュ垱寤哄彟涓�涓嚎绋嬪鐞�
                 if (!"HDLMIRACLE".Equals(Encoding.ASCII.GetString(Bytes, 4, 10)))
                 {
@@ -102,16 +105,19 @@
 #endif
                 //澶勭悊鏄惁瑕侀噸鍙戞暟鎹�
                 ManagerReceive(subnetID, deviceID, command, usefulBytes);
-            }
+
+#if DEBUG
+#else
+              }
             catch (Exception ex)
             {
                 MainPage.Log($"packet {ex.Message} ");
             }
+#endif
         }
 
         /// <summary>
         /// 鏁版嵁鍖呭鐞�
-        /// ps:鐢眂ommonpage杞Щ杩囨潵锛岃繕闇�瑕佽浆绉诲悎閫傜殑浣嶇疆绠$悊
         /// </summary>
         /// <param name="subnetID"></param>
         /// <param name="deviceID"></param>
@@ -119,8 +125,11 @@
         /// <param name="receiveBytes"></param>
         void UdpPacket_DataProcessing(byte subnetID, byte deviceID, Command command, byte[] receiveBytes)
         {
+#if DEBUG
+#else
             try
             {
+#endif
                 switch (command)
                 {
                     case Command.SetSingleLightACK:
@@ -324,17 +333,27 @@
                                     case SPK.CurtainRoller:
                                         RollingShutterPage.UpdataState(curtain);
                                         break;
+                                    case SPK.CurtainShades:
+                                        VenetianBlindsPage.UpdataState(curtain);
+                                        break;
                                 }
                             }
                         }
                         break;
                     case Command.SetACModeACK:
                     case Command.ReadACModeACK:
-                        foreach (var function in FunctionList.List.GetAcList())
+                        foreach (var function in FunctionList.List.Functions)
                         {
+                        if (function.bus == null || function.spk != SPK.AcStandard)
+                        {
+                            continue;
+                        }
                             var acFunction = new AC();
-                            if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
+                            if (function.bus.SubnetID == subnetID &&
+                                function.bus.DeviceID ==  deviceID &&
+                                function.bus.LoopId == receiveBytes[0])
                             {
+                            Console.WriteLine(function.GetBusId());
                                 function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString());
                                 function.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[2].ToString());
                                 function.SetAttrState(FunctionAttributeKey.OnOff,  receiveBytes[8] == 1 ? "on" : "off");
@@ -380,7 +399,7 @@
                                 FunctionPage.UpdataStates(function);
                                 HomePage.UpdataFunctionStates(function);
                                 ClassificationPage.UpdataInfo(function);
-                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function.sid, function.status);
+                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function);
 
                             }
                         }
@@ -653,7 +672,9 @@
 
                                 }
                                 function.lastState = "";
-                                function.lastState += " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function);
+                                function.lastState += acFunction.GetModeAttrText(function.GetAttrState(FunctionAttributeKey.Mode)) +
+                                    acFunction.GetModeAttrText(function.GetAttrState(FunctionAttributeKey.FanSpeed)) +
+                                    " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function);
                                 RoomPage.UpdataStates(function);
                                 FunctionPage.UpdataStates(function);
                                 HomePage.UpdataFunctionStates(function);
@@ -727,11 +748,16 @@
                         }
                         break;
                 }
-            }
+
+#if DEBUG
+#else
+              }
             catch (Exception ex)
             {
                 MainPage.Log($"Bus Rev Erorr : {ex.Message}");
             }
+#endif
+
         }
         /// <summary>
         /// byte杞�16杩涘埗瀛楃涓�

--
Gitblit v1.8.0