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/4-PersonalCenter/AddFunction/BrandListPage.cs  |    2 
 HDL-ON_Android/Properties/AndroidManifest.xml                |    2 
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs                         |    4 
 HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs  |    2 
 HDL-ON_Android/Assets/Language.ini                           |    6 +
 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs |   60 +++++++++++
 HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs      |  102 ++++++++++----------
 HDL_ON/DAL/Mqtt/MqttClient.cs                                |    8 +
 HDL-ON_Android/SplashActivity.cs                             |    2 
 HDL_ON/DAL/Server/NewAPI.cs                                  |    4 
 HDL_ON/DAL/Server/NewApiRes.cs                               |    2 
 HDL_ON/Common/HDLCommon.cs                                   |   11 +
 HDL_ON/Common/R.cs                                           |    5 +
 HDL_ON/DAL/Server/HttpServerRequest.cs                       |   15 +++
 HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs         |   36 ++++---
 HDL_ON/UI/MainPage.cs                                        |    6 +
 16 files changed, 186 insertions(+), 81 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 3825dbf..11b1736 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -566,6 +566,7 @@
 579=Cancellation
 580=Are you sure to delete this combined dimming?
 581=
+582=Are you sure to delete this device?
 
 
 2532=Visitor Invitation Record
@@ -1796,7 +1797,7 @@
 579=绔嬪嵆娉ㄩ攢
 580=纭畾鍒犻櫎璇ョ粍鍚堣皟鍏夊悧锛�
 581=
-
+582=纭畾鍒犻櫎璇ヨ澶囧悧?
 
 
 2532=璁垮閭�璇疯褰�
@@ -3004,6 +3005,7 @@
 579=Cancellation
 580=Are you sure to delete this combined dimming?
 581=
+582=Are you sure to delete this device?
 
 
 2532=Visitor Invitation Record
@@ -4219,6 +4221,7 @@
 579=Cancellation
 580=Are you sure to delete this combined dimming?
 581=
+582=Are you sure to delete this device?
 
 
 
@@ -5420,6 +5423,7 @@
 579=Cancellation
 580=Are you sure to delete this combined dimming?
 581=
+582=Are you sure to delete this device?
 
 
 1000=袙谢邪卸薪芯褋褌 胁 褋褌邪褟褌邪
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index e597d8e..28e1a92 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211181">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.3" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211221">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
 	<!--鍙嬬洘-->
 	<!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs
index 54eae56..c6ae1b6 100644
--- a/HDL-ON_Android/SplashActivity.cs
+++ b/HDL-ON_Android/SplashActivity.cs
@@ -204,7 +204,7 @@
                     //}
                     //else
                     //{
-                    //    Console.WriteLine("HHH 缃戠粶鍙樺寲浣嗗浜庡悗鍙�");
+                        //Console.WriteLine("HHH 缃戠粶鍙樺寲浣嗗浜庡悗鍙�"+internetStatus);
                     //}
 
                     //缃戠粶鍙樺寲澶勭悊
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 76f3d70..7aa1087 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -119,10 +119,13 @@
                                 //}
                                 mForceUpdateInfo.ReasonStr = appVersionRes.remark;
 
-                                Application.RunOnMainThread(() =>
+                                if (appVersionRes.version != MainPage.VersionString)
                                 {
-                                    ShowForceUpdateDialog(mForceUpdateInfo);
-                                });
+                                    Application.RunOnMainThread(() =>
+                                    {
+                                        ShowForceUpdateDialog(mForceUpdateInfo);
+                                    });
+                                }
                             }
                         }
                     }
