From 34754c8a599b1a9b4024b400eb6c64eab0488bab Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 02 八月 2023 14:08:34 +0800
Subject: [PATCH] 备份

---
 HDL-ON_Android/Properties/AndroidManifest.xml                                               |    2 
 HDL_ON/DAL/DriverLayer/UdpSocket.cs                                                         |   34 ++
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs                 |    4 
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs                     |    5 
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs              |   85 +++----
 HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs                        |   12 
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs |    7 
 HDL_ON/DAL/Server/HttpUtil.cs                                                               |    4 
 HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs                              |   19 +
 HDL-ON_iOS/mono_crash.6efc3ba32.0.json                                                      |  384 ++++++++++++++++++++++++++++++++
 HDL_ON/UI/UI0-Public/PublicAssmebly.cs                                                      |    2 
 HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs                 |   80 +++++
 HDL_ON/DAL/DriverLayer/Control.cs                                                           |    6 
 HDL_ON/UI/MainPage.cs                                                                       |    4 
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs                         |   28 ++
 SiriIntents/Server/HttpUtil.cs                                                              |    4 
 16 files changed, 590 insertions(+), 90 deletions(-)

diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 2caaf1e..2c2be0f 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="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307311">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.0.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308021">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
 	<uses-permission android:name="android.permission.RECEIVE_SMS" />
 	<!--鍙嬬洘-->
