From d6aec3027ebec50e1096af7da19d03b1e5f5bea4 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期六, 19 十二月 2020 21:33:00 +0800
Subject: [PATCH] 20201219-99

---
 HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs |   74 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
old mode 100755
new mode 100644
index efac389..07c4933
--- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -349,6 +349,19 @@
                 };
                 view.AddChidren(btnCoverd);
 
+                Button btnShowDelay;
+                btnShowDelay = new Button()
+                {
+                    X = Application.GetRealWidth(40),
+                    Y = Application.GetRealWidth(4),
+                    Height = Application.GetRealWidth(32),
+                    Width = Application.GetRealWidth(100),
+                    TextColor = CSS_Color.AuxiliaryColor1,
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                };
+                view.AddChidren(btnShowDelay);
+
                 Button btnName;
                 btnName = new Button()
                 {
@@ -410,7 +423,7 @@
                     scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected;
                     scene.CollectScene();
                 };
-                LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene);
+                LoadEvent_ControlScene(btnCoverd, btnName, btnZone, btnShowDelay, scene);
                 btnSettingIcon.MouseUpEventHandler = (sender, e) => {
                     Action backAction = () => {
                         LoadSceneFunctionControlZone(null);
@@ -426,6 +439,53 @@
                     aep.LoadPage(refreshAction);
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 };
+                //鍦烘櫙姝e湪鍊掕鏃舵墽琛屼腑
+                scene.SceneCountDown(btnShowDelay);
+
+                //if (scene.LastExecutionTime == "" || Convert.ToDouble(scene.LastExecutionTime) + Convert.ToDouble(scene.delay) < Convert.ToDouble(Utlis.GetTimestamp(false)))
+                //{
+                //    int time = 0;
+                //    int.TryParse(Convert.ToInt32(
+                //        Convert.ToDouble(scene.LastExecutionTime) + Convert.ToDouble(scene.delay) - Convert.ToDouble(Utlis.GetTimestamp(false))
+                //        ).ToString(),out time);
+                //    if (time > 0)
+                //    {
+                //        new System.Threading.Thread(() =>
+                //        {
+                //            //int time = Convert.ToInt32(scene.delay);
+                //            if (time > 0)
+                //            {
+                //                while (time > 0)
+                //                {
+                //                    Application.RunOnMainThread(() =>
+                //                    {
+                //                        if (time / 60 > 1)
+                //                        {
+                //                            btnShowDelay.Text = (time / 60).ToString() + "min";
+                //                        }
+                //                        else
+                //                        {
+                //                            btnShowDelay.Text = (time--).ToString() + "s";
+                //                        }
+                //                    });
+                //                    if (time / 60 > 1)
+                //                    {
+                //                        System.Threading.Thread.Sleep(time / 60 * 60000);
+                //                    }
+                //                    else
+                //                    {
+                //                        System.Threading.Thread.Sleep(1000);
+                //                    }
+                //                }
+                //                Application.RunOnMainThread(() =>
+                //                {
+                //                    btnShowDelay.Text = "";
+                //                });
+                //            }
+                //        })
+                //        { IsBackground = true, Priority = System.Threading.ThreadPriority.BelowNormal }.Start();
+                //    }
+                //}
             }
             catch (Exception ex)
             {
@@ -557,14 +617,24 @@
         /// <summary>
         /// 鍔犺浇鍦烘櫙鎺у埗浜嬩欢
         /// </summary>
-        void LoadEvent_ControlScene(Button btnCoverd, Button btnName, Button btnZone, Scene scene)
+        void LoadEvent_ControlScene(Button btnCoverd, Button btnName, Button btnZone,Button btnShowDelay, Scene scene)
         {
 
             EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
             {
+                //鍦烘櫙姝e湪鍊掕鏃舵墽琛屼腑锛屼笉鍏佽鍐嶇偣鍑�
+                if (scene.LastExecutionTime == "" || Convert.ToDouble(scene.LastExecutionTime) + Convert.ToDouble(scene.delay) < Convert.ToDouble(Utlis.GetTimestamp(false)))
+                {
+                    scene.LastExecutionTime = Utlis.GetTimestamp(false);
+                }
+                else
+                {
+                    return;
+                }
                 string msg = scene.name + Language.StringByID(StringId.AlreadyOpened);
                 new PublicAssmebly().TipMsgAutoClose(msg, true);
                 Control.Ins.ControlScene(scene);
+                scene.SceneCountDown(btnShowDelay);
             };
             btnCoverd.MouseUpEventHandler = eventHandler;
             btnName.MouseUpEventHandler = eventHandler;

--
Gitblit v1.8.0