From 02498f7744e6fdc413e518f96b25f3635540dc6b Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 15 十一月 2022 11:27:38 +0800 Subject: [PATCH] 金茂科技系统更新 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 154 +++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 131 insertions(+), 23 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 2c645ad..4c0e435 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; } } @@ -147,9 +147,9 @@ /// <returns></returns> public List<HDL_ON.Entity.Room> GetGatewayRoomList() { - return HDL_ON.Entity.SpatialInfo.CurrentSpatial.RoomList; + return HDL_ON.Entity.SpatialInfo.CurrentSpatial.RoomList; - + } /// <summary> /// 鑾峰彇缃戝叧鎴块棿鍒楄〃 @@ -182,9 +182,37 @@ /// <returns></returns> public List<HDL_ON.Entity.Function> GetGatewayDeviceList() { - var list = Entity.FunctionList.List.GetDeviceFunctionList(); - //return GetTestDevice(list, true); + 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, false); 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 +354,16 @@ string strPath = ""; switch (functionType) { - + case SPK.MechanicalArm: + { + strPath = "LogicIcon/lightloguc.png"; + } + break; + case SPK.doorgate: + { + strPath = "VideoIcon/keshiduijiang.png"; + } + break; case SPK.AirSwitch: { strPath = "FunctionIcon/Icon/electricalbreaker.png"; @@ -386,6 +423,7 @@ case SPK.SensorPir: case SPK.SensorDoorWindow: case SPK.SensorUtrasonic: + case SPK.SensorMmvPose: case SPK.SenesorMegahealth: case SPK.SenesorMegahealth2: case SPK.SensorEnvironment: @@ -407,6 +445,12 @@ strPath = "FunctionIcon/DoorLock/DoorLock.png"; } break; + case SPK.MusicStandard: + case SPK.AvMusic: + { + strPath = "MusicIcon/localMusic.png"; + } + break; } return strPath; @@ -420,6 +464,7 @@ { List<string> deviceStrTypeList = new List<string>(); deviceStrTypeList.Clear(); + ///鐏厜绫� var lightjosn = deviceList.Find((device) => device.spk == SPK.LightSwitch @@ -472,6 +517,7 @@ || device.spk == SPK.SensorPir || device.spk == SPK.SensorDoorWindow || device.spk == SPK.SensorUtrasonic + || device.spk == SPK.SensorMmvPose || device.spk == SPK.SenesorMegahealth || device.spk == SPK.SenesorMegahealth2 || device.spk == SPK.SensorEnvironment @@ -505,6 +551,25 @@ { 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)); + } + ///鏈烘鎵嬬被 + var MechanicalArm = deviceList.Find((device) => + device.spk == SPK.MechanicalArm); + if (MechanicalArm != null) + { + deviceStrTypeList.Add(Language.StringByID(StringId.jixieshou)); + } return deviceStrTypeList; } @@ -516,6 +581,7 @@ public List<string> GetDeviceTypeFunctionList(string deviceType) { List<string> functionTypeList = new List<string>(); + ///鐏厜绫� if (deviceType == Language.StringByID(StringId.Lights)) { @@ -565,6 +631,7 @@ functionTypeList.Add(SPK.SensorPir); functionTypeList.Add(SPK.SensorDoorWindow); functionTypeList.Add(SPK.SensorUtrasonic); + functionTypeList.Add(SPK.SensorMmvPose); functionTypeList.Add(SPK.SenesorMegahealth); functionTypeList.Add(SPK.SenesorMegahealth2); functionTypeList.Add(SPK.SensorEnvironment); @@ -591,6 +658,21 @@ else if (deviceType == Language.StringByID(StringId.DoorLock)) { 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 if (deviceType == Language.StringByID(StringId.jixieshou)) + { + functionTypeList.Add(SPK.MechanicalArm); } else { @@ -622,6 +704,7 @@ functionTypeList.Add(SPK.SensorPir); functionTypeList.Add(SPK.SensorDoorWindow); functionTypeList.Add(SPK.SensorUtrasonic); + functionTypeList.Add(SPK.SensorMmvPose); functionTypeList.Add(SPK.SenesorMegahealth); functionTypeList.Add(SPK.SenesorMegahealth2); functionTypeList.Add(SPK.SensorEnvironment); @@ -640,6 +723,11 @@ functionTypeList.Add(SPK.SensorHelp); functionTypeList.Add(SPK.DoorLock); functionTypeList.Add(SPK.CurtainDream); + functionTypeList.Add(SPK.MusicStandard); + functionTypeList.Add(SPK.AvMusic); + functionTypeList.Add(SPK.doorgate); + functionTypeList.Add(SPK.MechanicalArm); + } @@ -677,6 +765,7 @@ deviceTypeList.Add(SPK.SensorPir); deviceTypeList.Add(SPK.SensorDoorWindow); deviceTypeList.Add(SPK.SensorUtrasonic); + deviceTypeList.Add(SPK.SensorMmvPose); deviceTypeList.Add(SPK.SenesorMegahealth); deviceTypeList.Add(SPK.SenesorMegahealth2); deviceTypeList.Add(SPK.SensorEnvironment); @@ -694,6 +783,7 @@ deviceTypeList.Add(SPK.HvacCac); deviceTypeList.Add(SPK.SensorHelp); deviceTypeList.Add(SPK.DoorLock); + deviceTypeList.Add(SPK.doorgate); } break; @@ -714,6 +804,9 @@ deviceTypeList.Add(SPK.PanelSocket); deviceTypeList.Add(SPK.ElectricSocket); deviceTypeList.Add(SPK.CurtainDream); + deviceTypeList.Add(SPK.MusicStandard); + deviceTypeList.Add(SPK.AvMusic); + deviceTypeList.Add(SPK.MechanicalArm); } break; } @@ -750,11 +843,11 @@ /// <returns></returns> public List<Entity.Function> GetFunctionDeviceList(Entity.Room room, string str) { - List<string> functionTypeList = GetSupportEquipment(str); + List<string> functionTypeList = this.GetSupportEquipment(str); //杩斿洖鎴块棿璁惧鍒楄〃 - var roomDeviceList = GetRoomDevice(room); + var roomDeviceList = this.GetRoomDevice(room); //杩斿洖鏈�缁堟敮鎸佹樉绀哄嚭鏉ョ殑璁惧鍒楄〃 - var list = GetShowDeviceList(functionTypeList, roomDeviceList); + var list =this.GetShowDeviceList(functionTypeList, roomDeviceList); return list; } /// <summary> @@ -948,8 +1041,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); @@ -978,7 +1071,7 @@ //瀹氫箟涓�涓眬閮ㄥ彉閲� string direction = string.Empty; //涓ょ偣璺濈灏忎簬閰嶇疆璺濈<鏃㈣嚜鍔ㄥ寲閰嶇疆杈撳叆鏉′欢鍦扮悊鍥存爮鍗婂緞>,璇存槑杩涘叆鍖哄煙 - if (r < radius) + if (r * 1000 < radius) { //鍒拌揪鏌愬湴 direction = "arrive"; @@ -993,7 +1086,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) { ///娣诲姞鍒版帹閫佸垪琛� @@ -1023,20 +1116,35 @@ /// </summary> /// <param name="isBool">鏄惁寮�鍚�</param> /// <returns></returns> - private List<Entity.Function> GetTestDevice(List<HDL_ON.Entity.Function> list, bool isBool) + private List<Entity.Function> GetTestDevice(ref List<HDL_ON.Entity.Function> list, bool isBool) { if (isBool) { - Entity.Function function = new Entity.Function { sid = "0123456789", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic }; - var device = list.Find((o) => { return o.sid == function.sid; }); - if (device == null) + //妯℃嫙璁惧 + var functions = new List<Function> { + //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 }, + new Entity.Function { sid = "12345678933456", name = "璋冨厜鐏�", spk = Entity.SPK.LightDimming }, + new Entity.Function { sid = "1234567895444", name = "cct", spk = Entity.SPK.LightCCT }, + //new Entity.Function { sid = "1234567896", name = "姣背娉紶鎰熷櫒", spk = Entity.SPK.SenesorMegahealth }, + // new Entity.Function { sid = "1234567897", name = "姣背娉紶鎰熷櫒1", spk = Entity.SPK.SenesorMegahealth2 }, + // new Entity.Function { sid = "1234567899", name = "闂ㄧ浼犳劅鍣�", spk = Entity.SPK.SensorDoorWindow }, + // new Entity.Function { sid = "12345678991234", name = "HDL鏈烘鎵�", spk = Entity.SPK.MechanicalArm }, + // new Entity.Function { sid = "123456789912345", name = "娴锋浖鏈烘鎵�", spk = Entity.SPK.MechanicalArm }, + // new Entity.Function { sid = "12345678991234566", name = "娴锋浖鏈烘鎵�", spk = Entity.SPK.MechanicalArm }, + }; + foreach (var function in functions) { - list.Add(function); + var device = list.Find((o) => { return o.sid == function.sid; }); + if (device == null) + { + list.Add(function); + } } } return list; - } -- Gitblit v1.8.0