diff --git a/HDL-ON_iOS/mono_crash.6efc3ba32.0.json b/HDL-ON_iOS/mono_crash.6efc3ba32.0.json
new file mode 100644
index 0000000..5e0c690
--- /dev/null
+++ b/HDL-ON_iOS/mono_crash.6efc3ba32.0.json
@@ -0,0 +1,384 @@
+{
+  "protocol_version" : "0.0.6",
+  "configuration" : {
+    "version" : "(6.12.0.182) (2020-02/6051b710727)",
+    "tlc" : "normal",
+    "sigsgev" : "altstack",
+    "notifications" : "kqueue",
+    "architecture" : "amd64",
+    "disabled_features" : "none",
+    "smallconfig" : "disabled",
+    "bigarrays" : "disabled",
+    "softdebug" : "enabled",
+    "interpreter" : "enabled",
+    "llvm_support" : "0",
+    "suspend" : "hybrid"
+  },
+  "memory" : {
+    "Resident Size" : "213450752",
+    "Virtual Size" : "35264557056",
+    "minor_gc_time" : "4050407",
+    "major_gc_time" : "175543721",
+    "minor_gc_count" : "9",
+    "major_gc_count" : "1030",
+    "major_gc_time_concurrent" : "0"
+ },
+  "threads" : [
+ {
+    "is_managed" : true,
+    "offset_free_hash" : "0x6efc3ba32",
+    "offset_rich_hash" : "0x6efc3baac",
+    "crashed" : true,
+    "native_thread_id" : "0x70000d4da000",
+    "thread_info_addr" : "0x7fee5f808800",
+    "thread_name" : "Finalizer",
+    "ctx" : {
+      "IP" : "0x7ff813720189",
+      "SP" : "0x70000d4d9a60",
+      "BP" : "0x70000d4d9a60"
+  },
+    "managed_frames" : [
+  {
+      "is_managed" : "false",
+      "native_address" : "unregistered"
+   }
+,
+  {
+      "is_managed" : "true",
+      "guid" : "5964C1F3-3A6B-4E45-985E-4259425270A7",
+      "token" : "0x00000",
+      "native_offset" : "0x0",
+      "filename" : "System.dll",
+      "sizeofimage" : "0x290000",
+      "timestamp" : "0x85731fb9",
+      "il_offset" : "0x0000c"
+   }
+,
+  {
+      "is_managed" : "true",
+      "guid" : "5964C1F3-3A6B-4E45-985E-4259425270A7",
+      "token" : "0x600429c",
+      "native_offset" : "0x0",
+      "filename" : "System.dll",
+      "sizeofimage" : "0x290000",
+      "timestamp" : "0x85731fb9",
+      "il_offset" : "0x00000"
+   }
+,
+  {
+      "is_managed" : "true",
+      "guid" : "B27839CC-2DBA-4804-BAAC-F2F5CCE6DE32",
+      "token" : "0x60040a5",
+      "native_offset" : "0x0",
+      "filename" : "mscorlib.dll",
+      "sizeofimage" : "0x472000",
+      "timestamp" : "0xe057582a",
+      "il_offset" : "0x00003"
+   }
+,
+  {
+      "is_managed" : "true",
+      "guid" : "B27839CC-2DBA-4804-BAAC-F2F5CCE6DE32",
+      "token" : "0x60040a4",
+      "native_offset" : "0x0",
+      "filename" : "mscorlib.dll",
+      "sizeofimage" : "0x472000",
+      "timestamp" : "0xe057582a",
+      "il_offset" : "0x00000"
+   }
+,
+  {
+      "is_managed" : "true",
+      "guid" : "5964C1F3-3A6B-4E45-985E-4259425270A7",
+      "token" : "0x6002f52",
+      "native_offset" : "0x0",
+      "filename" : "System.dll",
+      "sizeofimage" : "0x290000",
+      "timestamp" : "0x85731fb9",
+      "il_offset" : "0x00041"
+   }
+,
+  {
+      "is_managed" : "true",
+      "guid" : "5964C1F3-3A6B-4E45-985E-4259425270A7",
+      "token" : "0x6002f51",
+      "native_offset" : "0x0",
+      "filename" : "System.dll",
+      "sizeofimage" : "0x290000",
+      "timestamp" : "0x85731fb9",
+      "il_offset" : "0x00000"
+   }
+,
+  {
+      "is_managed" : "true",
+      "guid" : "B27839CC-2DBA-4804-BAAC-F2F5CCE6DE32",
+      "token" : "0x00000",
+      "native_offset" : "0x0",
+      "filename" : "mscorlib.dll",
+      "sizeofimage" : "0x472000",
+      "timestamp" : "0xe057582a",
+      "il_offset" : "0x0002a"
+   }
+
+  ],
+  "unmanaged_frames" : [
+ {
+    "is_managed" : "false",
+    "native_address" : "0x1078b2756",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a4dfd5",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a4e64a",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x10791f907",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x1078b73ee",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x1079197b6",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff813720189",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff81e42d60f",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff81e42bdcf",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff81e42ce3c",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff81e42b189",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x10ea0cdad",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "true",
+    "guid" : "5964C1F3-3A6B-4E45-985E-4259425270A7",
+    "token" : "0x00000",
+    "native_offset" : "0x0",
+    "filename" : "System.dll",
+    "sizeofimage" : "0x290000",
+    "timestamp" : "0x85731fb9",
+    "il_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "true",
+    "guid" : "5964C1F3-3A6B-4E45-985E-4259425270A7",
+    "token" : "0x600429c",
+    "native_offset" : "0x0",
+    "filename" : "System.dll",
+    "sizeofimage" : "0x290000",
+    "timestamp" : "0x85731fb9",
+    "il_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "true",
+    "guid" : "(null)",
+    "token" : "0x00000",
+    "native_offset" : "0x0",
+    "filename" : "(null)",
+    "sizeofimage" : "0x0",
+    "timestamp" : "0x0",
+    "il_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "true",
+    "guid" : "(null)",
+    "token" : "0x00000",
+    "native_offset" : "0x0",
+    "filename" : "(null)",
+    "sizeofimage" : "0x0",
+    "timestamp" : "0x0",
+    "il_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "true",
+    "guid" : "5964C1F3-3A6B-4E45-985E-4259425270A7",
+    "token" : "0x6002f51",
+    "native_offset" : "0x0",
+    "filename" : "System.dll",
+    "sizeofimage" : "0x290000",
+    "timestamp" : "0x85731fb9",
+    "il_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "true",
+    "guid" : "B27839CC-2DBA-4804-BAAC-F2F5CCE6DE32",
+    "token" : "0x00000",
+    "native_offset" : "0x0",
+    "filename" : "mscorlib.dll",
+    "sizeofimage" : "0x472000",
+    "timestamp" : "0xe057582a",
+    "il_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a8e869",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107aad9ac",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a90759",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a4ec1d",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff81370d4e1",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff813708f6b",
+    "native_offset" : "0x00000"
+  }
+
+ ]
+},
+{
+  "is_managed" : false,
+  "offset_free_hash" : "0x0",
+  "offset_rich_hash" : "0x0",
+  "crashed" : false,
+  "native_thread_id" : "0x111f89600",
+  "thread_info_addr" : "0x7fee5e008600",
+  "thread_name" : "tid_103",
+  "ctx" : {
+    "IP" : "0x7ff8136d09be",
+    "SP" : "0x7ff7b86ff168",
+    "BP" : "0x7ff7b86ff1e0"
+ },
+  "unmanaged_frames" : [
+ {
+    "is_managed" : "false",
+    "native_address" : "0x1078b2756",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a4dfd5",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a4dd07",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x10791e840",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff813722dfd",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x7ff7b86fedf0",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107a8ec37",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107814e1a",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107877d16",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x107803b58",
+    "native_offset" : "0x00000"
+  }
+,
+ {
+    "is_managed" : "false",
+    "native_address" : "0x111f0e52e",
+    "native_offset" : "0x00000"
+  }
+
+ ]
+}
+]
+}
\ No newline at end of file
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 1658bfd..87b720f 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -1209,7 +1209,7 @@
 
 
         /// <summary>
