From f46be160caed45c67e8980173d29ed48d525a4d3 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期二, 28 三月 2023 14:49:52 +0800 Subject: [PATCH] 2023年03月28日14:49:50 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 90 +++++++++++++++++++++++++++++++++++++-------- 1 files changed, 74 insertions(+), 16 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 659975d..6e55a2f 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -187,7 +187,7 @@ var list2 = this.GetVideoDeviceList(); list.AddRange(list1); list.AddRange(list2); - this.GetTestDevice(ref list, false); + GetTestDevice(ref list, true); return list; } /// <summary> @@ -343,17 +343,47 @@ return roomName.TrimEnd(','); } - #region 鍔ㄤ竴鏀瑰洓 + /// <summary> /// 鑾峰彇璁惧绫诲瀷鍥炬爣 /// </summary> + /// <param name="device">璁惧</param> + /// <returns></returns> + public string GetDeviceIconPath(Function device) + { + if (SPK.MusicStandard == device.spk + || SPK.AvMusic == device.spk) + { + return "MusicIcon/localMusic.png"; + } + else if (SPK.SensorPm10 == device.spk) + { + return "LogicIcon/sensor.png"; + } + else if (SPK.DoorLock == device.spk + || SPK.VideoDoorLock == device.spk) + { + return "FunctionIcon/DoorLock/DoorLock.png"; + } + //LogicIcon/heatlogic.png" + return $"FunctionIcon/Icon/{device.IconName}.png"; + + } + /// <summary> + /// 鑾峰彇璁惧绫诲瀷鍥炬爣(宸插純鐢� 2022骞�11鏈�25鏃�14:07:30) + /// </summary> /// <param name="functionType">璁惧绫诲瀷</param> /// <returns></returns> - public string GetIconPath(string functionType) + public string GetIconPath(string spk) { string strPath = ""; - switch (functionType) + switch (spk) { + case SPK.IpCam_Imou: + { + strPath = $"FunctionIcon/Icon/{SPK.IpCam_Imou.Replace(".", "")}.png"; + } + break; case SPK.MechanicalArm: { strPath = "LogicIcon/lightloguc.png"; @@ -423,6 +453,7 @@ case SPK.SensorPir: case SPK.SensorDoorWindow: case SPK.SensorUtrasonic: + case SPK.SensorMmvPose: case SPK.SenesorMegahealth: case SPK.SenesorMegahealth2: case SPK.SensorEnvironment: @@ -450,10 +481,10 @@ strPath = "MusicIcon/localMusic.png"; } break; - } return strPath; } + #region 鍔ㄤ竴鏀逛笁 /// <summary> /// 璁惧绫诲瀷鐨勫垪琛�(鐏厜绫伙紝绐楀笜绫汇�傘�傘��) /// </summary> @@ -516,6 +547,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 @@ -528,6 +560,7 @@ || device.spk == SPK.SensorTVOC || device.spk == SPK.SensorHcho || device.spk == SPK.SensorHelp + || device.spk == SPK.SensorPm10 ); if (sensor != null) { @@ -544,7 +577,8 @@ deviceStrTypeList.Add(Language.StringByID(StringId.Electric)); } ///闂ㄩ攣绫� - var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock); + var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock + || device.spk == SPK.VideoDoorLock); if (doorlock != null) { deviceStrTypeList.Add(Language.StringByID(StringId.DoorLock)); @@ -567,6 +601,13 @@ if (MechanicalArm != null) { deviceStrTypeList.Add(Language.StringByID(StringId.jixieshou)); + } + ///鎽勫儚澶寸被 + var camera = deviceList.Find((device) => + device.spk == SPK.IpCam_Imou); + if (camera != null) + { + deviceStrTypeList.Add(Language.StringByID(StringId.shexiangtou)); } return deviceStrTypeList; @@ -629,6 +670,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); @@ -641,6 +683,7 @@ functionTypeList.Add(SPK.SensorTVOC); functionTypeList.Add(SPK.SensorHcho); functionTypeList.Add(SPK.SensorHelp); + functionTypeList.Add(SPK.SensorPm10); } @@ -655,6 +698,7 @@ else if (deviceType == Language.StringByID(StringId.DoorLock)) { functionTypeList.Add(SPK.DoorLock); + functionTypeList.Add(SPK.VideoDoorLock); } ///闊充箰绫� else if (deviceType == Language.StringByID(StringId.Music)) @@ -666,10 +710,16 @@ else if (deviceType == Language.StringByID(StringId.VideoIntercom)) { functionTypeList.Add(SPK.doorgate); - } ///鏈烘鎵嬬被 + } + ///鏈烘鎵嬬被 else if (deviceType == Language.StringByID(StringId.jixieshou)) { functionTypeList.Add(SPK.MechanicalArm); + } + ///鎽勫儚澶寸被 + else if (deviceType == Language.StringByID(StringId.shexiangtou)) + { + functionTypeList.Add(SPK.IpCam_Imou); } else { @@ -701,6 +751,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); @@ -723,6 +774,9 @@ functionTypeList.Add(SPK.AvMusic); functionTypeList.Add(SPK.doorgate); functionTypeList.Add(SPK.MechanicalArm); + functionTypeList.Add(SPK.IpCam_Imou); + functionTypeList.Add(SPK.SensorPm10); + functionTypeList.Add(SPK.VideoDoorLock); } @@ -761,6 +815,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); @@ -779,6 +834,9 @@ deviceTypeList.Add(SPK.SensorHelp); deviceTypeList.Add(SPK.DoorLock); deviceTypeList.Add(SPK.doorgate); + deviceTypeList.Add(SPK.IpCam_Imou); + deviceTypeList.Add(SPK.SensorPm10); + deviceTypeList.Add(SPK.VideoDoorLock); } break; @@ -846,7 +904,7 @@ return list; } /// <summary> - /// 缃戝叧ID(鑾峰彇鍢変箰缃戝叧ID) + /// 缃戝叧ID(鑾峰彇缃戝叧ID) /// </summary> public string GatewayId { @@ -1120,14 +1178,14 @@ //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 = "1234567893", name = "绾㈠瀵瑰皠浼犳劅鍣�", spk = Entity.SPK.SensorDuiShe }, - // new Entity.Function { sid = "1234567895", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic }, - 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 }, + new Entity.Function { sid = "12345678933456", name = "闂ㄩ攣", spk = Entity.SPK.DoorLock }, + new Entity.Function { sid = "1234567895444", name = "瑙嗛闂ㄩ攣", spk = Entity.SPK.VideoDoorLock }, + //new Entity.Function { sid = "12345678968888", name = "pm10", spk = Entity.SPK.SensorPm10 }, + // 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) { -- Gitblit v1.8.0