From b3e96fce4cc01113128ddf8e0a18fc19594a9e56 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 05 十二月 2019 18:38:30 +0800
Subject: [PATCH] 一个新的版本

---
 ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs |   37 +++++++++----------------------------
 1 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
index efbd1ec..c60af98 100755
--- a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
@@ -1,6 +1,7 @@
 锘縰sing System;
 using Shared.Common;
 using Shared.Phone.Device.CommonForm;
+using Shared.Phone.Device.DeviceLogic;
 using Shared.Phone.UserView;
 using ZigBee.Device;
 
@@ -137,8 +138,6 @@
                                 {
                                     curtainSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
                                 }
-                                //SeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
-                                //seekBarTitle.Text = $"{SeekBar.Progress} %";
                                 rollerShade.LastDateTime = DateTime.Now;
                             }
                             else if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
@@ -274,8 +273,7 @@
             {
                 UserHomeView.ReadStatus(rollerShade, () =>
                 {
-                    rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
-                    rollerShade.ReadWcdCurrentPositionLiftPercentage();
+                    ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice);
                 });
             }
             else
@@ -283,8 +281,7 @@
                 //闃叉鐭椂闂村唴澶氭璇诲彇
                 if ((DateTime.Now - rollerShade.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
                 {
-                    rollerShade.ReadWcdCurrentPositionLiftPercentage();
-                    rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
+                    ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice);
                 }
             }
 
@@ -505,28 +502,12 @@
             //upBtn.MouseUpEventHandler += Up;
             //stopBtn.MouseUpEventHandler += Stop;
             //downBtn.MouseUpEventHandler += Down;
-            //SeekBar.ProgressChanged += SeekBar_ProgressChange;
-            //collectionBtn.MouseUpEventHandler += Collection;
-            //moreBtn.MouseUpEventHandler += More;
-            //roomBtn.MouseUpEventHandler += BackToRoomHandler;
-            //roomName.MouseUpEventHandler += BackToRoomHandler;
+            collectionBtn.MouseUpEventHandler += Collection;
         }
 
         #endregion
 
-        #region 鈼� 鎺у埗___________________________
-
-        /// <summary>
-        /// 婊戞潯绉诲姩鍙戦�佸懡浠�
-        /// </summary>
-        /// <param name="sender">Sender.</param>
-        /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
-        private void SeekBar_ProgressChange(object sender, int mouseEventArgs)
-        {
-            //seekBarTitle.Text = $"{SeekBar.Progress}%";
-            //(device.CommonDevice as ZigBee.Device.Rollershade).WcdGoToTiltValue(SeekBar.Progress);
-        }
-
+        #region 鈼� 鎺у埗__________________________
 
         /// <summary>
         /// 涓娿�佸紑
@@ -726,11 +707,12 @@
                 curtainSeekBar.Width = Application.GetRealWidth(570);
                 curtainSeekBar.Height = Application.GetRealHeight(513);
                 curtainSeekBar.Gravity = Gravity.CenterHorizontal;
+                curtainSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage;
                 layout.AddChidren(curtainSeekBar);
 
                 curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
                 {
-                    (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
+                    (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainSeekBar.Progress);
                 };
             }
         }
@@ -748,15 +730,14 @@
         /// <param name="e">E.</param>
         private void Collection(object sender, MouseEventArgs e)
         {
-            //collection
             if (collectionBtn.IsSelected)
             {
-                Shared.Common.Room.Lists[0].DeleteDevice(device.FileName);
+                Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName);
                 collectionBtn.IsSelected = false;
             }
             else
             {
-                Shared.Common.Room.Lists[0].AddDevice(device.FileName);
+                Common.Room.CurrentRoom.GetLoveRoom().AddDevice(device.FileName);
                 collectionBtn.IsSelected = true;
             }
         }

--
Gitblit v1.8.0