From 26d1cdf2f5246c1ad7890e6740444c4a6a80e6fb Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期二, 11 八月 2020 13:21:10 +0800 Subject: [PATCH] 合并了新代码 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs index 603dce4..095850c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs @@ -604,6 +604,48 @@ } #endregion + #region 鈻� 鏍℃娓╁害___________________________ + /// <summary> + /// 鏍℃娓╁害 + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <param name="correctValue">鏍℃娓╁害鍊�</param> + /// <param name="direction">琛ュ伩鏂瑰悜0涓嶈ˉ鍋� 1锛氭鍚戯紱2锛氬弽鍚�</param> + /// <param name="type">0 娓╁害 锛�1 婀垮害</param> + /// <returns></returns> + public async Task<bool> CorrectTemperature(CommonDevice device, double correctValue, int direction = 0, int type = 0) + { + //鍊熺敤瀹冪殑鍑絫 + var panel = new Panel(); + panel.DeviceAddr = device.DeviceAddr; + panel.DeviceEpoint = 200; + panel.CurrentGateWayId = device.CurrentGateWayId; + + var result = await panel.CorrectTemperature(correctValue, direction, type); + panel = null; + + //鍏遍�氶敊璇娴� + string error = HdlCheckLogic.Current.CheckCommonErrorCode(result); + if (error != null) + { + this.ShowErrorMsg(error); + return false; + } + + if (result == null || result.responseData == null) + { + //鐭娓╁害澶辫触 + string msg = Language.StringByID(R.MyInternationalizationString.DataCorrectionFailed); + //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg + msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result); + + this.ShowTipMsg(msg); + return false; + } + return true; + } + #endregion + #region 鈻� 鑺傝兘妯″紡___________________________ /// <summary> /// 鑾峰彇璁惧鑺傝兘妯″紡鐨勯厤缃姸鎬�(ui鍙妭鑳芥ā寮�) -- Gitblit v1.8.0