From fba7be989c27154db963cfce1ddd7b01d71e8b21 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期五, 20 十月 2023 14:21:12 +0800 Subject: [PATCH] 2023年10月20日14:20:17 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 61 +++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 2 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index fd883fb..80b27c9 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; } @@ -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