From b8e94316e41eba72d927d5ca7d931b26139ee8ff Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 15 六月 2020 09:12:53 +0800 Subject: [PATCH] 20200612 --- HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs | 61 ++++++++++++++++++++++-------- 1 files changed, 44 insertions(+), 17 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs index aa90d95..2aad4ab 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs @@ -19,8 +19,29 @@ /// 鎴块棿閫夋嫨涓嬫媺鍥炬爣 /// </summary> Button btnFoorDownIcon; + + /// <summary> + /// 澶╂皵鍚嶇О鏂囨湰 + /// </summary> + Button btnWatherText; + /// <summary> + /// 婀垮害鏁版嵁鏂囨湰 + /// </summary> + Button btnHumidityText; + /// <summary> + /// pm25鏁版嵁鏂囨湰 + /// </summary> + Button btnPm25Values; + /// <summary> + /// 椋庨�熸暟鎹枃鏈� + /// </summary> + Button btnFanSpeedValues; + #endregion #region 鍖哄煙鍙橀噺 + List<System.Threading.Thread> threads = new List<System.Threading.Thread>(); + + uint level1Color = 0xFF2172FF; uint level2Color = 0xCC4484F4; uint level3Color = 0x664484F4; @@ -37,6 +58,16 @@ public EnvironmentalSciencePage() { bodyView = this; + } + + public override void RemoveFromParent() + { + foreach(var thread in threads) + { + thread.Abort(); + } + threads.Clear(); + base.RemoveFromParent(); } /// <summary> @@ -70,8 +101,7 @@ IsBold = true, TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.MainBackgroundColor, - - Text = "28", + Text = MainPage.cityInfo.temperature, }; topWeatherView.AddChidren(btnTemp); @@ -96,8 +126,9 @@ UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/SmogIcon.png", }; topWeatherView.AddChidren(btnWeatherIcon); + LoadEvent_ChangeWeatherIcon(btnWeatherIcon); - var btnWatherText = new Button() + btnWatherText = new Button() { X = Application.GetRealWidth(139), Y = Application.GetRealHeight(16), @@ -106,10 +137,9 @@ TextColor = CSS_Color.MainBackgroundColor, TextSize = CSS_FontSize.TextFontSize, TextAlignment = TextAlignment.CenterLeft, - Text = "闆鹃溇" + Text = MainPage.cityInfo.weather }; topWeatherView.AddChidren(btnWatherText); - var btnTempUpperLimit = new Button() { @@ -159,8 +189,6 @@ }; topWeatherView.AddChidren(btnTempLowerLimitText); - - var btnLocationText = new Button() { X = Application.GetRealWidth(233), @@ -170,7 +198,7 @@ TextAlignment = TextAlignment.CenterRight, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextColor = CSS_Color.MainBackgroundColor, - Text = "骞垮窞", + Text = MainPage.cityInfo.location, }; topWeatherView.AddChidren(btnLocationText); @@ -194,7 +222,7 @@ }; topWeatherView.AddChidren(btnHumidityIcon); - Button btnHumidityText = new Button() + btnHumidityText = new Button() { X = Application.GetRealWidth(15), Y = btnHumidityIcon.Bottom, @@ -203,7 +231,7 @@ TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.Center, TextColor = CSS_Color.MainBackgroundColor, - Text = "--%", + Text = MainPage.cityInfo.humidity + "%", }; topWeatherView.AddChidren(btnHumidityText); @@ -217,7 +245,7 @@ }; topWeatherView.AddChidren(btnPm25Icon); - Button btnPm25Values = new Button() + btnPm25Values = new Button() { X = Application.GetRealWidth(90), Y = btnHumidityIcon.Bottom, @@ -226,7 +254,7 @@ TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.Center, TextColor = CSS_Color.MainBackgroundColor, - Text = "--", + Text = MainPage.cityInfo.pm25, }; topWeatherView.AddChidren(btnPm25Values); @@ -240,7 +268,7 @@ }; topWeatherView.AddChidren(btnFanSpeedIcon); - Button btnFanSpeedValues = new Button() + btnFanSpeedValues = new Button() { X = Application.GetRealWidth(162), Y = btnFanSpeedIcon.Bottom, @@ -249,7 +277,7 @@ TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.Center, TextColor = CSS_Color.MainBackgroundColor, - Text = "--", + Text = MainPage.cityInfo.windLevel, }; topWeatherView.AddChidren(btnFanSpeedValues); #endregion @@ -310,7 +338,6 @@ }; contentView.AddChidren(sensorListView); - int index = 0; foreach(var sensor in DB_ResidenceData.residenceData.functionList.sensorsEnvironmentalScience) { @@ -330,7 +357,7 @@ BackgroundColor = CSS_Color.MainBackgroundColor, Y = Application.GetRealWidth(92 * (index / 2)) }; - if(index%2!=0) + if (index % 2 != 0) { sensorView.X = Application.GetRealWidth(160); } @@ -343,7 +370,7 @@ Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth(48), Height = Application.GetRealWidth(48), - Angle = 1, + OpenAngle = 1, ThumbColor = 0x00000000, ThumbModeFill = true, ProgressBarColor = sensor.levelColorList[sensor.curLevel - 1], -- Gitblit v1.8.0