| | |
| | | /// </summary> |
| | | public int OldIconPathType; |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | public EditRoom() |
| | |
| | | return; |
| | | } |
| | | room.TemperatrueDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}"; |
| | | temperatureRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice"); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, ((report) => |
| | |
| | | { |
| | | //0℃ |
| | | temperatureRow.NameText.Text = "0.0℃"; |
| | | room.Temperatrue = 0; |
| | | } |
| | | else if (data.AttriButeData > 32767) |
| | | { |
| | |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = int.Parse(strValue) * 0.1; |
| | | } |
| | | else |
| | | { |
| | |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = int.Parse(strValue) *0.1; |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | | temperatureRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice"); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, (Action<ZigBee.Device.CommonDevice>)((report) => |
| | | { |
| | |
| | | { |
| | | //0℃ |
| | | temperatureRow.NameText.Text = "0.0℃"; |
| | | room.Temperatrue = 0; |
| | | } |
| | | else if (data.AttriButeData > 32767) |
| | | { |
| | |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = int.Parse(strValue) * 0.1; |
| | | } |
| | | else |
| | | { |
| | |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = int.Parse(strValue) * 0.1; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | (dev as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | temperatureRow.SetTitle(R.MyInternationalizationString.No); |
| | | } |
| | | |
| | | |
| | |
| | | return; |
| | | } |
| | | room.HumidityDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}"; |
| | | humidityRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A设备属性上报, (report) => |
| | |
| | | { |
| | | //0 |
| | | humidityRow.NameText.Text = "0.0%"; |
| | | room.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; |
| | | room.Humidity = int.Parse(strValue) * 0.1; |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | if (string.IsNullOrEmpty(room.HumidityDevice) == false) |
| | | { |
| | | humidityRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A设备属性上报, (report) => |
| | | { |
| | |
| | | { |
| | | //0 |
| | | humidityRow.NameText.Text = "0.0%"; |
| | | room.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; |
| | | room.Humidity = int.Parse(strValue) * 0.1; |
| | | } |
| | | } |
| | | } |
| | |
| | | (dev as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | humidityRow.SetTitle(R.MyInternationalizationString.No); |
| | | } |
| | | |
| | | if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove) |
| | | { |
| | |
| | | humidityRow.Y= Application.GetRealHeight(446); |
| | | } |
| | | |
| | | var confirm = new Device.CommonForm.CompleteButton(1700, 700, 127); |
| | | var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127); |
| | | confirm.SetTitle(R.MyInternationalizationString.Confrim); |
| | | AddChidren(confirm); |
| | | confirm.MouseUpEventHandler += (sender, e) => |
| | |
| | | action?.Invoke(); |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |