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 | 69 +++++++++++++++++++++++++++++++--- 1 files changed, 63 insertions(+), 6 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index e2e9a5d..ebbfe22 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -189,7 +189,7 @@ list.AddRange(list2); list.AddRange(FunctionList.List.groupControls); #if DEBUG - //GetTestDevice(ref list, true); + GetTestDevice(ref list, true); #endif return list; } @@ -377,10 +377,10 @@ //{ // return "LogicIcon/ganjiedian.png"; //} - else if (SPK.SensorLight == device.spk) - { - return "LogicIcon/lightloguc.png"; - } + //else if (SPK.SensorLight == device.spk) + //{ + // return "LogicIcon/lightloguc.png"; + //} //LogicIcon/heatlogic.png" return $"FunctionIcon/Icon/{device.IconName}.png"; @@ -998,6 +998,63 @@ 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 ""; + } + } #region 楂樺痉鍧愭爣杞琖GS84鍧愭爣 /// <summary> @@ -1242,7 +1299,7 @@ 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