| | |
| | | /// </summary>
|
| | | private bool isDeviceThreadStart = false;
|
| | | /// <summary>
|
| | | /// 等待设备的回馈的超时时间(单位:秒)
|
| | | /// 等待设备的回馈的超时时间(单位:百毫秒)
|
| | | /// </summary>
|
| | | private int waitDeviceTimeOut = 3;
|
| | | private int waitDeviceTimeOut = 20;
|
| | | /// <summary>
|
| | | /// 主题超时的线程是否开启
|
| | | /// </summary>
|
| | |
| | | this.btnProgressBar = new FrameLayout();
|
| | | btnProgressBar.Width = 0;
|
| | | btnProgressBar.Height = btnProRow.Height;
|
| | | btnProgressBar.Radius = btnProRow.Radius;
|
| | | btnProgressBar.BackgroundColor = 0xfffb744a;
|
| | | btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
|
| | | btnProRow.AddChidren(btnProgressBar);
|
| | |
| | | this.StartTopicTimeOutThread();
|
| | | return;
|
| | | }
|
| | | //中断主题超时线程
|
| | | this.topTimeOut = -100;
|
| | |
|
| | | lock (this.dicNewDevice)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | //刷新超时时间
|
| | | this.waitDeviceTimeOut = 3;
|
| | | this.waitDeviceTimeOut = 20;
|
| | |
|
| | | //获取设备的固定属性
|
| | | HdlDeviceFixedAttributeLogic.Current.SetAllFixedAttributeToDevice(device);
|
| | |
|
| | | if ((device is OTADevice) == false)
|
| | | {
|
| | | //不需要200端点的那个设备
|
| | | this.dicNewDevice[device.DeviceAddr].Add(device);
|
| | | //不需要200端点的那个设备 2020.01.13 变更:ota也加进来
|
| | | this.dicNewDevice[device.DeviceAddr].Add(device);
|
| | |
|
| | | //有新设备,开启显示设备信息界面的线程(里面会等待三秒这样)
|
| | | this.StartShowDeviceAddSuccessFormThread();
|
| | | }
|
| | | //有新设备,开启显示设备信息界面的线程(里面会等待三秒这样)
|
| | | this.StartShowDeviceAddSuccessFormThread();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | while (this.waitDeviceTimeOut >= 0)
|
| | | {
|
| | | //等待下一个回路
|
| | | System.Threading.Thread.Sleep(1000);
|
| | | System.Threading.Thread.Sleep(100);
|
| | | this.waitDeviceTimeOut--;
|
| | | }
|
| | | //停止接收
|
| | | this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
|
| | | System.Threading.Thread.Sleep(500);
|
| | | System.Threading.Thread.Sleep(200);
|
| | |
|
| | | //目前就弄一个
|
| | | Application.RunOnMainThread(() =>
|
| | |
| | | //重新变更UI
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | if (device is OTADevice)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | device.IconPath = string.Empty;
|
| | | device.ReSave();
|
| | | }
|
| | |
| | | if (info.Result != 0)
|
| | | {
|
| | | //出现未知错误,请重新入网
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uUnKnowErrorAndReAccessNetwork));
|
| | | //HdlLogLogic.Current.WriteLog(-1, resultData);
|
| | | //this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uUnKnowErrorAndReAccessNetwork));
|
| | | HdlLogLogic.Current.WriteLog(-1, resultData);
|
| | | return 2;
|
| | | }
|
| | | this.topTimeOut = topMaxTime;
|
| | |
| | | }
|
| | | else if (topic == gatewayId + "/DeviceInComingRespon")
|
| | | {
|
| | | this.topTimeOut = topMaxTime;
|
| | | //网关最终上报节点设备信息
|
| | | this.SetDeviceProgressValue(6);
|
| | | return 1;
|
| | |
| | | System.Threading.Thread.Sleep(1000);
|
| | | this.topTimeOut--;
|
| | | }
|
| | | if (this.topTimeOut < 0 && this.topTimeOut >= -10)
|
| | | if (this.topTimeOut < 0)
|
| | | {
|
| | | //响应超时,请重新入网
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uResponseTimeoutsAndReAccessNetwork));
|