From f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 30 十二月 2019 13:32:33 +0800
Subject: [PATCH] 2019-12-30-1

---
 ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs |   96 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 82 insertions(+), 14 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
index 681e7eb..efbd1ec 100755
--- a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
@@ -65,6 +65,20 @@
         /// StopBtn
         /// </summary>
         public Button StopBtn;
+        /// <summary>
+        /// 寮�鍚堝笜
+        /// </summary>
+        private CurtainSeekBar curtainSeekBar = new CurtainSeekBar { };
+        /// <summary>
+        /// 鍗峰笜
+        /// </summary>
+        private CurtainRollSeekBar curtainRollSeekBar = new CurtainRollSeekBar { };
+
+        /// <summary>
+        /// IsDrawerLockMode
+        /// </summary>
+        public bool IsDrawerLockMode;
+
         #endregion
 
         #region 鈼� 鎺ュ彛___________________________
@@ -115,6 +129,14 @@
                                 rollerShade.DeviceStatusReport = common.DeviceStatusReport;
                                 rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData;
                                 StatuBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} { deviceUI.GetDeviceStatu()}";
+                                if(rollerShade.WcdType==0)
+                                {
+                                    curtainRollSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
+                                }
+                                else if(rollerShade.WcdType==4)
+                                {
+                                    curtainSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
+                                }
                                 //SeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
                                 //seekBarTitle.Text = $"{SeekBar.Progress} %";
                                 rollerShade.LastDateTime = DateTime.Now;
@@ -215,6 +237,10 @@
             //action();
             //action = null;
             RemoveUpdateControlDeviceStatuAction();
+            if (IsDrawerLockMode)
+            {
+                CommonPage.Instance.IsDrawerLockMode = false;
+            }
             base.RemoveFromParent();
         }
 
@@ -294,15 +320,6 @@
                 RemoveFromParent();
             };
 
-            var sharedBtn = new Button
-            {
-                X = Application.GetRealWidth(850),
-                Width = Application.GetMinReal(69),
-                Height = Application.GetMinReal(69),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "Item/Shared.png"
-            };
-            top.topView.AddChidren(sharedBtn);
 
             var moreBtn = new Button
             {
@@ -386,7 +403,7 @@
             itemView.AddChidren(OpenOrUpBtn);
             OpenOrUpBtn.MouseUpEventHandler += (sender, e) =>
             {
-                (device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(0);
+                (device.CommonDevice as Rollershade).CurtainUpDownStopControl(0);
             };
 
             StopBtn = new Button
@@ -401,7 +418,7 @@
             itemView.AddChidren(StopBtn);
             StopBtn.MouseUpEventHandler += (sender, e) =>
             {
-                (device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(2);
+                (device.CommonDevice as Rollershade).CurtainUpDownStopControl(2);
             };
 
             CloseOrDownBtn = new Button
@@ -414,10 +431,9 @@
             itemView.AddChidren(CloseOrDownBtn);
             CloseOrDownBtn.MouseUpEventHandler += (sender, e) =>
             {
-                (device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(1);
+                (device.CommonDevice as Rollershade).CurtainUpDownStopControl(1);
             };
 
-            SetRollerShadeIcon((device.CommonDevice as Rollershade).WcdType);
             if ((device.CommonDevice as Rollershade).WcdType == -1)
             {
                 CommonPage.Loading.Start();
@@ -434,6 +450,9 @@
                 })
                 { IsBackground = true }.Start();
             }
+
+            SetCurtainType(itemView, (device.CommonDevice as Rollershade).WcdType);
+            
             var roomBG = new Button
             {
                 Y = Application.GetRealHeight(1178 - 50),
@@ -645,11 +664,22 @@
         }
 
         /// <summary>
+        /// SetCurtainType
+        /// </summary>
+        /// <param name="layout"></param>
+        /// <param name="type"></param>
+        private void SetCurtainType(FrameLayout layout, int type)
+        {
+            SetRollerShadeIcon(type);
+            SetRollerSeekBar(layout, type);
+        }
+
+        /// <summary>
         /// WcdType=4锛氬紑鍚堝笜
         /// WcdType=0锛氬嵎甯�
         /// </summary>
         /// <param name="type"></param>
-        public void SetRollerShadeIcon(int type)
+        private void SetRollerShadeIcon(int type)
         {
             if (type == 0)
             {
@@ -669,6 +699,44 @@
             }
         }
 
+        /// <summary>
+        /// SetRollerSeekBar
+        /// </summary>
+        /// <param name="layout"></param>
+        /// <param name="type"></param>
+        private void SetRollerSeekBar(FrameLayout layout,int type)
+        {
+            if(type == 0)
+            {
+                curtainRollSeekBar.Y = Application.GetRealHeight(300);
+                curtainRollSeekBar.Width = Application.GetRealWidth(438);
+                curtainRollSeekBar.Height = Application.GetRealHeight(576);
+                curtainRollSeekBar.Gravity = Gravity.CenterHorizontal;
+                curtainRollSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage;
+                layout.AddChidren(curtainRollSeekBar);
+
+                curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+                {
+                    (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
+                };
+            }
+            else
+            {
+                curtainSeekBar.Y = Application.GetRealHeight(334);
+                curtainSeekBar.Width = Application.GetRealWidth(570);
+                curtainSeekBar.Height = Application.GetRealHeight(513);
+                curtainSeekBar.Gravity = Gravity.CenterHorizontal;
+                layout.AddChidren(curtainSeekBar);
+
+                curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+                {
+                    (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
+                };
+            }
+        }
+
+
+
         #endregion
 
         #region 鈼� 鏀惰棌鍒颁富椤礯______________________

--
Gitblit v1.8.0