From 489d3bd60ad7dc2fecb398b09cf4c52df16f0fc2 Mon Sep 17 00:00:00 2001
From: Davin <591807572@qq.com>
Date: 星期三, 26 七月 2023 15:55:30 +0800
Subject: [PATCH] Merge branch 'Dev-Branch' of http://59.41.255.150:6688/r/~wxr/OnPro into Dev-Branch

---
 HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
index 2fd1ff6..9a24099 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
@@ -61,7 +61,7 @@
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
-                TextID = StringId.ColorfulFunction,
+                TextID = StringId.CulorfulTest,
             };
             viewSwitch.AddChidren(btnSwitchText);
 
@@ -106,6 +106,12 @@
                 })
                 { IsBackground = true }.Start();
             };
+
+            contentView.AddChidren(new Button
+            {
+                Height = Application.GetRealHeight(10),
+                BackgroundColor = CSS_Color.BackgroundColor,
+            });
 
             #endregion
 
@@ -155,7 +161,7 @@
             btnStartColor.MouseUpEventHandler = (sender, e) => {
                 Action<uint> action = (color) => {
                     btnStartColor.BackgroundColor = color;
-                    function.SetAttrState(FunctionAttributeKey.ColorfulBegin, color);
+                    //function.SetAttrState(FunctionAttributeKey.ColorfulBegin, color);
                 };
                 var rgbView = new ColorfulSettingPage(function, action,true);
                 MainPage.BasePageView.AddChidren(rgbView);
@@ -265,6 +271,13 @@
             };
             workHoursView.AddChidren(btnWorkHours);
 
+            var time = Convert.ToInt32( function.GetAttrState(FunctionAttributeKey.ColorfulTime));
+
+
+            btnWorkHours.Text = time/ 360 + Language.StringByID(StringId.h);
+            btnWorkHours.Text += time / 60 + Language.StringByID(StringId.m);
+            btnWorkHours.Text += time % 60 + Language.StringByID(StringId.s);
+
             var waitPage = new Loading();
             this.AddChidren(waitPage);
 
@@ -279,11 +292,17 @@
                         {
                             LoadEditDialog(() =>
                             {
+                                if(hour == 0 && minute == 0 && second == 0)
+                                {
+                                    new PublicAssmebly().TipMsg(StringId.Tip, StringId.TimeInvalid);
+                                    return;
+                                }
                                 btnWorkHours.Text = hour + "鏃�";
                                 btnWorkHours.Text += minute + "鍒�";
                                 btnWorkHours.Text += second + "绉�";
                                 new System.Threading.Thread(() => {
-                                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+                                    var d = new Dictionary<string, string>();
+                                    function.SetAttrState(FunctionAttributeKey.ColorfulTime, (hour * 360 + minute * 60 + second).ToString());
                                     d.Add(FunctionAttributeKey.ColorfulTime, (hour * 360 + minute * 60 + second).ToString());
                                     Control.Ins.SendWriteCommand(function, d);
                                 }) { IsBackground = true }.Start();
@@ -303,8 +322,6 @@
             btnWorkHours.MouseUpEventHandler = eventHandler;
             workHoursView.MouseUpEventHandler = eventHandler;
             btnWorkHoursRight.MouseUpEventHandler = eventHandler;
-
-
             #endregion
 
 

--
Gitblit v1.8.0