-        /// 鏇存柊璁惧鐘舵��
+        /// 鏇存柊缇ゆ帶璁惧鐘舵��
         /// A鍗忚鏁版嵁
         /// </summary>
         public void UpdataGroupControlStatus(string revString, byte[] usefulBytes, bool isCloudData = false)
@@ -1348,6 +1348,10 @@
                                     EnergyMainPage.UpdataStatus(localFunction);
                                 }
                                 break;
+                            case SPK.AirSwitchP3:
+                                AirSwitchP3Page.UpdataState(localFunction);
+                                AirSwitchP3SubloopEnergyPage.UpdataStatus(localFunction);
+                                break;
                             case SPK.ElectricEnergy:
                                 EnergyMainPage.UpdataStatus(localFunction);
                                 break;
diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs
index 36637f9..4bb4c7f 100644
--- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs
+++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -27,17 +27,22 @@
 		/// </summary>
 		public void Start (int port = 0)
         {
+			MainPage.Log("鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳�0");
 			if (IsRunning)
 			{
-                if (port == Port)
+			MainPage.Log("鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳絰");
+				if (port == Port)
                 {
+			MainPage.Log("鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳絪");
                     return;
-                }
+				}
                 else
                 {
+			MainPage.Log("鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳絘");
                     busSocket.Close();
-                }
+				}
             }
+			MainPage.Log("鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳�1");
 			if (port != 0)
 				Port = port;
 			if (Port == 0)
@@ -49,6 +54,7 @@
 				busSocket.Bind(new IPEndPoint(IPAddress.Any, Port));
 
 				busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188")));
