黄学彪
2020-07-20 2029e64ec0491f7e511dc15bffaf821bfbabe2de
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -625,7 +625,7 @@
        {
            lock (dicRowInfo)
            {
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    if (this.listView == null)
                    {
@@ -717,7 +717,7 @@
            }
            //获取全部设备
            int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway);
            int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway, false);
            if (this.Parent == null)
            {
                return;
@@ -754,7 +754,7 @@
                //刷新网关在线状态
                HdlGatewayLogic.Current.RefreshGatewayOnlineStatu(new List<ZbGateway>() { zbGateway });
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    if (this.gatewayViewRow != null && this.gatewayViewRow.zbGatewayId == selectGwId)
                    {
@@ -782,7 +782,7 @@
            }
            if (gateWay.GwId == this.gatewayViewRow.zbGatewayId)
            {
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //相同的状态,不需要再次刷新
                    if (this.gatewayViewRow.isOnline != online)
@@ -848,7 +848,7 @@
                                this.ReceiveDeviceStatu(device);
                            }, ShowErrorMode.NO);
                        }
                        System.Threading.Thread.Sleep(30);
                        System.Threading.Thread.Sleep(50);
                    }
                }
            });
@@ -1034,14 +1034,27 @@
        {
            if (this.dicRowInfo.ContainsKey(deviceAddr) == true)
            {
                var row = this.dicRowInfo[deviceAddr];
                row.MenuRow?.RefreshControlInfo(true);
                //明细
                if (row.dicDetailRow != null)
                var rowInfo = this.dicRowInfo[deviceAddr];
                //检测这个设备是否被删除 2020.01.13变更:追加Ota设备的判断
                if (LocalDevice.Current.GetDevicesByMac(deviceAddr).Count == 0
                    && LocalDevice.Current.GetOTADevice(deviceAddr) == null)
                {
                    foreach (var detailRow in row.dicDetailRow.Values)
                    //移除控件
                    rowInfo.dicDetailRow = null;
                    rowInfo.frameTable.RemoveFromParent();
                    this.dicRowInfo.Remove(deviceAddr);
                }
                else
                {
                    //刷新设备信息
                    rowInfo.MenuRow?.RefreshControlInfo(true);
                    if (rowInfo.dicDetailRow != null)
                    {
                        detailRow.RefreshControlInfo();
                        foreach (var contr in rowInfo.dicDetailRow.Values)
                        {
                            contr?.RefreshControlInfo();
                        }
                    }
                }
            }
@@ -1107,30 +1120,8 @@
        {
            if (this.nowActionDeviceMac != null)
            {
                var rowInfo = this.dicRowInfo[nowActionDeviceMac];
                //检测这个设备是否被删除 2020.01.13变更:追加Ota设备的判断
                if (Common.LocalDevice.Current.GetDevicesByMac(nowActionDeviceMac).Count == 0
                    && Common.LocalDevice.Current.GetOTADevice(nowActionDeviceMac) == null)
                {
                    //移除控件
                    rowInfo.dicDetailRow = null;
                    rowInfo.frameTable.RemoveFromParent();
                    this.dicRowInfo.Remove(nowActionDeviceMac);
                    rowInfo = null;
                }
                else
                {
                    //刷新设备信息
                    rowInfo.MenuRow?.RefreshControlInfo(true);
                    if (rowInfo.dicDetailRow != null)
                    {
                        foreach (var contr in rowInfo.dicDetailRow.Values)
                        {
                            contr?.RefreshControlInfo();
                        }
                    }
                }
                //刷新指定设备行的信息
                this.RefreshDeviceRow(this.nowActionDeviceMac);
            }
            //清空记录
            this.nowActionDeviceMac = null;