| | |
| | | /// </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设备属性上报, (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; |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | 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> |
| | |
| | | Height = Application.GetRealHeight(450), |
| | | Width = Application.GetRealWidth(selectRow_Width), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | selectFL.AddChidren(itemFL); |
| | | itemFL.Animate = Animate.DownToUp; |
| | | //itemFL.Animate = Animate.DownToUp; |
| | | |
| | | var selectLocalPicture = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.LocalPicture, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize = 17 |
| | | }; |
| | | itemFL.AddChidren(selectLocalPicture); |
| | | var selectLocalLine = new Button() |
| | | { |
| | | Y = selectLocalPicture.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2 |
| | | }; |
| | | itemFL.AddChidren(selectLocalLine); |
| | | |
| | |
| | | Y = selectLocalLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.Photograph, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize = 17 |
| | | }; |
| | | itemFL.AddChidren(selectPhotographBtn); |
| | | var selectPhotographLine = new Button() |
| | | { |
| | | Y = selectPhotographBtn.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2, |
| | | }; |
| | | itemFL.AddChidren(selectPhotographLine); |
| | | |
| | |
| | | Y = selectPhotographLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.MyAblums, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize = 17 |
| | | }; |
| | | itemFL.AddChidren(selectAblumsBtn); |
| | | |
| | |
| | | TextID = R.MyInternationalizationString.Cancel, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | TextSize = 17 |
| | | }; |
| | | selectFL.AddChidren(cancelBtn); |
| | | |