From d4ff2cb026bfa348c62651c0547511eede9f94f3 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期三, 21 七月 2021 13:45:50 +0800
Subject: [PATCH] Merge branch 'wxr7-ez' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into wxr7-ez

---
 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs |   55 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
index f2c2ae5..5adc74f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
@@ -595,18 +595,18 @@
             };
             selfInfoView.AddChidren(btnSeltSensorValue);
 
-            Button btnShowData;
-            btnShowData = new Button()
-            {
-                X = Application.GetRealWidth(291),
-                Y = Application.GetRealWidth(62),
-                Width = Application.GetMinRealAverage(32),
-                Height = Application.GetMinRealAverage(32),
-                UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png",
-                SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png",
-                IsSelected = true,
-            };
-            selfInfoView.AddChidren(btnShowData);
+            //Button btnShowData;
+            //btnShowData = new Button()
+            //{
+            //    X = Application.GetRealWidth(291),
+            //    Y = Application.GetRealWidth(62),
+            //    Width = Application.GetMinRealAverage(32),
+            //    Height = Application.GetMinRealAverage(32),
+            //    UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png",
+            //    SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png",
+            //    IsSelected = true,
+            //};
+            //selfInfoView.AddChidren(btnShowData);
             //btnShowData.MouseUpEventHandler = (sender, e) => {
             //    btnShowData.IsSelected = !btnShowData.IsSelected;
             //    if(btnShowData.IsSelected)
@@ -644,7 +644,9 @@
 
             bool initTitleButton = true;
 
-            foreach (var tempSensor in FunctionList.List.GetEnvirSensorsList())
+            var tempList = FunctionList.List.GetEnvirSensorsList();
+
+            foreach (var tempSensor in tempList)
             {
                 if (tempSensor.sid == function.sid)
                 {
@@ -675,7 +677,7 @@
                 #region 鍏跺畠浼犳劅鍣ㄤ俊鎭爮
                 FrameLayout otherInfoView = new FrameLayout()
                 {
-                    Gravity = Gravity.CenterVertical,
+                    Gravity = Gravity.CenterHorizontal,
                     Width = Application.GetRealWidth(343),
                     Height = Application.GetRealWidth(100),
                     BackgroundColor = CSS_Color.MainBackgroundColor,
@@ -739,7 +741,11 @@
                 {
                     Action backAction = () =>
                     {
-                        btnSeltSensorName.Text = tempSensor.name;
+                        MainPage.Log("45678i");
+                        Application.RunOnMainThread(() =>
+                        {
+                            btnSeltSensorName.Text = tempSensor.name;
+                        });
                     };
                     var infoView = new FunctionBaseInfoSetPage(tempSensor, backAction);
                     MainPage.BasePageView.AddChidren(infoView);
@@ -774,21 +780,26 @@
                     btnShowData1.IsSelected = !btnShowData1.IsSelected;
                     if (btnShowData1.IsSelected)
                     {
-                        if (!showFunctions.Contains(function))
+                        if (!showFunctions.Contains(tempSensor))
                         {
-                            showFunctions.Add(function);
+                            showFunctions.Add(tempSensor);
                         }
                     }
                     else
                     {
-                        if (showFunctions.Contains(function))
+                        if (showFunctions.Contains(tempSensor))
                         {
-                            showFunctions.Remove(function);
+                            showFunctions.Remove(tempSensor);
                         }
                     }
                     LoadMothed_GetSensorHistoryData();
                 };
                 #endregion
+
+                contentView.AddChidren(new Button()
+                {
+                    Height = Application.GetRealHeight(12),
+                });
 
             }
             #endregion
@@ -826,7 +837,7 @@
 
                     string yDataString = "";
 
-                    foreach (var sr in FunctionList.List.GetEnvirSensorsList())
+                    foreach (var sr in showFunctions)
                     {
                         if (sr.spk != function.spk)
                         {
@@ -839,7 +850,9 @@
                         }
 
                         var sensorType = sr.spk.Split(".")[1];
-                        var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId,"value");
+                        var queryType = sr.GetAttrState("spk")==null? "value": sr.GetAttrState("spk");
+
+                        var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, queryType);
                         if (revertObj != null)
                         {
                             if (revertObj.Code == StateCode.SUCCESS)

--
Gitblit v1.8.0