From cda2410f9c29f2fadc16e9de38ccae95b75a89dd Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 09 六月 2021 10:51:13 +0800
Subject: [PATCH] 1

---
 HDL_ON/Entity/Function/Scene.cs |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index 3970bc1..f4bdd83 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -67,7 +67,7 @@
         /// </summary>
         public string delay = "0";
         /// <summary>
-        /// 鍦烘櫙鐨勬渶濂戒竴娆℃墽琛屾椂闂�
+        /// 鍦烘櫙鐨勬渶鍚庝竴娆℃墽琛屾椂闂�
         /// </summary>
         public string LastExecutionTime = "";
 
@@ -83,6 +83,11 @@
         /// 鏀惰棌鏍囪
         /// </summary>
         public bool collect = false;
+
+        /// <summary>
+        /// 鍒涘缓璇ュ満鏅殑鐢ㄦ埛ID
+        /// </summary>
+        public string userId = "";
 
         ///// <summary>
         ///// 鍦烘櫙鑳屾櫙
@@ -138,13 +143,14 @@
                 sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2");
 
 
-                if (sTimeSpan.Length > 8)
+                if (sTimeSpan.Length >= 8)
                 {
                     sTimeSpan = sTimeSpan.Substring(0, 8);
                 }
                 else
                 {
-                    sTimeSpan = "00000000";
+                    sTimeSpan = Guid.NewGuid().ToString().Substring(0, 8);
+                    //sTimeSpan = "00000000";
                 }
 
                 sceneId = sOidBeginsWith + sTimeSpan;
@@ -340,7 +346,21 @@
         /// </summary>
         public string GetDelayText()
         {
+            var delayInt = 0;
+            int.TryParse(delay,out delayInt);
+            if(delayInt == 0)
+            {
+                return Language.StringByID(StringId.NoDelay);
+            }
             string text = "";
+            if (delayInt > 60)
+            {
+                text = (delayInt / 60) + Language.StringByID(StringId.m) + (delayInt % 60) + Language.StringByID(StringId.s);
+            }else
+            {
+                text = delayInt + Language.StringByID(StringId.s);
+            }
+            return text;
             switch (delay)
             {
                 case "0":

--
Gitblit v1.8.0