From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs |   65 +++++++++++++++++++-------------
 1 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 64c7cd3..4b5ea8d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -78,12 +78,23 @@
             frameLayoutDraw.Height = frameBack.Height - Application.GetRealHeight(181);
             frameBack.AddChidren(frameLayoutDraw);
 
+            //璁$畻瀹藉害浣跨敤
+            var btnTemp = new ButtonBase();
+            btnTemp.TextSize = 16;
+            btnTemp.IsBold = true;
+
+            btnTemp.TextID = R.MyInternationalizationString.uSecurityLog;
+            int frameLogWidth = btnTemp.GetRealWidthByText() + Application.GetRealWidth(30);
+
+            btnTemp.TextID = R.MyInternationalizationString.uSensorStatu;
+            int frameSensorWidth = btnTemp.GetRealWidthByText() + Application.GetRealWidth(30);
+
             //瀹夐槻璁板綍(鐐瑰嚮鑼冨洿鏈夌偣灏忥紝闇�瑕佹墿澶у畠鐨勭偣鍑昏寖鍥�)
             var frameLog = new FrameLayoutStatuControl();
             frameLog.UseClickStatu = false;
             frameLog.Height = Application.GetRealHeight(123);
-            frameLog.Width = Application.GetRealWidth(273);
-            frameLog.X = Application.GetRealWidth(259);
+            frameLog.Width = frameLogWidth;
+            frameLog.X = (frameBack.Width - frameLogWidth - frameSensorWidth) / 2;
             frameLog.Y = Application.GetRealHeight(58);
             frameBack.AddChidren(frameLog);
             //鏍囬
@@ -96,7 +107,8 @@
             //搴曠嚎
             var btnLogLine = new NormalViewControl(40, 10, true);
             btnLogLine.Y = Application.GetRealHeight(86);
-            btnLogLine.X = btnLog.X + btnLog.Width / 2 - Application.GetRealWidth(40) / 2;
+            //btnLogLine.X = btnLog.X + btnLog.Width / 2 - Application.GetRealWidth(40) / 2;
+            btnLogLine.Gravity = Gravity.CenterHorizontal;
             btnLogLine.Radius = (uint)Application.GetRealHeight(10) / 2;
             btnLogLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
             frameLog.AddChidren(btnLogLine, ChidrenBindMode.BindEvent);
@@ -106,7 +118,7 @@
             var frameSensor = new FrameLayoutStatuControl();
             frameSensor.UseClickStatu = false;
             frameSensor.Height = frameLog.Height;
-            frameSensor.Width = frameLog.Width;
+            frameSensor.Width = frameSensorWidth;
             frameSensor.X = frameLog.Right;
             frameSensor.Y = frameLog.Y;
             frameBack.AddChidren(frameSensor);
@@ -123,7 +135,8 @@
             var btnSensorLine = new NormalViewControl(40, 10, true);
             btnSensorLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
             btnSensorLine.Y = btnLogLine.Y;
-            btnSensorLine.X = btnSensor.X + btnSensor.Width / 2 - Application.GetRealWidth(40) / 2;
+            //btnSensorLine.X = btnSensor.X + btnSensor.Width / 2 - Application.GetRealWidth(40) / 2;
+            btnSensorLine.Gravity = Gravity.CenterHorizontal;
             btnSensorLine.Radius = (uint)Application.GetRealHeight(10) / 2;
             frameSensor.AddChidren(btnSensorLine, ChidrenBindMode.BindEvent);
 
@@ -178,7 +191,7 @@
             btnShortCut.UnSelectedImagePath = "Safeguard/SafetyShortcut.png";
             btnShortCut.SelectedImagePath = "Safeguard/SafetyShortcutSelected.png";
 
-            if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
+            if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1 || HdlUserCenterResourse.ResidenceOption.AuthorityNo == 2)
             {
                 //蹇嵎鏂瑰紡鍚戝乏绉诲姩
                 btnShortCut.X = Application.GetRealWidth(855);
@@ -238,7 +251,7 @@
 
             topFrameLayout.AddChidren(btnShortCut);
             btnShortCut.InitControl();
-            if (UserCenterResourse.ResidenceOption.SafetyShortcut == true)
+            if (HdlUserCenterResourse.ResidenceOption.SafetyShortcut == true)
             {
                 //浣跨敤蹇嵎鏂瑰紡
                 btnShortCut.IsSelected = true;
@@ -250,11 +263,11 @@
                     //纭畾鍙栨秷涓婚〉鐨勩�屽畨闃层�嶆嵎寰勶紵
                     this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCancelSafetyShortcutMsg), () =>
                     {
-                        UserCenterResourse.ResidenceOption.SafetyShortcut = false;
-                        UserCenterResourse.ResidenceOption.Save();
+                        HdlUserCenterResourse.ResidenceOption.SafetyShortcut = false;
+                        HdlUserCenterResourse.ResidenceOption.Save();
                         btnShortCut.IsSelected = false;
                         //鍙栨秷涓婚〉鐨勩�屽畨闃层�嶆嵎寰勭殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                        UserView.UserPage.Instance.RefreshForm = true;
+                        UserView.UserPage.Instance.RefreshAllForm = true;
                     });
                 }
                 else
