From 5851291c78b2cb5532e6938c77b5f51eb06a6ad2 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 21 十二月 2020 19:41:07 +0800
Subject: [PATCH] Merge branch 'NewFilePath' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into NewFilePath
---
HDL_ON/Entity/Function/Scene.cs | 81 +++++++++++++++++++++++++---------------
1 files changed, 50 insertions(+), 31 deletions(-)
diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index fba530b..a369fa7 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -35,7 +35,7 @@
/// <summary>
/// 浜戠鍞竴ID
/// </summary>
- public string userSceneId = "";
+ public string userSceneId = null;
/// <summary>
/// 鍦烘櫙sid
/// </summary>
@@ -64,36 +64,10 @@
/// 寤舵椂
/// </summary>
public string delay = "0";
- ///// <summary>
- ///// 寤舵椂鏄剧ず鐨勬枃鏈�
- ///// </summary>
- //[Newtonsoft.Json.JsonIgnore]
- //public string delayText
- //{
- // get
- // {
- // string text = "";
- // switch (delay)
- // {
- // case 0:
- // text = Language.StringByID(StringId.NoDelay);
- // break;
- // case 30:
- // text = "30s";
- // break;
- // case 60:
- // text = "1min";
- // break;
- // case 120:
- // text = "2min";
- // break;
- // case 300:
- // text = "5min";
- // break;
- // }
- // return text;
- // }
- //}
+ /// <summary>
+ /// 鍦烘櫙鐨勬渶濂戒竴娆℃墽琛屾椂闂�
+ /// </summary>
+ public string LastExecutionTime = "";
/// <summary>
/// 鍦烘櫙鍒嗙粍
@@ -239,6 +213,51 @@
return "SceneData_" + sid;
}
}
+ /// <summary>
+ /// 鍦烘櫙鎵ц\鍊掕鏃�
+ /// </summary>
+ /// <param name="btnShowDelay"></param>
+ public void SceneCountDown(Button btnShowDelay)
+ {
+ //鍦烘櫙姝e湪鍊掕鏃舵墽琛屼腑
+ if (LastExecutionTime != "" && Convert.ToDouble(LastExecutionTime) + Convert.ToDouble(delay) > Convert.ToDouble(Utlis.GetTimestamp(false)))
+ {
+ int time = 0;
+ int.TryParse(Convert.ToInt32(
+ Convert.ToDouble(LastExecutionTime) + Convert.ToDouble(delay) - Convert.ToDouble(Utlis.GetTimestamp(false))
+ ).ToString(), out time);
+ if (time > 0)
+ {
+ new System.Threading.Thread(() =>
+ {
+ if (time > 0)
+ {
+ while (time > 0)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ if (time > 60)
+ {
+ btnShowDelay.Text = (time / 60).ToString() + "min" + time % 60 + "s";
+ }
+ else
+ {
+ btnShowDelay.Text = time.ToString() + "s";
+ }
+ });
+ System.Threading.Thread.Sleep(1000);
+ time--;
+ }
+ Application.RunOnMainThread(() =>
+ {
+ btnShowDelay.Text = "";
+ });
+ }
+ })
+ { IsBackground = true, Priority = System.Threading.ThreadPriority.BelowNormal }.Start();
+ }
+ }
+ }
/// <summary>
/// 淇濆瓨鍔熻兘鏁版嵁
--
Gitblit v1.8.0