From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs | 59 +++++++++++++++++++++++++++++++----------------------------
1 files changed, 31 insertions(+), 28 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
index 99eff0f..44e7821 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
@@ -23,7 +23,7 @@
/// </summary>
Button btnCollection;
/// <summary>
- /// 绌鸿皟娓╁害鎺у埗鎺т欢
+ /// 娓╁害鎺у埗鎺т欢
/// </summary>
DiyArcSeekBar arcBar;
/// <summary>
@@ -62,7 +62,8 @@
#endregion
#region 鍖哄煙鍙橀噺
- FloorHeating fh;
+ FloorHeating fhTemp = new FloorHeating();
+ Function function;
Button btnCollection_Out;
Button btnFunctionName_Out;
Button btnFromFloor_Out;
@@ -71,10 +72,10 @@
/// </summary>
Action actionRefresh;
#endregion
- public FloorHeatingPage(FloorHeating func)
+ public FloorHeatingPage(Function func)
{
bodyView = this;
- fh = func;
+ function = func;
}
public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -103,7 +104,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
- Text = fh.name,
+ Text = function.name,
};
controlView.AddChidren(btnFunctionName);
@@ -116,7 +117,7 @@
TextColor = CSS_Color.PromptingColor1,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = fh.GetRoomListName()
+ Text = function.GetRoomListName()
};
controlView.AddChidren(btnFromFoorAndRoom);
@@ -128,7 +129,7 @@
Height = Application.GetMinRealAverage(40),
SelectedImagePath = "Collection/CollectionIcon.png",
UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
- IsSelected = fh.collect
+ IsSelected = function.collect
};
//controlView.AddChidren(btnCollection);
//2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
@@ -141,14 +142,15 @@
{
Gravity = Gravity.CenterHorizontal,
OpenAngle = 160,
- ThumbImagePath = fh.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
+ ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
ThumbImageHeight = Application.GetRealWidth(50),
- ProgressBarColor = fh.trait_on_off.curValue.ToString() == "on" ? CSS_Color.MainColor : CSS_Color.PromptingColor2, // 0xFFFC9C04 : CSS_Color.PromptingColor2,
- MinValue = 5,
- MaxValue = 35,
- IsClickable = fh.trait_on_off.curValue.ToString() == "on",
+ ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04,
+ OfflineProgressBarColor = CSS_Color.PromptingColor2,
+ IsOffline = function.trait_on_off.curValue.ToString() == "off",
+ MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min,
+ MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max,
ArcColor = CSS_Color.BackgroundColor,
- Progress = Convert.ToInt32(fh.trait_temp.curValue),
+ Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)),
#if __IOS__
Y = Application.GetRealHeight(120+25),
Width = Application.GetRealWidth(260-40),
@@ -173,7 +175,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = 56,
IsBold = true,
- Text = fh.trait_temp.curValue.ToString(),
+ Text = function.GetAttrState(FunctionAttributeKey.SetTemp),
TextAlignment = TextAlignment.Center,
};
controlView.AddChidren(btnTemp);
@@ -188,7 +190,7 @@
TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
IsBold = true,
TextAlignment = TextAlignment.CenterLeft,
- Text = fh.tempUnitString
+ Text = fhTemp.GetTempUnitString(function)
};
controlView.AddChidren(btnTempUint);
@@ -230,27 +232,27 @@
Y = Application.GetRealHeight(337),
Width = Application.GetRealWidth(30),
Height = Application.GetRealWidth(30),
- UnSelectedImagePath = fh.curModeImage,
+ UnSelectedImagePath = fhTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode))
};
controlView.AddChidren(btnMode);
btnSwitch = new Button()
{
Gravity = Gravity.CenterHorizontal,
- Y = Application.GetRealHeight(462),
- Width = Application.GetRealWidth(40),
- Height = Application.GetRealWidth(40),
+ Y = Application.GetRealHeight(466),
+ Width = Application.GetRealWidth(32),
+ Height = Application.GetRealWidth(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = fh.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.curValue.ToString() == "on"
};
controlView.AddChidren(btnSwitch);
LoadEventList();
- new TopViewDiv(bodyView, Language.StringByID(StringId.FloorHeating)).LoadTopView_FunctionTop(fh, actionRefresh);
+ new TopViewDiv(bodyView, Language.StringByID(StringId.FloorHeating)).LoadTopView_FunctionTop(function, actionRefresh);
new System.Threading.Thread(() =>
{
- DriverLayer.Control.Ins.SendReadCommand(fh);
+ DriverLayer.Control.Ins.SendReadCommand(function);
})
{ IsBackground = true }.Start();
}
@@ -302,28 +304,29 @@
};
modeChangeView.AddChidren(btnLine);
- foreach (var m in fh.trait_mode.value)
+ var modeList = function.GetAttribute(FunctionAttributeKey.Mode).value;
+ foreach (var m in modeList)
{
Button btnModeIcon = new Button()
{
X = btnTitle.X,
- Y = Application.GetRealHeight(44 * (fh.trait_mode.value.IndexOf(m) + 1) + 10 + 8),
+ Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
Width = Application.GetRealWidth(24),
Height = Application.GetRealWidth(24),
- IsSelected = fh.trait_mode.curValue.ToString() == m,
+ IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
};
modeChangeView.AddChidren(btnModeIcon);
Button btnModeText = new Button()
{
X = Application.GetRealWidth(12) + btnModeIcon.Right,
- Y = Application.GetRealHeight(44 * (fh.trait_mode.value.IndexOf(m) + 1) + 8),
+ Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
Height = Application.GetRealHeight(44),
Width = Application.GetRealWidth(70),
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.FirstLevelTitleColor,
SelectedTextColor = CSS_Color.MainColor,
- IsSelected = fh.trait_mode.curValue.ToString() == m,
+ IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
};
modeChangeView.AddChidren(btnModeText);
@@ -356,7 +359,7 @@
break;
}
- if (fh.trait_mode.value.IndexOf(m) < fh.trait_mode.value.Count - 1)
+ if (modeList.IndexOf(m) < modeList.Count - 1)
{
modeChangeView.AddChidren(new Button()
{
--
Gitblit v1.8.0