From 0d9f64668fd7350d6a21fd157e32009a96d98134 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 16 十二月 2020 13:09:08 +0800
Subject: [PATCH] 新云端代码Ver1.2

---
 ZigbeeApp/Shared/Phone/Common/Logic/HdlDevicePanelLogic.cs |   72 ++++++++++++++++++------------------
 1 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs b/ZigbeeApp/Shared/Phone/Common/Logic/HdlDevicePanelLogic.cs
similarity index 93%
rename from ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
rename to ZigbeeApp/Shared/Phone/Common/Logic/HdlDevicePanelLogic.cs
index c8bc35a..e8b22fb 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
+++ b/ZigbeeApp/Shared/Phone/Common/Logic/HdlDevicePanelLogic.cs
@@ -5,7 +5,7 @@
 using System.Threading.Tasks;
 using Newtonsoft.Json.Linq;
 
-namespace Shared.Phone.UserCenter
+namespace Shared.Phone
 {
     /// <summary>
     /// 骞叉帴鐐圭殑閫昏緫
@@ -65,7 +65,7 @@
             Panel.KeyNum keyNum = (Panel.KeyNum)panel.DeviceEpoint;
             var result = this.GetPanelColorInfoAsync(panel, keyNum);
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -93,7 +93,7 @@
             Panel.KeyNum keyNum = (Panel.KeyNum)panel.DeviceEpoint;
             var result = this.GetPanelColorInfoAsync(panel, keyNum);
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -119,7 +119,7 @@
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
                 //杩欓噷鐗规畩,杩欓噷鏄寜鍥炶矾鍒嗙殑
-                return TemplateData.TemplateDeviceDataLogic.Current.GetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyNum);
+                return HdlTemplateDeviceDataLogic.Current.GetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyNum);
             }
             //鍙戦�佹暟鎹� keyNum杞负16杩涘埗 鑼冨洿锛�01~10
             var passData = "0504040101" + Convert.ToString((int)keyNum, 16).ToUpper().PadLeft(2, '0');
@@ -217,7 +217,7 @@
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
                 //杩欎釜涔熸槸鐗规畩,鎸夊洖璺潵鍒�
-                return TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyColorData, keyNumStatus, null);
+                return HdlTemplateDeviceDataLogic.Current.SetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyColorData, keyNumStatus, null);
             }
             //鑾峰彇閰嶇疆鎸夐敭鎸囩ず鐏鑹茬殑鍛戒护瀛楃
             var sendData = this.GetPanelColorCommandText(device.DeviceAddr, keyColorData, keyNumStatus);
@@ -232,7 +232,7 @@
             tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
 
             //娣诲姞缂撳瓨
-            TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyColorData, keyNumStatus, result.JsonData[0]);
+            HdlTemplateDeviceDataLogic.Current.SetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyColorData, keyNumStatus, result.JsonData[0]);
 
             return new CommonDevice.ResponseAllData { responseData = tempD };
         }
@@ -392,7 +392,7 @@
             //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceLightSettion(device.DeviceAddr, 200);
+                return HdlTemplateDeviceDataLogic.Current.GetDeviceLightSettion(device.DeviceAddr, 200);
             }
             //鑾峰彇鍙戦�佺殑鍛戒护瀛楃
             var passData = "050604010101";
@@ -428,7 +428,7 @@
             //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device.DeviceAddr, 200, directionsLevel, backlightLevel, null);
+                return HdlTemplateDeviceDataLogic.Current.SetDeviceLightSettion(device.DeviceAddr, 200, directionsLevel, backlightLevel, null);
             }
             //鑾峰彇淇敼闈㈡澘鐨勪寒搴﹁皟鑺傜殑鍛戒护瀛楃
             var sendData = this.GetPanelLevelCommadText(device.DeviceAddr, directionsLevel, backlightLevel);
@@ -443,7 +443,7 @@
                 //璁剧疆浜害璋冭妭澶辫触
                 string msg = Language.StringByID(R.MyInternationalizationString.uSetLightRegulationFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowTipMsg(msg);
                 return false;
@@ -462,7 +462,7 @@
             }
 
             //淇敼缂撳瓨
