old mode 100755
new mode 100644
File was renamed from ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs |
| | |
| | | using System.Threading.Tasks;
|
| | | using Newtonsoft.Json.Linq;
|
| | |
|
| | | namespace Shared.Phone.UserCenter
|
| | | namespace Shared.Phone |
| | | {
|
| | | /// <summary>
|
| | | /// 干接点的逻辑
|
| | |
| | | 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);
|
| | |
| | | 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);
|
| | |
| | | //设置亮度调节失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetLightRegulationFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowTipMsg(msg);
|
| | | return false;
|
| | |
| | | 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);
|
| | |
| | | panel = null;
|
| | |
|
| | | //共通错误检测
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | | string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result); |
| | | if (error != null)
|
| | | {
|
| | | this.ShowErrorMsg(error);
|
| | |
| | | //接近传感配置失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.SetPannelProximityFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowTipMsg(msg);
|
| | | return false;
|
| | |
| | | panel = null;
|
| | |
|
| | | //共通错误检测
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | | string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result); |
| | | if (error != null)
|
| | | {
|
| | | this.ShowErrorMsg(error);
|
| | |
| | | //矫正温度失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.DataCorrectionFailed);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowTipMsg(msg);
|
| | | return false;
|
| | |
| | | //获取按键面板节能模式信息失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetPanelEnergyConservationInfoFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowErrorMsg(msg);
|
| | | return null;
|
| | |
| | | //节能模式配置失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetEnergyConservationFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowTipMsg(msg);
|
| | | return false;
|
| | |
| | | var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(device);
|
| | |
|
| | | //共通错误检测
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | | string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result); |
| | | if (error != null)
|
| | | {
|
| | | this.ShowErrorMsg(error);
|
| | |
| | | //获取设备配置信息失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetDeviceConfigureInfoFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowErrorMsg(msg);
|
| | | return null;
|
| | |
| | | /// <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)
|
| | | {
|
| | | //创建对象
|
| | |
| | | {
|
| | | var result = await panel.GetPanelPrivateFunctionsAsync(parameter);
|
| | | //共通错误检测
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | | string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result); |
| | | if (error != null)
|
| | | {
|
| | | this.ShowErrorMsg(error);
|
| | |
| | | //获取按键功能类信息失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetPanelFunctionInfoFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowErrorMsg(msg);
|
| | | return null;
|
| | |
| | | {
|
| | | 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);
|
| | |
| | | //设备属性变更失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uDeviceAttributeChangedFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | |
|
| | | this.ShowErrorMsg(msg);
|
| | | return false;
|
| | |
| | | {
|
| | | //获取震动反馈配置信息失败
|
| | | 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;
|
| | | }
|
| | |
| | | {
|
| | | //设置震动反馈配置信息失败
|
| | | 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;
|
| | | }
|
| | |
| | | /// <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;
|
| | |
| | | /// <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)
|
| | | {
|
| | | //创建对象
|
| | |
| | | /// </summary>
|
| | | private void SaveDryContactFunctionToLocaltion()
|
| | | {
|
| | | HdlFileLogic.Current.SaveFileContent(DirNameResourse.DryContactFunctionFile, dicDryContactFunction);
|
| | | HdlFileLogic.Current.SaveFileContent(HdlFileNameResourse.DryContactFunctionFile, dicDryContactFunction); |
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | 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;
|