From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs |   53 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
index ef83e6e..76535ea 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
@@ -35,20 +35,12 @@
         #region 鈻� 鍒濆鍖朹____________________________
 
         /// <summary>
-        /// 鍒嗙被鐣岄潰鐨勭獥甯樿澶囪鎺т欢
-        /// </summary>
-        /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
-        public DeviceCurtainRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
-        {
-        }
-
-        /// <summary>
         /// 鍒濆鍖栨帶浠�
         /// </summary>
         /// <param name="i_device"></param>
-        public override void InitControl(CommonDevice i_device)
+        public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom)
         {
-            base.InitControl(i_device);
+            base.InitControl(i_device, i_nowSelectRoom);
 
             //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
             this.AddDetailInfoEvent(i_device);
@@ -61,6 +53,13 @@
             btnOpen.X = Application.GetRealWidth(625) - btnOpen.XOffset;
             btnOpen.ButtonClickEvent += (sender, e) =>
             {
+                //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴淇敼缂撳瓨
+                if (Common.Config.Instance.Home.IsVirtually == true)
+                {
+                    ((Rollershade)i_device).WcdCurrentPositionLiftPercentage = 100;
+                    base.RefreshControlInfo(i_device);
+                    return;
+                }
                 ((Rollershade)i_device).CurtainUpDownStopControl(0);
             };
 
@@ -74,7 +73,11 @@
             btnStop.X = Application.GetRealWidth(769) - btnOpen.XOffset;
             btnStop.ButtonClickEvent += (sender, e) =>
             {
-                ((Rollershade)i_device).CurtainUpDownStopControl(2);
+                //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁�
+                if (Common.Config.Instance.Home.IsVirtually == false)
+                {
+                    ((Rollershade)i_device).CurtainUpDownStopControl(2);
+                }
             };
 
             //鍏抽棴
@@ -85,6 +88,13 @@
             btnClose.X = Application.GetRealWidth(896) - btnOpen.XOffset;
             btnClose.ButtonClickEvent += (sender, e) =>
             {
+                //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴淇敼缂撳瓨
+                if (Common.Config.Instance.Home.IsVirtually == true)
+                {
+                    ((Rollershade)i_device).WcdCurrentPositionLiftPercentage = 0;
+                    base.RefreshControlInfo(i_device);
+                    return;
+                }
                 ((Rollershade)i_device).CurtainUpDownStopControl(1);
             };
 
@@ -104,12 +114,11 @@
             //娣卞害鍗$墖淇℃伅
             this.frameTable.ButtonClickEvent += (sender, e) =>
             {
-                var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
-                UserView.HomePage.Instance.AddChidren(rollerShadeControl);
-                UserView.HomePage.Instance.PageIndex += 1;
-                UserView.HomePage.Instance.ScrollEnabled = false;
-                rollerShadeControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
-                rollerShadeControl.action += this.CardDetailInfoBackEvent;
+                //绐楀笜绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈�
+                var form = new MainPage.ControlForm.DeviceCurtainDetailCardForm();
+                form.RowOrCardControl = this;
+                form.AddForm(i_device, this.nowSelectRoom, 965, 1316);
+                form.FormCloseEvent += this.CardDetailInfoBackEvent;
             };
         }
 
@@ -124,7 +133,7 @@
         /// <returns></returns>
         public override bool CheckIsOpenStatu(CommonDevice i_device)
         {
-            return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 10;
+            return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 0;
         }
 
         #endregion
@@ -136,10 +145,15 @@
         /// </summary>
         public override void SendStatuComand()
         {
+            //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁�
+            if (Common.Config.Instance.Home.IsVirtually == true)
+            {
+                return;
+            }
             //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
             if (this.CheckCanSendStatuComand() == true)
             {
-                Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(this.device);
+                HdlDeviceAttributeLogic.Current.SendCurtainStatuComand(this.device);
             }
             if (((Rollershade)this.device).WcdType == -1)
             {
@@ -183,6 +197,7 @@
                 //鏃犻渶鍙樻洿
                 return;
             }
+            this.WcdType = wcdType;
             if (this.WcdType == 0)
             {
                 btnOpen.UnSelectedImagePath = "RollerShade/Up.png";

--
Gitblit v1.8.0