From 18b93d511dc764b469d7c4a7e755f7274f89cdb4 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 27 四月 2020 17:55:14 +0800
Subject: [PATCH] 2020-4-27-1

---
 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs |   40 +++++++++++++++++++++++++++++++---------
 1 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
index ef83e6e..72e5900 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
@@ -61,6 +61,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 +81,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 +96,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 +122,10 @@
             //娣卞害鍗$墖淇℃伅
             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.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom, 965, 1316);
+                form.FormCloseEvent += this.CardDetailInfoBackEvent;
             };
         }
 
@@ -124,7 +140,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 +152,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 +204,7 @@
                 //鏃犻渶鍙樻洿
                 return;
             }
+            this.WcdType = wcdType;
             if (this.WcdType == 0)
             {
                 btnOpen.UnSelectedImagePath = "RollerShade/Up.png";

--
Gitblit v1.8.0