HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -1,21 +1,21 @@
using System;
using 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 ■ 变量声明___________________________
        /// <summary>
        /// 桌布控件,用于存放或者移除功能块控件(Tab控件专用)
        /// </summary>
        private FrameLayout frameLayoutDraw = null;
        private NormalFrameLayout frameLayoutDraw = null;
        /// <summary>
        /// 安防控件
        /// </summary>
@@ -52,11 +52,9 @@
        {
            //清空bodyFrame
            this.ClearBodyFrame();
            if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
            {
                //初始化右上角图标
                this.InitTopRightIcon();
            }
            //初始化右上角图标
            this.InitTopRightIcon();
            //初始化全部内存信息
            this.InitAllMemoryData();
@@ -67,64 +65,80 @@
        /// </summary>
        private void InitTabSwitchControl()
        {
            //桌布控件
            frameLayoutDraw = new FrameLayout();
            frameLayoutDraw.Y = Application.GetRealHeight(590);
            frameLayoutDraw.Height = bodyFrameLayout.Height - Application.GetRealHeight(590);
            bodyFrameLayout.AddChidren(frameLayoutDraw);
            var frameBack = new FrameLayout();
            frameBack.Height = Application.GetRealHeight(1300);
            frameBack.Y = Application.GetRealHeight(444);
            frameBack.BackgroundColor = 0xa1ffffff;
            frameBack.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            bodyFrameLayout.AddChidren(frameBack);
            //临时的一个东西,用来计算真实值而已
            var btnTemp = new NormalViewControl(100, false);
            int realLogWidth = btnTemp.GetRealWidthByText(16, Language.StringByID(R.MyInternationalizationString.uSecurityLog));
            int realSensorWidth = btnTemp.GetRealWidthByText(16, Language.StringByID(R.MyInternationalizationString.uSensorStatu));
            btnTemp = null;
            //桌布控件
            frameLayoutDraw = new NormalFrameLayout();
            frameLayoutDraw.Y = Application.GetRealHeight(181);
            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 FrameLayoutControl();
            var frameLog = new FrameLayoutStatuControl();
            frameLog.UseClickStatu = false;
            frameLog.Height = Application.GetRealHeight(123);
            frameLog.Width = realLogWidth;
            frameLog.X = Application.GetRealWidth(489) - realLogWidth;
            frameLog.Y = Application.GetRealHeight(467);
            bodyFrameLayout.AddChidren(frameLog);
            frameLog.Width = frameLogWidth;
            frameLog.X = (frameBack.Width - frameLogWidth - frameSensorWidth) / 2;
            frameLog.Y = Application.GetRealHeight(58);
            frameBack.AddChidren(frameLog);
            //标题
            var btnLog = new NormalViewControl(100, 63, true);
            btnLog.Width = realLogWidth;
            btnLog.TextAlignment = TextAlignment.CenterRight;
            btnLog.Width = frameLog.Width;
            btnLog.TextAlignment = TextAlignment.Center;
            btnLog.TextID = R.MyInternationalizationString.uSecurityLog;
            btnLog.TextColor = UserCenterColor.Current.TextGrayColor3;
            frameLog.AddChidren(btnLog, ChidrenBindMode.BindEventOnly);
            frameLog.AddChidren(btnLog, ChidrenBindMode.BindEvent);
            //底线
            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.BindEventOnly);
            frameLog.AddChidren(btnLogLine, ChidrenBindMode.BindEvent);
            btnLogLine.Visible = false;
            //传感器状态(点击范围有点小,需要扩大它的点击范围)
            var frameSensor = new FrameLayoutControl();
            var frameSensor = new FrameLayoutStatuControl();
            frameSensor.UseClickStatu = false;
            frameSensor.Height = frameLog.Height;
            frameSensor.Width = realSensorWidth;
            frameSensor.X = Application.GetRealWidth(550);
            frameSensor.Width = frameSensorWidth;
            frameSensor.X = frameLog.Right;
            frameSensor.Y = frameLog.Y;
            bodyFrameLayout.AddChidren(frameSensor);
            frameBack.AddChidren(frameSensor);
            //标题
            var btnSensor = new NormalViewControl(100, 63, true);
            btnSensor.Width = realSensorWidth;
            btnSensor.Width = frameSensor.Width;
            btnSensor.TextID = R.MyInternationalizationString.uSensorStatu;
            btnSensor.TextSize = 16;
            btnSensor.TextAlignment = TextAlignment.Center;
            btnSensor.TextColor = UserCenterColor.Current.TextColor2;
            frameSensor.AddChidren(btnSensor, ChidrenBindMode.BindEventOnly);
            btnSensor.IsBold = true;
            frameSensor.AddChidren(btnSensor, ChidrenBindMode.BindEvent);
            //底线
            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.BindEventOnly);
            frameSensor.AddChidren(btnSensorLine, ChidrenBindMode.BindEvent);
            //安防记录Tab
            frameLog.ButtonClickEvent += (sender, e) =>
