From 944b87b6bcccb095cd73f13f4410fb20faf48f74 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 25 十二月 2019 11:21:06 +0800
Subject: [PATCH] 2019.12.25

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
index 65f1e0a..10cf90f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
@@ -143,7 +143,7 @@
                 listText.Add(Language.StringByID(R.MyInternationalizationString.uForwardDirection));//姝e悜
                 listText.Add(Language.StringByID(R.MyInternationalizationString.uReverseDirection));//鍙嶅悜
 
-                var form = new BottomDialogSelectForm();
+                var form = new BottomItemSelectForm();
                 form.AddForm(Language.StringByID(R.MyInternationalizationString.uDirectionSelect), listText, nowSelectNo);
                 form.FinishSelectEvent += async (index) =>
                 {
@@ -299,7 +299,7 @@
                         startWait = false;
                         checking = true;
 
-                        var value = openSeekBar.Progress;
+                        var value = curtainData.OpenLimitPersent;
                         if (oldValue == value)
                         {
                             //鐩稿悓鏁板��
@@ -426,7 +426,7 @@
                         startWait = false;
                         checking = true;
 
-                        var value = closeSeekBar.Progress;
+                        var value = curtainData.CloseLimitPersent;
                         if (oldValue == value)
                         {
                             //鐩稿悓鏁板��
@@ -512,7 +512,7 @@
 
             bool receiptData = false;
             string mainkeys = LocalDevice.Current.GetDeviceMainKeys(curtainDevice);
-            HdlDeviceAttributeLogic.Current.AddAttributeEvent("CurtainDeviceAttribute", "DeviceStatusReport", (device) =>
+            HdlGatewayReceiveLogic.Current.AddAttributeEvent("CurtainDeviceAttribute", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (device) =>
             {
                 string checkKey = LocalDevice.Current.GetDeviceMainKeys(device);
                 if (mainkeys != checkKey || device.DeviceStatusReport.CluterID != 258)
@@ -576,7 +576,7 @@
                 return false;
             }
             //绉婚櫎鐩戝惉
-            HdlDeviceAttributeLogic.Current.RemoveEvent("CurtainDeviceAttribute");
+            HdlGatewayReceiveLogic.Current.RemoveEvent("CurtainDeviceAttribute");
 
             //澶囦唤绐楀笜鏁版嵁
             if (this.backupCurtainData == true)
@@ -605,12 +605,12 @@
         /// </summary>
         private void ReceiveLimitData()
         {
-            if (HdlDeviceAttributeLogic.Current.IsEsixt("ReceiveLimitData") == true)
+            if (HdlGatewayReceiveLogic.Current.IsEsixt("ReceiveLimitData") == true)
             {
-                HdlDeviceAttributeLogic.Current.RemoveEvent("ReceiveLimitData");
+                HdlGatewayReceiveLogic.Current.RemoveEvent("ReceiveLimitData");
             }
             string mainkeys = LocalDevice.Current.GetDeviceMainKeys(curtainDevice);
-            HdlDeviceAttributeLogic.Current.AddAttributeEvent("ReceiveLimitData", "DeviceStatusReport", (device) =>
+            HdlGatewayReceiveLogic.Current.AddAttributeEvent("ReceiveLimitData", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (device) =>
             {
                 string checkKey = LocalDevice.Current.GetDeviceMainKeys(device);
                 if (mainkeys != checkKey || device.DeviceStatusReport.CluterID != 258)
@@ -639,8 +639,12 @@
                                 this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
                                 {
                                     //鎵ц纭鍙婅鐩栦笂闄愪綅鐐�
-                                    await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
+                                    var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
                                         curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
+                                    if (result == true)
+                                    {
+                                        curtainData.DeleteOpenLimit = true;
+                                    }
                                 });
                             }
                             //鍚堥檺浣�
@@ -654,8 +658,12 @@
                                 this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
                                 {
                                     //鎵ц纭鍙婅鐩栧悎闄愪綅鐐�
-                                    await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
+                                    var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
                                         curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
+                                    if (result == true)
+                                    {
+                                        curtainData.DeleteCloseLimit = true;
+                                    }
                                 });
                             }
                         }
@@ -671,14 +679,14 @@
         /// <summary>
         /// 鐣岄潰鍏抽棴
         /// </summary>
-        public override void CloseForm()
+        public override void CloseFormBefore()
         {
-            HdlDeviceAttributeLogic.Current.RemoveEvent("CurtainDeviceAttribute");
-            HdlDeviceAttributeLogic.Current.RemoveEvent("ReceiveLimitData");
+            HdlGatewayReceiveLogic.Current.RemoveEvent("CurtainDeviceAttribute");
+            HdlGatewayReceiveLogic.Current.RemoveEvent("ReceiveLimitData");
 
             UserView.HomePage.Instance.ScrollEnabled = true;
 
-            base.CloseForm();
+            base.CloseFormBefore();
         }
 
         #endregion

--
Gitblit v1.8.0