From 160785587667cc0d927f85e44c139ec9dde13a9e Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 25 十一月 2019 14:30:13 +0800
Subject: [PATCH] 原来的 IOS 工程舍弃(注:没有合并其他组员的代码)

---
 ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs |  101 +++++++++++++++++++++-----------------------------
 1 files changed, 43 insertions(+), 58 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 75c888f..43a4379 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -1,14 +1,14 @@
-锘縰sing System;
+锘縰sing System;
 using System.Collections.Generic;
 using System.Threading.Tasks;
 using ZigBee.Device;
 
-namespace Shared.Phone.UserCenter.Safety
-{
-    /// <summary>
-    /// 瀹夐槻绠$悊鐨勪富鐣岄潰鈽�
-    /// </summary>
-    public class SafetyManagementMainForm : EditorCommonForm
+namespace Shared.Phone.UserCenter.Safety
+{
+    /// <summary>
+    /// 瀹夐槻绠$悊鐨勪富鐣岄潰鈽�
+    /// </summary>
+    public class SafetyManagementMainForm : EditorCommonForm
     {
         #region 鈻� 鍙橀噺澹版槑___________________________
 
@@ -346,12 +346,12 @@
         /// <summary>
         /// 鐢婚潰鍏抽棴
         /// </summary>
-        public override void CloseForm()
+        public override void CloseFormBefore()
         {
             //绉婚櫎鍏ㄩ儴鐩戝惉浜嬩欢
             this.RemoveAllListenEvent();
 
-            base.CloseForm();
+            base.CloseFormBefore();
         }
 
         /// <summary>
@@ -359,8 +359,8 @@
         /// </summary>
         private void RemoveAllListenEvent()
         {
-            HdlDeviceAttributeLogic.Current.RemoveEvent("SafetyManagementMainFormAlarm");
-            HdlDeviceAttributeLogic.Current.RemoveEvent("SafetyManagementMainFormReceivePushOnline");
+            HdlGatewayReceiveLogic.Current.RemoveEvent("SafetyManagementMainFormAlarm");
+            HdlGatewayReceiveLogic.Current.RemoveEvent("SafetyManagementMainFormReceivePushOnline");
         }
 
         #endregion
@@ -400,9 +400,9 @@
                 var dicDevice = HdlSafeguardLogic.Current.GetAllSensorDeviceInfo();
                 var listDevice = new List<CommonDevice>();
 
-                foreach (var zoneId in dicDevice.Keys)
+                HdlThreadLogic.Current.RunMain(() =>
                 {
-                    Application.RunOnMainThread(() =>
+                    foreach (var zoneId in dicDevice.Keys)
                     {
                         foreach (var Info in dicDevice[zoneId])
                         {
@@ -420,17 +420,12 @@
                                 listDevice.Add(tempDevice);
                             }
                         }
-                        //鏈�鍚庝竴涓槻鍖虹殑鏃跺�欙紝寮�鍚悇绉嶇洃瑙嗙嚎绋�
-                        if (zoneId == dicDevice.Count)
-                        {
-                            //寮�鍚紶鎰熷櫒鎶ヨ鐩戣
-                            this.StartCheckDeviceAlarm();
-
-                            //寮�鍚澶囧湪绾跨洃娴�
-                            this.StartCheckDeviceOnline(listDevice);
-                        }
-                    });
-                }
+                    }
+                    //寮�鍚紶鎰熷櫒鎶ヨ鐩戣
+                    this.StartCheckDeviceAlarm();
+                    //寮�鍚澶囧湪绾跨洃娴�
+                    this.StartCheckDeviceOnline(listDevice);
+                });
             });
         }
 
@@ -452,6 +447,9 @@
             var frameDevice = new SafetySensorStatuControl();
             listView.AddChidrenFrame(frameDevice);
             frameDevice.InitControl(device);
+            //娣诲姞闃村奖鐗规晥
+            var btnTemp = new ButtonBase();
+            btnTemp.AddBottomShadow(frameDevice);
 
             string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
             this.dicSensorStatuView[mainkeys] = frameDevice;