@@ -132,8 +146,10 @@
                //字体大小和颜色变更
                btnSensor.TextColor = UserCenterColor.Current.TextGrayColor3;
                btnSensor.TextSize = 14;
                btnSensor.IsBold = false;
                btnLog.TextColor = UserCenterColor.Current.TextColor2;
                btnLog.TextSize = 16;
                btnLog.IsBold = true;
                btnLogLine.Visible = true;
                btnSensorLine.Visible = false;
@@ -150,8 +166,10 @@
                //字体大小和颜色变更
                btnSensor.TextColor = UserCenterColor.Current.TextColor2;
                btnSensor.TextSize = 16;
                btnSensor.IsBold = true;
                btnLog.TextColor = UserCenterColor.Current.TextGrayColor3;
                btnLog.TextSize = 14;
                btnLog.IsBold = false;
                btnLogLine.Visible = false;
                btnSensorLine.Visible = true;
@@ -168,28 +186,102 @@
        /// </summary>
        private void InitTopRightIcon()
        {
            var btnIcon = new MostRightIconControl(69, 69);
            btnIcon.UnSelectedImagePath = "Item/More.png";
            topFrameLayout.AddChidren(btnIcon);
            btnIcon.InitControl();
            btnIcon.ButtonClickEvent += (sender, e) =>
            //快捷方式
            var btnShortCut = new MostRightIconControl(69, 69);
            btnShortCut.UnSelectedImagePath = "Safeguard/SafetyShortcut.png";
            btnShortCut.SelectedImagePath = "Safeguard/SafetyShortcutSelected.png";
            if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
            {
                //菜单控件
                var frameMenu = new TopRightMenuControl(this, 2);
                //防区列表
                string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
                frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
                //快捷方式向左移动
                btnShortCut.X = Application.GetRealWidth(855);
                var btnIcon = new MostRightIconControl(69, 69);
                btnIcon.UnSelectedImagePath = "Item/More.png";
                topFrameLayout.AddChidren(btnIcon);
                btnIcon.InitControl();
                btnIcon.ButtonClickEvent += (sender, e) =>
                {
                    var form = new GarrisonAreaListMenuForm();
                    form.AddForm();
                });
                //密码设置
                string menu2 = Language.StringByID(R.MyInternationalizationString.uPasswordSettion);
                frameMenu.AddRowMenu(menu2, "Item/PswSettion.png", "Item/PswSettionSelected.png", () =>
                    //菜单控件
                    var frameMenu = new TopRightMenuControl(2, 2);
                    //防区列表
                    string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
                    frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
                    {
                        HdlCheckLogic.Current.CheckSecondarySecurity(() =>
                        {
                            //验证成功
                            var form = new GarrisonAreaListMenuForm();
                            form.AddForm();
                        },
                        () =>
                        {
                            //请前往个人中心{0}设置二次安全验证方式
                            string msg = Language.StringByID(R.MyInternationalizationString.uGotoCenterAndSetSecondAuthentication).Replace("{0}", "\r\n");
                            this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                            {
                                var form = new UserMain.SecondAuthenticationForm();
                                form.AddForm();
                            });
                        });
                    });
                    //密码设置
                    string menu2 = Language.StringByID(R.MyInternationalizationString.uPasswordSettion);
                    frameMenu.AddRowMenu(menu2, "Item/PswSettion.png", "Item/PswSettionSelected.png", () =>
                    {
                        HdlCheckLogic.Current.CheckSecondarySecurity(() =>
                        {
                            //验证成功
                            var form = new PasswordMenuForm();
                            form.AddForm();
                        },
                        () =>
                        {
                            //请前往个人中心{0}设置二次安全验证方式
                            string msg = Language.StringByID(R.MyInternationalizationString.uGotoCenterAndSetSecondAuthentication).Replace("{0}", "\r\n");
                            this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                            {
                                var form = new UserMain.SecondAuthenticationForm();
                                form.AddForm();
                            });
                        });
                    });
                };
            }
            topFrameLayout.AddChidren(btnShortCut);
            btnShortCut.InitControl();
            if (UserCenterResourse.ResidenceOption.SafetyShortcut == true)
            {
                //使用快捷方式
                btnShortCut.IsSelected = true;
            }
            btnShortCut.ButtonClickEvent += (sender, e) =>
            {
                if (btnShortCut.IsSelected == true)
                {
                    var form = new SafetyPasswordMenuForm();
                    form.AddForm();
                });
                    //确定取消主页的「安防」捷径?
                    this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCancelSafetyShortcutMsg), () =>
                    {
                        UserCenterResourse.ResidenceOption.SafetyShortcut = false;
                        UserCenterResourse.ResidenceOption.Save();
                        btnShortCut.IsSelected = false;
                        //取消主页的「安防」捷径的话,主页需要重新刷新
                        UserView.UserPage.Instance.RefreshAllForm = true;
                    });
                }
                else
                {
                    //确定创建「安防」捷径到主页?
                    this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCreatSafetyShortcutMsg), () =>
                    {
                        UserCenterResourse.ResidenceOption.SafetyShortcut = true;
                        UserCenterResourse.ResidenceOption.Save();
                        btnShortCut.IsSelected = true;
                        //创建主页的「安防」捷径的话,主页需要重新刷新
                        UserView.UserPage.Instance.RefreshAllForm = true;
                    });
                }
            };
        }
