From e74f8bfbe6c52f220deef5fc99a53c3a7872808d Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 11 四月 2023 17:08:34 +0800
Subject: [PATCH] Merge branch 'Dev-Wxr' into wjc

---
 HDL_ON/DAL/DriverLayer/Control.cs |   68 +++++++++++++++++++++++++++++++---
 1 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index bed293b..eeb2431 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -1175,11 +1175,62 @@
 
         }
 
+
         /// <summary>
         /// 鏇存柊璁惧鐘舵��
         /// A鍗忚鏁版嵁
         /// </summary>
-        /// <param name="updateBytes"></param>
+        public void UpdataGroupControlStatus(string revString, byte[] usefulBytes, bool isCloudData = false)
+        {
+            var temp = JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString);
+            if (temp != null)
+            {
+                Control_Udp.ReceiveRepeatManager(temp.id, usefulBytes);
+                var allLocalFuntion = FunctionList.List.groupControls;
+                foreach (var updateTemp in temp.objects)
+                {
+                    try
+                    {
+                        var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid);
+                        if (localFunction == null)
+                        {
+                            continue;
+                        }
+                        MainPage.Log($"鏀跺埌鏁版嵁:{revString}");
+                        foreach (var attr in updateTemp.status)
+                        {
+                            localFunction.time_stamp = temp.time_stamp;
+                            localFunction.SetAttrState(attr.key, attr.value);
+
+                        }
+
+                        //鏇存柊鐣岄潰鐘舵��
+                        switch (localFunction.spk)
+                        {
+                            case SPK.ElectricEnergy:
+                                EnergyMainPage.UpdataStatus(localFunction);
+                                break;
+                        }
+
+                        HomePage.UpdataFunctionStates(localFunction);
+                        RoomPage.UpdataStates(localFunction);
+                        FunctionPage.UpdataStates(localFunction);
+                        ClassificationPage.UpdataInfo(localFunction);
+
+                    }
+                    catch (Exception ex)
+                    {
+                        MainPage.Log($"A鍗忚鏇存柊鐘舵�佸紓甯�:{ex.Message}");
+                    }
+                }
+            }
+        }
+
+
+        /// <summary>
+        /// 鏇存柊璁惧鐘舵��
+        /// A鍗忚鏁版嵁
+        /// </summary>
         public void UpdataFunctionStatus(string revString, byte[] usefulBytes, bool isCloudData = false)
         {
             ////test 浜戠杩炴帴鎴愬姛鏃讹紝涓嶉�傜敤鏈湴鏁版嵁鏇存柊
@@ -1231,11 +1282,16 @@
                             }
                         }
 
-                        if (SPK.MusicSpkList().Contains(localFunction.spk))
-                        {
-                            MainPage.Log($"闊充箰鏀跺埌鏁版嵁:{revString}");
-
-                        }
+                        //if (SPK.MusicSpkList().Contains(localFunction.spk))
+                        //{
+                        //    if (updateTemp.status.Count < 3)
+                        //    {
+                        //        ///鏄煶涔愬姛鑳界殑
+                        //        ///涓婃姤灞炴�у皯3鏉′笉鍋氬鐞�
+                        //        return;
+                        //    }
+                        //}
+                        MainPage.Log($"鏀跺埌鏁版嵁:{revString}");
                         foreach (var attr in updateTemp.status)
                         {
                             localFunction.time_stamp = temp.time_stamp;

--
Gitblit v1.8.0