| | |
| | | btnOk.TextID = R.MyInternationalizationString.uSave;
|
| | | bodyFrameLayout.AddChidren(btnOk);
|
| | | btnOk.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (this.oldReportValue == this.reportValue)
|
| | | {
|
| | | {
|
| | | if (this.oldReportValue == this.reportValue)
|
| | | {
|
| | | //数据相同,不需要修改
|
| | | this.CloseForm();
|
| | | return;
|
| | | }
|
| | | //将二进制转换为十进制
|
| | | var data = Convert.ToInt32(this.fixValue + this.reportValue, 2);
|
| | | var result = HdlDeviceAirConditionerLogic.Current.SetAcModeSupport(deviceAc, data);
|
| | | if (result == true)
|
| | | {
|
| | | //更改缓存
|
| | | for (int i = 0; i < this.reportValue.Length; i++)
|
| | | {
|
| | | deviceAc.listSupportMode[i] = Convert.ToInt32(reportValue[i].ToString());
|
| | | }
|
| | | deviceAc.ReSave();
|
| | | this.CloseForm();
|
| | | }
|
| | | };
|
| | | return;
|
| | | }
|
| | | //将二进制转换为十进制
|
| | | var data = Convert.ToInt32(this.fixValue + this.reportValue, 2);
|
| | | var result = HdlDeviceAirConditionerLogic.Current.SetAcModeSupport(deviceAc, data);
|
| | | if (result == true)
|
| | | {
|
| | | //更改缓存
|
| | | for (int i = 0; i < this.reportValue.Length; i++)
|
| | | {
|
| | | deviceAc.listSupportMode[i] = Convert.ToInt32(reportValue[i].ToString());
|
| | | }
|
| | | deviceAc.ReSave();
|
| | | this.CloseForm();
|
| | | }
|
| | | };
|
| | | //如果是展示模板
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | btnOk.CanClick = false;
|
| | | }
|
| | | });
|
| | | });
|
| | | }
|
| | |
| | | this.reportValue = reportValue.Substring(0, div) + "0" + reportValue.Substring(div + 1);
|
| | | }
|
| | | };
|
| | | //如果是展示模板
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | rowFrame.CanClick = false;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | private void ReadAirConditionerModeSupport()
|
| | | {
|
| | | //如果是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | if (Common.Config.Instance.Home.IsVirtually == true || Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | var data = ModelData.DeviceModelDataLogic.Current.GetAcModeSupport(deviceAc);
|
| | | var data = TemplateData.TemplateDeviceDataLogic.Current.GetAcModeSupport(deviceAc);
|
| | | //转换为二进制
|
| | | var value = Convert.ToString(data, 2).PadLeft(16, '0');
|
| | | //这五个设置是放在后面的
|