| | |
| | | //设置标题信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
|
| | |
|
| | | this.gatewayId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway);
|
| | | this.gatewayId = GatewayResourse.NowSelectGatewayId;
|
| | | HdlGatewayLogic.Current.GetRealGateway(ref this.realGateway, this.gatewayId);
|
| | |
|
| | | //初始化中部控件
|
| | |
| | | btnProgressView.Text = "0%";
|
| | | frameProgress.AddChidren(btnProgressView);
|
| | |
|
| | | //允许设备入网
|
| | | this.StartDeviceCanAddToGateway(false);
|
| | |
|
| | | //添加监视设备新上报的事件
|
| | | this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
|
| | | if (this.realGateway != null)
|
| | | {
|
| | | //允许设备入网
|
| | | this.StartDeviceCanAddToGateway(false);
|
| | | //添加监视设备新上报的事件
|
| | | this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
|
| | | }
|
| | | //开启连接的假想动画效果线程
|
| | | this.StartConcetionAnimeteThread();
|
| | | }
|
| | |
| | | /// </summary>
|
| | | public override void CloseFormBefore()
|
| | | {
|
| | | //停止接收
|
| | | this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | if (this.realGateway != null)
|
| | | {
|
| | | System.Threading.Thread.Sleep(1200);
|
| | | //关闭入网模式
|
| | | this.realGateway.AddNewDeviceToGateway(0);
|
| | | });
|
| | | //停止接收
|
| | | this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | System.Threading.Thread.Sleep(1200);
|
| | | //关闭入网模式
|
| | | this.realGateway.AddNewDeviceToGateway(0);
|
| | | });
|
| | | }
|
| | | base.CloseFormBefore();
|
| | | }
|
| | |
|