From 60c59ea2ed4ee11a9989fdd4ce0ddace6efe452e Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 04 四月 2023 14:35:46 +0800 Subject: [PATCH] 群控备份 --- HDL_ON/DAL/DriverLayer/Control.cs | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 52 insertions(+), 1 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 29e90a2..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 浜戠杩炴帴鎴愬姛鏃讹紝涓嶉�傜敤鏈湴鏁版嵁鏇存柊 -- Gitblit v1.8.0