| | |
| | | DeviceType.IASZone, |
| | | DeviceType.OnOffSwitch, |
| | | DeviceType.OnOffOutput,//楼梯灯 |
| | | DeviceType.DoorLock |
| | | DeviceType.DoorLock, |
| | | DeviceType.TemperatureSensor, |
| | | }; |
| | | |
| | | ///楼层点击事件 |
| | |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains)); |
| | | } |
| | | |
| | | var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone); |
| | | var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone|| device.CommonDevice.Type == DeviceType.TemperatureSensor); |
| | | if (iASZonejosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor)); |
| | |
| | | else if (devicetype == Language.StringByID(MyInternationalizationString.sensor)) |
| | | { |
| | | list.Add(DeviceType.IASZone); |
| | | list.Add(DeviceType.TemperatureSensor); |
| | | } |
| | | else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock)) |
| | | { |
| | |
| | | deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png"; |
| | | |
| | | |
| | | } |
| | | break; |
| | | case DeviceType.TemperatureSensor: |
| | | { |
| | | var temperatureSensor = common.CommonDevice as TemperatureSensor; |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | deviceIconBtn.UnSelectedImagePath = $"ZigeeLogic/temperature.png"; |
| | | deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedtemperature.png"; |
| | | } |
| | | else |
| | | { |
| | | deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/humidity.png"; |
| | | deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedhumidity.png"; |
| | | } |
| | | } |
| | | break; |
| | | case DeviceType.OnOffSwitch: |
| | |
| | | } |
| | | break; |
| | | |
| | | case DeviceType.TemperatureSensor: |
| | | { |
| | | devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 * 2 - 20 - 50); |
| | | devicefra.Height = Application.GetRealHeight(140 + 160 * 2 + 20 + 50); |
| | | var temperatureSensor = common as TemperatureSensor; |
| | | var Btntemperaturevalue = new Button |
| | | { |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetRealWidth(400), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | X = Application.GetRealWidth(80), |
| | | Y = timetype.Bottom + Application.GetRealHeight(70), |
| | | }; |
| | | devicefra.AddChidren(Btntemperaturevalue); |
| | | |
| | | var horizontalSeekBarVol = new HorizontalSeekBar |
| | | { |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(80), |
| | | Radius = (uint)Application.GetRealHeight(25), |
| | | Y = timetype.Bottom + Application.GetRealHeight(70 + 60 + 70), |
| | | X = Application.GetRealWidth(80), |
| | | ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, |
| | | Max = 100, |
| | | SleepTime = 1000, |
| | | ThumbRadius = 9, |
| | | }; |
| | | devicefra.AddChidren(horizontalSeekBarVol); |
| | | horizontalSeekBarVol.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SelectedDeviceStatuscondition = "TemperatureSensor"; |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString()); |
| | | |
| | | Btntemperaturevalue.Text = "当前>" + horizontalSeekBarVol.Progress.ToString() + "℃"; |
| | | |
| | | } |
| | | else |
| | | { |
| | | Btntemperaturevalue.Text = "当前<" + horizontalSeekBarVol.Progress.ToString() + "%"; |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());//温度值 |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | dictionary(deviceConditionsInfo, "Cluster_ID", "1026"); |
| | | dictionary(deviceConditionsInfo, "AttriButeId", "0"); |
| | | dictionary(deviceConditionsInfo, "Range", "0");//0大于AttriButeData1时触发动作 |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", "0"); |
| | | dictionary(deviceConditionsInfo, "AttriButeData2", "0"); |
| | | Btntemperaturevalue.Text = "当前>0℃"; |
| | | |
| | | } |
| | | else |
| | | { |
| | | Btntemperaturevalue.Text = "当前<0%"; |
| | | dictionary(deviceConditionsInfo, "Cluster_ID", "1029"); |
| | | dictionary(deviceConditionsInfo, "AttriButeId", "0"); |
| | | dictionary(deviceConditionsInfo, "Range", "2");//2小于AttriButeData1时触发动作 |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", "0");//温度值 |
| | | dictionary(deviceConditionsInfo, "AttriButeData2", "0"); |
| | | } |
| | | |
| | | if (edit && devices != null) |
| | | { |
| | | horizontalSeekBarVol.Progress = int.Parse(devices["AttriButeData1"]); |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | |
| | | Btntemperaturevalue.Text = "当前>" + devices["AttriButeData1"] + "℃"; |
| | | |
| | | } |
| | | else |
| | | { |
| | | Btntemperaturevalue.Text = "当前<" + devices["AttriButeData1"] + "%"; |
| | | } |
| | | } |
| | | |
| | | } |
| | | break; |
| | | } |
| | | |
| | | Btncomplete.MouseUpEventHandler += (sender2, e2) => |