From 0a0d7ec5080cd1f1802d9fcc96b08102b9b551f1 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 29 五月 2020 11:15:19 +0800
Subject: [PATCH] 2020-05-29-2
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 32 ++++++++++++++++++++++++++++----
1 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index cf2a242..5080f98 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -45,6 +45,9 @@
listNewDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
}
+ //娣诲姞鏂拌澶囩殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂�
+ UserView.UserPage.Instance.RefreshForm = true;
+
//璁剧疆鏍囬淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
@@ -55,6 +58,8 @@
this.SetAllEpointName();
// 璁剧疆缃戝叧鎵�鍦ㄧ殑鏃跺尯鐨勬椂闂寸粰闂ㄩ攣鏃堕棿
this.SetDoorTime();
+ //鏂板叆缃戠殑璁惧,娓呯┖鎺夊畠鐨勬埧闂�
+ this.ClearDeviceFromRoom();
}
/// <summary>
@@ -184,6 +189,8 @@
//鏀瑰悕瀛�
btnNote.txtInput.FinishInputEvent();
+ this.CloseForm();
+
var form = new DeviceMacInfoEditorForm();
form.AddForm(this.listNewDevice[0].DeviceAddr);
};
@@ -255,11 +262,11 @@
/// </summary>
/// <param name="i_deviceName">deviceName.</param>
/// <param name="mode">鏄惁鏄剧ず閿欒</param>
- private async void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES)
+ private void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES)
{
//淇敼MAC鍚�
string deviceName = i_deviceName.Trim();
- var result = await Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName, mode);
+ var result = Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName, mode);
if (result == false)
{
return;
@@ -271,7 +278,7 @@
/// <summary>
/// 璁剧疆鍏ㄩ儴鍥炶矾鐨勯粯璁ゅ悕瀛�
/// </summary>
- private async void SetAllEpointName()
+ private void SetAllEpointName()
{
foreach (var device in this.listNewDevice)
{
@@ -282,7 +289,7 @@
}
//鑾峰彇绔偣鍚嶅瓧
var epointName = Common.LocalDevice.Current.GetDeviceEpointName(device);
- await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
+ Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
}
}
@@ -306,6 +313,23 @@
#endregion
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鏂板叆缃戠殑璁惧,娓呯┖鎺夊畠鐨勬埧闂�
+ /// </summary>
+ private void ClearDeviceFromRoom()
+ {
+ foreach (var device in this.listNewDevice)
+ {
+ HdlRoomLogic.Current.DeleteDevice(device);
+ HdlRoomLogic.Current.DeleteLoveDevice(device);
+ }
+ Common.LocalDevice.Current.DeleteRealDeviceFromRoom(this.listNewDevice[0]);
+ }
+
+ #endregion
+
#region 鈻� 鐢婚潰鍏抽棴___________________________
/// <summary>
--
Gitblit v1.8.0