From b5444e6e566c2128bcb4fb522bfa636ee2c5b8fb Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 25 八月 2022 15:37:18 +0800 Subject: [PATCH] 场景背景图问题修复 --- HDL_ON/Entity/FunctionList.cs | 62 +++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 3 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 6dda2d1..9dce20e 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -24,7 +24,11 @@ var filePathList = FileUtlis.Files.ReadFiles(); foreach (var filePath in filePathList) { - _FunctionList.IniFunctionList(filePath); + try + { + _FunctionList.IniFunctionList(filePath); + } + catch { } } #endregion } @@ -69,6 +73,12 @@ public List<Function> GetFloorHeatingList() { var spkList = SPK.FhSpkList(); + return Functions.FindAll((obj) => spkList.Contains(obj.spk)); + } + + public List<Function> GetDoorLockList() + { + var spkList = SPK.GetDoorLockSPKList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } @@ -139,6 +149,23 @@ var spkList = SPK.ArmSensorSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } + /// <summary> + /// 瀹夐槻涓績鏀寔鐨勪紶鎰熷櫒鍒楄〃 + /// </summary> + public List<Function> GetArmCenterList() + { + var spkList = new List<string>() + { + SPK.SensorPir, + SPK.SensorDoorWindow, + SPK.SensorSmoke, + SPK.SensorWater, + SPK.SensorGas, + }; + + return Functions.FindAll((obj) => spkList.Contains(obj.spk)); + } + /// <summary> /// 鍙瀵硅鍒楄〃,褰撲负null鎴杝ize涓�0鍒欎笉鏄剧ず鍙瀵硅icon @@ -175,6 +202,19 @@ /// </summary> public List<SecurityAlarm> securities = new List<SecurityAlarm>(); + public List<SecurityAlarm> GetOrdinarySecurities() + { + var ordinarySecurities = new List<SecurityAlarm>(); + foreach (var mode in securities) + { + if (mode.type == "all_day" || mode.type == "mute") + { + continue; + } + ordinarySecurities.Add(mode); + } + return ordinarySecurities; + } /// <summary> /// 鍔犺浇鍔熻兘鍒楄〃 @@ -423,12 +463,26 @@ if(DriverLayer.Control.Ins.GatewayOnline_Local) { + + //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl); + //var sss = functions.OrderBy((obj) => obj.collect); + + List<Function> readList = new List<Function>(); foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl)) { + readList.Add(function); MainPage.Log($"璇诲彇鍔熻兘鐘舵�侊細{function.name} : {function.sid} "); - Control.Ins.SendReadCommand(function); + if (readList.Count > 9) + { + Control.Ins.SendReadCommand(readList); + readList.Clear(); + } } - if(DB_ResidenceData.Instance.GatewayType == 1) + if (readList.Count > 0) + { + Control.Ins.SendReadCommand(readList); + } + if (DB_ResidenceData.Instance.GatewayType == 1) { Dictionary<string, string> pairs = new Dictionary<string, string>(); string sendId = Control.Ins.msg_id.ToString(); @@ -445,6 +499,8 @@ var page = new List<string>(); int count = 0; + //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl); + //var sss = functions.OrderBy((obj) => obj.collect); foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl)) { page.Add(function.deviceId); -- Gitblit v1.8.0