@@ -236,7 +328,7 @@
            this.CloseProgressBar();
            //数据初始化完成后
            Application.RunOnMainThread(() =>
            HdlThreadLogic.Current.RunMain(() =>
            {
                //初始化头部的那三个图标
                garrisonControl = new SafetyMasterControl();
@@ -278,12 +370,12 @@
        /// <summary>
        /// 画面关闭
        /// </summary>
        public override void CloseForm()
        public override void CloseFormBefore()
        {
            //移除全部监听事件
            this.RemoveAllListenEvent();
            base.CloseForm();
            base.CloseFormBefore();
        }
        /// <summary>
@@ -291,8 +383,8 @@
        /// </summary>
        private void RemoveAllListenEvent()
        {
            HdlDeviceAttributeLogic.Current.RemoveEvent("SafetyManagementMainFormAlarm");
            HdlDeviceAttributeLogic.Current.RemoveEvent("SafetyManagementMainFormReceivePushOnline");
            HdlGatewayReceiveLogic.Current.RemoveEvent("SafetyManagementMainFormAlarm");
            HdlGatewayReceiveLogic.Current.RemoveEvent("SafetyManagementMainFormReceivePushOnline");
        }
        #endregion
@@ -332,9 +424,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])
                        {
@@ -352,17 +444,14 @@
                                listDevice.Add(tempDevice);
                            }
                        }
                        //最后一个防区的时候,开启各种监视线程
                        if (zoneId == dicDevice.Count)
                        {
                            //开启传感器报警监视
                            this.StartCheckDeviceAlarm();
                            //开启设备在线监测
                            this.StartCheckDeviceOnline(listDevice);
                        }
                    });
                }
                    }
                    //调整列表控件高度
                    listView.AdjustChidrenFrameHeight(listView.frameTable, Application.GetRealHeight(46));
                    //开启传感器报警监视
                    this.StartCheckDeviceAlarm();
                    //开启设备在线监测
                    this.StartCheckDeviceOnline(listDevice);
                });
            });
        }
@@ -382,8 +471,10 @@
            //自定义传感器状态控件
            var frameDevice = new SafetySensorStatuControl();
            listView.AddChidrenFrame(frameDevice);
            listView.AddChidren(frameDevice);
            frameDevice.InitControl(device);
            //添加阴影特效
            frameDevice.SetViewShadow(true);
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
            this.dicSensorStatuView[mainkeys] = frameDevice;
@@ -399,15 +490,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);
@@ -418,7 +507,7 @@
                var control = this.dicSensorStatuView[mainkey];
                //获取传感器报警信息的翻译文本
                var msgInfo = HdlAlarmsLogic.Current.GetSensorAlarmInfo(device);
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    control?.SetSensoReportInfo(msgInfo);
                });
