From cae4d4b5b508a666fbd0dff3c2a981fdff841bc8 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 30 三月 2023 13:10:33 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' into wjc --- HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs | 99 ++++++++++++++++++++++++++++--------------------- 1 files changed, 56 insertions(+), 43 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs index a49c750..147501a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs @@ -495,6 +495,7 @@ List<uint> levelColorList = new List<uint>(); List<int> levelTextList = new List<int>(); List<string> levelText = new List<string>(); + List<string> intervalList = new List<string>(); var configs = sensor.GetAttrKeyConfigs(sensor.SpkClassification); @@ -514,7 +515,9 @@ { levelColorList = sensorTemp.GetLevelColorList(sensor.spk); levelTextList = sensorTemp.GetLevelTextList(sensor.spk); - foreach(var iii in levelTextList) + intervalList = sensorTemp.GetIntervalValue(sensor.spk); + + foreach (var iii in levelTextList) { levelText.Add(Language.StringByID(iii)); } @@ -611,55 +614,65 @@ IsBold = true, TextID = StringId.ColorValue, }); - for (int index = 0; index < levelText.Count; index++) + try { - infoView.AddChidren(new Button() + for (int index = 0; index < levelText.Count; index++) { - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(303), - Height = Application.GetRealWidth(1), - BackgroundColor = CSS_Color.DividingLineColor, - }); + //if(sensorTemp.GetIntervalValue(sensor.spk).Count >= index) + //{ + // return; + //} + infoView.AddChidren(new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(303), + Height = Application.GetRealWidth(1), + BackgroundColor = CSS_Color.DividingLineColor, + }); - FrameLayout subInfoView = new FrameLayout() - { - Height = Application.GetRealHeight(44), - }; - infoView.AddChidren(subInfoView); + FrameLayout subInfoView = new FrameLayout() + { + Height = Application.GetRealHeight(44), + }; + infoView.AddChidren(subInfoView); - subInfoView.AddChidren(new Button() - { - X = Application.GetRealWidth(20), - Width = Application.GetRealWidth(100), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - IsBold = true, - Text = sensorTemp.GetIntervalValue(sensor.spk)[index] - }); + subInfoView.AddChidren(new Button() + { + X = Application.GetRealWidth(20), + Width = Application.GetRealWidth(100), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + IsBold = true, + Text = sensorTemp.GetIntervalValue(sensor.spk)[index] + }); - subInfoView.AddChidren(new Button() - { - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(100), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - IsBold = true, - Text = levelText[index] - }); + subInfoView.AddChidren(new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(100), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + IsBold = true, + Text = levelText[index] + }); - subInfoView.AddChidren(new Button() - { - X = Application.GetRealWidth(285), - Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(38), - Height = Application.GetRealHeight(18), - Radius = (uint)Application.GetRealWidth(4), - BackgroundColor = levelColorList[index] - }); + subInfoView.AddChidren(new Button() + { + X = Application.GetRealWidth(285), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(38), + Height = Application.GetRealHeight(18), + Radius = (uint)Application.GetRealWidth(4), + BackgroundColor = levelColorList[index] + }); + } } - + catch (Exception ex) + { + MainPage.Log($"鐜绛夌骇淇℃伅琛ㄥ姞杞藉紓甯�:{ex.Message}"); + } -- Gitblit v1.8.0