From bb6ad792b598927a5459a5fb6f6c27fb1aa9e94e Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 17 十二月 2020 14:06:36 +0800
Subject: [PATCH] 20201217-1

---
 HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs |   56 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
index cc40ad1..bf0f284 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
@@ -31,6 +31,14 @@
         /// </summary>
         WaveSeekBarOn dimmerBar;
         /// <summary>
+        /// 浜害鏄剧ず鎸夐挳
+        /// </summary>
+        Button btnBrightnessText;
+        /// <summary>
+        /// 娓愬彉鏃堕棿淇敼
+        /// </summary>
+        DiyImageSeekBar barFadeTime;
+        /// <summary>
         /// 寮�鍏虫寜閽�
         /// </summary>
         Button btnSwitch;
@@ -113,9 +121,14 @@
                 Height = Application.GetMinRealAverage(40),
                 SelectedImagePath = "Collection/CollectionIcon.png",
                 UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
-                IsSelected = light.collection
+                IsSelected = light.collect
             };
-            controlView.AddChidren(btnCollection);
+            //controlView.AddChidren(btnCollection);
+            //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
+            if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
+            {
+                controlView.AddChidren(btnCollection);
+            }
 
             dimmerBar = new WaveSeekBarOn()
             {
@@ -131,9 +144,11 @@
                 //BackgroundColor = CSS_Color.BackgroundColor,
                 //Radius = (uint)Application.GetRealWidth(40),
                 Progress = light.brightness,
+                //ProgressTextColor =0x00000000,
+                IsProgressTextShow = false,
             };
             controlView.AddChidren(dimmerBar);
-            if(light.trait_on_off.value.ToString() == "on")
+            if(light.trait_on_off.curValue.ToString() == "on")
             {
                 dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
             }
@@ -141,7 +156,20 @@
             {
                 dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
             }
-            
+            dimmerBar.Progress = light.brightness;
+            btnBrightnessText = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y =( (100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) /100)+ Application.GetRealWidth(40),
+                Width = Application.GetRealWidth(56),
+                Height = Application.GetRealWidth(46),
+                UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
+                Text = light.brightness + "%",
+            };
+            controlView.AddChidren(btnBrightnessText);
+
 
             #region 娓愬彉鏃堕棿璋冭妭
             var btnGradualChangeText = new Button()
@@ -170,7 +198,7 @@
             };
             controlView.AddChidren(btnGradualChangeMinValuesText);
 
-            var barGradualChange = new DiyImageSeekBar()
+            barFadeTime = new DiyImageSeekBar()
             {
                 X = btnGradualChangeMinValuesText.Right,
                 Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
@@ -184,13 +212,14 @@
                 ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                 ProgressBarUnitSring = "s",
                 MaxValue = 10,
-                Progress = 0,
+                Progress = light.fadeTime,
+                SeekBarPadding = Application.GetRealWidth(20),
             };
-            controlView.AddChidren(barGradualChange);
+            controlView.AddChidren(barFadeTime);
 
             var btnGradualChangeMaxValuesText = new Button()
             {
-                X = barGradualChange.Right,
+                X = barFadeTime.Right,
                 Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
                 Width = Application.GetRealWidth(35),
                 Height = Application.GetRealHeight(21),
@@ -210,15 +239,18 @@
                 Height = Application.GetMinRealAverage(40),
                 UnSelectedImagePath = "Public/PowerClose.png",
                 SelectedImagePath = "Public/PowerOpen.png",
-                IsSelected = light.trait_on_off.value.ToString() == "on",
-                //Tag = 
+                IsSelected = light.trait_on_off.curValue.ToString() == "on",
             };
             controlView.AddChidren(btnSwitch);
 
             LoadEventList();
 
-            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(light, actionRefresh);
-
+            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
+            new System.Threading.Thread(() =>
+            {
+                DriverLayer.Control.Ins.SendReadCommand(light);
+            })
+            { IsBackground = true }.Start();
         }
 
 

--
Gitblit v1.8.0