@@ -444,80 +533,73 @@
            {
                return;
            }
            var timeValue = (DateTime.Now - oldGetOnlineTime).Milliseconds;
            if (timeValue <= 10000)
            if (oldGetOnlineTime.Year != 1900)
            {
                //最少要间隔十秒,才去重新获取
                return;
                var timeValue = (DateTime.Now - oldGetOnlineTime).TotalSeconds;
                if (timeValue < 10)
                {
                    //最少要间隔十秒,才去重新获取
                    return;
                }
            }
            oldGetOnlineTime = DateTime.Now;
            //从设备列表中获取在线状态
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //首先获取这些传感器所在的网关
                var listWay = new List<ZbGateway>();
                foreach (var device in listDevice)
                {
                    ZbGateway realWay = null;
                    //是否存在真实物理网关
                    if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, device.CurrentGateWayId) == false)
                    {
                        continue;
                    }
                    listWay.Add(realWay);
                }
                foreach (var zbway in listWay)
                {
                    if (this.Parent == null)
                    {
                        //界面关闭
                        return;
                    }
                    await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
                    var deviceInfo = Common.LocalDevice.Current.ReadDeviceEpointDeviceInfo(device);
                    if (deviceInfo != null)
                    {
                        //设置设备在线状态
                        this.ReceiveDeviceStatuPush(device, deviceInfo);
                    }
                    System.Threading.Thread.Sleep(50);
                }
            });
            }, ShowErrorMode.NO);
        }
        /// <summary>
        /// 接受设备在线推送
        /// </summary>
        /// <param name="device"></param>
        private void ReceiveDeviceStatuPush(CommonDevice device)
        private void ReceiveDeviceStatuPush(CommonDevice device, CommonDevice.DeviceInfoData deviceInfo)
        {
            if (this.Parent == null)
            {
                //界面关闭
                return;
            }
            lock (objOnlineLock)
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
            if (this.dicSensorStatuView.ContainsKey(mainkeys) == true)
            {
                string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
                if (this.dicSensorStatuView.ContainsKey(mainkeys) == true)
                CommonDevice Loacldevice = Common.LocalDevice.Current.GetDevice(mainkeys);
                if (Loacldevice == null)
                {
                    CommonDevice Loacldevice = Common.LocalDevice.Current.GetDevice(mainkeys);
                    if (Loacldevice == null)
                    {
                        return;
                    }
                    //在线状态一样的话,不需要刷新
                    if (Loacldevice.IsOnline == device.IsOnline)
                    {
                        return;
                    }
                    //保存状态
                    Loacldevice.IsOnline = device.IsOnline;
                    Loacldevice.ReSave();
                    //因为这是推送过来的,我不保证那一瞬间这个东西会不会被移除
                    var control = this.dicSensorStatuView[mainkeys];
                    Application.RunOnMainThread(() =>
                    {
                        //设置控件的在线状态文本效果
                        control?.SetOnlineStatu(device.IsOnline == 1);
                    });
                    return;
                }
                //在线状态一样的话,不需要刷新
                if (Loacldevice.IsOnline == deviceInfo.IsOnline)
                {
                    return;
                }
                //保存状态
                Loacldevice.IsOnline = deviceInfo.IsOnline;
                //因为这是推送过来的,我不保证那一瞬间这个东西会不会被移除
                var control = this.dicSensorStatuView[mainkeys];
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //设置控件的在线状态文本效果
                    bool bolOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
                    control?.SetOnlineStatu(bolOnline);
                });
            }
        }
@@ -551,7 +633,7 @@
            this.dicSensorStatuView.Clear();
            frameLayoutDraw.RemoveAll();
            var listView = new VerticalFrameControl(35);
            var listView = new VerticalFrameControl(0);
            listView.Height = frameLayoutDraw.Height;
            frameLayoutDraw.AddChidren(listView);
@@ -583,7 +665,7 @@
                }
                dicAlarm = null;
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    if (this.Parent == null)
                    {
@@ -600,7 +682,8 @@
                    }
                    //执行初始化
                    TodaySafeguardFrame = new SafeguardLogControl();
                    listView.AddChidrenFrame(TodaySafeguardFrame);
                    TodaySafeguardFrame.Y = Application.GetRealHeight(10);
                    listView.AddChidren(TodaySafeguardFrame);
                    TodaySafeguardFrame.InitControl(nowDayKey, nowDayData);
                    //初始化其他日期的安防记录控件
@@ -608,7 +691,7 @@
                    {
                        otherDaySafeguardFrame = new FrameLayout();
                        otherDaySafeguardFrame.Height = Application.GetRealHeight(10);
                        listView.AddChidrenFrame(otherDaySafeguardFrame);
                        listView.AddChidren(otherDaySafeguardFrame);
                        foreach (var dayText in dicInfo.Keys)
                        {
                            //执行初始化
@@ -634,38 +717,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)
            {
                //如果是安防推送的话,头上面的那三个圆圈的图标要改变
                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);
@@ -677,7 +736,7 @@
                }
            }
            Application.RunOnMainThread(() =>
            HdlThreadLogic.Current.RunMain(() =>
            {
                if (this.TodaySafeguardFrame != null)
                {
@@ -698,6 +757,18 @@
                        listview?.AdjustTableHeight();
                    }
                }
            });
        }
        /// <summary>
        /// 防区推送
        /// </summary>
        /// <param name="garrison"></param>
        public void GarrisonModePush(GarrisonMode garrison)
        {
            HdlThreadLogic.Current.RunMain(() =>
            {
                garrisonControl?.SetIconStatuByGarrisonMode(garrison);
            });
        }
@@ -726,6 +797,6 @@
            return 1;
        }
        #endregion
    }
}
        #endregion
    }
}