From 23fb45dd846ed8b62304c408c6bbe64265d4ac8b Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 20 十二月 2019 18:57:16 +0800 Subject: [PATCH] 代码合并 --- ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 98 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 95 insertions(+), 3 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs index a6f7ada..abe2b33 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Shared.Common; -using Shared.Phone.UserView; using ZigBee.Device; namespace Shared.Phone.UserCenter.Device @@ -30,6 +29,10 @@ /// 璁惧鍏蜂綋绫诲瀷鐨勪俊鎭� /// </summary> private DeviceEnumInfo deviceEnumInfo = null; + /// <summary> + /// 涓ぎ绌鸿皟鐨勭増鏈帶浠� + /// </summary> + private NormalViewControl btnAirConditionerVersion = null; #endregion @@ -222,6 +225,9 @@ } //娣诲姞銆愰�氱敤淇℃伅銆戣 this.AddGeneralInformationRow(); + + //娣诲姞銆愮┖璋冩ā鍧楃増鏈�(绌鸿皟涓撶敤)銆戣 + this.AddAirConditionerModelVersionRow(); if (isHdlDevice == true) { @@ -728,6 +734,34 @@ #endregion + #region 鈻� 绌鸿皟妯″潡鐗堟湰(绌鸿皟涓撶敤)_____________ + + /// <summary> + /// 娣诲姞銆愮┖璋冩ā鍧楃増鏈�戣(娌充笢鐨勪腑澶┖璋�) + /// </summary> + private void AddAirConditionerModelVersionRow() + { + if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway) + { + //涓嶆槸涓ぎ绌鸿皟 + return; + } + string caption = Language.StringByID(R.MyInternationalizationString.uAirConditionerModelVersion); + var rowVersion = new FrameRowControl(listview.rowSpace / 2); + rowVersion.UseClickStatu = false; + listview.AddChidren(rowVersion); + rowVersion.AddLeftCaption(caption, 600); + //鐗堟湰 + this.btnAirConditionerVersion = rowVersion.AddMostRightView("", 800); + //搴曠嚎 + rowVersion.AddBottomLine(); + + //鑾峰彇涓ぎ绌鸿皟妯″潡鐨勭増鏈� + this.ReadAirConditionerVersion(); + } + + #endregion + #region 鈻� 鍥轰欢鍗囩骇___________________________ /// <summary> @@ -762,9 +796,19 @@ rowUpDate.ButtonClickEvent += (sender, e) => { + if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway) + { + //杩欎釜鏄竴鑸澶囩殑鍗囩骇 + var form = new DeviceFirmwareUpdateForm(); + form.AddForm(listNewDevice[0].DeviceAddr); + } + else + { + //涓ぎ绌鸿皟鐨勫崌绾х殑璇濓紝鏄壒娈婄殑 + var form = new DeviceAirConditioner.ACZbGatewayUpdateMenuForm(); + form.AddForm((AC)listNewDevice[0], btnNewVersion.Visible); + } btnNewVersion.Visible = false; - var form = new DeviceFirmwareInfoForm(); - form.AddForm(listNewDevice[0].DeviceAddr); }; //璁剧疆璁惧鐨勭増鏈俊鎭� @@ -984,8 +1028,56 @@ #endregion + #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________ + + /// <summary> + /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠� + /// </summary> + public override int FormActionAgainEvent() + { + //閲嶆柊鑾峰彇涓ぎ绌鸿皟妯″潡鐨勭増鏈� + this.ReadAirConditionerVersion(); + + return 0; + } + + #endregion + #region 鈻� 涓�鑸柟娉昣__________________________ + /// <summary> + /// 鑾峰彇涓ぎ绌鸿皟妯″潡鐨勭増鏈� + /// </summary> + private void ReadAirConditionerVersion() + { + if (this.btnAirConditionerVersion == null) + { + return; + } + //鑾峰彇涓�.... + this.btnAirConditionerVersion.TextID = R.MyInternationalizationString.uGetting; + HdlThreadLogic.Current.RunThread(async () => + { + //璇诲彇绌鸿皟妯″潡鐗堟湰 + var result = await ((AC)listNewDevice[0]).ReadACFirewareVersionAsync(); + if (result == null || result.readACFirewareVersionResponData == null || result.readACFirewareVersionResponData.Status != 0) + { + HdlThreadLogic.Current.RunMain(() => + { + //鑾峰彇澶辫触 + btnAirConditionerVersion.TextID = R.MyInternationalizationString.uGettingFail; + }); + } + else + { + HdlThreadLogic.Current.RunMain(() => + { + btnAirConditionerVersion.Text = result.readACFirewareVersionResponData.FirewareVersion.Replace("-", string.Empty); + }); + } + }); + } + #endregion } } -- Gitblit v1.8.0