HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-09-30 404cdc88627f942df7944af04ee05b9d527752d6
ZigbeeApp/Shared/Phone/UserCenter/DeviceShard/ShardDeviceManagementMainForm.cs
@@ -53,8 +53,8 @@
        /// </summary>
        public void InitMiddleFrame()
        {
            //移除全部
            bodyFrameLayout.RemoveAll();
            //清空bodyFrame
            this.ClearBodyFrame();
            //初始化搜索控件
            this.InitSearchControl();
@@ -111,8 +111,11 @@
            {
                Application.RunOnMainThread(() =>
                {
                    if (this.Parent != null)
                    {
                    //在界面中间显示无分享设备的提示消息
                    this.ShowNotShardDeviceMsg();
                    }
                });
            }
            else
@@ -138,6 +141,10 @@
            {
                Application.RunOnMainThread(() =>
                {
                    if (this.Parent == null)
                    {
                        return;
                    }
                    count++;
                    //添加设备的菜单行
                    this.AddDeviceMenuRow(rowInfo.listDevice);
@@ -380,8 +387,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            if (this.Parent != null)
                            {
                            //添加设备的行
                            this.AddDeviceMenuRow(rowInfo.listDevice);
                            }
                        });
                    }
                }
@@ -395,8 +405,11 @@
                        {
                            Application.RunOnMainThread(() =>
                            {
                                if (this.Parent != null)
                                {
                                //添加设备的行
                                this.AddDeviceMenuRow(rowInfo.listDevice);
                                }
                            });
                        }
                    }
@@ -471,7 +484,7 @@
        private void StartCheckDeviceOnline()
        {
            //添加接受网关自动推送的事件
            DeviceAttributeLogic.Current.AddReceiveDeviceOnlinePushEvent("DeviceListFormReceivePushOnline", this.ReceiveDeviceStatuPush);
            HdlDeviceAttributeLogic.Current.AddReceiveDeviceOnlinePushEvent("DeviceListFormReceivePushOnline", this.ReceiveDeviceStatuPush);
            //从设备列表中获取在线状态
            new System.Threading.Thread(async () =>
@@ -540,7 +553,7 @@
                Application.RunOnMainThread(() =>
                {
                    row.SetOnlineStatu(device.IsOnline == 1);
                    row?.SetOnlineStatu(device.IsOnline == 1);
                });
            }
        }
@@ -554,7 +567,7 @@
        /// </summary>
        private void StartCheckDeviceAlarm()
        {
            DeviceAttributeLogic.Current.AddSafetyAlarmEvent("DeviceListFormSensor", this.SetAlarmInfoByInterfaceResult);
            HdlDeviceAttributeLogic.Current.AddSafetyAlarmEvent("DeviceListFormSensor", this.SetAlarmInfoByInterfaceResult);
        }
        /// <summary>
@@ -584,7 +597,7 @@
                }
                Application.RunOnMainThread(() =>
                {
                    row.StartSelectStatuThread(3000);
                    row?.StartSelectStatuThread(3000);
                });
            }
        }
@@ -620,6 +633,14 @@
                //收集检索用的信息
                foreach (var rowInfo in this.dicRowInfo.Values)
                {
                    rowInfo.listDevice.Sort((CommonDevice device1, CommonDevice device2) =>
                    {
                        if (device1.DeviceEpoint > device2.DeviceEpoint)
                        {
                            return 1;
                        }
                        return -1;
                    });
                    rowInfo.MacName = Common.LocalDevice.Current.GetDeviceMacName(rowInfo.listDevice[0]);
                    rowInfo.DeviveTypeName = Common.LocalDevice.Current.GetDeviceObjectText(rowInfo.listDevice);
                }
@@ -648,7 +669,7 @@
        /// </summary>
        public void OpenGatewayManagementForm()
        {
            var form = new Gateway.GatewayManagementForm();
            var form = new GatewayManage.GatewayManagementForm();
            this.AddForm(form);
        }
@@ -674,13 +695,12 @@
        /// <summary>
        /// 画面关闭
        /// </summary>
        /// <param name="isCloseForm">是否关闭界面,false的时候,只会调用关闭函数里面的附加功能</param>
        public override void CloseForm(bool isCloseForm = true)
        public override void CloseForm()
        {
            DeviceAttributeLogic.Current.RemoveEvent("DeviceListFormSensor");
            DeviceAttributeLogic.Current.RemoveEvent("DeviceListFormReceivePushOnline");
            HdlDeviceAttributeLogic.Current.RemoveEvent("DeviceListFormSensor");
            HdlDeviceAttributeLogic.Current.RemoveEvent("DeviceListFormReceivePushOnline");
            base.CloseForm(isCloseForm);
            base.CloseForm();
        }
        #endregion