| | |
| | | /// </summary> |
| | | public void InitMiddleFrame() |
| | | {
|
| | | //移除全部
|
| | | bodyFrameLayout.RemoveAll();
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //初始化搜索控件
|
| | | this.InitSearchControl();
|
| | |
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | if (this.Parent != null)
|
| | | {
|
| | | //在界面中间显示无分享设备的提示消息
|
| | | this.ShowNotShardDeviceMsg();
|
| | | }
|
| | | });
|
| | | } |
| | | else
|
| | |
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | if (this.Parent == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | count++;
|
| | | //添加设备的菜单行
|
| | | this.AddDeviceMenuRow(rowInfo.listDevice);
|
| | |
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | if (this.Parent != null)
|
| | | {
|
| | | //添加设备的行
|
| | | this.AddDeviceMenuRow(rowInfo.listDevice);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | if (this.Parent != null)
|
| | | {
|
| | | //添加设备的行
|
| | | this.AddDeviceMenuRow(rowInfo.listDevice);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | private void StartCheckDeviceOnline()
|
| | | {
|
| | | //添加接受网关自动推送的事件
|
| | | DeviceAttributeLogic.Current.AddReceiveDeviceOnlinePushEvent("DeviceListFormReceivePushOnline", this.ReceiveDeviceStatuPush);
|
| | | HdlDeviceAttributeLogic.Current.AddReceiveDeviceOnlinePushEvent("DeviceListFormReceivePushOnline", this.ReceiveDeviceStatuPush);
|
| | |
|
| | | //从设备列表中获取在线状态
|
| | | new System.Threading.Thread(async () =>
|
| | |
| | |
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | row.SetOnlineStatu(device.IsOnline == 1);
|
| | | row?.SetOnlineStatu(device.IsOnline == 1);
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | /// </summary> |
| | | private void StartCheckDeviceAlarm()
|
| | | {
|
| | | DeviceAttributeLogic.Current.AddSafetyAlarmEvent("DeviceListFormSensor", this.SetAlarmInfoByInterfaceResult);
|
| | | HdlDeviceAttributeLogic.Current.AddSafetyAlarmEvent("DeviceListFormSensor", this.SetAlarmInfoByInterfaceResult);
|
| | | } |
| | | |
| | | /// <summary>
|
| | |
| | | }
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | row.StartSelectStatuThread(3000);
|
| | | row?.StartSelectStatuThread(3000);
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | //收集检索用的信息
|
| | | 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);
|
| | | } |
| | |
| | | /// </summary>
|
| | | public void OpenGatewayManagementForm()
|
| | | {
|
| | | var form = new Gateway.GatewayManagementForm();
|
| | | var form = new GatewayManage.GatewayManagementForm();
|
| | | this.AddForm(form);
|
| | | }
|
| | |
|
| | |
| | | /// <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
|