From 32a8370517ce75caac836edc82f62614d5f9b187 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 23 十一月 2022 10:19:31 +0800
Subject: [PATCH] 科技系统优化、大华摄像头功能

---
 HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs |  102 +++++++++++++++++++++++++-------------------------
 1 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs
index 0887152..dd2b028 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs
@@ -18,6 +18,7 @@
 
         VerticalScrolViewLayout contentView;
 
+        string helloText = "涓婂崍濂�";
 
         #region 澶╂皵鎺т欢
         Button btnOutdoorTemp;
@@ -65,8 +66,45 @@
         public AcstParentPage()
         {
             basePage = this;
+            var curTime = DateTime.Now;
+            if (Language.CurrentLanguage != "Chinese")
+            {
+                helloText = "Good morning";
+            }
+            if (curTime.Hour >= 8 && curTime.Hour < 12)
+            {
+                helloText = "涓婂崍濂�";
+                if (Language.CurrentLanguage != "Chinese")
+                {
+                    helloText = "Good morning";
+                }
+                curColor = CSS.CSS_Color.MainColor;
+                imageFolder = "blue";
+            }
+            else if (curTime.Hour >= 12 && curTime.Hour < 18)
+            {
+                helloText = "涓嬪崍濂�";
+                if (Language.CurrentLanguage != "Chinese")
+                {
+                    helloText = "Good afternoon";
+                }
+                curColor = 0xFFE7914F;
+                imageFolder = "orange";
+            }
+            else
+            {
+                helloText = "鏅氫笂濂�";
+                if (Language.CurrentLanguage != "Chinese")
+                {
+                    helloText = "Good evening";
+                }
+
+                curColor = 0xFF9175F3;
+                imageFolder = "purple";
+            }
             this.function = FunctionList.List.GetAcstParentList()[0];
             this.BackgroundColor = CSS.CSS_Color.BackgroundColor;
+            this.AddChidren(new Button() { Height = Application.GetRealHeight(50), BackgroundColor = curColor });
             contentView = new VerticalScrolViewLayout() {
                 Height = Application.GetRealHeight(667 - 56),
             };
@@ -205,44 +243,6 @@
 
         public void LoadPage()
         {
-            var curTime = DateTime.Now;
-            string helloText = "涓婂崍濂�"; 
-            if (Language.CurrentLanguage != "Chinese")
-            {
-                helloText = "Good morning";
-            }
-            if (curTime.Hour >= 8 && curTime.Hour < 12)
-            {
-                helloText = "涓婂崍濂�";
-                if (Language.CurrentLanguage != "Chinese")
-                {
-                    helloText = "Good morning";
-                }
-                curColor = CSS.CSS_Color.MainColor;
-                imageFolder = "blue";
-            }
-            else if (curTime.Hour >= 12 && curTime.Hour < 18)
-            {
-                helloText = "涓嬪崍濂�";
-                if (Language.CurrentLanguage != "Chinese")
-                {
-                    helloText = "Good afternoon";
-                }
-                curColor = 0xFFE7914F;
-                imageFolder = "orange";
-            }
-            else
-            {
-                helloText = "鏅氫笂濂�";
-                if (Language.CurrentLanguage != "Chinese")
-                {
-                    helloText = "Good evening";
-                }
-                
-                curColor = 0xFF9175F3;
-                imageFolder = "purple";
-            }
-
             #region 澶撮儴淇℃伅鍖哄煙
             FrameLayout topView = new FrameLayout()
             {
@@ -464,7 +464,7 @@
                     {
                         tempValues = tempValues.Remove(tempValues.IndexOf('.'), tempValues.Length - tempValues.IndexOf('.'));
                     }
-                    sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempValues, "掳", Language.StringByID(StringId.Temp));
+                    sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempValues, "掳","", Language.StringByID(StringId.Temp));
                 }
                 if (humiObj != null)
                 {
@@ -473,19 +473,19 @@
                     {
                         humiValues = humiValues.Remove(humiValues.IndexOf('.'), humiValues.Length - humiValues.IndexOf('.'));
                     }
-                    sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiValues , "%", Language.StringByID(StringId.Humidity));
+                    sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiValues , "%", "", Language.StringByID(StringId.Humidity));
                 }
                 if (pm25Obj != null)
                 {
-                    sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "", "PM2.5");
+                    sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "", "", "PM2.5");
                 }
                 if (co2Obj != null)
                 {
-                    sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "", "CO2");
+                    sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "", "", "CO2");
                 }
                 if (tvocObj != null)
                 {
-                    sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "", "TVOC");
+                    sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "", "", "TVOC");
                 }
                 #endregion
 
@@ -507,7 +507,7 @@
                     {
                         text = "Power";
                     }
-                    sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state, "KW", text, 100);
+                    sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state, "", "KW", text, 100);
                 }
                 if (dayObj != null)
                 {
@@ -516,7 +516,7 @@
                     {
                         text = "Power of today";
                     }
-                    sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "KWh", text, 100);
+                    sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "", "KWh", text, 100);
                 }
                 if (monthObj != null)
                 {
@@ -525,7 +525,7 @@
                     {
                         text = "Power of month";
                     }
-                    sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state, "KWh", text, 100);
+                    sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state, "", "KWh", text, 100);
                 }
 
 
@@ -1166,7 +1166,7 @@
         public string Tag;
         public string unitString;
 
-        public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string unitStr,string text,int setWidth = 60)
+        public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string unitStr, string unitStr2, string text,int setWidth = 60)
         {
             unitString = unitStr;
             if (string.IsNullOrEmpty(value))
@@ -1191,7 +1191,7 @@
                 TextAlignment = TextAlignment.Center,
                 TextColor = color,
                 TextSize = 20,
-                Text = value,
+                Text = value + unitString,
             };
             contentView.AddChidren(btnValue);
 
@@ -1206,9 +1206,9 @@
             };
             contentView.AddChidren(btnText);
 
-            if(!string.IsNullOrEmpty(unitString))
+            if(!string.IsNullOrEmpty(unitStr2))
             {
-                btnText.Text += "(" + unitString + ")";
+                btnText.Text += "(" + unitStr2 + ")";
             }
 
 
@@ -1220,7 +1220,7 @@
             {
                 value = value.Remove(value.IndexOf('.'), value.Length - value.IndexOf('.'));
             }
-            btnValue.Text = value;
+            btnValue.Text = value + unitString;
         }
     }
 

--
Gitblit v1.8.0