+				relinkCount = 0;
 			}
 			catch (Exception ex){
 				MainPage.Log ($"udp port bind error : {ex.Message}");
@@ -67,6 +73,10 @@
 		/// </summary>
 		public void Stop()
 		{
+			if(busSocket == null)
+            {
+				return;
+            }
 			if (!IsRunning)
 			{
 				return;
@@ -74,6 +84,7 @@
 			try
 			{
 				busSocket.Close();
+				relinkCount = 0;
 			}
 			catch { }
 			busSocket = null;
@@ -100,6 +111,10 @@
 			{
 				return;
 			}
+			if(busSocket == null)
+            {
+				return;
+            }
 
             try {
                 Packet packet = new Packet ();
@@ -107,10 +122,21 @@
             } 
             catch (Exception e) {
                 System.Threading.Thread.Sleep (1);
-                asyncBeginReceive ();
+                Console.WriteLine("asyncBeginReceive " + relinkCount	);
+				if (relinkCount == 0)
+				{
+					asyncBeginReceive();
+				}
+				relinkCount = 1;
                 Console.WriteLine($"asyncBeginReceive {e.Message}");
             } 
 		}
+		/// <summary>
+        /// 閲嶈繛娆℃暟
+        /// </summary>
+		private int relinkCount = 0;
+
+
 
 		/// <summary>
 		/// 寮傛鎺ユ敹鏁版嵁缁撴潫
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 2ef648a..f356d18 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,8 +18,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
         const string APP_KEY = "HDL-HOME-APP-TEST";
         const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
         //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 60bf4fe..53521fe 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
         /// <summary>
         /// 鐗堟湰鍙�
         /// </summary>
-        public static string VersionString = "2.1.0";
+        public static string VersionString = "2.0.0";
         ///// <summary>
         ///// 瀹㈡埛绔被鍨�
         ///// </summary>
@@ -141,7 +141,7 @@
                     //_RoomNotSupportFunctionList.Add(SPK.MusicStandard);
                     //_RoomNotSupportFunctionList.Add(SPK.AvMusic);
                     _RoomNotSupportFunctionList.Add(SPK.AirSwitch);
-                    _RoomNotSupportFunctionList.Add(SPK.AirSwitchP3);
+                    //_RoomNotSupportFunctionList.Add(SPK.AirSwitchP3);
                     _RoomNotSupportFunctionList.Add(SPK.ElectricEnergy);
                     //_RoomNotSupportFunctionList.Add(SPK.OtherCommon);
                     _RoomNotSupportFunctionList.Add(SPK.SensorLight);
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
index e274951..496c9ab 100644
--- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
@@ -155,7 +155,7 @@
 
             etParater.TextChangeEventHandler = (sender, e) =>
             {
-                if (System.Text.Encoding.UTF8.GetBytes(etParater.Text).Length > entryMaxLength)
+                if (System.Text.Encoding.Unicode.GetBytes(etParater.Text).Length > entryMaxLength)
                 {
                     etParater.Text = etParater.Text.Remove(etParater.Text.Length-1);
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs
index 2166a5e..c08e442 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs
@@ -452,19 +452,21 @@
             btnTitlea.MouseUpEventHandler = (sender, e) => {
                 var skipView = new AirSwitchP3SubloopEnergyPage(device,FunctionAttributeKey.ElectricityA);
                 MainPage.BasePageView.AddChidren(skipView);
-                skipView.LoadPage();
+                skipView.LoadPage(StringId.RealTimeElectricityConsumptionDataOfPhaseA);
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
-            btnTitlea.MouseUpEventHandler = (sender, e) => {
+
+            btnTitleb.MouseUpEventHandler = (sender, e) => {
                 var skipView = new AirSwitchP3SubloopEnergyPage(device, FunctionAttributeKey.ElectricityB);
                 MainPage.BasePageView.AddChidren(skipView);
-                skipView.LoadPage();
+                skipView.LoadPage(StringId.RealTimeElectricityConsumptionDataOfPhaseB);
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
-            btnTitlea.MouseUpEventHandler = (sender, e) => {
+
+            btnTitlec.MouseUpEventHandler = (sender, e) => {
                 var skipView = new AirSwitchP3SubloopEnergyPage(device, FunctionAttributeKey.ElectricityC);
                 MainPage.BasePageView.AddChidren(skipView);
-                skipView.LoadPage();
+                skipView.LoadPage(StringId.RealTimeElectricityConsumptionDataOfPhaseC);
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs
index ff695ab..88ad3f0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs
@@ -210,6 +210,13 @@
             };
             controlView.AddChidren(btnSwitch);
 
+            //鍥為��鍒锋柊淇℃伅浜嬩欢
+            actionRefresh = () => {
+                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
+                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
+                //function.SaveFunctionData(true);
+            };
+
             new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh);
             new System.Threading.Thread(() =>
             {
@@ -273,6 +280,11 @@
                         btnRunStatus.Text = "杩囧帇棰勮";
                         btnRunStatus.TextColor = 0xFFFC9C04;
                         break;
+                    ////* HV:杩囧帇棰勮
+                    //case "HV_A":
+                    //    btnRunStatus.Text = "A椤硅繃鍘嬮璀�";
+                    //    btnRunStatus.TextColor = 0xFFFC9C04;
+                    //    break;
                     //* LV:娆犲帇棰勮
                     case "LV":
                         btnRunStatus.Text = "娆犲帇棰勮";
@@ -390,13 +402,6 @@
         {
             LoadSwitchEvent();
             LoadCollectionEvent();
-
-            //鍥為��鍒锋柊淇℃伅浜嬩欢
-            actionRefresh = () => {
-                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
-                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
-                //function.SaveFunctionData(true);
-            };
         }
 
         /// <summary>
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs
index dcc70c0..17173d8 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs
@@ -14,6 +14,12 @@
     {
         static AirSwitchP3SubloopEnergyPage bodyView;
 
+        Button btnRighta;
+
+        Button btnRightb;
+
+        Button btnRightc;
+
         /// <summary>
         /// 鏇茬嚎鍥炬暟鎹畇tring
         /// </summary>
@@ -45,9 +51,9 @@
         /// <summary>
         /// 
         /// </summary>
-        public void LoadPage()
+        public void LoadPage(int titleId)
         {
-            new TopViewDiv(bodyView, Language.StringByID(StringId.EnergyMonitoring)).LoadTopView(0xFFF7F7F7);
+            new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(0xFFF7F7F7);
             bodyView.BackgroundColor = 0xFFF5F7FA;
 
             var contentView = new VerticalScrolViewLayout()
@@ -85,7 +91,7 @@
             };
             contentView.AddChidren(viewa);
 
-            Button btnRighta = new Button()
+            btnRighta = new Button()
             {
                 X = Application.GetRealWidth(201),
                 Gravity = Gravity.CenterVertical,
@@ -126,7 +132,7 @@
             };
             contentView.AddChidren(viewb);
 
-            Button btnRightb = new Button()
+            btnRightb = new Button()
             {
                 X = Application.GetRealWidth(201),
                 Gravity = Gravity.CenterVertical,
@@ -167,7 +173,7 @@
             };
             contentView.AddChidren(viewc);
 
-            Button btnRightc = new Button()
+            btnRightc = new Button()
             {
                 X = Application.GetRealWidth(201),
                 Gravity = Gravity.CenterVertical,
@@ -448,7 +454,7 @@
 
             var btnTip = new Button()
             {
-                Y = Application.GetRealHeight(289),
+                Y = Application.GetRealWidth(289),
                 Height = Application.GetRealHeight(41),
                 Width = Application.GetRealWidth(300),
                 TextAlignment = TextAlignment.Center,
@@ -540,11 +546,14 @@
                 historyDataView.Height = Application.GetRealHeight(184);
             };
 
-
-
-
-
             #endregion
+
+
+            new System.Threading.Thread(() =>
+            {
+                DriverLayer.Control.Ins.SendReadCommand(device);
+            })
+            { IsBackground = true }.Start();
 
 
 
@@ -656,7 +665,7 @@
                         brokenLine.xTitle = Language.StringByID(StringId.Date);
                     }
 
-                    var opString = brokenLine.InitOption(50, curQueryType == "year_month");
+                    var opString = brokenLine.InitOption(100, curQueryType == "year_month");
                     Application.RunOnMainThread(() =>
                     {
                         myEchartsView_Line.ShowWithOption(opString);
@@ -677,6 +686,55 @@
             { IsBackground = true }.Start();
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        public static void UpdataStatus(Function updataTemp)
+        {
+            Application.RunOnMainThread(() =>
+            {
+                try
+                {
+                    if (bodyView != null)
+                    {
+                        double power = 0.00;
+                        double voltage = 0.00;
+                        double current = 0.00;
+                        switch (bodyView.key)
+                        {
+                            case FunctionAttributeKey.ElectricityA:
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.PowerA), out power);
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.VoltageA),out voltage);
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.CurrentA),out current);
+                                break;
+                            case FunctionAttributeKey.ElectricityB:
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.PowerB), out power);
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.VoltageB), out voltage);
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.CurrentB), out current);
+                                break;
+                            case FunctionAttributeKey.ElectricityC:
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.PowerC), out power);
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.VoltageC), out voltage);
+                                double.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.CurrentC), out current);
+                                break;
+                        }
+                        bodyView.btnRighta.Text = voltage.ToString("F2") + "V";
+                        bodyView.btnRightb.Text = current.ToString("F2") + "A";
+                        bodyView.btnRightc.Text = power.ToString("F2") + "W";
+                    }
+                }
+                catch (Exception ex)
+                {
+                    MainPage.Log($"鏇存柊涓夌浉瀛愰」寮傚父:{ex.Message}");
+                }
+            });
+        }
+
+        public override void RemoveFromParent()
+        {
+            base.RemoveFromParent();
+            bodyView = null;
+        }
 
     }
 }
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs
index 7ba9cc4..385e4d9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs
@@ -267,7 +267,10 @@
 
                 btnTriggerModeText.MouseUpEventHandler = (sender, e) =>
                 {
-                    var page = new VideoDoorlockFaceUnlockTriggerSettingPage(device, faceUnlockSetup);
+                    Action<int> updataAction = (faceUnlockSetupMode) => {
+                        btnTriggerModeStateText.TextID = faceUnlockSetupMode == 0 ? StringId.AutomaticTriggering : StringId.ManualTriggering;
+                    };
+                    var page = new VideoDoorlockFaceUnlockTriggerSettingPage(device, faceUnlockSetup,updataAction);
                     MainPage.BasePageView.AddChidren(page);
                     page.LoadPage();
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
index 8becceb..1f4a5c5 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -60,6 +60,7 @@
         /// 闂ㄩ攣鐘舵��
         /// </summary>
         private Button btnDoorLockIcon;
+            Button btnDoorlockStatus;
         /// <summary>
         /// 瀹炴椂瑙嗛
         /// </summary>
@@ -239,7 +240,6 @@
 
             this.CalculatedPosition();//閲嶆柊璁$畻瀹藉害
 
-            Button btnDoorlockStatus;
             btnDoorlockStatus = new Button()
             {
                 Width = Application.GetRealWidth(200),
@@ -378,14 +378,27 @@
                 CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk, false);
 
             });
