From bfb3d0d4879dca8c59ff287c92f5113162f3a33a Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期二, 27 八月 2024 15:22:48 +0800 Subject: [PATCH] 代码备份 --- OnPro/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 116 ++++++++++++++++++++-------------------------------------- 1 files changed, 40 insertions(+), 76 deletions(-) diff --git a/OnPro/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/OnPro/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index af02b12..dad4771 100644 --- a/OnPro/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/OnPro/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -80,12 +80,14 @@ public void LoadPage() { + //MainPage.BaseTopButton.BackgroundColor = 0xFFF7F7F7; MainPage.CurPageIndex = 1; - bodyView.BackgroundColor = CSS_Color.BackgroundColor; + bodyView.BackgroundColor = CSS_Color.TopViewColor; #region top FrameLayout topView = new FrameLayout() { - Height = Application.GetRealHeight(64), + Y = Application.GetRealHeight(10), + Height = Application.GetRealHeight(74), BackgroundColor = CSS_Color.TopViewColor, }; bodyView.AddChidren(topView); @@ -100,7 +102,8 @@ TextColor = CSS_Color.PromptingColor1, SelectedTextColor = CSS_Color.MainColor, TextID = StringId.Rooms, - IsSelected = true + IsSelected = true, + IsBold = true, }; topView.AddChidren(btnRoomTilte); @@ -121,8 +124,8 @@ contentPageView = new PageLayout() { - Y = Application.GetRealHeight(64), - Height = Application.GetRealHeight(667 - 64 - 49 + 30), + Y = Application.GetRealHeight(74), + Height = Application.GetRealHeight(667 - 64 - 49 + 30 - 10), BackgroundColor = CSS_Color.MainBackgroundColor, IsShowPoint = false }; @@ -357,6 +360,13 @@ //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶 ImageUtlis.Current.LoadLocalOrNetworkImages(room.backgroundImage, roomViewbg); + + var btnRoomNameBg = new Button { + Height = Application.GetRealHeight(45), + BackgroundColor = 0x44000000, + }; + roomView.AddChidren(btnRoomNameBg); + btnRoomNameBg.SetCornerWithSameRadius((uint)Application.GetRealWidth(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); var btnFloorAndRoomName = new Button() { @@ -749,9 +759,9 @@ TextAlignment = TextAlignment.CenterLeft, IsMoreLines = true, }; - functionView.AddChidren(btnName); + functionView.AddChidren(btnName); - if (item != ShowFunction.FreshAir && functionCount != 0) + if (functionCount != 0) { Button btnFunctionCount = new Button() { @@ -764,6 +774,22 @@ TextAlignment = TextAlignment.CenterLeft, Text = "/" + functionCount, }; + functionView.AddChidren(btnFunctionCount); + + Button btnOpenCount = new Button() + { + X = Application.GetRealWidth(16), + Y = btnName.Bottom, + Width = Application.GetRealWidth(14 * functionCount.ToString().Length), + Height = Application.GetRealHeight(24), + TextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextAlignment = TextAlignment.CenterLeft, + Text = functionOnCount.ToString(), + Tag = item + "_onCount", + BorderWidth = 0, + }; + functionView.AddChidren(btnOpenCount); } @@ -905,7 +931,13 @@ break; } - + + btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { + var skipView = new FunctionPage(); + MainPage.BasePageView.AddChidren(skipView); + skipView.LoadPage(functionPageTitleId); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; index++; } @@ -916,74 +948,6 @@ } - - void refreshInverterInfo(Button btnPowerTenerationToday, Button btnWorkingMode, Button btnCurrentPowerGeneration) - { - new System.Threading.Thread(() => - { - var http = new HttpServerRequest(); - var pack = http.GetInverterStatisticsInfo(); - if (pack != null) - { - if(pack.Data == null) - { - return; - } - var info = JsonConvert.DeserializeObject<StatisticsInfo>(pack.Data?.ToString()); - if (info == null) - { - return; - } - try - { - Application.RunOnMainThread(() => - { - btnPowerTenerationToday.Text = info.totalElectricityPvToday + "kW路h";// Language.StringByID(StringId.PowerTenerationToday).Replace("----", info.totalElectricityPvToday); - string workModeString = ""; - if (Language.CurrentLanguage == "Chinese") { - switch (info.workMode) - { - case "self_use": - workModeString = "鑷彂鑷敤"; - break; - case "peak_load_shifting": - workModeString = "鍓婂嘲濉胺"; - break; - case "battery_priority": - workModeString = "鐢垫睜浼樺厛"; - break; - } - } - else - { - switch (info.workMode) - { - case "self_use": - workModeString = "Self Consume"; - break; - case "peak_load_shifting": - workModeString = "Peak Shift"; - break; - case "battery_priority": - workModeString = "Battery Priority"; - break; - } - } - btnWorkingMode.Text = workModeString;// Language.StringByID(StringId.WorkingMode).Replace("----", workModeString); - btnCurrentPowerGeneration.Text = info.powerPvNow + "w";// Language.StringByID(StringId.CurrentPowerGeneration).Replace("----", info.powerPvNow); - //btnBatterySOC.Text = Language.StringByID(StringId.BatterySOC).Replace("--", info.batterySoc); - }); - } - catch (Exception ex) - { - MainPage.Log($"鑾峰彇瀹跺涵鍏変紡缁熻鏁版嵁寮傚父锛歿ex.Message}"); - } - } - - - }) - { IsBackground = true }.Start(); - } #region 鍒囨崲妤煎眰 /// <summary> -- Gitblit v1.8.0