-            TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device.DeviceAddr, 200, directionsLevel, backlightLevel, result.JsonData[0]);
+            HdlTemplateDeviceDataLogic.Current.SetDeviceLightSettion(device.DeviceAddr, 200, directionsLevel, backlightLevel, result.JsonData[0]);
 
             return true;
         }
@@ -550,7 +550,7 @@
             var result = await panel.GetProximitySensorAsync();
             panel = null;
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -585,7 +585,7 @@
             panel = null;
 
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -597,7 +597,7 @@
                 //鎺ヨ繎浼犳劅閰嶇疆澶辫触
                 string msg = Language.StringByID(R.MyInternationalizationString.SetPannelProximityFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowTipMsg(msg);
                 return false;
@@ -627,7 +627,7 @@
             panel = null;
 
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -639,7 +639,7 @@
                 //鐭娓╁害澶辫触
                 string msg = Language.StringByID(R.MyInternationalizationString.DataCorrectionFailed);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowTipMsg(msg);
                 return false;
@@ -659,7 +659,7 @@
             //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceEnergyConservationMode(device.DeviceAddr, 200);
+                return HdlTemplateDeviceDataLogic.Current.GetDeviceEnergyConservationMode(device.DeviceAddr, 200);
             }
             //鍙戦�佸懡浠�
             string passData = "050804010101";
@@ -678,7 +678,7 @@
                 //鑾峰彇鎸夐敭闈㈡澘鑺傝兘妯″紡淇℃伅澶辫触
                 string msg = Language.StringByID(R.MyInternationalizationString.uGetPanelEnergyConservationInfoFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowErrorMsg(msg);
                 return null;
@@ -725,7 +725,7 @@
             //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device.DeviceAddr, 200, modeEnable, modeTime, level, null);
+                return HdlTemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device.DeviceAddr, 200, modeEnable, modeTime, level, null);
             }
             //鑾峰彇璁剧疆璁惧鐨勮妭鑳芥ā寮忕殑鍛戒护瀛楃
             var sendData = this.GetDeviceEnergyConservationModeCommandText(device.DeviceAddr, modeEnable, modeTime, level);
@@ -740,7 +740,7 @@
                 //鑺傝兘妯″紡閰嶇疆澶辫触
                 string msg = Language.StringByID(R.MyInternationalizationString.uSetEnergyConservationFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowTipMsg(msg);
                 return false;
@@ -755,7 +755,7 @@
             }
 
             //淇敼缂撳瓨
-            TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device.DeviceAddr, 200, modeEnable, modeTime, level, result.JsonData[0]);
+            HdlTemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device.DeviceAddr, 200, modeEnable, modeTime, level, result.JsonData[0]);
 
             return true;
         }
