| | |
| | | foreach (var device in listDevice)
|
| | | {
|
| | | var typeInfo = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
|
| | | if (device.Type == DeviceType.IASZone)
|
| | | //按所属ID分组
|
| | | if (dic.ContainsKey(typeInfo.BeloneTextId) == false)
|
| | | {
|
| | | //这个强制为传感器
|
| | | typeInfo.BeloneTextId = R.MyInternationalizationString.uDeviceBelongId1200;
|
| | | typeInfo.ConcreteType = Common.DeviceConcreteType.Sensor;
|
| | | }
|
| | | if (device.Type == DeviceType.OnOffOutput)
|
| | | {
|
| | | string iconPath = string.Empty;
|
| | | //继电器的时候,需要特殊处理
|
| | | if (device.DfunctionType == DeviceFunctionType.A开关)
|
| | | {
|
| | | typeInfo.BeloneTextId = R.MyInternationalizationString.uSwitch;
|
| | | iconPath = "Device/Switch.png";
|
| | | }
|
| | | else if (device.DfunctionType == DeviceFunctionType.A插座)
|
| | | {
|
| | | typeInfo.BeloneTextId = R.MyInternationalizationString.uSocket1;
|
| | | iconPath = "Device/Socket1.png";
|
| | | }
|
| | | else if (device.DfunctionType == DeviceFunctionType.A灯光)
|
| | | {
|
| | | typeInfo.BeloneTextId = R.MyInternationalizationString.uLight;
|
| | | iconPath = "Device/Light.png";
|
| | | }
|
| | | else
|
| | | {
|
| | | //继电器
|
| | | typeInfo.BeloneTextId = R.MyInternationalizationString.uDeviceBelongId2300;
|
| | | iconPath = "Device/Relay.png";
|
| | | }
|
| | | if (dic.ContainsKey(typeInfo.BeloneTextId) == false)
|
| | | {
|
| | | dic[typeInfo.BeloneTextId] = new DeviceRowInfo();
|
| | | dic[typeInfo.BeloneTextId].IconPath = iconPath;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (dic.ContainsKey(typeInfo.BeloneTextId) == false)
|
| | | {
|
| | | dic[typeInfo.BeloneTextId] = new DeviceRowInfo();
|
| | | string path1 = string.Empty;
|
| | | string path2 = string.Empty;
|
| | | Common.LocalDevice.Current.GetDeviceBeloneIcon(typeInfo.ConcreteType, ref path1, ref path2);
|
| | | dic[typeInfo.BeloneTextId].IconPath = path1;
|
| | | }
|
| | | dic[typeInfo.BeloneTextId] = new DeviceRowInfo();
|
| | | string path1 = string.Empty;
|
| | | string path2 = string.Empty;
|
| | | //获取图片
|
| | | Common.LocalDevice.Current.GetDeviceBeloneIcon(typeInfo.ConcreteType, ref path1, ref path2);
|
| | | dic[typeInfo.BeloneTextId].IconPath = path1;
|
| | | }
|
| | | dic[typeInfo.BeloneTextId].listDeviceKeys.Add(Common.LocalDevice.Current.GetDeviceMainKeys(device));
|
| | | }
|