From 553d47e277f537eaf85865a8b808a88ae9dce5eb Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 30 十月 2023 10:18:24 +0800 Subject: [PATCH] 2.3版本 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 82 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 77 insertions(+), 5 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 8954694..ebbfe22 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -361,7 +361,7 @@ } else if (SPK.SensorPm10 == device.spk || SPK.SensorPirHold == device.spk - || SPK.SensorLight == device.spk) + ) { return "LogicIcon/sensor.png"; } @@ -370,11 +370,21 @@ { return "FunctionIcon/DoorLock/DoorLock.png"; } - + //else if (SPK.SensorDryContact == device.spk + // || SPK.SensorDryContact2 == device.spk + // || SPK.OtherCommon == device.spk + // ) + //{ + // return "LogicIcon/ganjiedian.png"; + //} + //else if (SPK.SensorLight == device.spk) + //{ + // return "LogicIcon/lightloguc.png"; + //} //LogicIcon/heatlogic.png" return $"FunctionIcon/Icon/{device.IconName}.png"; - } + } /// <summary> /// 鑾峰彇璁惧绫诲瀷鍥炬爣(宸插純鐢� 2022骞�11鏈�25鏃�14:07:30) /// </summary> @@ -519,6 +529,7 @@ || device.spk == SPK.LightCCT || device.spk == SPK.LightRGB || device.spk == SPK.LightRGBW + || device.spk == SPK.OtherCommon ); if (lightjosn != null) { @@ -652,6 +663,7 @@ functionTypeList.Add(SPK.AirSwitch); functionTypeList.Add(SPK.PanelSocket); functionTypeList.Add(SPK.ElectricSocket); + functionTypeList.Add(SPK.OtherCommon); } //缇ゆ帶 else if (deviceType == Language.StringByID(StringId.GroupControl)) @@ -816,6 +828,7 @@ functionTypeList.Add(SPK.SensorPirHold); functionTypeList.Add(SPK.ElectricalTvHisense); functionTypeList.Add(SPK.SensorLight); + functionTypeList.Add(SPK.OtherCommon); } @@ -907,6 +920,7 @@ deviceTypeList.Add(SPK.MechanicalArm); deviceTypeList.Add(SPK.AcIr); deviceTypeList.Add(SPK.ElectricalTvHisense); + deviceTypeList.Add(SPK.OtherCommon); } break; } @@ -982,6 +996,63 @@ get { return Entity.DB_ResidenceData.Instance.CurrentRegion.isOtherShare; + } + } + /// <summary> + /// 鎷兼帴鏃堕棿鏍煎紡//"{h}h{m}min{s}s"; + /// </summary> + /// <param name="totalSeconds">绉�(娌℃湁榛樿浼犲叆0)</param> + /// <returns></returns> + public string getTimeStr(string totalSeconds) + { + try + { + if (string.IsNullOrEmpty(totalSeconds)) + { + return ""; + } + int time = int.Parse(totalSeconds); + int h = time / (60 * 60); + int m = time % (60 * 60) / 60; + int s = (time % (60 * 60) % 60); + + if (h == 0 && m != 0 && s != 0) + { + return $"{m}min{s}s"; + } + else if (h == 0 && m == 0 && s != 0) + { + return $"{s}s"; + } + else if (h == 0 && m != 0 && s == 0) + { + return $"{m}min"; + } + else if (h != 0 && m == 0 && s != 0) + { + return $"{h}h{s}s"; + } + else if (h != 0 && m == 0 && s == 0) + { + return $"{h}h"; + } + else if (h != 0 && m != 0 && s == 0) + { + return $"{h}h{m}min"; + } + else if (h != 0 && m != 0 && s != 0) + { + return $"{h}h{m}min{s}s"; + } + else if (h == 0 && m == 0 && s == 0) + { + return $"0s"; + } + return ""; + } + catch + { + return ""; } } @@ -1223,11 +1294,12 @@ //妯℃嫙璁惧 var functions = new List<Function> { new Entity.Function { sid = "1234567890", name = "鍏夌収浼犳劅鍣�", spk = Entity.SPK.SensorLight }, - new Entity.Function { sid = "1234567891", name = "鎻掑骇", spk = Entity.SPK.PanelSocket }, + new Entity.Function { sid = "1234567891", name = "骞茶妭鐐�", spk = Entity.SPK.SensorDryContact }, new Entity.Function { sid = "1234567892", name = "绱ф�ユ眰鍔╀紶鎰熷櫒", spk = Entity.SPK.SensorHelp }, + new Entity.Function { sid = "12345678921", name = "閫氱敤寮�鍏�", spk = Entity.SPK.OtherCommon }, //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 = "浜轰綋瀛樺湪浼犳劅鍣�", spk = Entity.SPK.SensorPirHold }, + new Entity.Function { sid = "123456789688889", name = "浜轰綋瀛樺湪浼犳劅鍣�", spk = Entity.SPK.SensorPirHold }, new Entity.Function { sid = "12345678968888", name = "娴嬭瘯鐚溂", spk = Entity.SPK.Peephole }, new Entity.Function { sid = "12345678968889", name = "娴嬭瘯钀ょ煶鎽勫儚澶�", spk = Entity.SPK.Ev_Ipcam }, // new Entity.Function { sid = "1234567897", name = "姣背娉紶鎰熷櫒1", spk = Entity.SPK.SenesorMegahealth2 }, -- Gitblit v1.8.0