wxr
2022-12-07 03d8399009aacc15efde15f08e37893e47dc2427
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -488,8 +488,33 @@
        /// </summary>
        void LoadInfo(Function sensor)
        {
            var levelColorList = sensorTemp.GetLevelColorList(sensor.spk);
            var levelTextList = sensorTemp.GetLevelTextList(sensor.spk);
            List<uint> levelColorList = new List<uint>();
            List<int> levelTextList = new List<int>();
            List<string> levelText = new List<string>();
            var configs = sensor.GetAttrKeyConfigs(sensor.SpkClassification);
            int i = 0;
            foreach(var info in configs)
            {
                foreach(var config in info.configs)
                {
                    var color = Convert.ToUInt32(config.color,16);
                    var text = config.desc;
                    levelColorList.Add(color);
                    levelText.Add(text);
                    levelTextList.Add(i++);
                }
            }
            if (levelColorList.Count == 0)
            {
                levelColorList = sensorTemp.GetLevelColorList(sensor.spk);
                levelTextList = sensorTemp.GetLevelTextList(sensor.spk);
                foreach(var iii in levelTextList)
                {
                    levelText.Add(Language.StringByID(iii));
                }
            }
            Dialog dialog = new Dialog();
            FrameLayout dialogBodyView = new FrameLayout();
@@ -582,7 +607,7 @@
                IsBold = true,
                TextID = StringId.ColorValue,
            });
            for (int index = 0; index < levelTextList.Count; index++)
            for (int index = 0; index < levelText.Count; index++)
            {
                infoView.AddChidren(new Button()
                {
@@ -617,7 +642,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                    IsBold = true,
                    TextID = levelTextList[index]
                    Text = levelText[index]
                });
                subInfoView.AddChidren(new Button()