| | |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = int.Parse(strValue) * 0.1; |
| | | room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 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; |
| | | room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | | room.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | room = r; |
| | | IconPathType = r.BackgroundImageType; |
| | | OldIconPathType= r.BackgroundImageType; |
| | | OldIconPathType = r.BackgroundImageType; |
| | | if (IconPathType != 0) |
| | | { |
| | | OldBackgroundImagePath = r.BackgroundImage; |
| | |
| | | }; |
| | | AddChidren(bodyFrameLayout); |
| | | |
| | | var backGround1 = new ImageView() |
| | | { |
| | | Y = Application.GetRealHeight(60), |
| | | Width = Application.GetMinRealAverage(916), |
| | | Height = Application.GetMinRealAverage(487), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | ImagePath = "Room/Room_Rectangle.png" |
| | | }; |
| | | bodyFrameLayout.AddChidren(backGround1); |
| | | |
| | | |
| | | backGround = new ImageView() |
| | | { |
| | | Y = Application.GetRealHeight(60), |
| | | Width = Application.GetMinRealAverage(887), |
| | | Height = Application.GetMinRealAverage(444), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius), |
| | | Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius), |
| | | ImagePath = room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage) |
| | | }; |
| | | bodyFrameLayout.AddChidren(backGround); |
| | | backGround.SetViewShadow(true); |
| | | |
| | | if (room.BackgroundImageType != 0) |
| | | { |
| | | backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(backGround.ImagePath); |
| | |
| | | nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.RoomName)} :"); |
| | | nameRow.SetTitle(room.Name); |
| | | infoFL.AddChidren(nameRow); |
| | | if(room.IsLove) |
| | | if (room.IsLove) |
| | | { |
| | | nameRow.NameText.Enable = false; |
| | | } |
| | |
| | | }; |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | | temperatureRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | temperatureRow.SetTitle(room.Temperatrue == 0 ? "--℃" : $"{room.Temperatrue}℃"); |
| | | //发送获取温度的命令 |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); |
| | | ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(dev); |
| | |
| | | }; |
| | | if (string.IsNullOrEmpty(room.HumidityDevice) == false) |
| | | { |
| | | humidityRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | humidityRow.SetTitle(room.Humidity == 0 ? "--%" : $"{room.Humidity}%"); |
| | | //发送获取湿度的命令 |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); |
| | | ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(dev); |
| | |
| | | } |
| | | |
| | | var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127); |
| | | confirm.SetTitle(R.MyInternationalizationString.Confrim); |
| | | confirm.SetTitle(R.MyInternationalizationString.Save); |
| | | AddChidren(confirm); |
| | | confirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | room.Name = nameRow.NameText.Text.Trim(); |
| | | if (OldIconPathType != 0) |
| | | { |
| | | Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath,OldBackgroundImagePath)); |
| | | Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath)); |
| | | HdlAutoBackupLogic.DeleteFile(OldBackgroundImagePath); |
| | | } |
| | | if (IconPathType == 0) |
| | | { |
| | |
| | | else |
| | | { |
| | | Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); |
| | | HdlAutoBackupLogic.AddOrEditorFile(fileName); |
| | | room.BackgroundImage = fileName; |
| | | } |
| | | room.BackgroundImageType = IconPathType; |