From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs | 145 ++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 126 insertions(+), 19 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs
index 0fdd8c3..f507873 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs
@@ -17,7 +17,7 @@
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="device"></param>
- /// <param name="deviceBindType">1:鏂伴;2:娓╁害浼犳劅鍣�;3:婀垮害浼犳劅鍣�;4:PM2.5浼犳劅鍣�;5:绌鸿皟鐩爣,6:鍦版殩鐩爣銆愭殏鏃舵病鍋氾紝鍥犱负娌℃湁璇ヨ澶囷紝鍚庢湡澧炲姞銆�</param>
+ /// <param name="deviceBindType">1:鏂伴;2:娓╁害浼犳劅鍣�;3:婀垮害浼犳劅鍣�;4:PM2.5浼犳劅鍣�;5:绌鸿皟鐩爣,6:鍦版殩鐩爣,7:Co2鐩爣</param>
/// <param name="bindDev">缁戝畾鐩爣 </param>
public PaneTargetsBaseForm(CommonDevice device, CommonDevice bindDev, DeviceBind.BindInfo.BindType deviceBindType)
{
@@ -71,7 +71,8 @@
/// 3:婀垮害浼犳劅鍣�
/// 4:PM2.5浼犳劅鍣�
/// 5:绌鸿皟鐩爣
- /// 6:鍦版殩鐩爣銆愭殏鏃舵病鍋氾紝鍥犱负娌℃湁璇ヨ澶囷紝鍚庢湡澧炲姞銆�
+ /// 6:鍦版殩鐩爣
+ /// 7:Co2鐩爣
/// </summary>
DeviceBind.BindInfo.BindType curDeviceBindType = 0;
/// <summary>
@@ -131,6 +132,10 @@
/// </summary>
public Action<string> actionPMTarget = null;
/// <summary>
+ /// Co2缁戝畾鐩爣鍥炶皟
+ /// </summary>
+ public Action<string> actionCo2Target = null;
+ /// <summary>
/// Ac缁戝畾鐩爣鍥炶皟
/// </summary>
public Action<string> actionAcTarget = null;
@@ -184,6 +189,9 @@
case DeviceBind.BindInfo.BindType.Fh:
titleText = Language.StringByID(R.MyInternationalizationString.uFloorHeatingTarget);
break;
+ //case DeviceBind.BindInfo.BindType.CO2:
+ //titleText = Language.StringByID(R.MyInternationalizationString.CO2Source);
+ //break;
}
this.TopFrameLayout(this, titleText);
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
@@ -527,7 +535,7 @@
X = devicePic.Right + Application.GetRealWidth(20),
TextAlignment = TextAlignment.CenterLeft,
TextSize = 15,
- Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device),
+ Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
};
rowLayout.AddChidren(btnBindName);
@@ -556,7 +564,7 @@
{
line2.Visible = false;
}
- if (HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(device) == true)
+ if (Common.LocalDevice.Current.CheckDeviceIsOnline(device) == true)
{
btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.TextBlack;
}
@@ -564,6 +572,8 @@
{
btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
}
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
switch (curDeviceBindType)
{
case DeviceBind.BindInfo.BindType.FreshAir:
@@ -573,17 +583,30 @@
devicePic.UnSelectedImagePath = "Device/SensorTemperature.png";
if (device.Type == DeviceType.PMSensor)
{
- btnBindName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+ btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+ }
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
}
break;
case DeviceBind.BindInfo.BindType.Humidity:
devicePic.UnSelectedImagePath = "Device/SensorHumidity.png";
if (device.Type == DeviceType.PMSensor)
{
- btnBindName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+ btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+ }
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
}
break;
case DeviceBind.BindInfo.BindType.PM:
+ devicePic.UnSelectedImagePath = "Device/AirQualitySensorEpoint.png";
+ break;
+ case DeviceBind.BindInfo.BindType.CO2:
devicePic.UnSelectedImagePath = "Device/AirQualitySensorEpoint.png";
break;
case DeviceBind.BindInfo.BindType.AC:
@@ -752,12 +775,12 @@
var mainKey = bindDev.BindMacAddr + bindDev.BindEpoint;
//鍒嗛厤鐨勭洰鏍囧垪琛�
- if (HdlDeviceCommonLogic.Current.listAllDevice.Count != 0)
+ if (Shared.Common.LocalDevice.Current.listAllDevice.Count != 0)
{
var dev = currentPanelSupportBindDeviceList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey));
if (dev != null)
{
- var device = HdlDeviceCommonLogic.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint);
+ var device = LocalDevice.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint);
if (device != null)
{
BindTypeTargetsList(device, bindDev);
@@ -771,7 +794,7 @@
var dev = undistruibuteDevList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey));
if (dev != null)
{
- var device = HdlDeviceCommonLogic.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint);
+ var device = LocalDevice.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint);
if (device != null)
{
BindTypeTargetsList(device, bindDev);
@@ -834,7 +857,7 @@
foreach (var dev in targetList)
{
//鑾峰彇鏈湴璁惧鍒楄〃
- var localDeviceList = HdlDeviceCommonLogic.Current.listAllDevice;
+ var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice;
var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == dev.DeviceAddr && obj.DeviceEpoint == dev.DeviceEpoint);
if (tempDev != null)
{
@@ -848,13 +871,15 @@
else
{
curControlDev.currentSelectRoomId = "UndistributedId";
+ //鐩爣鍦ㄦ湭鍒嗛厤鏃讹紝榛樿绗竴涓ゼ灞�
+ curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId();
}
}
if (canUpdateBindName)
{
//鏇存柊澶栭潰鐩爣鍚嶅瓧锛氬叿浣撳悕瀛椼�愬埛鏂版湰鍦扮晫闈細瀵艰嚧澶栭儴鐩爣鍙樺寲銆�
- string bindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(dev);
+ string bindName = Common.LocalDevice.Current.GetDeviceEpointName(dev);
switch (curDeviceBindType)
{
case BindInfo.BindType.Temperature:
@@ -862,11 +887,31 @@
{
bindName += "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
}
+ if (dev.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+ {
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { dev });
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ bindName += "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+ }
+ }
break;
case BindInfo.BindType.Humidity:
if (dev.Type == DeviceType.PMSensor)
{
bindName += "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+ }
+ if (dev.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+ {
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { dev });
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ bindName += "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+ }
}
break;
}
@@ -1192,23 +1237,40 @@
case BindInfo.BindType.AC:
addBindInfo.BindCluster = 513;
break;
+ case BindInfo.BindType.CO2:
+ addBindInfo.BindCluster = 1037;
+ break;
}
addBindInfo.BindType = 0;
addBindInfo.BindMacAddr = de.DeviceAddr;
addBindInfo.BindEpoint = de.DeviceEpoint;
- addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de);
+ addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de);
+
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { de });
switch (curDeviceBindType)
{
case BindInfo.BindType.Temperature:
if (de.Type == DeviceType.PMSensor)
{
- addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+ addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+ }
+
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
}
break;
case BindInfo.BindType.Humidity:
if (de.Type == DeviceType.PMSensor)
{
- addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+ addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+ }
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
}
break;
}
@@ -1402,13 +1464,14 @@
/// <param name="bindDev"></param>
void BindTypeTargetsList(CommonDevice device, BindListResponseObj bindDev)
{
+ //鑾峰彇璁惧绫诲瀷鐨�
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
switch (curDeviceBindType)
{
case BindInfo.BindType.FreshAir:
- //鑾峰彇璁惧绫诲瀷鐨�
- var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+
//鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欎笉鏄剧ず
- if (deviceEnumInfo.ConcreteType != DeviceConcreteType.ButtonPanel_FangyueFreshAir)
+ if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
{
if (device.Type == DeviceType.FreshAir)
{
@@ -1422,7 +1485,18 @@
var bDev = device as TemperatureSensor;
if (bDev.SensorDiv == 1)
{
- oldTargetList.Add(device);
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ if (bindDev.BindCluster == 1026)
+ {
+ oldTargetList.Add(device);
+ }
+ }
+ else
+ {
+ oldTargetList.Add(device);
+ }
}
}
if (device.Type == DeviceType.PMSensor)
@@ -1440,6 +1514,15 @@
if (bDev.SensorDiv == 2)
{
oldTargetList.Add(device);
+ }
+
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ if (bindDev.BindCluster == 1029)
+ {
+ oldTargetList.Add(device);
+ }
}
}
if (device.Type == DeviceType.FreshAirHumiditySensor)
@@ -1462,6 +1545,17 @@
oldTargetList.Add(device);
}
}
+ else if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+ {
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ if (bindDev.BindCluster == 1066)
+ {
+ oldTargetList.Add(device);
+ }
+ }
+ }
break;
case BindInfo.BindType.AC:
if (device.Type == DeviceType.Thermostat)
@@ -1469,6 +1563,19 @@
if (bindDev.BindCluster == 513)
{
oldTargetList.Add(device);
+ }
+ }
+ break;
+ case BindInfo.BindType.CO2:
+ if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+ {
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ if (bindDev.BindCluster == 1037)
+ {
+ oldTargetList.Add(device);
+ }
}
}
break;
@@ -1498,7 +1605,7 @@
return;
}
//鑾峰彇鏈湴璁惧鍒楄〃
- var localDeviceList = HdlDeviceCommonLogic.Current.listAllDevice;
+ var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice;
var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == bindDev.DeviceAddr && obj.DeviceEpoint == bindDev.DeviceEpoint);
if (tempDev != null)
{
--
Gitblit v1.8.0