| | |
| | | //停止接收
|
| | | this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
|
| | |
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | this.CloseForm();
|
| | | });
|
| | |
| | | return;
|
| | | }
|
| | | //根据设备Type创建对应的设备对象
|
| | | var device = Common.LocalDevice.Current.NewDeviceObjectByDeviceId((DeviceType)jobject.Value<int>("Device_ID"));
|
| | | var device = Common.LocalDevice.Current.NewDeviceObjectByDeviceId((DeviceType)jobject.Value<int>("Device_ID"), jobject.Value<int>("Epoint"));
|
| | | if (device == null)
|
| | | {
|
| | | return;
|
| | |
| | |
|
| | | //刷新超时时间
|
| | | this.waitDeviceTimeOut = 20;
|
| | |
|
| | | //获取设备的固定属性
|
| | | HdlDeviceFixedAttributeLogic.Current.SetAllFixedAttributeToDevice(device);
|
| | |
|
| | | //不需要200端点的那个设备 2020.01.13 变更:ota也加进来
|
| | | this.listNewDevice.Add(device);
|
| | |
| | | this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
|
| | | System.Threading.Thread.Sleep(200);
|
| | |
|
| | | //目前就弄一个
|
| | | Application.RunOnMainThread(() =>
|
| | | var listDevice = new List<CommonDevice>();
|
| | | for (int i = 0; i < this.listNewDevice.Count; i++)
|
| | | {
|
| | | var listDevice = new List<CommonDevice>();
|
| | | for (int i = 0; i < this.listNewDevice.Count; i++)
|
| | | var device = this.listNewDevice[i];
|
| | | if (device.DeviceAddr != this.listNewDevice[0].DeviceAddr)
|
| | | {
|
| | | var device = this.listNewDevice[i];
|
| | | if (device.DeviceAddr != this.listNewDevice[0].DeviceAddr)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | listDevice.Add(device);
|
| | | //重新变更UI
|
| | | if (device is OTADevice)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | device.IconPath = string.Empty;
|
| | | device.ReSave();
|
| | | continue;
|
| | | }
|
| | | listDevice.Add(device);
|
| | | //重新变更UI
|
| | | if (device is OTADevice)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | device.IconPath = string.Empty;
|
| | | device.ReSave();
|
| | |
|
| | | //设置设备功能类型 (不能在接收回路的地方写入,不然网关可能会超负荷)
|
| | | Common.LocalDevice.Current.RefreshDeviceFunctionType(device, device, true);
|
| | | System.Threading.Thread.Sleep(200);
|
| | | //获取设备的固定属性
|
| | | if (HdlDeviceFixedAttributeLogic.Current.SetAllFixedAttributeToDevice(device) == true)
|
| | | {
|
| | | System.Threading.Thread.Sleep(200);
|
| | | }
|
| | | }
|
| | |
|
| | | //目前就弄一个
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //显示设备信息画面
|
| | | this.ShowDeviceAddSuccessForm(listDevice);
|
| | | });
|
| | |
| | | timeCount = 0;
|
| | | }
|
| | | }
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (btnRound != null)
|
| | | {
|
| | |
| | | else if (topic == gatewayId + "/DeviceInComingRespon")
|
| | | {
|
| | | this.topTimeOut = topMaxTime;
|
| | |
|
| | | //设备入网时,有时候网关会上报虚拟设备
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
|
| | | CommonDevice.DeviceInfoData info = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceInfoData>(jobject["Data"].ToString());
|
| | | if (info.DriveCode != 0)
|
| | | {
|
| | | //不需要虚拟设备
|
| | | return 0;
|
| | | }
|
| | | //网关最终上报节点设备信息
|
| | | this.btnProgressBar.SetValue(6, 6);
|
| | | return 1;
|
| | |
| | | {
|
| | | //响应超时,请重新入网
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uResponseTimeoutsAndReAccessNetwork));
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //关闭界面
|
| | | this.CloseForm();
|