| | |
| | | dName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
|
| | | }
|
| | |
|
| | | new System.Threading.Thread(async () =>
|
| | | { |
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | await this.ReName(device, dName, ShowErrorMode.NO);
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | imageFilePath = "RealDevice/" + arry[0] + ".png";
|
| | | //如果它自己的共通图片还是不存在的话,则直接使用所有设备的共通图片
|
| | | if (string.IsNullOrEmpty(IO.FileUtils.GetImageFilePath(imageFilePath)) == true)
|
| | | {
|
| | | imageFilePath = "RealDevice/CommonDevice.png";
|
| | | }
|
| | | }
|
| | | btnIcon.UnSelectedImagePath = imageFilePath;
|
| | | }
|
| | |
| | | info.BeloneType = DeviceBeloneType.A智能门锁;
|
| | | info.ConcreteType = DeviceConcreteType.IntelligentLocks;
|
| | | }
|
| | | //2包含传感器的话,当传感器处理
|
| | | //12包含传感器的话,当传感器处理
|
| | | else if (dicType.ContainsKey(DeviceType.IASZone) == true)
|
| | | {
|
| | | //设置传感器具体的类型
|
| | | info.BeloneType = DeviceBeloneType.A传感器;
|
| | | this.SetSensorDeviceSpecificType(ref info, listdevice);
|
| | | }
|
| | | //13包含温度传感器的话
|
| | | else if (dicType.ContainsKey(DeviceType.TemperatureSensor) == true)
|
| | | {
|
| | | bool temperatrue = false;
|
| | | bool humidity = false;
|
| | | foreach (var device in listdevice)
|
| | | {
|
| | | if (device is TemperatureSensor)
|
| | | {
|
| | | //温度传感器
|
| | | if (((TemperatureSensor)device).SensorDiv == 1)
|
| | | {
|
| | | temperatrue = true;
|
| | | }
|
| | | //湿度传感器
|
| | | else if(((TemperatureSensor)device).SensorDiv == 2)
|
| | | {
|
| | | humidity = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (temperatrue == true && humidity == true)
|
| | | {
|
| | | //设置传感器具体的类型
|
| | | info.BeloneType = DeviceBeloneType.A温湿度传感器;
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId10;
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_TemperatrueHumidity;
|
| | | }
|
| | | else if (temperatrue == true && humidity == false)
|
| | | {
|
| | | //设置传感器具体的类型
|
| | | info.BeloneType = DeviceBeloneType.A温度传感器;
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId11;
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_Temperatrue;
|
| | | }
|
| | | else if (temperatrue == false && humidity == true)
|
| | | {
|
| | | //设置传感器具体的类型
|
| | | info.BeloneType = DeviceBeloneType.A湿度传感器;
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId12;
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_Humidity;
|
| | | }
|
| | | }
|
| | |
|
| | | int value = (int)info.BeloneType;
|
| | | if (dicDeviceDefultNameID.ContainsKey("uDeviceBelongId" + value) == true)
|
| | | {
|
| | |
| | | mainDevice.OutClusterList.AddRange(device.DeviceInfo.OutClusterList);
|
| | | mainDevice.AttributeStatus.Clear();
|
| | | mainDevice.AttributeStatus.AddRange(device.DeviceInfo.AttributeStatus);
|
| | | |
| | | //如果是温度传感器
|
| | | if (mainDevice is TemperatureSensor)
|
| | | {
|
| | | //输出族 1026:温度传感器 1029:湿度传感器
|
| | | foreach (var data in mainDevice.OutClusterList)
|
| | | {
|
| | | if (data.OutCluster == 1029)
|
| | | {
|
| | | ((TemperatureSensor)mainDevice).SensorDiv = 2;
|
| | | }
|
| | | else if (data.OutCluster == 1026)
|
| | | {
|
| | | ((TemperatureSensor)mainDevice).SensorDiv = 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | else if (deviceType == DeviceType.Repeater) { device = new Repeater(); }
|
| | | else if (deviceType == DeviceType.Thermostat) { device = new AC(); }
|
| | | else if (deviceType == DeviceType.DoorLock) { device = new DoorLock(); }
|
| | | else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); }
|
| | | else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); }
|
| | | else { return null; }
|
| | |
|