+            var lastClickTime = DateTime.MinValue;
             //涓存椂瀵嗙爜
             this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) =>
             {
+                if (lastClickTime.AddSeconds(3) > DateTime.Now)
+                {
+                    return;
+                }
+                lastClickTime = DateTime.Now;
                 CommonMethod.Current.SkipPSWActivity(this.device.deviceId);
             });
+
             //鍘嗗彶璁板綍
             this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) =>
             {
+                if (lastClickTime.AddSeconds(3) > DateTime.Now)
+                {
+                    return;
+                }
+                lastClickTime = DateTime.Now;
+
                 //VideoDoorlockHistoryPage historyPage = new VideoDoorlockHistoryPage(device);
                 //MainPage.BasePageView.AddChidren(historyPage);
                 //historyPage.LoadPage();
@@ -434,7 +447,18 @@
                         //this.cellDiyArcSeekBar.Progress = i;
                         //鏇存柊鐢甸噺鍊�
                         this.btnCell.Text = cellInfo.remain + "%";
-                        this.btnDoorLockIcon.IsSelected = videoDoorLockInfo.doorStatus == "open";
+                        if(videoDoorLockInfo.doorStatus == "open")
+                        {
+                            this.btnDoorLockIcon.IsSelected = true;
+                            this.btnDoorlockStatus.TextID = StringId.DoorlockOpen;
+                            this.btnDoorlockStatus.TextColor = CSS_Color.WarningColor;
+                        }
+                        else
+                        {
+                            this.btnDoorLockIcon.IsSelected = false;
+                            this.btnDoorlockStatus.TextID = StringId.DoorlockClose;
+                            this.btnDoorlockStatus.TextColor = 0xFF000000;
+                        }
                     });
                 }
                 catch { }
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs
index 6bc84a5..c56f096 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs
@@ -15,8 +15,10 @@
 
         Function device;
         FaceUnlockSetupObj faceUnlockSetup;
