From 6e580804d74d7a6fb118b6ba381e88aa81f267c7 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 15 三月 2021 15:30:23 +0800
Subject: [PATCH] Merge branch 'temp-wxr' into dev-tzy

---
 HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs
index 3255433..aa73f74 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs
@@ -405,6 +405,7 @@
                 {
                     lightingView.SetViewStatus(lightTemp.state == "on");
                 }
+                Console.WriteLine($"鏃堕棿鎴筹細{device.time_stamp}  鏃堕棿锛歿device.GeteTime()} 鐑樺共:{hotDryTemp.state} 椋庡共:{windDryTemp.state} 娑堟瘨:{disinfectTemp.state} 鐏厜鐘舵�侊細{lightTemp.state}");
                 #endregion
 
                 #region 淇敼鏃堕棿
@@ -450,8 +451,6 @@
         /// </summary>
         public bool Lighting = false;
 
-
-
         public ClothesHangerControl(string iconPath1, string iconPath2, string title, string time)
         {
             btnIcon = new Button()
@@ -478,7 +477,7 @@
             btnTime = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = btnTitle.Bottom,
+                Y = Application.GetRealHeight(74-32),
                 Height = Application.GetRealHeight(32),
                 Text = time,
                 TextColor = 0x00000000,
@@ -494,29 +493,44 @@
         public void ChangeTime(string newTime)
         {
             int.TryParse(newTime, out leftTime);
-            leftTime *= 60;
+            if (leftTime > 0)
+            {
+                Application.RunOnMainThread(() =>
+                {
+                    btnTime.Text = new TimeSpan(0, leftTime, 0).ToString().Remove(5, 3);
+                });
+                leftTime--;
+            }
+            else if (leftTime == 0)
+            {
+                Application.RunOnMainThread(() =>
+                {
+                    btnTime.Text = "";
+                });
+            }
             if (countdownThread == null)
             {
                 countdownThread = new System.Threading.Thread(() =>
                 {
+
                     while (true)
                     {
-                        if (leftTime > 1)
+                        if (leftTime > 0)
                         {
                             Application.RunOnMainThread(() =>
                             {
-                                btnTime.Text = new TimeSpan(0, 0, leftTime).ToString();
+                                btnTime.Text = new TimeSpan(0, leftTime, 0).ToString().Remove(5,3) ;
                             });
-                            System.Threading.Thread.Sleep(1000);
                             leftTime--;
                         }
-                        else
+                        else if(leftTime == 0)
                         {
                             Application.RunOnMainThread(() =>
                             {
                                 btnTime.Text = "";
                             });
                         }
+                        System.Threading.Thread.Sleep(60000);
                     }
                 })
                 { IsBackground = true };

--
Gitblit v1.8.0