@@ -863,7 +863,7 @@
             var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(device);
 
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -875,7 +875,7 @@
                 //鑾峰彇璁惧閰嶇疆淇℃伅澶辫触
                 string msg = Language.StringByID(R.MyInternationalizationString.uGetDeviceConfigureInfoFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowErrorMsg(msg);
                 return null;
@@ -918,7 +918,7 @@
         /// <returns></returns>
         public async Task<List<int>> GetDryContactFunction(Panel panel, int level1 = -1, int level2 = -1, bool reLevel3 = false)
         {
-            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(panel);
+            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(panel);
             if (dicDryContactFunction.ContainsKey(mainkeys) == false)
             {
                 //鍒涘缓瀵硅薄
@@ -995,7 +995,7 @@
         {
             var result = await panel.GetPanelPrivateFunctionsAsync(parameter);
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -1007,7 +1007,7 @@
                 //鑾峰彇鎸夐敭鍔熻兘绫讳俊鎭け璐�
                 string msg = Language.StringByID(R.MyInternationalizationString.uGetPanelFunctionInfoFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowErrorMsg(msg);
                 return null;
@@ -1031,7 +1031,7 @@
         {
             var result = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(panel, (Panel.KeyMode)i_value);
             //鍏遍�氶敊璇娴�
-            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -1043,7 +1043,7 @@
                 //璁惧灞炴�у彉鏇村け璐�
                 string msg = Language.StringByID(R.MyInternationalizationString.uDeviceAttributeChangedFail);
                 //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
 
                 this.ShowErrorMsg(msg);
                 return false;
@@ -1096,7 +1096,7 @@
             //濡傛灉鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateData.TemplateDeviceDataLogic.Current.GetPanelVibrationInfo(device.DeviceAddr, 200);
+                return HdlTemplateDeviceDataLogic.Current.GetPanelVibrationInfo(device.DeviceAddr, 200);
             }
             //鍙戦�佹暟鎹�
             var jObject = new Newtonsoft.Json.Linq.JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
@@ -1108,7 +1108,7 @@
             {
                 //鑾峰彇闇囧姩鍙嶉閰嶇疆淇℃伅澶辫触
                 string errorMsg = Language.StringByID(R.MyInternationalizationString.uGetVibrationFeedbackSettionFail);
-                errorMsg = UserCenterLogic.CombineGatewayTimeOutMsg(errorMsg, null, "鍥炲瓒呮椂", false);
+                errorMsg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(errorMsg, null, "鍥炲瓒呮椂", false);
                 this.ShowTipMsg(errorMsg);
                 return null;
             }
@@ -1131,7 +1131,7 @@
             //濡傛灉鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device.DeviceAddr, 200, datainfo, null);
+                return HdlTemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device.DeviceAddr, 200, datainfo, null);
             }
             //鑾峰彇缂栬緫闈㈡澘闇囧姩鍔熻兘鐨勫懡浠ゅ瓧绗�
             var sendData = this.GetPanelVibrationCommandText(device.DeviceAddr, datainfo);
@@ -1140,12 +1140,12 @@
             {
                 //璁剧疆闇囧姩鍙嶉閰嶇疆淇℃伅澶辫触
                 string errorMsg = Language.StringByID(R.MyInternationalizationString.uSetVibrationFeedbackSettionFail);
-                errorMsg = UserCenterLogic.CombineGatewayTimeOutMsg(errorMsg, null, "鍥炲瓒呮椂", false);
+                errorMsg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(errorMsg, null, "鍥炲瓒呮椂", false);
                 this.ShowTipMsg(errorMsg);
                 return false;
             }
             //娣诲姞缂撳瓨
-            TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device.DeviceAddr, 200, datainfo, result.JsonData[0]);
+            HdlTemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device.DeviceAddr, 200, datainfo, result.JsonData[0]);
 
             return true;
         }
@@ -1204,7 +1204,7 @@
         /// <returns></returns>
         private List<int> GetDryContactFunctionFromLocation(Panel panel, int level1 = -1, int level2 = -1)
         {
-            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(panel);
+            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(panel);
             if (dicDryContactFunction.ContainsKey(mainkeys) == false)
             {
                 return null;
@@ -1254,7 +1254,7 @@
         /// <param name="level2"></param>
         private void SetDryContactFunctionToMemory(Panel panel, List<int> listLevel, int level1, int level2)
         {
-            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(panel);
+            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(panel);
             if (dicDryContactFunction.ContainsKey(mainkeys) == false)
             {
                 //鍒涘缓瀵硅薄
@@ -1300,7 +1300,7 @@
         /// </summary>
         private void SaveDryContactFunctionToLocaltion()
         {
-            HdlFileLogic.Current.SaveFileContent(DirNameResourse.DryContactFunctionFile, dicDryContactFunction);
+            HdlFileLogic.Current.SaveFileContent(HdlFileNameResourse.DryContactFunctionFile, dicDryContactFunction);
         }
 
         /// <summary>
@@ -1309,7 +1309,7 @@
         private void LoadDryContactFunctionFromLocaltion()
         {
             this.dicDryContactFunction = new Dictionary<string, DryContactFunctionInfo>();
-            byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(DirNameResourse.DryContactFunctionFile);
+            byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(HdlFileNameResourse.DryContactFunctionFile);
             if (filebyte == null)
             {
                 return;

--
Gitblit v1.8.0