From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCurtainLogic.cs |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCurtainLogic.cs b/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCurtainLogic.cs
index 657135a..643ef14 100644
--- a/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCurtainLogic.cs
+++ b/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCurtainLogic.cs
@@ -1,6 +1,5 @@
 锘縰sing Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
-using Shared.Phone.TemplateData;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -51,7 +50,7 @@
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
                 //娣诲姞缂撳瓨
-                TemplateDeviceDataLogic.Current.SetCurtainHandPullControl(device, bolStatu, null);
+                HdlTemplateDeviceDataLogic.Current.SetCurtainHandPullControl(device, bolStatu, null);
                 return true;
             }
             //鑾峰彇鍙戦�佺殑鍛戒护瀛楃
@@ -82,7 +81,7 @@
                 return false;
             }
             //娣诲姞缂撳瓨
-            TemplateDeviceDataLogic.Current.SetCurtainHandPullControl(device, bolStatu, result.JsonData[0]);
+            HdlTemplateDeviceDataLogic.Current.SetCurtainHandPullControl(device, bolStatu, result.JsonData[0]);
 
             return true;
         }
@@ -153,7 +152,7 @@
             //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateDeviceDataLogic.Current.SetCurtainDirection(device, isDirectionReversed, null);
+                return HdlTemplateDeviceDataLogic.Current.SetCurtainDirection(device, isDirectionReversed, null);
             }
             //鑾峰彇缂栬緫绐楀笜鏂瑰悜鐨勫懡浠ゅ瓧绗�
             var sendData = this.GetCurtainDirectionCommadText(device.DeviceAddr, device.DeviceEpoint, isDirectionReversed);
@@ -164,7 +163,7 @@
             }
 
             //娣诲姞缂撳瓨
-            TemplateDeviceDataLogic.Current.SetCurtainDirection(device, isDirectionReversed, result.JsonData[0]);
+            HdlTemplateDeviceDataLogic.Current.SetCurtainDirection(device, isDirectionReversed, result.JsonData[0]);
 
             var tempData = JsonConvert.DeserializeObject<CommonDevice.SetWritableValueResponData>(result.ReceiptData);
             return new CommonDevice.SetWritableValueResponAllData { setWritableValueResponData = tempData };
@@ -205,7 +204,7 @@
             //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateData.TemplateDeviceDataLogic.Current.SetCurtainLimitPoint(rollershade, upLimit, downLimit, curtainLength, null);
+                return HdlTemplateDeviceDataLogic.Current.SetCurtainLimitPoint(rollershade, upLimit, downLimit, curtainLength, null);
             }
             //鑾峰彇缂栬緫寮�鍚堝笜闄愪綅鐨勫懡浠ゅ瓧绗�
             var sendData = this.GetAutoOpenCurtainLimitPointCommandText(rollershade.DeviceAddr, rollershade.DeviceEpoint, upLimit, downLimit);
@@ -229,7 +228,7 @@
             }
 
             //娣诲姞缂撳瓨
-            TemplateDeviceDataLogic.Current.SetCurtainLimitPoint(rollershade, upLimit, downLimit, curtainLength, result.JsonData[0]);
+            HdlTemplateDeviceDataLogic.Current.SetCurtainLimitPoint(rollershade, upLimit, downLimit, curtainLength, result.JsonData[0]);
 
             return true;
         }
@@ -413,14 +412,17 @@
         /// </summary>
         /// <param name="rollershade">绐楀笜瀵硅薄</param>
         /// <returns></returns>
-        public async Task<bool> RestoreCurtain(Rollershade rollershade)
+        public async Task<bool> RestoreCurtain(Rollershade rollershade, ShowErrorMode showError = ShowErrorMode.YES)
         {
             var result = await rollershade.RestoreCurtainLimitAsync();
             //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
             string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
-                this.ShowTipMsg(error);
+                if (showError == ShowErrorMode.YES)
+                {
+                    this.ShowTipMsg(error);
+                }
                 return false;
             }
             if (result == null || result.setWritableValueResponData == null)
@@ -429,14 +431,20 @@
                 string msg = Language.StringByID(R.MyInternationalizationString.uRestoreCurtainFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
                 msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
-                this.ShowTipMsg(msg);
+                if (showError == ShowErrorMode.YES)
+                {
+                    this.ShowTipMsg(msg);
+                }
                 return false;
             }
             if (result.setWritableValueResponData.Status != 0)
             {
                 //閲嶇疆绐楀笜澶辫触
                 string msg = Language.StringByID(R.MyInternationalizationString.uRestoreCurtainFail);
-                this.ShowTipMsg(msg);
+                if (showError == ShowErrorMode.YES)
+                {
+                    this.ShowTipMsg(msg);
+                }
                 return false;
             }
             return true;

--
Gitblit v1.8.0