From f6fd8acd7c53c44187e70b4709443318a628f4b5 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 16 六月 2020 13:12:33 +0800
Subject: [PATCH] 2020-06-016

---
 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs |   53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs
index a3a3be3..86d16e0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs
@@ -1,4 +1,6 @@
 锘縰sing System;
+using HDL_ON.Entity;
+using Shared;
 namespace HDL_ON.UI
 {
     public partial class EnvironmentalSciencePage
@@ -9,7 +11,56 @@
 
         }
 
-        void LoadEvent_ChangeWeatherIcon(Shared.Button btnWeatherIcon)
+       public static void LoadEvent_UpdataStatus(Sensor sensor)
+        {
+            Application.RunOnMainThread(() =>{
+                if (bodyView != null)
+                {
+                    for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++)
+                    {
+                        var sensorTag = sensor.sid;
+                        if (sensor.bus_Data != null)
+                        {
+                            sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus_Data.SubnetID + "_" + sensor.bus_Data.DeviceID + "_" + sensor.bus_Data.LoopID;
+                        }
+                        var view = bodyView.sensorListView.GetChildren(i);
+                        if (view.GetType() == typeof(FrameLayout))
+                        {
+                            if(view.Tag.ToString() != sensorTag)
+                            {
+                                continue;
+                            }
+                            for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++)
+                            {
+                                var btn = (view as FrameLayout).GetChildren(j);
+                                if (btn.GetType() == typeof(Button))
+                                {
+                                    if (btn.Tag!=null)
+                                    {
+                                        var tag = btn.Tag.ToString();
+                                        if (tag == "SensorValues")
+                                        {
+                                            (btn as Button).Text = sensor.values.ToString();
+                                        }
+                                        else if (tag == "SensorLevel")
+                                        {
+                                            (btn as Button).TextID = sensor.levelTextList[sensor.curLevel - 1];
+                                        }
+                                    }
+                                }
+                                else if (btn.GetType() == typeof(ArcSeekBar))
+                                {
+                                    (btn as ArcSeekBar).ProgressBarColor = sensor.levelColorList[sensor.curLevel - 1];
+                                    (btn as ArcSeekBar).Progress = (96 / sensor.levelColorList.Count) * sensor.curLevel;
+                                }
+                            }
+                        }
+                    }
+                }
+            });
+        }
+
+        void LoadEvent_ChangeWeatherIcon(Button btnWeatherIcon)
         {
 
             switch (MainPage.cityInfo.weather)

--
Gitblit v1.8.0