| | |
| | | {
|
| | | lock (dicRowInfo)
|
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (this.listView == null)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | //获取全部设备
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway);
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway, false);
|
| | | if (this.Parent == null)
|
| | | {
|
| | | return;
|
| | |
| | | //刷新网关在线状态
|
| | | HdlGatewayLogic.Current.RefreshGatewayOnlineStatu(new List<ZbGateway>() { zbGateway });
|
| | |
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (this.gatewayViewRow != null && this.gatewayViewRow.zbGatewayId == selectGwId)
|
| | | {
|
| | |
| | | }
|
| | | if (gateWay.GwId == this.gatewayViewRow.zbGatewayId)
|
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //相同的状态,不需要再次刷新
|
| | | if (this.gatewayViewRow.isOnline != online)
|
| | |
| | | this.ReceiveDeviceStatu(device);
|
| | | }, ShowErrorMode.NO);
|
| | | }
|
| | | System.Threading.Thread.Sleep(30);
|
| | | System.Threading.Thread.Sleep(50);
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | {
|
| | | 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();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | 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;
|