@@ -262,11 +275,11 @@
                     //纭畾鍒涘缓銆屽畨闃层�嶆嵎寰勫埌涓婚〉锛�
                     this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCreatSafetyShortcutMsg), () =>
                     {
-                        UserCenterResourse.ResidenceOption.SafetyShortcut = true;
-                        UserCenterResourse.ResidenceOption.Save();
+                        HdlUserCenterResourse.ResidenceOption.SafetyShortcut = true;
+                        HdlUserCenterResourse.ResidenceOption.Save();
                         btnShortCut.IsSelected = true;
                         //鍒涘缓涓婚〉鐨勩�屽畨闃层�嶆嵎寰勭殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                        UserView.UserPage.Instance.RefreshForm = true;
+                        UserView.UserPage.Instance.RefreshAllForm = true;
                     });
                 }
             };
@@ -315,7 +328,7 @@
             this.CloseProgressBar();
 
             //鏁版嵁鍒濆鍖栧畬鎴愬悗
-            Application.RunOnMainThread(() =>
+            HdlThreadLogic.Current.RunMain(() =>
             {
                 //鍒濆鍖栧ご閮ㄧ殑閭d笁涓浘鏍�
                 garrisonControl = new SafetyMasterControl();
@@ -425,7 +438,7 @@
                             this.AddSensorStatuRow(listView, zoneId, Info);
 
                             //鏀堕泦浼犳劅鍣�
-                            var tempDevice = Common.LocalDevice.Current.GetDevice(Info.MacAddr, Info.Epoint);
+                            var tempDevice = HdlDeviceCommonLogic.Current.GetDevice(Info.MacAddr, Info.Epoint);
                             if (tempDevice != null)
                             {
                                 listDevice.Add(tempDevice);
@@ -450,7 +463,7 @@
         /// <param name="sensorInfo">浼犳劅鍣ㄧ殑淇℃伅</param>
         private void AddSensorStatuRow(VerticalFrameControl listView, int zoneID, Safeguard.ZoneDeviceListData sensorInfo)
         {
-            CommonDevice device = Common.LocalDevice.Current.GetDevice(sensorInfo.MacAddr, sensorInfo.Epoint);
+            CommonDevice device = HdlDeviceCommonLogic.Current.GetDevice(sensorInfo.MacAddr, sensorInfo.Epoint);
             if (device == null)
             {
                 return;
@@ -463,7 +476,7 @@
             //娣诲姞闃村奖鐗规晥
             frameDevice.SetViewShadow(true);
 
-            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
             this.dicSensorStatuView[mainkeys] = frameDevice;
         }
 
@@ -486,7 +499,7 @@
                 }
 
                 //浼犳劅鍣ㄧ姸鎬�
-                string mainkey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+                string mainkey = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
                 if (this.dicSensorStatuView.ContainsKey(mainkey) == false)
                 {
                     return;
@@ -541,7 +554,7 @@
                         //鐣岄潰鍏抽棴
                         return;
                     }
-                    var deviceInfo = Common.LocalDevice.Current.ReadDeviceEpointDeviceInfo(device);
+                    var deviceInfo = HdlDeviceCommonLogic.Current.ReadDeviceEpointDeviceInfo(device);
                     if (deviceInfo != null)
                     {
                         //璁剧疆璁惧鍦ㄧ嚎鐘舵��
@@ -563,10 +576,10 @@
                 //鐣岄潰鍏抽棴
                 return;
             }
-            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
             if (this.dicSensorStatuView.ContainsKey(mainkeys) == true)
             {
-                CommonDevice Loacldevice = Common.LocalDevice.Current.GetDevice(mainkeys);
+                CommonDevice Loacldevice = HdlDeviceCommonLogic.Current.GetDevice(mainkeys);
                 if (Loacldevice == null)
                 {
                     return;
@@ -584,7 +597,7 @@
                 HdlThreadLogic.Current.RunMain(() =>
                 {
                     //璁剧疆鎺т欢鐨勫湪绾跨姸鎬佹枃鏈晥鏋�
-                    bool bolOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
+                    bool bolOnline = HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(device);
                     control?.SetOnlineStatu(bolOnline);
                 });
             }
@@ -652,7 +665,7 @@
                 }
                 dicAlarm = null;
 
-                Application.RunOnMainThread(() =>
+                HdlThreadLogic.Current.RunMain(() =>
                 {
                     if (this.Parent == null)
                     {
@@ -714,8 +727,8 @@
             var info = HdlAlarmsLogic.Current.listSafetyAlarmInfo[0];
             if (device != null)
             {
-                string mainkey1 = Common.LocalDevice.Current.GetDeviceMainKeys(info.DeviceAddr, info.DeviceEpoint);
-                string mainkey2 = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+                string mainkey1 = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(info.DeviceAddr, info.DeviceEpoint);
+                string mainkey2 = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
                 if (mainkey1 != mainkey2)
                 {
                     //涓嶆槸鍚屼竴涓笢瑗�
@@ -723,7 +736,7 @@
                 }
             }
 
-            Application.RunOnMainThread(() =>
+            HdlThreadLogic.Current.RunMain(() =>
             {
                 if (this.TodaySafeguardFrame != null)
                 {

--
Gitblit v1.8.0