| | |
| | | //设置标题信息
|
| | | 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);
|
| | |
|
| | | //初始化中部控件
|
| | |
| | |
|
| | | //图片
|
| | | var btnPic = new PicViewControl(878, 478);
|
| | | btnPic.Y = Application.GetMinRealAverage(251);
|
| | | btnPic.Y = Application.GetRealHeight(251);
|
| | | btnPic.Gravity = Gravity.CenterHorizontal;
|
| | | btnPic.UnSelectedImagePath = "Instruct/DeviceSearch.png";
|
| | | bodyFrameLayout.AddChidren(btnPic);
|
| | |
| | | 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>
|
| | | private void StartConcetionAnimeteThread()
|
| | | {
|
| | | int iconSize = Application.GetMinRealAverage(23);
|
| | | int iconSize = this.GetPictrueRealSize(23);
|
| | |
|
| | | var listPoint = new List<int>();
|
| | | for (int i = 0; i < 9; i++)
|
| | | {
|
| | | //X轴+Index*(图标大小+间距)
|
| | | listPoint.Add(Application.GetMinRealAverage(394) + i * (iconSize + Application.GetMinRealAverage(10)));
|
| | | listPoint.Add(this.GetPictrueRealSize(394) + i * (iconSize + this.GetPictrueRealSize(10)));
|
| | | }
|
| | |
|
| | | var btnRound = new PicViewControl(iconSize, iconSize, false);
|
| | | btnRound.Radius = (uint)iconSize / 2;
|
| | | btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor;
|
| | | btnRound.X = listPoint[0];
|
| | | btnRound.Y = Application.GetMinRealAverage(475);
|
| | | btnRound.Y = this.GetPictrueRealSize(475);
|
| | | bodyFrameLayout.AddChidren(btnRound);
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | |
| | | /// </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();
|
| | | }
|
| | |
|