From 592974441a4df95fffd9167c90192da1a390b1c2 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 06 六月 2023 11:51:12 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' --- HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index 987ec8e..0c52ed6 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -289,7 +289,7 @@ deviceId = enviTemp.deviceId, attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = humiAttr.state, curValue = humiAttr.curValue } }, }; - humiSensorList.Add(newTemp); + humiSensorList.Add(newTemp);//020103CF594C3E00051F0001051F// 1650546588519424001 } var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "temperature"); if (tempAttr != null) @@ -301,7 +301,7 @@ deviceId = enviTemp.deviceId, attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } }, }; - tempSensorList.Add(newTemp); + tempSensorList.Add(newTemp);//020103CF594C3E00051F0001051F } } @@ -359,7 +359,10 @@ foreach (var temp in tempSensorList) { double tempValue = 0; - double.TryParse(temp.GetAttrState("temperature"), out tempValue); + if (temp.GetAttribute("temperature") != null) + double.TryParse(temp.GetAttrState("temperature"), out tempValue); + else + double.TryParse(temp.GetAttrState("value"), out tempValue); if (tempValue > 0) { tempTotalValues += tempValue; @@ -413,7 +416,10 @@ foreach (var humi in humiSensorList) { double humiValue = 0; - double.TryParse(humi.GetAttrState("humidity"), out humiValue); + if (humi.GetAttribute("temperature") != null) + double.TryParse(humi.GetAttrState("humidity"), out humiValue); + else + double.TryParse(humi.GetAttrState("value"), out humiValue); if (humiValue > 0) { humiTotalValues += humiValue; @@ -449,7 +455,8 @@ }; btnPm25Values.Width = btnPm25Values.GetTextWidth(); environmentalView.AddChidren(btnPm25Values); -#endregion + #endregion + btnSecurityStatus = new Button() { @@ -598,9 +605,9 @@ TextAlignment = TextAlignment.Center, }; changeView.AddChidren(btnChangeScene); -#endregion + #endregion -#region ContextView + #region ContextView contentView = new PageLayout() { //Y = changeView.Bottom, @@ -613,7 +620,7 @@ LoadContentView(); -#endregion + #endregion } catch (Exception ex) { @@ -627,6 +634,7 @@ /// </summary> void LoadContentView() { + if (!Common.ApiUtlis.Ins.DownloadDataComplete && !MainPage.NoLoginMode) { var waitPage = new Loading(); -- Gitblit v1.8.0