@@ -467,15 +465,13 @@
         private void StartCheckDeviceAlarm()
         {
             //鏍规嵁鎺ュ彛鎺ㄩ�侊紝璁剧疆鎶ヨ淇℃伅
-            HdlDeviceAttributeLogic.Current.AddAttributeEvent("SafetyManagementMainFormAlarm", "IASInfoReport", (device) =>
+            HdlGatewayReceiveLogic.Current.AddAttributeEvent("SafetyManagementMainFormAlarm", ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�, (device) =>
             {
                 if (HdlSafeguardLogic.Current.IsSensorDeviceExist(device) == false)
                 {
                     //濡傛灉杩欎釜璁惧涓嶅瓨鍦ㄤ簬瀹夐槻锛屽垯涓嶅鐞�
                     return;
                 }
-                //娣诲姞瀹夐槻璁惧涓婃姤鐨勮鎺т欢
-                this.AddSafeguardLogPushRow(device);
 
                 //浼犳劅鍣ㄧ姸鎬�
                 string mainkey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
@@ -622,7 +618,7 @@
             this.dicSensorStatuView.Clear();
 
             frameLayoutDraw.RemoveAll();
-            var listView = new VerticalFrameControl(35);
+            var listView = new VerticalFrameControl(0);
             listView.Height = frameLayoutDraw.Height;
             frameLayoutDraw.AddChidren(listView);
 
@@ -671,6 +667,7 @@
                     }
                     //鎵ц鍒濆鍖�
                     TodaySafeguardFrame = new SafeguardLogControl();
+                    TodaySafeguardFrame.Y = Application.GetRealHeight(10);
                     listView.AddChidrenFrame(TodaySafeguardFrame);
                     TodaySafeguardFrame.InitControl(nowDayKey, nowDayData);
 
@@ -705,38 +702,14 @@
         /// <summary>
         /// 娣诲姞瀹夐槻璁惧涓婃姤鐨勮鎺т欢(瀹夐槻鎺ㄩ�佷細璋冪敤杩欎釜涓滆タ)
         /// </summary>
-        /// <param name="device">璁惧瀵硅薄锛屼负null鏃舵槸甯冮槻</param>
+        /// <param name="device">璁惧瀵硅薄</param>
         public void AddSafeguardLogPushRow(CommonDevice device)
         {
-            if (device == null && HdlSafeguardLogic.Current.listAlarmInfo.Count > 0)
-            {
-                //濡傛灉鏄畨闃叉帹閫佺殑璇濓紝澶翠笂闈㈢殑閭d笁涓渾鍦堢殑鍥炬爣瑕佹敼鍙�
-                Application.RunOnMainThread(() =>
-                {
-                    var infoTemp = HdlSafeguardLogic.Current.listAlarmInfo[0];
-                    if (infoTemp.AlarmType == SafeguardAlarmType.AtHome)
-                    {
-                        garrisonControl?.SetIconStatuByGarrisonMode(GarrisonMode.AtHome);
-                        this.ShowMassage(ShowMsgType.Tip, infoTemp.AlarmMsg);
-                    }
-                    else if (infoTemp.AlarmType == SafeguardAlarmType.RemoveHome)
-                    {
-                        garrisonControl?.SetIconStatuByGarrisonMode(GarrisonMode.RemoveHome);
-                        this.ShowMassage(ShowMsgType.Tip, infoTemp.AlarmMsg);
-                    }
-                    else if (infoTemp.AlarmType == SafeguardAlarmType.RemoveGarrison)
-                    {
-                        garrisonControl?.SetIconStatuByGarrisonMode(GarrisonMode.RemoveGarrison);
-                        this.ShowMassage(ShowMsgType.Tip, infoTemp.AlarmMsg);
-                    }
-                });
-                return;
-            }
-            if (this.TabSelectIndex != 1 || HdlSafeguardLogic.Current.listAlarmInfo.Count == 0)
+            if (this.TabSelectIndex != 1 || HdlAlarmsLogic.Current.listSafetyAlarmInfo.Count == 0)
             {
                 return;
             }
-            var info = HdlSafeguardLogic.Current.listAlarmInfo[0];
+            var info = HdlAlarmsLogic.Current.listSafetyAlarmInfo[0];
             if (device != null)
             {
                 string mainkey1 = Common.LocalDevice.Current.GetDeviceMainKeys(info.DeviceAddr, info.DeviceEpoint);
@@ -772,6 +745,18 @@
             });
         }
 
+        /// <summary>
+        /// 闃插尯鎺ㄩ��
+        /// </summary>
+        /// <param name="garrison"></param>
+        public void GarrisonModePush(GarrisonMode garrison)
+        {
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                garrisonControl?.SetIconStatuByGarrisonMode(garrison);
+            });
+        }
+
         #endregion
 
         #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________
@@ -797,6 +782,6 @@
             return 1;
         }
 
-        #endregion
-    }
-}
+        #endregion
+    }
+}

--
Gitblit v1.8.0