From 4f2dbd1f6a1ec2d9c3c39b4a37b0b7c9ddece4aa Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 23 九月 2021 15:24:01 +0800 Subject: [PATCH] 主页刷新优化 --- HDL_ON/Entity/FunctionList.cs | 34 ++++++++++++++++++++++++++++------ 1 files changed, 28 insertions(+), 6 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 042a71b..2419c00 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -5,6 +5,7 @@ using HDL_ON.Common; using HDL_ON.DAL; using HDL_ON.DAL.Server; +using HDL_ON.DriverLayer; using Shared; namespace HDL_ON.Entity @@ -127,7 +128,7 @@ /// </summary> public List<Function> GetEnvirSensorsList() { - var spkList = SPK.EnvironSpkList(); + var spkList = SPK.EnvironDeviceSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } /// <summary> @@ -173,6 +174,7 @@ /// 瀹夐槻鍒楄〃 /// </summary> public List<SecurityAlarm> securities = new List<SecurityAlarm>(); + /// <summary> /// 鍔犺浇鍔熻兘鍒楄〃 @@ -432,6 +434,17 @@ // break; //} } + if(DB_ResidenceData.Instance.GatewayType == 1) + { + Dictionary<string, string> pairs = new Dictionary<string, string>(); + string sendId = Control.Ins.msg_id.ToString(); + pairs.Add("id", sendId); + pairs.Add("time_stamp", Utlis.GetTimestamp()); + var readSecurityStatusJson = Newtonsoft.Json.JsonConvert.SerializeObject(pairs); + var sendBytes = Control.Ins.ConvertSendBodyData(CommunicationTopic.ct.ReadSecurityStatus, readSecurityStatusJson); + MainPage.Log($"鏈湴閫氳 璇诲彇瀹夐槻鐘舵��:{readSecurityStatusJson}"); + new Control_Udp().SendLocalHdlLinkData(sendBytes, sendId); + } } else { @@ -478,11 +491,20 @@ var revPack = pm.AddScene(scene); if (revPack.Code == StateCode.SUCCESS) { - var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString()); - tempScene = sceneList.Find((obj) => obj.sid == scene.sid); - var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(tempScene)); - FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd); - result = tempScene; + if (MainPage.NoLoginMode) + { + var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(scene)); + FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd); + result = scene; + } + else + { + var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString()); + tempScene = sceneList.Find((obj) => obj.sid == scene.sid); + var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(tempScene)); + FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd); + result = tempScene; + } } else { -- Gitblit v1.8.0