From 34e965100d635346e2d4cd6e6013bdaed66b3004 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 19:52:13 +0800
Subject: [PATCH] 2019.1.2-3
---
ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs | 47 ++++++++++++++++++++++++++++++-----------------
1 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
index 5742330..d912084 100644
--- a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
@@ -131,7 +131,7 @@
//灏忔暟鐐归渶瑕佷竴浣�
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
{
@@ -139,7 +139,7 @@
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, "."));
}
}
}
@@ -162,7 +162,7 @@
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, "."));
}
}
}
@@ -193,7 +193,7 @@
{
room = r;
IconPathType = r.BackgroundImageType;
- OldIconPathType= r.BackgroundImageType;
+ OldIconPathType = r.BackgroundImageType;
if (IconPathType != 0)
{
OldBackgroundImagePath = r.BackgroundImage;
@@ -204,11 +204,11 @@
}
- public override void RemoveFromParent()
+ public override void RemoveFromParent()
{
- ZbGateway.StatusList.Remove(this);
- CommonPage.Instance.IsDrawerLockMode = false;
- base.RemoveFromParent();
+ ZbGateway.StatusList.Remove(this);
+ CommonPage.Instance.IsDrawerLockMode = false;
+ base.RemoveFromParent();
}
#region Add____________________________________
@@ -241,17 +241,28 @@
};
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);
@@ -286,7 +297,7 @@
nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.RoomName)} :");
nameRow.SetTitle(room.Name);
infoFL.AddChidren(nameRow);
- if(room.IsLove)
+ if (room.IsLove)
{
nameRow.NameText.Enable = false;
}
@@ -346,7 +357,7 @@
};
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);
@@ -384,7 +395,7 @@
};
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);
@@ -397,11 +408,11 @@
if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove)
{
temperatureRow.Y = Application.GetRealHeight(308);
- humidityRow.Y= Application.GetRealHeight(446);
+ humidityRow.Y = Application.GetRealHeight(446);
}
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) =>
{
@@ -410,7 +421,8 @@
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(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
}
if (IconPathType == 0)
{
@@ -419,6 +431,7 @@
else
{
Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
+ HdlAutoBackupLogic.AddOrEditorFile(System.IO.Path.Combine(Config.Instance.FullPath, fileName));
room.BackgroundImage = fileName;
}
room.BackgroundImageType = IconPathType;
@@ -587,4 +600,4 @@
#endregion
}
-}
+}
\ No newline at end of file
--
Gitblit v1.8.0