From d78515ac4ac8cf4a1785d9df18058d6724f12b79 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 14 一月 2021 19:34:59 +0800 Subject: [PATCH] 合并xm2021-01-13 wjc2021-02-06 --- ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 109 ++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 73 insertions(+), 36 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs index 402b3a6..3d9b62d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -227,7 +227,7 @@ } } //淇濆瓨璁惧鎴块棿绱㈠紩 - Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys); + HdlRoomLogic.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys); }; //娣诲姞鍏ㄩ儴鑿滃崟 @@ -784,8 +784,30 @@ //鍙湁鍥炶矾鏁板ぇ浜�1鎵嶈兘鏈夎繖涓彍鍗� if (Common.LocalDevice.Current.GetDevicesCountByMac(listNewDevice[0].DeviceAddr) == 1) { - //鏂伴灏忔ā鍧楀彧鏈変竴涓洖璺紝浣嗚姹傛柊椋庡皬妯″潡鐨勬柊椋庢湁鍔熻兘璁剧疆 - if (deviceEnumInfo.ConcreteType != DeviceConcreteType.Relay_FangyueFreshAirModul) + //绌烘皵璐ㄩ噺浼犳劅鍣ㄥ拰鏂伴灏忔ā鍧楀彧鏈変竴涓洖璺紝浣嗚姹傛柊椋庡皬妯″潡鐨勬柊椋庢湁鍔熻兘璁剧疆 + //鏅捐。鏋堕粯璁ゅ彧瀛樺偍绗竴鍥炶矾锛屽叾浠栧洖璺杩囨护浜� + bool isSpecial = false; + if (deviceEnumInfo.ConcreteType == DeviceConcreteType.Relay_FangyueFreshAirModul || + deviceEnumInfo.ConcreteType == DeviceConcreteType.AirQualitySensor) + { + isSpecial = true; + } + if (deviceEnumInfo.ConcreteType == DeviceConcreteType.Airer) + { + isSpecial = true; + var dev = listNewDevice[0]; + //鏅捐。鏋堕粯璁ゅ彧瀛樺偍绗竴鍥炶矾锛屽叾浠栧洖璺湪鍔熻兘鐣岄潰闇�瑕佽鍙栨椂闂达紝鎵�浠ユ彁鍓嶄竴涓晫闈㈣幏鍙� + //绗竴鐗堟椂闂村姛鑳界敱浜庤澶囦笉鏀寔锛屾殏鏃跺幓鎺夛紝鍚庢湡鎵嶅姞涓� + //for (int i = 3; i < 6; i++) + //{ + // //娉ㄦ剰锛岃。鏋朵腑鐨勭姸鎬佺敱涓嶅悓绔偣鑾峰彇 + // //鍥炶矾3:璇诲彇椋庡共寮�鍏崇姸鎬佸拰鏃堕棿鍊� + // //鍥炶矾4:璇诲彇鐑樺共寮�鍏崇姸鎬佸拰鏃堕棿鍊� + // //鍥炶矾5:璇诲彇娑堟瘨寮�鍏崇姸鎬佸拰鏃堕棿鍊� + // HdlDeviceAttributeLogic.Current.SendAirerComand(dev, i); + //} + } + if (!isSpecial) { return; } @@ -831,14 +853,19 @@ var form = new DevicePanel.PanelFangyueFunctionSettionForm(); form.AddForm(listNewDevice[0], deviceEnumInfo); } - //绠�绾︾幆澧冮潰鏉跨殑鎸夐敭閰嶇疆 + //绠�绾﹀鍔熻兘闈㈡澘鐨勬寜閿厤缃� else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction) { - var form = new DeviceFunctionSettionForm(); - if (listNewDevice.Count > 62) + foreach (var dev in listNewDevice) { - form.AddForm(listNewDevice[62], true); + if (dev.Type == DeviceType.OnOffOutput && dev.DeviceEpoint == 62) + { + var form = new DeviceFunctionSettionForm(); + form.AddForm(dev, true); + break; + } } + } //娌充笢鐨勯潰鏉胯澶� else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A鎸夐敭闈㈡澘 && deviceEnumInfo.IsHdlDevice == true) @@ -1174,6 +1201,7 @@ if (string.IsNullOrEmpty(bindName)) { btnHumidityStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); + bindHumidityDev = null; } else { @@ -1225,6 +1253,7 @@ if (string.IsNullOrEmpty(bindName)) { btnTemperatureStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); + bindTemperatureDev = null; } else { @@ -1308,47 +1337,54 @@ { continue; } + //鑾峰彇璁惧绫诲瀷鐨� + var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); if (device.Type == DeviceType.TemperatureSensor) { var bD = device as TemperatureSensor; if (bD.SensorDiv == 1 && bDev.BindCluster == 1026) { - if (string.IsNullOrEmpty(bDev.ESName)) - { - bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device); - } - else - { - bindTemperatureName = bDev.ESName; - } + bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device); bindTemperatureDev = device; } if (bD.SensorDiv == 2 && bDev.BindCluster == 1029) { - if (string.IsNullOrEmpty(bDev.ESName)) - { - bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); - } - else - { - bindHumidityName = bDev.ESName; - } - + bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); bindHumidityDev = device; + } + + //绌烘皵璐ㄩ噺浼犳劅鍣� + if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) + { + if (bDev.BindCluster == 1026) + { + bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); + bindTemperatureDev = device; + } + if (bDev.BindCluster == 1029) + { + bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); + bindHumidityDev = device; + } } } if (device.Type == DeviceType.FreshAirHumiditySensor) { - if (string.IsNullOrEmpty(bDev.ESName)) - { - bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); - } - else - { - bindHumidityName = bDev.ESName; - } - + bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); bindHumidityDev = device; + } + else if (device.Type == DeviceType.PMSensor) + { + if (bDev.BindCluster == 1026) + { + bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); + bindTemperatureDev = device; + } + if (bDev.BindCluster == 1029) + { + bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); + bindHumidityDev = device; + } } } result = true; @@ -1377,7 +1413,8 @@ { return; } - } catch (Exception ex) + } + catch (Exception ex) { var mess = ex.Message; } @@ -1598,7 +1635,7 @@ } }, ShowErrorMode.NO); } - }); + }, ShowErrorMode.NO); } #endregion @@ -1683,7 +1720,7 @@ frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () => { //鍙戦�佸畾浣嶅姛鑳� - Common.LocalDevice.Current.SetFixedPositionCommand(listNewDevice[0]); + Common.LocalDevice.Current.SetFixedPositionCommand(listNewDevice[0], true); }); } -- Gitblit v1.8.0