| | |
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddWirelessGateway));
|
| | |
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var ssid = HdlWifiLogic.Current.SSID;
|
| | | if (ssid == null)
|
| | | {
|
| | | //获取网络SSID失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetSsidFail);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return;
|
| | | }
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame(ssid);
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private void InitMiddleFrame()
|
| | | private void InitMiddleFrame(string ssid)
|
| | | {
|
| | | bodyFrameLayout.RemoveAll();
|
| | |
|
| | |
| | |
|
| | | //请选择网络
|
| | | var btnTitle = new NormalViewControl(600, 64, true);
|
| | | btnTitle.X = ControlCommonResourse.XXLeft;
|
| | | btnTitle.X = HdlControlResourse.XXLeft;
|
| | | btnTitle.Y = Application.GetRealHeight(30);
|
| | | btnTitle.TextSize = 15;
|
| | | btnTitle.TextID = R.MyInternationalizationString.uPleaseSelectNetwork;
|
| | | frameBack.AddChidren(btnTitle);
|
| | |
|
| | | //WIFI
|
| | | var rowWifi = new FrameCaptionViewControl("WiFi", HdlWifiLogic.Current.SSID);
|
| | | //var rowWifi = new FrameCaptionViewControl("WiFi", "software");
|
| | | var rowWifi = new FrameCaptionViewControl("WiFi", ssid);
|
| | | rowWifi.UseClickStatu = false;
|
| | | rowWifi.Y = Application.GetRealHeight(124);
|
| | | frameBack.AddChidren(rowWifi);
|
| | |
| | | };
|
| | |
|
| | | var btnMsg = new NormalViewControl(btnPsw.txtInput.Width, false);
|
| | | btnMsg.X = ControlCommonResourse.XXLeft;
|
| | | btnMsg.X = HdlControlResourse.XXLeft;
|
| | | btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23);
|
| | | btnMsg.TextSize = 12;
|
| | | btnMsg.Height = Application.GetRealHeight(40);
|
| | | btnMsg.TextColor = UserCenterColor.Current.Red;
|
| | | btnMsg.TextColor = UserCenterColor.Current.ErrorColor;
|
| | | bodyFrameLayout.AddChidren(btnMsg);
|
| | |
|
| | | //查看帮助
|
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("WirelessUdp");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Udp");
|
| | | };
|
| | |
|
| | | //下一步
|
| | |
| | | return;
|
| | | }
|
| | | //开始Wi-Fi配网
|
| | | HdlWifiLogic.Current.StartSmartConnection(rowWifi.Text, btnPsw.Text, "1");
|
| | | HdlWifiLogic.Current.StartSmartConnection(rowWifi.Text, btnPsw.Text, "");
|
| | | var form = new WirelessUdpSearchForm();
|
| | | this.AddFromAndRemoveNowForm(form);
|
| | | this.AddFormAndCloseNowForm(form);
|
| | | };
|
| | | }
|
| | |
|