| | |
| | | /// 构造函数 |
| | | /// </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) |
| | | { |
| | |
| | | /// 3:湿度传感器 |
| | | /// 4:PM2.5传感器 |
| | | /// 5:空调目标 |
| | | /// 6:地暖目标【暂时没做,因为没有该设备,后期增加】 |
| | | /// 6:地暖目标 |
| | | /// 7:Co2目标 |
| | | /// </summary> |
| | | DeviceBind.BindInfo.BindType curDeviceBindType = 0; |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public Action<string> actionPMTarget = null; |
| | | /// <summary> |
| | | /// Co2绑定目标回调 |
| | | /// </summary> |
| | | public Action<string> actionCo2Target = null; |
| | | /// <summary> |
| | | /// Ac绑定目标回调 |
| | | /// </summary> |
| | | public Action<string> actionAcTarget = null; |
| | |
| | | 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) => |
| | |
| | | { |
| | | 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: |
| | |
| | | { |
| | | 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"; |
| | |
| | | { |
| | | 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: |
| | |
| | | else |
| | | { |
| | | curControlDev.currentSelectRoomId = "UndistributedId"; |
| | | //目标在未分配时,默认第一个楼层 |
| | | curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | 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 = Common.LocalDevice.Current.GetDeviceEpointName(de); |
| | | |
| | | //获取设备类型 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { de }); |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.Temperature: |
| | |
| | | { |
| | | 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 = 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); |
| | | } |
| | |
| | | /// <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 = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | |
| | | //新风面板的新风设备,则不显示 |
| | | if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | { |
| | |
| | | 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) |
| | |
| | | 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) |
| | |
| | | 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) |
| | |
| | | } |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | targetList.Clear(); |