@@ -622,6 +625,7 @@
         public void UpdateInternetStatus(int internetStatus, bool IsEnterBackground = false)
         {
             MainPage.Log($"缃戠粶鐘舵�佸彉鍖栵紝褰撳墠缃戠粶:{internetStatus} 鏄惁鍚庡彴:{IsEnterBackground.ToString()}");
+            MainPage.LinkHdlMqttCount = 0;
             //缃戠粶鐘舵�佸彉鍖� 閲嶇疆缃戝叧鐘舵�侀噸鏂版悳绱�
             Control.Ins.GatewayOnline_Cloud = false;
             Control.Ins.GatewayOnline_Local = false;
@@ -631,6 +635,7 @@
             if (internetStatus == 0)//娌℃湁缃戠粶杩炴帴 0
             {
                 MainPage.InternetStatus = 0;
+                DAL.Mqtt.MqttClient.InitState();
             }
             else if (internetStatus == 1)//3,4G鐨勭綉缁滆繛鎺� 1
             {
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index e322932..6bb7906 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,6 +4,11 @@
 {
     public static class StringId
     {
+
+        /// <summary>
+        /// 纭畾鍒犻櫎璇ヨ澶囧悧?
+        /// </summary>
+        public const int AreYouSureToDeleteThisDevice = 582;
         /// <summary>
         /// 
         /// </summary>
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index ea5e472..383bda8 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -323,10 +323,12 @@
         /// </summary>
         public static async Task StartCloudMqtt()
         {
-            if (MainPage.InternetStatus == 0)
+            //娌℃湁缃戠粶鐨勭姸鎬佷笅灏濊瘯涓�涓嬭繛鎺qtt 锛屽畨鍗撶殑缃戠粶鐘舵�佸彉鍖栫洃鍚湁寮傚父锛屼慨鏀瑰簳灞傞夯鐑�
+            if (MainPage.InternetStatus == 0 && MainPage.LinkHdlMqttCount > 1)
             {
                 return;
             }
+            MainPage.LinkHdlMqttCount++;
 
             if (!UserInfo.Current.IsLogin)
             {
@@ -618,6 +620,10 @@
                         {
                             IfNeedReadAllDeviceStatus = true;
                             Control.Ins.GatewayOnline_Cloud = true;
+                            if(MainPage.InternetStatus == 0)
+                            {
+                                MainPage.InternetStatus = 1;
+                            }
                             Utlis.WriteLine($"============>Mqtt杩滅▼杩炴帴鎴愬姛");
                             SendPushSignOut();
                         });
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 5ee350a..c16df43 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2080,6 +2080,21 @@
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
         }
 
+        /// <summary>
+        /// 鍒犻櫎绗笁鏂硅澶�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Delete3tyDevice(string deviceId)
+        {
+
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
+            return responsePackNew;
+        }
 
 
 
diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs
index 4943403..57001d2 100644
--- a/HDL_ON/DAL/Server/NewAPI.cs
+++ b/HDL_ON/DAL/Server/NewAPI.cs
@@ -394,6 +394,10 @@
         /// </summary>
         public const string Api_Post_IndependentRegister3TyDevcie = "/home-wisdom/app/device/independentRegister";
         /// <summary>
+        /// 绉婚櫎绗笁鏂硅澶�
+        /// </summary>
+        public const string Api_Post_Remove3tyDevcie = "/home-wisdom/app/device/remove";
+        /// <summary>
         /// 鑾峰彇璁惧璇︽儏
         /// </summary>
         public const string Api_Post_GetDevcieInfoList = "/home-wisdom/app/device/info";
diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs
index 1878cab..6bb1700 100644
--- a/HDL_ON/DAL/Server/NewApiRes.cs
+++ b/HDL_ON/DAL/Server/NewApiRes.cs
@@ -1219,7 +1219,7 @@
         /// <summary>
         /// 
         /// </summary>
-        public string version = MainPage.VersionString;
+        public string version = "V" + MainPage.VersionString;
         ///// <summary>
         ///// 杞欢鏉ユ簮锛孍voyo銆丱N銆丱N_Plus
         ///// </summary>
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index e48a361..ab0c1e5 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
         /// <summary>
         /// 鐗堟湰鍙�
         /// </summary>
-        public static string VersionString = "1.6.2";
+        public static string VersionString = "1.6.3";
         ///// <summary>
         ///// 瀹㈡埛绔被鍨�
         ///// </summary>
@@ -59,6 +59,10 @@
         /// </summary>
         public static int InternetStatus = 2;
         /// <summary>
+        /// 杩炴帴mqtt娆℃暟
+        /// </summary>
+        public static int LinkHdlMqttCount = 0;
+        /// <summary>
         /// 鏄惁杩涘叆鍚庡彴
         /// </summary>
         public static bool IsEnterBackground = false;
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index ec6a2eb..b177154 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -1234,11 +1234,11 @@
 
             var btnLogo = new Button()
             {
-                Y = Application.GetRealWidth(85),
+                Y = Application.GetRealHeight(65),
                 UnSelectedImagePath = "FunctionIcon/Acst/LvJianLogo.png",
                 SelectedImagePath = "FunctionIcon/Acst/LvJianLogo.png",
                 Width = Application.GetRealWidth(80),
-                Height = Application.GetRealWidth(37),
+                Height = Application.GetRealHeight(37),
             };
             view.AddChidren(btnLogo);
 
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
index 55b8dc9..874f5e9 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
@@ -155,7 +155,7 @@
                 Button btnName = new Button()
                 {
                     X = Application.GetRealWidth(83),
-                    Width = Application.GetRealWidth(210),
+                    //Width = Application.GetRealWidth(210),
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = CSS_FontSize.SubheadingFontSize,
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
index 048ce36..a03c335 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -108,12 +108,70 @@
             bool isFrist = true;
             foreach (var device in deviceList)
             {
-                FrameLayout row = new FrameLayout()
+                var row = new RowLayout()
                 {
                     Height = Application.GetRealHeight(50),
                     BackgroundColor = CSS_Color.MainBackgroundColor,
+                    LineColor = 0x00000000,
                 };
                 contentView.AddChidren(row);
+                if(device.spk == SPK.IpCam_Imou)
+                {
+                    var btnDel = new Button()
+                    {
+                        TextColor = CSS_Color.TextualColor,
+                        BackgroundColor = CSS_Color.WarningColor,
+                        TextID = StringId.Del,
+                        TextAlignment = TextAlignment.Center,
+                    };
+                    row.AddRightView(btnDel);
+
+                    btnDel.MouseUpEventHandler = (sender, e) => {
+                        Action action = () => {
+                            var waitPage = new Loading();
+                            this.AddChidren(waitPage);
+                            waitPage.Start("");
+                            new System.Threading.Thread(() =>
+                            {
+                                try
+                                {
+                                    var http = new HttpServerRequest();
+                                    var result = http.Delete3tyDevice("3452daf");// device.deviceId);
+                                    if (result.Code == StateCode.SUCCESS)
+                                    {
+                                        Application.RunOnMainThread(() =>
+                                        {
+                                            Load3tyBrandDeviceList();
+                                        });
+                                    }
+                                    else
+                                    {
+                                        Application.RunOnMainThread(() =>
+                                        {
+                                            new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.OperationFailed)+$"\r\n({result.Code})", true);
+                                        });
+                                    }
+                                }catch (Exception ex)
+                                {
+                                    MainPage.Log($"鍒犻櫎绗笁鏂硅澶囧け璐�:{ex.Message}");
+                                }
+                                finally
+                                {
+                                    Application.RunOnMainThread(() =>
+                                    {
+                                        if(waitPage!= null)
+                                        {
+                                            waitPage.RemoveFromParent();
+                                            waitPage = null;
+                                        }
+                                    });
+                                }
+                            })
+                            { IsBackground = true }.Start();
+                        };
+                        new PublicAssmebly().TipOptionMsg(StringId.Tip, Language.StringByID(StringId.AreYouSureToDeleteThisDevice), action);
+                    };
+                }
 
                 if (isFrist)
                 {
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;
         }
     }
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs
index 990e90e..bd1070c 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs
@@ -49,7 +49,7 @@
         /// </summary>
         public void LoadPage()
         {
-            new TopViewDiv(bodyView, function.GetRoomListName()).LoadTopView();
+            new TopViewDiv(bodyView, function.name).LoadTopView();
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
 
             //var contentView = new FrameLayout()
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
index 446bda8..d179519 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
@@ -27,7 +27,7 @@
 
         public static void UpdateStatus(Function temp)
         {
-            if(bodyView == null)
+            if(bodyView == null || bodyView.function.sid != temp.sid)
             {
                 return;
             }
@@ -43,7 +43,7 @@
                 if (setTempValue != 0)
                     bodyView.btnSetTempValues.Text = setTempValue.ToString();
 
-                bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
+                //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
 
                 //int progress = 0;
                 //int.TryParse(temp.GetAttrState(AcstSub_AttrEnum.set_temp.ToString()), out progress);
@@ -126,32 +126,35 @@
             tempHumiView.AddChidren(tempValuesView);
             btnTempValues = new Button()
             {
-                Y = Application.GetRealWidth(45),
-                Height = Application.GetRealWidth(35),
+                Y = Application.GetRealWidth(38),
+                Height = Application.GetRealWidth(66),
                 IsBold = true,
                 TextSize = 30,
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                 TextAlignment = TextAlignment.TopRight,
                 Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString(),"---"),
             };
-            //btnTempValues.Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString());
+#if __IOS__
+            btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(10);
+#else
             btnTempValues.Width = btnTempValues.GetTextWidth();
+#endif
             btnTempValues.Gravity = Gravity.CenterHorizontal;
             tempValuesView.AddChidren(btnTempValues);
             var btnTempValuesUint = new Button()
             {
                 X = btnTempValues.Right,
-                Y = Application.GetRealWidth(48),
+                //Y = Application.GetRealWidth(48),
+                Y = Application.GetRealWidth(45),
+                Height = Application.GetRealWidth(66),
                 TextAlignment = TextAlignment.TopLeft,
                 Width = Application.GetRealWidth(30),
-                Height = Application.GetRealWidth(30),
+                //Height = Application.GetRealWidth(30),
                 TextSize = 10,
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                 Text = "掳C"
             };
             tempValuesView.AddChidren(btnTempValuesUint);
-
-
 
             var humiValuesView = new FrameLayout()
             {
@@ -163,8 +166,8 @@
             tempHumiView.AddChidren(humiValuesView);
             btnHumiValues = new Button()
             {
-                Y = Application.GetRealWidth(45),
-                Height = Application.GetRealWidth(35),
+                Y = Application.GetRealWidth(39),
+                Height = Application.GetRealWidth(66),
                 IsBold = true,
                 TextSize = 30,
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,
@@ -177,10 +180,10 @@
             var btnHumiValuesUint = new Button()
             {
                 X = btnTempValues.Right,
-                Y = Application.GetRealWidth(48),
+                Y = Application.GetRealWidth(45),
                 TextAlignment = TextAlignment.TopLeft,
                 Width = Application.GetRealWidth(30),
-                Height = Application.GetRealWidth(30),
+                Height = Application.GetRealWidth(66),
                 TextSize = 10,
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                 Text = "%"
@@ -221,15 +224,16 @@
                 Text = setTempStr
             };
             contentView.AddChidren(btnSetTempValues);
-            //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
-
+#if __IOS__
+            bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
+#endif
 
 
             var btnSetTempUnit = new Button()
             {
                 X = btnSetTempValues.Right + Application.GetRealWidth(3),
                 Y = Application.GetRealHeight(267),
-                Width = Application.GetRealWidth(30),
+                Width = Application.GetRealWidth(50),
                 Height = Application.GetRealHeight(50),
                 TextSize = 23,
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,

--
Gitblit v1.8.0