From bd46c57c77c276014db3192a4e2cc96e23c93202 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 21 二月 2020 13:08:47 +0800
Subject: [PATCH] 先上传个版本吧
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 54 +++++++++++++++++++-----------------------------------
1 files changed, 19 insertions(+), 35 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index a4c9e34..c691a17 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -35,6 +35,11 @@
public void ShowForm(string deviceMac)
{
this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
+ if (listNewDevice.Count == 0)
+ {
+ //瀵瑰簲鍗曠函鍙湁200鍥炶矾鐨勮澶�
+ listNewDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
+ }
//璁剧疆鏍囬淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
@@ -128,6 +133,10 @@
{
foreach (var device in this.listNewDevice)
{
+ if (device is OTADevice)
+ {
+ continue;
+ }
var room = Common.Room.CurrentRoom.GetRoomByDevice(device);
string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
if (room == null)
@@ -213,9 +222,9 @@
};
}
-#endregion
+ #endregion
-#region 鈻� 淇敼鍚嶅瓧___________________________
+ #region 鈻� 淇敼鍚嶅瓧___________________________
/// <summary>
/// 璁惧閲嶅懡鍚嶇劧鍚庢墦寮�鏂扮殑鐢婚潰
@@ -235,7 +244,7 @@
this.saveDefultName = string.Empty;
//濡傛灉瀹冪殑鍥炶矾鍙湁涓�涓殑璇濓紝鍒欏湪璁惧涓婃姤鐨勬椂鍊欙紝淇敼MAC鍚嶅瓧涔嬪悗锛岃繛鍚岀鐐瑰悕瀛椾篃涓�璧蜂慨鏀�
- if (this.listNewDevice.Count == 1)
+ if (this.listNewDevice.Count == 1 && (this.listNewDevice[0] is OTADevice) == false)
{
//淇敼绔偣鍚嶅瓧
result = await Common.LocalDevice.Current.ReName(this.listNewDevice[0], deviceName, mode);
@@ -251,47 +260,22 @@
/// </summary>
private async void SetAllEpointName()
{
- var tempValue = Common.LocalDevice.Current.GetDeviceObjectText(this.listNewDevice);
- var arry = tempValue.Split(new string[] { "(" }, StringSplitOptions.RemoveEmptyEntries);
- var objName = arry[0].Trim();
-
- //鑾峰彇璁惧绫诲瀷
- var deviceInfoType = Common.LocalDevice.Current.GetMyDeviceEnumInfo(this.listNewDevice);
foreach (var device in this.listNewDevice)
{
- if (Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty)
+ if ((device is OTADevice) || Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty)
{
+ //鏈夊悕瀛椾笉澶勭悊
continue;
}
- var epointName = objName;
- if (this.listNewDevice.Count > 1)
- {
- if (deviceInfoType.BeloneType == Common.DeviceBeloneType.A鎸夐敭闈㈡澘 && device.Type == DeviceType.TemperatureSensor)
- {
- //闈㈡澘鐨勬渶鍚庝竴涓洖璺槸娓╁害浼犳劅鍣�
- epointName += Language.StringByID(R.MyInternationalizationString.uDeviceBelongId11);
- }
- else if (deviceInfoType.ConcreteType == Common.DeviceConcreteType.Sensor_Pir)
- {
- //pir浼犳劅鍣�,瀹冨張鎼炵壒娈婁笢瑗�,浼犳劅鍣ㄨ嚜韬敤鑷繁鐨勫悕瀛�,缁х數鍣ㄥ洖璺殑璇濃�︹��
- if (device.Type == DeviceType.OnOffOutput)
- {
- epointName += Language.StringByID(R.MyInternationalizationString.uDeviceBelongId2300);
- }
- }
- else
- {
- //XXXXX(N鍥炶矾)
- epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
- }
- }
+ //鑾峰彇绔偣鍚嶅瓧
+ var epointName = Common.LocalDevice.Current.GetDeviceEpointName(device);
await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
}
}
-#endregion
+ #endregion
-#region 鈻� 鐢婚潰鍏抽棴___________________________
+ #region 鈻� 鐢婚潰鍏抽棴___________________________
/// <summary>
/// 鐢婚潰鍏抽棴
@@ -308,6 +292,6 @@
base.CloseFormBefore();
}
-#endregion
+ #endregion
}
}
--
Gitblit v1.8.0