From 270b3d8539f6b4a991a9ebf3b3a9eceb436d61d5 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 28 十月 2021 17:08:02 +0800 Subject: [PATCH] 自动化地址问题修复 --- HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs | 127 ++++++++++++++++++++++++++--------------- 1 files changed, 80 insertions(+), 47 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs index 36d4ec5..7eacd06 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs @@ -2,6 +2,7 @@ using Shared; using HDL_ON.Entity; using HDL_ON.UI.CSS; +using System.Collections.Generic; namespace HDL_ON.UI { @@ -23,9 +24,9 @@ /// </summary> Button btnCollection; /// <summary> - /// 绌鸿皟娓╁害鎺у埗鎺т欢 + /// 娓╁害鎺у埗鎺т欢 /// </summary> - ArcSeekBar arcBar; + DiyArcSeekBar arcBar; /// <summary> /// 鍑忓彿鎸夐挳 /// </summary> @@ -62,7 +63,8 @@ #endregion #region 鍖哄煙鍙橀噺 - FloorHeating fh; + FloorHeating fhTemp = new FloorHeating(); + Function function; Button btnCollection_Out; Button btnFunctionName_Out; Button btnFromFloor_Out; @@ -71,10 +73,18 @@ /// </summary> Action actionRefresh; #endregion - public FloorHeatingPage(FloorHeating func) + + + /// <summary> + /// app鑷繁鎺у埗鐨勬俯搴︽暟鍊艰褰� + /// </summary> + List<string> seltControlTemp = new List<string>(); + + + public FloorHeatingPage(Function func) { bodyView = this; - fh = func; + function = func; } public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) @@ -103,7 +113,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, - Text = fh.name, + Text = function.name, }; controlView.AddChidren(btnFunctionName); @@ -116,7 +126,7 @@ TextColor = CSS_Color.PromptingColor1, TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = fh.GetRoomListName() + Text = function.GetRoomListName() }; controlView.AddChidren(btnFromFoorAndRoom); @@ -128,42 +138,58 @@ Height = Application.GetMinRealAverage(40), SelectedImagePath = "Collection/CollectionIcon.png", UnSelectedImagePath = "Collection/CollectionGrayIcon.png", - IsSelected = fh.collection + IsSelected = function.collect }; controlView.AddChidren(btnCollection); + //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳� + //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) + //{ + // controlView.AddChidren(btnCollection); + //} - arcBar = new ArcSeekBar() + + var minValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min; + var maxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max; + var progress = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); + + arcBar = new DiyArcSeekBar() { Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(120), - Width = Application.GetRealWidth(280), - Height = Application.GetRealWidth(280), OpenAngle = 160, - ThumbColor = CSS_Color.AuxiliaryColor1, - ThumbModeFill = true, - ProgressBarColor = fh.on_off == "on" ? CSS_Color.MainColor : CSS_Color.PromptingColor2, - ThumbRadius = Application.GetRealWidth(12), - ArcWidthWithDefaultStyle = Application.GetRealWidth(12), - MinValue = 5, - MaxValue = 35, - Progress = fh.curTemp, - ProgressBarUnitSring = "掳C", - IsClickable = true, - ProgressTextColor = 0x00000000, + ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png", + ThumbImageHeight = Application.GetRealWidth(50), + ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04, + OfflineProgressBarColor = CSS_Color.PromptingColor2, + IsOffline = function.trait_on_off.curValue.ToString() == "off", + MinValue = minValue,//function.GetAttribute(FunctionAttributeKey.SetTemp).min, + MaxValue = maxValue,// function.GetAttribute(FunctionAttributeKey.SetTemp).max, ArcColor = CSS_Color.BackgroundColor, + Progress = progress, +#if __IOS__ + Y = Application.GetRealHeight(120+25), + Width = Application.GetRealWidth(260-40), + Height = Application.GetRealWidth(260-40), + SeekBarPadding = Application.GetRealWidth(8), +#else + Y = Application.GetRealHeight(120 + 40), + Width = Application.GetRealWidth(260 - 40), + Height = Application.GetRealWidth(260 - 40), + SeekBarPadding = Application.GetRealWidth(7), +#endif + }; controlView.AddChidren(arcBar); btnTemp = new Button() { Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(206), - Width = Application.GetRealWidth(71), + Y = Application.GetRealHeight(200), + Width = Application.GetRealWidth(80), Height = Application.GetRealWidth(60), TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 56, IsBold = true, - Text = fh.curTemp.ToString(), + Text = progress.ToString(), TextAlignment = TextAlignment.Center, }; controlView.AddChidren(btnTemp); @@ -173,19 +199,19 @@ X = btnTemp.Right, Y = btnTemp.Y, Width = Application.GetRealWidth(30), - Height = Application.GetRealWidth(20), + Height = Application.GetRealWidth(25), TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, IsBold = true, TextAlignment = TextAlignment.CenterLeft, - Text = "掳C", + Text = fhTemp.GetTempUnitString(function) }; controlView.AddChidren(btnTempUint); btnIndoorTemp = new Button() { Gravity = Gravity.CenterHorizontal, - Y = btnTemp.Bottom, + Y = btnTemp.Bottom+ Application.GetRealWidth(10), Width = Application.GetRealWidth(100), Height = Application.GetRealHeight(20), Text = Language.StringByID(StringId.IndoorTemp) + "20掳C", @@ -209,7 +235,7 @@ X = Application.GetRealWidth(275), Y = Application.GetRealHeight(263), Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), UnSelectedImagePath = "Public/PlusSignIcon.png", }; controlView.AddChidren(btnPlus); @@ -220,24 +246,32 @@ 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); + if (function.GetAttribute(FunctionAttributeKey.Mode)!=null) + { + 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.on_off == "on" + IsSelected = function.trait_on_off.curValue.ToString() == "on" }; controlView.AddChidren(btnSwitch); LoadEventList(); - new TopViewDiv(bodyView, Language.StringByID(StringId.LocationManagement)).LoadTopView(fh, actionRefresh); + new TopViewDiv(bodyView, Language.StringByID(StringId.FloorHeating)).LoadTopView_FunctionTop(function, actionRefresh); + new System.Threading.Thread(() => + { + DriverLayer.Control.Ins.SendReadCommand(function); + }) + { IsBackground = true }.Start(); } /// <summary> /// 鍔犺浇淇敼妯″紡鍖哄煙 @@ -260,8 +294,6 @@ Width = Application.GetRealWidth(160), Height = Application.GetRealHeight(287), BackgroundImagePath = "FunctionIcon/AC/DivBg1.png", - AnimateSpeed = 0.3f, - Animate = Animate.DownToUp, }; dialogView.AddChidren(modeChangeView); @@ -289,28 +321,29 @@ }; modeChangeView.AddChidren(btnLine); - foreach (var m in fh.modeList) + var modeList = function.GetAttribute(FunctionAttributeKey.Mode).value; + foreach (var m in modeList) { Button btnModeIcon = new Button() { X = btnTitle.X, - Y = Application.GetRealHeight(44 * (fh.modeList.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.curMode == 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.modeList.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.curMode == m, + IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m, }; modeChangeView.AddChidren(btnModeText); @@ -336,14 +369,14 @@ btnModeIcon.UnSelectedImagePath = "FunctionIcon/AC/AutoIconGray.png"; btnModeText.TextID = StringId.Auto; break; - case "ordinary": + case "normal": btnModeIcon.SelectedImagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png"; btnModeIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/OrdinaryIconGray.png"; - btnModeText.TextID = StringId.Ordinary; + btnModeText.TextID = StringId.Normal; break; } - if (fh.modeList.IndexOf(m) < fh.modeList.Count - 1) + if (modeList.IndexOf(m) < modeList.Count - 1) { modeChangeView.AddChidren(new Button() { -- Gitblit v1.8.0