-        public VideoDoorlockFaceUnlockTriggerSettingPage(Function function,FaceUnlockSetupObj setupObj)
+        Action<int> updataAction;
+        public VideoDoorlockFaceUnlockTriggerSettingPage(Function function,FaceUnlockSetupObj setupObj,Action<int> action)
         {
+            updataAction = action;
             bodyView = this;
             device = function;
             faceUnlockSetup = setupObj;
@@ -138,7 +140,7 @@
                                 btnManualText.TextColor = CSS_Color.MainColor;
                                 automaitcTipView.Visible = true;
                                 manualTipView.Visible = false;
-
+                                updataAction?.Invoke(0);
                             });
                         }
                         else
@@ -207,6 +209,7 @@
                                 btnManualText.TextColor = CSS_Color.MainBackgroundColor;
                                 automaitcTipView.Visible = false;
                                 manualTipView.Visible = true;
+                                updataAction?.Invoke(1);
 
                             });
                         }
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs
index 624bc38..136a003 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs
@@ -143,6 +143,10 @@
                         userList.Remove(user);
                         initView();
                     };
+                    page.updataUserNameAction = (name) => {
+                        btnName.Text = name;
+                        user.lockUserName = name;
+                    };
                     MainPage.BasePageView.AddChidren(page);
                     page.LoadPage();
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs
index 16705c7..5c17463 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs
@@ -23,6 +23,8 @@
         Function device;
         VideoDoorlockUser doorlockUser;
         public Action delCallBackAction;
