From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 150 ++++++++++++++++++++++++++++++-------------------
1 files changed, 91 insertions(+), 59 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index f956017..c55d69b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -123,15 +123,26 @@
Text = "---",
IsBold = true,
};
- if(setTempAttr.step == "0.5")
+ if (setTempAttr.step == "0.5")
{
btnTemp.Text = Convert.ToDouble(setTempAttr.curValue).ToString("0.0");
}
else
{
- btnTemp.Text = setTempAttr.curValue.ToString();
+ if (setTempAttr.curValue.ToString().Contains("."))
+ {
+ btnTemp.Text = setTempAttr.curValue.ToString().Split(".")[0];
+ }
+ else
+ {
+ btnTemp.Text = setTempAttr.curValue.ToString();
+ }
}
- btnTemp.Width = btnTemp.GetTextWidth();
+#if __IOS__
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(10);
+#else
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+#endif
FrameWhiteCentet1.AddChidren(btnTemp);
@@ -171,8 +182,8 @@
var btnMinTemp = new Button()
{
- X = Application.GetRealWidth(26),
- Width = Application.GetRealWidth(18),
+ X = Application.GetRealWidth(22),
+ Width = Application.GetRealWidth(22),
TextAlignment = TextAlignment.Center,
Text = setTempAttr.min.ToString(),
TextSize = 12,
@@ -217,7 +228,7 @@
var btnMaxTemp = new Button()
{
X = setTempBar.Right,
- Width = Application.GetRealWidth(18),
+ Width = Application.GetRealWidth(24),
TextAlignment = TextAlignment.Center,
Text = setTempAttr.max.ToString(),
TextSize = 12,
@@ -284,21 +295,37 @@
{
btnTemp.Text = (setTempAttr.min + e).ToString();
}
+
+#if __IOS__
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(10);
+#else
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+#endif
+ btnTempUint.X = btnTemp.Right;
};
- setTempBar.OnStopTrackingTouchEvent = (sender,e) =>{
+ setTempBar.OnStopTrackingTouchEvent = (sender, e) => {
temp = e;
+ Dictionary<string, string> d = new Dictionary<string, string>();
device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
if (setTempAttr.step == "0.5")
{
- btnTemp.Text = (setTempAttr.min + ((double)e / 2)).ToString("0.0");
+ double ex = (double)e / 2;
+ btnTemp.Text = (setTempAttr.min + ((double)ex)).ToString("0.0");
+ d.Add(FunctionAttributeKey.SetTemp, (setTempAttr.min + ex).ToString());
}
else
{
btnTemp.Text = (setTempAttr.min + e).ToString();
+ d.Add(FunctionAttributeKey.SetTemp, (setTempAttr.min + e).ToString());
}
+
+#if __IOS__
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(10);
+#else
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+#endif
+ btnTempUint.X = btnTemp.Right;
controlTime = DateTime.Now;
- Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.SetTemp, e.ToString());
Control.Ins.SendWriteCommand(device, d);
};
@@ -384,7 +411,7 @@
btnModeIcon.UnSelectedImagePath = acFunction.GetModeIconPath(m, false);
btnModeIcon.SelectedImagePath = acFunction.GetModeIconPath(m);
- btnModeText.Text = acFunction.GetModeAttrText( m);
+ btnModeText.Text = acFunction.GetModeAttrText(m);
if (modeList.IndexOf(m) < modeList.Count - 1)
{
@@ -642,7 +669,7 @@
TextSize = CSS_FontSize.TextFontSize,
};
modeChangeView.AddChidren(btnFanText);
- btnFanIcon.UnSelectedImagePath = acFunction.GetFanIconPath(m,false);
+ btnFanIcon.UnSelectedImagePath = acFunction.GetFanIconPath(m, false);
btnFanIcon.SelectedImagePath = acFunction.GetFanIconPath(m);
btnFanText.Text = acFunction.GetFanAttrText(m);
@@ -738,7 +765,7 @@
{
Y = Application.GetRealHeight(16),
Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(296+200),
+ Width = Application.GetRealWidth(296 + 200),
};
bodyView.AddChidren(contentView);
@@ -754,7 +781,8 @@
int index = 0;
List<FunctionAttributes> attrList = new List<FunctionAttributes>();
attrList.AddRange(device.attributes);
- attrList.Add(new FunctionAttributes() {
+ attrList.Add(new FunctionAttributes()
+ {
key = "+",
});
@@ -844,45 +872,45 @@
SelectedTextColor = CSS_Color.MainBackgroundColor,
SelectedBackgroundColor = CSS_Color.MainColor,
};
- if (attr.value.Count > 0)
- {
- btn.Text = attr.value[0];
- }
- if (index % 3 == 1)
- {
- btn.Gravity = Gravity.Center;
- }
- else if (index % 3 == 2)
- {
- btn.X = Application.GetRealWidth(208);
- }
- row.AddChidren(btn);
-
- btn.MouseUpEventHandler = (sender, e) =>
- {
- //if (!device.online)
- //{
- // new Tip()
- // {
- // CloseTime = 1,
- // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- // Direction = AMPopTipDirection.None,
- // }.Show(MainPage.BaseView);
- //}
- Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(attr.key, "");
- Control.Ins.SendWriteCommand(device, d);
-
- new System.Threading.Thread(() =>
+ if (attr.value.Count > 0)
{
- System.Threading.Thread.Sleep(2000);
- Application.RunOnMainThread(() =>
+ btn.Text = attr.value[0];
+ }
+ if (index % 3 == 1)
+ {
+ btn.Gravity = Gravity.Center;
+ }
+ else if (index % 3 == 2)
+ {
+ btn.X = Application.GetRealWidth(208);
+ }
+ row.AddChidren(btn);
+
+ btn.MouseUpEventHandler = (sender, e) =>
+ {
+ //if (!device.online)
+ //{
+ // new Tip()
+ // {
+ // CloseTime = 1,
+ // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+ // Direction = AMPopTipDirection.None,
+ // }.Show(MainPage.BaseView);
+ //}
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add(attr.key, "");
+ Control.Ins.SendWriteCommand(device, d);
+
+ new System.Threading.Thread(() =>
{
- btn.IsSelected = false;
- });
- })
- { IsBackground = true }.Start();
- };
+ System.Threading.Thread.Sleep(2000);
+ Application.RunOnMainThread(() =>
+ {
+ btn.IsSelected = false;
+ });
+ })
+ { IsBackground = true }.Start();
+ };
}
@@ -971,15 +999,15 @@
{
btnSwitch.IsSelected = true;
//setTempBar.IsOffline = false;
- setTempBar.Enable = true;
- setTempBar.ProgressBarColor = CSS_Color.MainColor;
+ //setTempBar.Enable = true;
+ //setTempBar.ProgressBarColor = CSS_Color.MainColor;
}
else
{
btnSwitch.IsBold = false;
//setTempBar.IsOffline = true;
- setTempBar.Enable = false;
- setTempBar.ProgressBarColor = CSS_Color.DividingLineColor;
+ //setTempBar.Enable = false;
+ //setTempBar.ProgressBarColor = CSS_Color.DividingLineColor;
}
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString());
@@ -1014,7 +1042,7 @@
btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode), false);
btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false);
btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false);
-
+
if (device.GetAttribute(FunctionAttributeKey.SetTemp).step == "0.5")
{
var t = Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
@@ -1029,8 +1057,12 @@
btnTemp.Text = temp.ToString();
}
- //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
- //btnTempUint.X = btnTemp.Right;
+#if __IOS__
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(10);
+#else
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+#endif
+ btnTempUint.X = btnTemp.Right;
if (device.trait_on_off.curValue.ToString() == "on")
{
@@ -1058,7 +1090,7 @@
setTempBar.IsClickable = false;
}
- if(device.GetAttrState(FunctionAttributeKey.Mode) == "dry")
+ if (device.GetAttrState(FunctionAttributeKey.Mode) == "dry")
{
setTempBar.IsOffline = true;
setTempBar.IsClickable = false;
--
Gitblit v1.8.0