From d5088d3bb198c0f53d4716022f010a02ac393977 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 25 八月 2022 15:06:01 +0800 Subject: [PATCH] 2022年08月25日15:04:41 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 92 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 80 insertions(+), 12 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 60eb6a9..e1a5520 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -10,20 +10,20 @@ { /// <summary> /// 瀹氫箟涓�涓潤鎬佸璞� - /// </summary> - private static LogicMethod logicMethod = null; + /// </summary> + private static LogicMethod s_Current = null; /// <summary> /// 鑾峰彇闈欐�佸璞� /// </summary> - public static LogicMethod CurrLogicMethod + public static LogicMethod Current { get { - if (logicMethod == null) + if (s_Current == null) { return new LogicMethod(); } - return logicMethod; + return s_Current; } } @@ -182,9 +182,35 @@ /// <returns></returns> public List<HDL_ON.Entity.Function> GetGatewayDeviceList() { - var list = Entity.FunctionList.List.GetDeviceFunctionList(); + var list = new List<HDL_ON.Entity.Function>(); + var list1 = Entity.FunctionList.List.GetDeviceFunctionList(); + var list2 = this.GetVideoDeviceList(); + list.AddRange(list1); + list.AddRange(list2); //GetTestDevice(ref list, true); return list; + } + /// <summary> + /// 鑾峰彇鍙瀵硅璁惧鍒楄〃 + /// </summary> + /// <returns></returns> + public List<HDL_ON.Entity.Function> GetVideoDeviceList() + { + var functionList = new List<Function>(); + foreach (var videoDevice in FunctionList.List.videoIntercom) { + Function function = new Function(); + function.spk = videoDevice.spk; + function.name = videoDevice.deviceName; + function.deviceId = videoDevice.deviceId; + function.online = videoDevice.status== "online"; + function.sid = videoDevice.sid; + var video = functionList.Find((o) => o.deviceId == function.deviceId); + if (video == null) { + functionList.Add(function); + } + + } + return functionList; } /// <summary> /// 鑾峰彇鍦烘櫙鍒楄〃 @@ -326,7 +352,11 @@ string strPath = ""; switch (functionType) { - + case SPK.doorgate: + { + strPath = "VideoIcon/keshiduijiang.png"; + } + break; case SPK.AirSwitch: { strPath = "FunctionIcon/Icon/electricalbreaker.png"; @@ -405,6 +435,12 @@ case SPK.DoorLock: { strPath = "FunctionIcon/DoorLock/DoorLock.png"; + } + break; + case SPK.MusicStandard: + case SPK.AvMusic: + { + strPath = "MusicIcon/localMusic.png"; } break; @@ -505,6 +541,18 @@ { deviceStrTypeList.Add(Language.StringByID(StringId.DoorLock)); } + ///闊充箰绫� + var music = deviceList.Find((device) => device.spk == SPK.MusicStandard || device.spk == SPK.AvMusic); + if (music != null) + { + deviceStrTypeList.Add(Language.StringByID(StringId.Music)); + } + ///鍙瀵硅 + var doorgate = deviceList.Find((device) => device.spk == SPK.doorgate); + if (doorgate != null) + { + deviceStrTypeList.Add(Language.StringByID(StringId.VideoIntercom)); + } return deviceStrTypeList; } @@ -592,6 +640,17 @@ { functionTypeList.Add(SPK.DoorLock); } + ///闊充箰绫� + else if (deviceType == Language.StringByID(StringId.Music)) + { + functionTypeList.Add(SPK.MusicStandard); + functionTypeList.Add(SPK.AvMusic); + } + ///HDL鍙瀵硅 + else if (deviceType == Language.StringByID(StringId.VideoIntercom)) + { + functionTypeList.Add(SPK.doorgate); + } else { //鍏ㄩ儴鍖哄煙 @@ -640,6 +699,10 @@ functionTypeList.Add(SPK.SensorHelp); functionTypeList.Add(SPK.DoorLock); functionTypeList.Add(SPK.CurtainDream); + functionTypeList.Add(SPK.MusicStandard); + functionTypeList.Add(SPK.AvMusic); + functionTypeList.Add(SPK.doorgate); + } @@ -694,6 +757,7 @@ deviceTypeList.Add(SPK.HvacCac); deviceTypeList.Add(SPK.SensorHelp); deviceTypeList.Add(SPK.DoorLock); + deviceTypeList.Add(SPK.doorgate); } break; @@ -714,6 +778,8 @@ deviceTypeList.Add(SPK.PanelSocket); deviceTypeList.Add(SPK.ElectricSocket); deviceTypeList.Add(SPK.CurtainDream); + deviceTypeList.Add(SPK.MusicStandard); + deviceTypeList.Add(SPK.AvMusic); } break; } @@ -948,8 +1014,8 @@ try { //鑾峰彇閫昏緫ID鍒楄〃锛岀洰鍓嶉拡瀵规墍鏈�<澶囨敞:濡傛灉鍙拡瀵瑰綋鍓嶆墜鏈虹殑璇濓紝鍙互鐩存帴鎷跨紦瀛樻暟鎹嚜鍔ㄥ寲鍒楄〃閬嶅巻> - var idStr = Send.GetLogicIdList(); - if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "") + var idStr = Send.Current.GetLogicIdList(); + if (idStr != null) { var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data); logicDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LogicData>>(date); @@ -993,7 +1059,7 @@ if (isPush == null) { //鎺ㄩ�佺粰浜戠鏄惁鎴愬姛 - bool push = Send.GeoFenceStateReport(logicDate.userLogicId, logicDate.sid, direction); + bool push = Send.Current.GetFenceStateReport(logicDate.userLogicId, logicDate.sid, direction); if (push) { ///娣诲姞鍒版帹閫佸垪琛� @@ -1029,8 +1095,10 @@ { //妯℃嫙璁惧 var functions = new List<Function> { - new Entity.Function { sid = "0123456789", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic }, - }; + new Entity.Function { sid = "1234567890", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic }, + new Entity.Function { sid = "1234567891", name = "娓╁害浼犳劅鍣�", spk = Entity.SPK.SensorTemperature }, + new Entity.Function { sid = "1234567892", name = "婀垮害浼犳劅鍣�", spk = Entity.SPK.SensorHumidity }, + }; foreach (var function in functions) { var device = list.Find((o) => { return o.sid == function.sid; }); -- Gitblit v1.8.0