From ecba45c93391066bc30c7bd602c3a7683fbb99a7 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期五, 31 七月 2020 10:56:12 +0800 Subject: [PATCH] 临时备份 --- ZigbeeApp/Shared/Common/Device.cs | 93 ++++++++++++++++------------------------------ 1 files changed, 33 insertions(+), 60 deletions(-) diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs index 8b92a87..b94b3e0 100755 --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -267,8 +267,22 @@ listDriveDevice.Add(device); } } - //璁剧疆铏氭嫙璁惧鐨勯粯璁ゅ悕瀛� - this.SetDriveDeviceDefultName(listDriveDevice); + if (listDriveDevice.Count > 0) + { + //濡傛灉铏氭嫙璁惧杩樻病鏈夊悕瀛楃殑璇� + HdlThreadLogic.Current.RunThread(() => + { + //濡傛灉涓嶈繖鏍锋斁鍦ㄤ竴涓嚎绋嬮噷,鏈夊彲鑳藉Dictionary浜х敓褰卞搷 + foreach (var myDevice in listDriveDevice) + { + //鏍规嵁璁惧绫诲瀷鑾峰彇鍚嶇О + var dName = this.GetDeviceObjectText(new List<CommonDevice>() { myDevice }, false); + //鍦ㄧ鐐瑰悕瀛楃殑鍚庨潰闄勫姞銆愬洖璺�戝瓧鏍� + dName += "(" + myDevice.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")"; + this.ReName(myDevice, dName, ShowErrorMode.NO); + } + }); + } //鍙湁瀹屽叏鑾峰彇鐨勬椂鍊�,鎵嶄細鍘诲鐞嗗垹闄ょ殑闂 if (statu != 1) @@ -518,42 +532,6 @@ } } return true; - } - - /// <summary> - /// 璁剧疆铏氭嫙璁惧鐨勯粯璁ゅ悕瀛� - /// </summary> - /// <param name="listDriveDevice">铏氭嫙璁惧鍒楄〃</param> - private void SetDriveDeviceDefultName(List<CommonDevice> listDriveDevice) - { - if (listDriveDevice.Count == 0) - { - return; - } - //濡傛灉铏氭嫙璁惧杩樻病鏈夊悕瀛楃殑璇� - HdlThreadLogic.Current.RunThread(() => - { - //濡傛灉涓嶈繖鏍锋斁鍦ㄤ竴涓嚎绋嬮噷,鏈夊彲鑳藉Dictionary浜х敓褰卞搷 - foreach (var myDevice in listDriveDevice) - { - string dName = string.Empty; - if (this.IsMiniLight(myDevice) == true) - { - //Mini澶滅伅 - dName = Language.StringByID(R.MyInternationalizationString.uMiniNightLight); - } - else - { - //鏍规嵁璁惧绫诲瀷鑾峰彇鍚嶇О - dName = this.GetDeviceObjectText(new List<CommonDevice>() { myDevice }, false); - //鍦ㄧ鐐瑰悕瀛楃殑鍚庨潰闄勫姞銆愬洖璺�戝瓧鏍� - dName += "(" + myDevice.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")"; - } - this.ReName(myDevice, dName, ShowErrorMode.NO); - - System.Threading.Thread.Sleep(100); - } - }); } ///<summary > @@ -869,9 +847,9 @@ //闂ㄩ攣娌℃湁瀹氫綅鍔熻兘 return false; } - var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); if (device.Type == DeviceType.IASZone) { + var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_Pir) { //浼犳劅鍣ㄩ櫎浜哖ir閮芥病鏈夊畾浣嶅姛鑳� @@ -882,11 +860,6 @@ //鐞冨瀷绉诲姩浼犳劅鍣ㄨ櫧鐒舵槸鐢垫睜璁惧,浣嗘槸瀹冩湁瀹氫綅鍔熻兘 return true; } - return false; - } - //娓╂箍搴︿紶鎰熷櫒娌℃湁瀹氫綅鍔熻兘 - if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_TemperatrueHumidity) - { return false; } @@ -1881,8 +1854,7 @@ info.ObjectTypeName = this.dicDeviceModelIdEnum["A418"].A绫诲瀷鍚嶅瓧;//璋冨厜妯″潡 } else if (info.BeloneType == DeviceBeloneType.A浼犳劅鍣� - || device.Type == DeviceType.TemperatureSensor - || device.Type == DeviceType.FreshAirHumiditySensor) + || device.Type == DeviceType.TemperatureSensor) { //浼犳劅鍣ㄥ悎骞� info.ConcreteType = DeviceConcreteType.Sensor; @@ -2079,14 +2051,14 @@ //璁剧疆浼犳劅鍣ㄥ叿浣撶殑绫诲瀷 info.BeloneType = DeviceBeloneType.A娓╂箍搴︿紶鎰熷櫒; info.ConcreteText = this.dicDeviceModelIdEnum["A411"].A瀹樻柟鍚嶅瓧; - info.ConcreteType = DeviceConcreteType.Sensor_TemperatrueHumidity; + info.ConcreteType = DeviceConcreteType.Sensor_TemperatureHumidity; } else if (temperatrue == true && humidity == false) { //璁剧疆浼犳劅鍣ㄥ叿浣撶殑绫诲瀷 info.BeloneType = DeviceBeloneType.A娓╁害浼犳劅鍣�; info.ConcreteText = this.dicDeviceModelIdEnum["A412"].A瀹樻柟鍚嶅瓧; - info.ConcreteType = DeviceConcreteType.Sensor_Temperatrue; + info.ConcreteType = DeviceConcreteType.Sensor_Temperature; } else if (temperatrue == false && humidity == true) { @@ -2735,14 +2707,15 @@ listCheck.Add(mainkeys); //鍒锋柊涓�涓嬫湰鍦扮紦瀛� var localDevice = this.GetDevice(mainkeys); - var tempDevice = localDevice == null ? device : localDevice; - - //鍒锋柊灞炴�� - this.SetDeviceInfoToMain(tempDevice, device); - if (this.RefreshDeviceFunctionType(tempDevice, device, false) == true) + if (localDevice != null) { - //闇�瑕佸彂閫佸姛鑳界被鍨嬬粰缃戝叧 - listFucDevice.Add(tempDevice); + //鍒锋柊灞炴�� + this.SetDeviceInfoToMain(localDevice, device); + if (this.RefreshDeviceFunctionType(localDevice, device, false) == true) + { + //闇�瑕佸彂閫佸姛鑳界被鍨嬬粰缃戝叧 + listFucDevice.Add(localDevice); + } } } } @@ -3398,10 +3371,6 @@ /// PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� /// </summary> Sensor_PMTwoPointFive = 1307, - /// <summary> - /// 娓╂箍搴︿紶鎰熷櫒 - /// </summary> - Sensor_TemperatrueHumidity = 1308, /// <summary> /// 杩愬姩浼犳劅鍣� @@ -3412,9 +3381,13 @@ /// </summary> Sensor_Keyfob = -1307, /// <summary> + /// 娓╂箍搴︿紶鎰熷櫒 + /// </summary> + Sensor_TemperatureHumidity = -1308, + /// <summary> /// 娓╁害浼犳劅鍣� /// </summary> - Sensor_Temperatrue = -1309, + Sensor_Temperature = -1309, /// <summary> /// 婀垮害浼犳劅鍣� /// </summary> -- Gitblit v1.8.0