From 0087dd7734e71dfcfd1bb54db394ad7855021ffd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 24 七月 2020 10:18:08 +0800
Subject: [PATCH] 新版本

---
 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs |   58 ++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 40 insertions(+), 18 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
index a4001f1..5a87885 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
@@ -132,6 +132,7 @@
             seekBarColor.SeekBarPadding = Application.GetRealWidth(60);
             seekBarColor.IsProgressTextShow = true;
             seekBarColor.ProgressBarColor = UserCenterColor.Current.Transparent;
+            seekBarColor.ProgressBarUnEnableColor = UserCenterColor.Current.Transparent;
             seekBarColor.SeekBarBackgroundColor = UserCenterColor.Current.Transparent;
             seekBarColor.ProgressTextSize = 14;
             seekBarColor.ProgressTextColor = UserCenterColor.Current.TextGrayColor2;
@@ -161,6 +162,7 @@
             this.btnBuzzerSwitch = new IconBigViewControl(81, 81);
             btnBuzzerSwitch.UnSelectedImagePath = "Item/Switch.png";
             btnBuzzerSwitch.SelectedImagePath = "Item/SwitchSelected.png";
+            btnBuzzerSwitch.IsSelected = ((ColorTemperatureLight)this.device).IsBuzzerRing;
             frameWhiteBack.AddChidren(btnBuzzerSwitch);
             btnBuzzerSwitch.InitControl();
             btnBuzzerSwitch.UseClickStatu = false;
@@ -200,6 +202,12 @@
             };
             btnMiniSwitch.IsSelected = ((LightBase)this.device).OnOffStatus == 1;
             this.canSetProgressValue = btnMiniSwitch.IsSelected;
+            if (btnMiniSwitch.IsSelected == false)
+            {
+                //鍦ㄦ病鏈夋墦寮�澶滅伅寮�鍏充箣鍓�,涓嶅厑璁告粦鍔�
+                seekBarLight.Enable = false;
+                seekBarColor.Enable = false;
+            }
 
             //浜害寮�濮嬫粦鍔ㄧ殑浜嬩欢
             seekBarLight.OnStartTrackingTouchEvent += (sender, e) =>
@@ -347,7 +355,13 @@
                          {
                              //褰撴槸鎵撳紑鐘舵�佹椂,缃戝叧璇村畠浼氶粯璁ゆ妸浜害鍙樻垚100%
                              //浠ラ槻涓囦竴,杩欓噷鍐嶆璇诲彇涓�涓�
-                             ((ColorTemperatureLight)device).ReadLevel();
+                             HdlThreadLogic.Current.RunThread(() =>
+                             {
+                                 ((ColorTemperatureLight)device).ReadLevel();
+                                 System.Threading.Thread.Sleep(300);
+                                 ((ColorTemperatureLight)device).ReadColorTemperature();
+                             });
+
                          }
                      }
                  });
@@ -379,25 +393,19 @@
             //濡傛灉浣忓畢鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                //((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
-                ////鍒锋柊寮�鍏崇姸鎬�
-                //this.RefreshSwitchStatu(isOpen);
+                ((ColorTemperatureLight)this.device).IsBuzzerRing = isOpen;
+                //鍒锋柊寮�鍏崇姸鎬�
+                this.RefreshSwitchStatu(isOpen);
                 return;
             }
 
             //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
-            this.StartCheckResponeResult(new List<ButtonBase> { this.btnBuzzerSwitch.btnIcon }, (result) =>
+            this.btnBuzzerSwitch.CanClick = false;
+            this.StartCheckResponeResult(new List<ButtonBase>(), (result) =>
             {
                 HdlThreadLogic.Current.RunMain(() =>
                 {
-                    //鎺ユ敹鍒扮綉鍏冲洖澶�
-                    if (result == true)
-                    {
-                        this.btnBuzzerSwitch.IsSelected = isOpen;
-                        //bool statu = ((LightBase)this.device).OnOffStatus == 1;
-                        ////鍒锋柊寮�鍏崇姸鎬�
-                        //this.RefreshSwitchStatu(statu);
-                    }
+                    this.btnBuzzerSwitch.CanClick = true;
                 });
             });
             //鍙戦�佸懡浠�
@@ -463,11 +471,13 @@
         /// <param name="isOpen">鎵撳紑鐘舵��</param>
         private void RefreshSwitchStatu(bool isOpen)
         {
-            if (this.isColorProgressing == true)
+            //鍒锋柊铚傞福鍣ㄥ紑鍏崇姸鎬�
+            bool isBuzzerRing = ((ColorTemperatureLight)this.device).IsBuzzerRing;
+            if (this.btnBuzzerSwitch.IsSelected != isBuzzerRing)
             {
-                //濡傛灉鏄壊娓╂粦鍔ㄧ殑璇�,涓嶉渶瑕佸埛鏂扮晫闈�
-                return;
+                this.btnBuzzerSwitch.IsSelected = isBuzzerRing;
             }
+
             if (isOpen == true)
             {
                 //浜害鏄繀椤昏鍒锋柊鐨�  浜害 XX
@@ -482,13 +492,25 @@
                     //褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
                     seekBarColor.Progress = (int)(((ColorTemperatureLight)this.device).ColorTemperature / 100);
                 }
-                this.btnMiniSwitch.IsSelected = true;
+                if (this.btnMiniSwitch.IsSelected == false)
+                {
+                    this.btnMiniSwitch.IsSelected = true;
+                }
+                //婊戝姩鏉″彲浠ユ粦鍔�
+                seekBarLight.Enable = true;
+                seekBarColor.Enable = true;
             }
             else
             {
                 //鍙樻洿瀛楁牱:鍏抽棴
                 this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
-                this.btnMiniSwitch.IsSelected = false;
+                if (this.btnMiniSwitch.IsSelected == true)
+                {
+                    this.btnMiniSwitch.IsSelected = false;
+                }
+                //婊戝姩鏉′笉鍙互婊戝姩
+                seekBarLight.Enable = false;
+                seekBarColor.Enable = false;
             }
 
             //鍥炲鐨勭粨鏋滆,澶勪簬鎵撳紑鐘舵�佹墠鑳藉彂閫�

--
Gitblit v1.8.0