From 1e0014f5c2e2fe1cfaaacfb2bebe8adc577bc944 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 14 五月 2020 18:01:26 +0800
Subject: [PATCH] 2020-05-14-3
---
HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs | 301 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 273 insertions(+), 28 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
index d189929..d058f54 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
@@ -9,7 +9,7 @@
{
#region 鎺т欢闆嗗悎
- FrameLayout bodyView;
+ static ACPage bodyView;
/// <summary>
/// 鍔熻兘鍚嶇О鎸夐挳
/// </summary>
@@ -23,7 +23,7 @@
/// </summary>
Button btnCollection;
/// <summary>
- /// 绐楀笜鑳屾櫙icon
+ /// 绌鸿皟娓╁害鎺у埗鎺т欢
/// </summary>
ArcSeekBar arcBar;
/// <summary>
@@ -46,7 +46,7 @@
/// <summary>
/// 妯″紡鎸夐挳
/// </summary>
- Button btnPattern;
+ Button btnMode;
/// <summary>
/// 椋庝織鎸夐挳
/// </summary>
@@ -55,10 +55,18 @@
/// 鐢垫簮鎸夐挳
/// </summary>
Button btnSwitch;
+ /// <summary>
+ /// 淇敼妯″紡淇℃伅鍖哄煙
+ /// </summary>
+ //FrameLayout modeChangeView;
+ /// <summary>
+ /// 淇敼椋庨�熶俊鎭尯鍩�
+ /// </summary>
+ //FrameLayout fanChangeView;
#endregion
#region 鍖哄煙鍙橀噺
- Function function;
+ AC aC;
Button btnCollection_Out;
Button btnFunctionName_Out;
Button btnFromFloor_Out;
@@ -67,10 +75,10 @@
/// </summary>
Action actionRefresh;
#endregion
- public ACPage(Function func)
+ public ACPage(AC func)
{
bodyView = this;
- function = func;
+ aC = func;
}
public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -99,7 +107,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
- Text = function.name,
+ Text = aC.name,
};
controlView.AddChidren(btnFunctionName);
@@ -112,7 +120,7 @@
TextColor = CSS_Color.PromptingColor1,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = function.GetRoomListName()
+ Text = aC.GetRoomListName()
};
controlView.AddChidren(btnFromFoorAndRoom);
@@ -124,7 +132,7 @@
Height = Application.GetMinRealAverage(40),
SelectedImagePath = "Collection/CollectionIcon.png",
UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
- IsSelected = function.collection
+ IsSelected = aC.collection
};
controlView.AddChidren(btnCollection);
@@ -134,15 +142,15 @@
Y = Application.GetRealHeight(120),
Width = Application.GetRealWidth(280),
Height = Application.GetRealWidth(280),
- Angle = 160,
+ //Angle = 160,
ThumbColor = CSS_Color.AuxiliaryColor1,
ThumbModeFill = true,
- ProgressBarColor = CSS_Color.MainColor,
- ThumbRadius = Application.GetRealWidth(14),
+ ProgressBarColor = aC.on_off == "on"? CSS_Color.MainColor :CSS_Color.PromptingColor2,
+ ThumbRadius = Application.GetRealWidth(12),
ArcWidthWithDefaultStyle = Application.GetRealWidth(12),
MinValue = 16,
MaxValue = 38,
- Progress = 16,
+ Progress = aC.curTemp,
ProgressBarUnitSring = "掳C",
IsClickable = true,
ProgressTextColor = 0x00000000,
@@ -159,7 +167,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = 56,
IsBold = true,
- Text = "20",
+ Text = aC.curTemp.ToString(),
TextAlignment = TextAlignment.Center,
};
controlView.AddChidren(btnTemp);
@@ -210,23 +218,23 @@
};
controlView.AddChidren(btnPlus);
- btnPattern = new Button()
+ btnMode = new Button()
{
- X = Application.GetRealWidth(64),
- Y = Application.GetRealHeight(330),
- Width = Application.GetRealWidth(38),
- Height = Application.GetRealWidth(38),
- UnSelectedImagePath = "FunctionIcon/AC/CoolIcon.png",
+ X = Application.GetRealWidth(60),
+ Y = Application.GetRealHeight(334),
+ Width = Application.GetRealWidth(30),
+ Height = Application.GetRealWidth(30),
+ UnSelectedImagePath = aC.curModeImage,
};
- controlView.AddChidren(btnPattern);
+ controlView.AddChidren(btnMode);
btnWindSpeed = new Button()
{
- X = Application.GetRealWidth(225),
- Y = Application.GetRealHeight(330),
- Width = Application.GetRealWidth(38),
- Height = Application.GetRealWidth(38),
- UnSelectedImagePath = "FunctionIcon/AC/WindHighIcon.png",
+ X = Application.GetRealWidth(235),
+ Y = Application.GetRealHeight(337),
+ Width = Application.GetRealWidth(30),
+ Height = Application.GetRealWidth(30),
+ UnSelectedImagePath = aC.curFanImage,
};
controlView.AddChidren(btnWindSpeed);
@@ -238,13 +246,250 @@
Height = Application.GetRealWidth(40),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
+ IsSelected = aC.on_off == "on"
};
controlView.AddChidren(btnSwitch);
-
LoadEventList();
- new TopViewDiv(bodyView, Language.StringByID(StringId.LocationManagement)).LoadTopView(function, actionRefresh);
+ new TopViewDiv(bodyView, Language.StringByID(StringId.LocationManagement)).LoadTopView(aC, actionRefresh);
}
+ /// <summary>
+ /// 鍔犺浇淇敼妯″紡鍖哄煙
+ /// </summary>
+ void LoadDiv_ChangeModeView()
+ {
+ Dialog dialog = new Dialog();
+
+ FrameLayout dialogView = new FrameLayout()
+ {
+ BackgroundColor = CSS_Color.DialogTransparentColor1,
+ };
+ dialog.AddChidren(dialogView);
+
+ FrameLayout modeChangeView;
+ modeChangeView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(30),
+ Y = Application.GetRealHeight(128),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(287),
+ BackgroundImagePath = "FunctionIcon/AC/DivBg1.png",
+ Animate = Animate.DownToUp,
+ };
+ dialogView.AddChidren(modeChangeView);
+
+ Button btnTitle;
+ btnTitle = new Button()
+ {
+ X = Application.GetRealWidth(8+16),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(44),
+ TextID = StringId.ChooseMode,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
+ };
+ modeChangeView.AddChidren(btnTitle);
+
+ Button btnLine = new Button()
+ {
+ X = btnTitle.X,
+ Y = btnTitle.Bottom,
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = CSS_Color.BackgroundColor,
+ };
+ modeChangeView.AddChidren(btnLine);
+
+ foreach(var m in aC.modeList)
+ {
+ Button btnModeIcon = new Button()
+ {
+ X = btnTitle.X,
+ Y = Application.GetRealHeight(44 * (aC.modeList.IndexOf(m) + 1) + 10 + 8),
+ Width = Application.GetRealWidth(24),
+ Height = Application.GetRealWidth(24),
+ IsSelected = aC.trait_mode.curValues == m,
+ };
+ modeChangeView.AddChidren(btnModeIcon);
+
+ Button btnModeText = new Button()
+ {
+ X = Application.GetRealWidth(12) + btnModeIcon.Right,
+ Y = Application.GetRealHeight(44 * (aC.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 = aC.trait_mode.curValues == m,
+ };
+ modeChangeView.AddChidren(btnModeText);
+
+ switch (m)
+ {
+ case "auto":
+ btnModeIcon.UnSelectedImagePath = "FunctionIcon/AC/AutoIconGray.png";
+ btnModeIcon.SelectedImagePath = "FunctionIcon/AC/AutoIcon.png";
+ btnModeText.TextID = StringId.Auto;
+ break;
+ case "cool":
+ btnModeIcon.UnSelectedImagePath = "FunctionIcon/AC/CoolIconGray.png";
+ btnModeIcon.SelectedImagePath = "FunctionIcon/AC/CoolIcon.png";
+ btnModeText.TextID = StringId.Cool;
+ break;
+ case "heat":
+ btnModeIcon.UnSelectedImagePath = "FunctionIcon/AC/HeatingIconGray.png";
+ btnModeIcon.SelectedImagePath = "FunctionIcon/AC/HeatingIcon.png";
+ btnModeText.TextID = StringId.Heat;
+ break;
+ case "dry":
+ btnModeIcon.UnSelectedImagePath = "FunctionIcon/AC/DehumidificationIconGray.png";
+ btnModeIcon.SelectedImagePath = "FunctionIcon/AC/DehumidificationIcon.png";
+ btnModeText.TextID = StringId.Dry;
+ break;
+ case "fan":
+ btnModeIcon.UnSelectedImagePath = "FunctionIcon/AC/AirSupplyIconGray.png";
+ btnModeIcon.SelectedImagePath = "FunctionIcon/AC/AirSupplyIcon.png";
+ btnModeText.TextID = StringId.AirSupply;
+ break;
+ }
+
+ if(aC.modeList.IndexOf(m) < aC.modeList.Count-1)
+ {
+ modeChangeView.AddChidren(new Button()
+ {
+ X = btnTitle.X,
+ Y = btnModeText.Bottom ,
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = CSS_Color.BackgroundColor,
+ });
+ }
+ LoadEvent_ChangeMode(dialog, dialogView, btnModeIcon, btnModeText,m);
+ }
+
+ dialogView.MouseUpEventHandler = (sender, e) => {
+ dialog.Close();
+ };
+ dialog.Show();
+ }
+ /// <summary>
+ /// 鍔犺浇淇敼妯″紡鍖哄煙
+ /// </summary>
+ void LoadDiv_ChangeFanView()
+ {
+ Dialog dialog = new Dialog();
+
+ FrameLayout dialogView = new FrameLayout()
+ {
+ BackgroundColor = CSS_Color.DialogTransparentColor1,
+ };
+ dialog.AddChidren(dialogView);
+
+ FrameLayout modeChangeView;
+ modeChangeView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(185),
+ Y = Application.GetRealHeight(172),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(243),
+ BackgroundImagePath = "FunctionIcon/AC/DivBg2.png",
+ Animate = Animate.DownToUp,
+ };
+ dialogView.AddChidren(modeChangeView);
+
+ Button btnTitle;
+ btnTitle = new Button()
+ {
+ X = Application.GetRealWidth(8 + 16),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(44),
+ TextID = StringId.ChooseFan,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
+ };
+ modeChangeView.AddChidren(btnTitle);
+
+ Button btnLine = new Button()
+ {
+ X = btnTitle.X,
+ Y = btnTitle.Bottom,
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = CSS_Color.BackgroundColor,
+ };
+ modeChangeView.AddChidren(btnLine);
+
+ foreach (var m in aC.fan_List)
+ {
+ Button btnFanIcon = new Button()
+ {
+ X = btnTitle.X,
+ Y = Application.GetRealHeight(44 * (aC.fan_List.IndexOf(m) + 1) + 10 + 8),
+ Width = Application.GetRealWidth(24),
+ Height = Application.GetRealWidth(24),
+ IsSelected = aC.trait_fan.curValues.ToString() == m,
+ };
+ modeChangeView.AddChidren(btnFanIcon);
+
+ Button btnFanText = new Button()
+ {
+ X = Application.GetRealWidth(12) + btnFanIcon.Right,
+ Y = Application.GetRealHeight(44 * (aC.fan_List.IndexOf(m) + 1) + 8),
+ Height = Application.GetRealHeight(44),
+ Width = Application.GetRealWidth(70),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ SelectedTextColor = CSS_Color.MainColor,
+ IsSelected = aC.trait_fan.curValues.ToString() == m,
+ };
+ modeChangeView.AddChidren(btnFanText);
+
+ switch (m)
+ {
+ case "high":
+ btnFanIcon.UnSelectedImagePath = "FunctionIcon/AC/WindHighIconGray.png";
+ btnFanIcon.SelectedImagePath = "FunctionIcon/AC/WindHighIcon.png";
+ btnFanText.TextID = StringId.HighWindSpeed;
+ break;
+ case "medium":
+ btnFanIcon.UnSelectedImagePath = "FunctionIcon/AC/WindMediumIconGray.png";
+ btnFanIcon.SelectedImagePath = "FunctionIcon/AC/WindMediumIcon.png";
+ btnFanText.TextID = StringId.MiddleWindSpeed;
+ break;
+ case "low":
+ btnFanIcon.UnSelectedImagePath = "FunctionIcon/AC/WindLowIconGray.png";
+ btnFanIcon.SelectedImagePath = "FunctionIcon/AC/WindLowIcon.png";
+ btnFanText.TextID = StringId.LowWindSpeed;
+ break;
+ case "auto":
+ btnFanIcon.UnSelectedImagePath = "FunctionIcon/AC/AutoIconGray.png";
+ btnFanIcon.SelectedImagePath = "FunctionIcon/AC/AutoIcon.png";
+ btnFanText.TextID = StringId.Auto;
+ break;
+ }
+
+ if (aC.modeList.IndexOf(m) < aC.modeList.Count - 1)
+ {
+ modeChangeView.AddChidren(new Button()
+ {
+ X = btnTitle.X,
+ Y = btnFanText.Bottom,
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = CSS_Color.BackgroundColor,
+ });
+ }
+ LoadEvent_ChangeFan(dialog, dialogView, btnFanIcon, btnFanText,m);
+ }
+
+ dialog.Show();
+ }
+
}
}
--
Gitblit v1.8.0