+        public Action<string> updataUserNameAction;
+        Loading waitPage;
 
 
         public VideoDoorlockUserManagerPage(Function function,VideoDoorlockUser user)
@@ -31,11 +33,24 @@
             device = function;
             doorlockUser = user;
             BackgroundColor = CSS_Color.BackgroundColor;
-            
+            waitPage = new Loading();
+
+        }
+
+        public override void RemoveFromParent()
+        {
+            base.RemoveFromParent();
+            bodyView = null;
+            if (waitPage != null)
+            {
+                waitPage.RemoveFromParent();
+                waitPage = null;
+            }
         }
 
         public void LoadPage()
         {
+            bodyView.AddChidren(waitPage);
             new TopViewDiv(bodyView, Language.StringByID(StringId.UserManagement)).LoadTopView();
 
             contentView = new VerticalScrolViewLayout()
@@ -112,7 +127,7 @@
                     {
                         return;
                     }
-                    if (System.Text.Encoding.UTF8.GetBytes(str).Length > 20)
+                    if (System.Text.Encoding.Unicode.GetBytes(str).Length > 20)
                     {
                         new Tip()
                         {
@@ -122,19 +137,20 @@
                         }.Show(bodyView);
                         return;
                     }
-                    var waitPage = new Loading();
-                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
-                    bodyView.AddChidren(waitPage);
                     new System.Threading.Thread(() =>
                     {
                         try
                         {
+                            Application.RunOnMainThread(() => {
+                                waitPage.Start(Language.StringByID(StringId.PleaseWait));
+                            });
                             var pack = ApiUtlis.Ins.HttpRequest.EditDoorlockUserName(device.deviceId, doorlockUser.extUserId, str);
                             if (pack.Code == StateCode.SUCCESS)
                             {
                                 Application.RunOnMainThread(() =>
                                 {
                                     btnUserName.Text = str;
+                                    updataUserNameAction?.Invoke(str);
                                 });
                             }
                             else
@@ -168,11 +184,6 @@
                             Application.RunOnMainThread(() =>
                             {
                                 waitPage.Hide();
-                                if(waitPage!= null)
-                                {
-                                    waitPage.RemoveFromParent();
-                                    waitPage = null;
-                                }
                             });
                         }
                     })
@@ -337,13 +348,13 @@
                     fingerprintView.AddChidren(btnClearFingerprints);
                     btnClearFingerprints.MouseUpEventHandler = (sender, e) =>
                     {
-                        var waitPage = new Loading();
-                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
-                    bodyView.AddChidren(waitPage);
                         new System.Threading.Thread(() =>
                         {
                             try
                             {
+                                Application.RunOnMainThread(() => {
+                                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
+                                });
                                 var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserFingerPassword(device.deviceId, doorlockUser.lockUserIndex);
                                 if (pack != null && pack.Code == StateCode.SUCCESS)
                                 {
@@ -380,11 +391,6 @@
                                 Application.RunOnMainThread(() =>
                                 {
                                     waitPage.Hide();
-                                    if (waitPage != null)
-                                    {
-                                        waitPage.RemoveFromParent();
-                                        waitPage = null;
-                                    }
                                 });
                             }
                         })
@@ -454,13 +460,13 @@
                     digitalPasswordView.AddChidren(btnClearDigitalPassword);
                     btnClearDigitalPassword.MouseUpEventHandler = (sender, e) =>
                     {
-                        var waitPage = new Loading();
-                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
-                    bodyView.AddChidren(waitPage);
                         new System.Threading.Thread(() =>
                         {
                             try
                             {
+                                Application.RunOnMainThread(() => {
+                                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
+                                });
                                 var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserNumberPassword(device.deviceId, doorlockUser.lockUserIndex);
                                 if (pack != null && pack.Code == StateCode.SUCCESS)
                                 {
@@ -497,11 +503,6 @@
                                 Application.RunOnMainThread(() =>
                                 {
                                     waitPage.Hide();
-                                    if (waitPage != null)
-                                    {
-                                        waitPage.RemoveFromParent();
-                                        waitPage = null;
-                                    }
                                 });
                             }
                         })
@@ -570,13 +571,13 @@
                     };
                     nfcView.AddChidren(btnClearNfc);
                     btnClearNfc.MouseUpEventHandler = (sender, e) => {
-                        var waitPage = new Loading();
-                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
-                    bodyView.AddChidren(waitPage);
                         new System.Threading.Thread(() =>
                         {
                             try
                             {
+                                Application.RunOnMainThread(() => {
+                                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
+                                });
                                 var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserCardPassword(device.deviceId, doorlockUser.lockUserIndex);
                                 if (pack != null && pack.Code == StateCode.SUCCESS)
                                 {
@@ -612,11 +613,6 @@
                                 Application.RunOnMainThread(() =>
                                 {
                                     waitPage.Hide();
-                                    if (waitPage != null)
-                                    {
-                                        waitPage.RemoveFromParent();
-                                        waitPage = null;
-                                    }
                                 });
                             }
                         })
@@ -685,13 +681,13 @@
                     };
                     faceView.AddChidren(btnClearFace);
                     btnClearFace.MouseUpEventHandler = (sender, e) => {
-                        var waitPage = new Loading();
-                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
-                    bodyView.AddChidren(waitPage);
                         new System.Threading.Thread(() =>
                         {
                             try
                             {
+                                Application.RunOnMainThread(() => {
+                                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
+                                });
                                 var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserFacePassword(device.deviceId, doorlockUser.lockUserIndex);
                                 if (pack != null && pack.Code == StateCode.SUCCESS)
                                 {
@@ -727,11 +723,6 @@
                                 Application.RunOnMainThread(() =>
                                 {
                                     waitPage.Hide();
-                                    if (waitPage != null)
-                                    {
-                                        waitPage.RemoveFromParent();
-                                        waitPage = null;
-                                    }
                                 });
                             }
                         })
@@ -772,12 +763,13 @@
             {
                 new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteDoorlockUserTip, () =>
                 {
-                    var waitPage = new Loading();
-                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
                     new System.Threading.Thread(() =>
                     {
                         try
                         {
+                            Application.RunOnMainThread(() => {
+                                waitPage.Start(Language.StringByID(StringId.PleaseWait));
+                            });
                             var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUser(device.deviceId, doorlockUser.lockUserIndex);
                             if (pack != null && pack.Code == StateCode.SUCCESS)
                             {
@@ -818,11 +810,6 @@
                             Application.RunOnMainThread(() =>
                             {
                                 waitPage.Hide();
-                                if (waitPage != null)
-                                {
-                                    waitPage.RemoveFromParent();
-                                    waitPage = null;
-                                }
                             });
                         }
                     })
diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs
index dc7aca0..8d4483c 100644
--- a/SiriIntents/Server/HttpUtil.cs
+++ b/SiriIntents/Server/HttpUtil.cs
@@ -16,8 +16,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
         const string APP_KEY = "HDL-HOME-APP-TEST";
         const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
         //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm

--
Gitblit v1.8.0