wjc
2023-03-30 cae4d4b5b508a666fbd0dff3c2a981fdff841bc8
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}");
            }