From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 14 十二月 2020 09:59:01 +0800
Subject: [PATCH] 请合并代码,完成晾衣架最终功能。
---
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs | 74 ++++++++++++++++++++++++------------
1 files changed, 49 insertions(+), 25 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
index 8c174d1..c06b97a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
@@ -97,31 +97,37 @@
string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
string nameValue = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
var btnNote = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
+ btnNote.txtInput.MaxByte = 48;//闄愬埗鍙兘杈撳叆48涓瓧鑺�
listview.AddChidren(btnNote);
btnNote.InitControl();
//鍒掔嚎
btnNote.AddBottomLine();
- btnNote.txtInput.FinishInputEvent += async () =>
- {
- string oldName = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
- if (btnNote.Text.Trim() == string.Empty)
- {
- //灏嗗悕瀛楄繕鍘�
- btnNote.Text = oldName;
- }
- if (oldName != btnNote.Text)
- {
- //璁惧鍚嶇О淇敼
- var result = await Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
- if (result == false)
- {
- return;
- }
- //璁惧澶囨敞淇敼鎴愬姛!
- string msg = Language.StringByID(R.MyInternationalizationString.uDeviceReNoteSuccess);
- this.ShowMassage(ShowMsgType.Tip, msg);
- }
- };
+ btnNote.txtInput.FinishInputEvent += () =>
+ {
+ string oldName = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
+ if (btnNote.Text.Trim() == string.Empty)
+ {
+ //灏嗗悕瀛楄繕鍘�
+ btnNote.Text = oldName;
+ }
+ if (oldName != btnNote.Text)
+ {
+ //鏌ョ湅妯℃澘鏃�,涓嶅厑璁哥紪杈�
+ if (Common.Config.Instance.Home.IsShowTemplate == true)
+ {
+ return;
+ }
+ //璁惧鍚嶇О淇敼
+ var result = Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
+ if (result == false)
+ {
+ return;
+ }
+ //璁惧澶囨敞淇敼鎴愬姛!
+ string msg = Language.StringByID(R.MyInternationalizationString.uDeviceReNoteSuccess);
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ }
+ };
//璁惧绫诲瀷
caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
@@ -174,9 +180,9 @@
string statu = btnSwingSwitch.IsSelected == true ? "0" : "1";
//灏嗕簩杩涘埗杞崲涓哄崄杩涘埗
int sendData = Convert.ToInt32(this.fixValue + statu, 2);
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
- var result = await HdlDeviceAirConditionerLogic.Current.SetUseAcSwingFunctionStatu(deviceAc, sendData);
+ var result = HdlDeviceAirConditionerLogic.Current.SetUseAcSwingFunctionStatu(deviceAc, sendData);
if (result == true)
{
HdlThreadLogic.Current.RunMain(() =>
@@ -201,13 +207,13 @@
var btnFinish = new BottomClickButton();
btnFinish.TextID = R.MyInternationalizationString.uSave;
bodyFrameLayout.AddChidren(btnFinish);
- btnFinish.ButtonClickEvent += async (sender, e) =>
+ btnFinish.ButtonClickEvent += (sender, e) =>
{
string oldName = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
if (oldName != btnNote.Text)
{
//璁惧鍚嶇О淇敼
- var result = await Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
+ var result = Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
if (result == false)
{
return;
@@ -215,6 +221,12 @@
}
this.CloseForm();
};
+ //鏌ョ湅妯℃澘鏃�,涓嶅厑璁哥紪杈�
+ if (Common.Config.Instance.Home.IsShowTemplate == true)
+ {
+ btnFinish.CanClick = false;
+ btnSwingSwitch.CanClick = false;
+ }
}
#endregion
@@ -267,6 +279,18 @@
/// </summary>
private bool ReadAirConditionerSwingModeSupport()
{
+ //濡傛灉鏄櫄鎷熶綇瀹�
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ var data = TemplateData.TemplateDeviceDataLogic.Current.GetAcSwingModeSupport(deviceAc);
+ //杞崲涓轰簩杩涘埗
+ var value = Convert.ToString(data, 2).PadLeft(16, '0');
+ //杩欎釜璁剧疆鏄斁鍦ㄥ悗闈㈢殑
+ this.fixValue = value.Substring(0, value.Length - 1);
+ this.swingMode = Convert.ToInt32(value.Substring(this.fixValue.Length));
+ return true;
+ }
+
string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(deviceAc);
HdlGatewayReceiveLogic.Current.AddAttributeEvent("ReadAirConditionerModeSupport", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
{
--
Gitblit v1.8.0