From 03d8399009aacc15efde15f08e37893e47dc2427 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 07 十二月 2022 10:45:20 +0800
Subject: [PATCH] 大华摄像头,金茂科技系统

---
 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
index ea27379..6c33b71 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
+++ b/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()

--
Gitblit v1.8.0