From d78515ac4ac8cf4a1785d9df18058d6724f12b79 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 14 一月 2021 19:34:59 +0800
Subject: [PATCH] 合并xm2021-01-13 wjc2021-02-06
---
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs | 166 ++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 115 insertions(+), 51 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs
index 7e10cf7..37e0226 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs
@@ -31,66 +31,130 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
- //鍥剧墖
- var framePic = new FrameLayout();
- framePic.Width = Application.GetMinRealAverage(852);
- framePic.Height = Application.GetMinRealAverage(478);
- framePic.Gravity = Gravity.CenterHorizontal;
- framePic.Y = Application.GetRealHeight(285);
- framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
- bodyFrameLayout.AddChidren(framePic);
-
- //璺宠浆鍒扮Щ鍔ㄨ澶嘩LAN璁剧疆
- //閫夋嫨hdlZigbeeGW-xxxx缃戠粶
- string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
- int yy = framePic.Bottom + Application.GetRealHeight(213);
- foreach (var msg in ArryMsg)
- {
- var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
- btnMsg.Text = msg;
- btnMsg.Y = yy;
- btnMsg.TextAlignment = TextAlignment.Center;
- btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
- bodyFrameLayout.AddChidren(btnMsg);
- yy = btnMsg.Bottom;
- }
-
- //鍘昏缃�
- var btnSettion = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
- btnSettion.Y = yy + Application.GetRealHeight(12);
- btnSettion.TextSize = 12;
- btnSettion.TextAlignment = TextAlignment.Center;
- btnSettion.TextColor = 0xff0075ff;
- btnSettion.Text = Language.StringByID(R.MyInternationalizationString.uGotoSettion);
- btnSettion.ButtonClickEvent += (sender, e) =>
- {
- };
- bodyFrameLayout.AddChidren(btnSettion);
- //搴曠嚎
- int lineWidth = btnSettion.GetRealWidthByText(12);
- var btnLine1 = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
- btnLine1.BackgroundColor = 0xff0075ff;
- btnLine1.Gravity = Gravity.CenterHorizontal;
- btnLine1.Y = btnSettion.Bottom - Application.GetRealHeight(8);
- bodyFrameLayout.AddChidren(btnLine1);
-
- //鏌ョ湅甯姪
- var btnHelp = this.AddHelpControl();
- btnHelp.ButtonClickEvent += (sender, e) =>
- {
- var form = new DeviceDirection.DeviceDirectionHelpForm();
- form.AddForm("WirelessUdp");
- };
-
//涓嬩竴姝�
var btnNext = new BottomClickButton();
btnNext.TextID = R.MyInternationalizationString.uNextway;
bodyFrameLayout.AddChidren(btnNext);
btnNext.ButtonClickEvent += (sender, e) =>
{
+ //濡傛灉涓嶆槸鐑偣妯″紡
+ if (HdlWifiLogic.Current.IsGatewayHotspot == false)
+ {
+ //閫夋嫨hdlZigbeeGW-xxxx缃戠粶
+ this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uPleaseSelectGatewayXXNet));
+ return;
+ }
+ var errorMsg = HdlWifiLogic.Current.StartApTcpConnection();
+ if (errorMsg != null)
+ {
+ //鎷ユ湁閿欒
+ this.ShowMassage(ShowMsgType.Error, errorMsg);
+ return;
+ }
var form = new WirelessApSelectNetworkForm();
this.AddFromAndRemoveNowForm(form);
};
+ //濡傛灉涓嶆槸缃戝叧鐑偣
+ if (HdlWifiLogic.Current.IsGatewayHotspot == false)
+ {
+ btnNext.Visible = false;
+ }
+
+ //鍥剧墖
+ var framePic = new FrameLayout();
+ framePic.Width = this.GetPictrueRealSize(848);
+ framePic.Height = this.GetPictrueRealSize(475);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.Y = Application.GetRealHeight(199);
+ framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
+ bodyFrameLayout.AddChidren(framePic);
+
+ //鎵嬫満杩炴帴缃戝叧鐑偣
+ var btnTitle = new NormalViewControl(400, 60, true);
+ btnTitle.TextID = R.MyInternationalizationString.uMobileConnectionGatewayHotspot;
+ btnTitle.X = Application.GetRealWidth(75);
+ btnTitle.Y = framePic.Bottom + Application.GetRealHeight(107);
+ btnTitle.IsBold = true;
+ btnTitle.TextSize = 14;
+ bodyFrameLayout.AddChidren(btnTitle);
+
+ //1.缃戝叧鐑偣鐨勮处鍙蜂负hdlZigbeeGW-XXX,瀵嗙爜涓篽dl123456
+ //2.鍏蜂綋璐﹀彿鍜屽瘑鐮佸彲鏌ョ湅缃戝叧鏍囩
+ //3.鐐瑰嚮"{1}"瀹屾垚鎵嬫満杩炴帴缃戝叧鐑偣
+ //4.鐐瑰嚮涓嬩竴姝�
+ string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+ int yy = btnTitle.Bottom + Application.GetRealHeight(23);
+ for (int i = 0; i < ArryMsg.Length; i++)
+ {
+ if (i != 2)
+ {
+ var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ btnMsg.Text = ArryMsg[i];
+ btnMsg.Y = yy;
+ btnMsg.X = btnTitle.X;
+ btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnMsg.TextSize = 12;
+ bodyFrameLayout.AddChidren(btnMsg);
+ yy = btnMsg.Bottom;
+ }
+ else
+ {
+ //3.鐐瑰嚮"{1}"瀹屾垚鎵嬫満杩炴帴缃戝叧鐑偣
+ var myArry = ArryMsg[i].Split(new string[] { "{1}" }, StringSplitOptions.RemoveEmptyEntries);
+ //3.鐐瑰嚮
+ var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ btnMsg1.Text = myArry[0];
+ btnMsg1.Y = yy;
+ btnMsg1.X = btnTitle.X;
+ btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnMsg1.TextSize = 12;
+ btnMsg1.Width = btnMsg1.GetRealWidthByText();
+ bodyFrameLayout.AddChidren(btnMsg1);
+
+ //鍘昏缃�
+ var btnSettion = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ btnSettion.X = btnMsg1.Right;
+ btnSettion.Y = btnMsg1.Y;
+ btnSettion.TextSize = 12;
+ btnSettion.TextAlignment = TextAlignment.Center;
+ btnSettion.TextColor = 0xff0075ff;
+ btnSettion.Text = Language.StringByID(R.MyInternationalizationString.uGotoSettion);
+ btnSettion.Width = btnSettion.GetRealWidthByText();
+ bodyFrameLayout.AddChidren(btnSettion);
+ btnSettion.ButtonClickEvent += (sender, e) =>
+ {
+ HdlWifiLogic.Current.OpenAppWifiSettion();
+ btnNext.Visible = true;
+ };
+ //搴曠嚎
+ var btnLine1 = new NormalViewControl(btnSettion.Width, ControlCommonResourse.BottomLineHeight, false);
+ btnLine1.BackgroundColor = 0xff0075ff;
+ btnLine1.X = btnSettion.X;
+ btnLine1.Y = btnSettion.Bottom - Application.GetRealHeight(8);
+ bodyFrameLayout.AddChidren(btnLine1);
+
+ //瀹屾垚鎵嬫満杩炴帴缃戝叧鐑偣
+ var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ btnMsg2.Text = myArry[1];
+ btnMsg2.Y = btnMsg1.Y;
+ btnMsg2.X = btnSettion.Right;
+ btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnMsg2.TextSize = 12;
+ btnMsg2.Width = btnMsg2.GetRealWidthByText();
+ bodyFrameLayout.AddChidren(btnMsg2);
+
+ yy = btnMsg1.Bottom;
+ }
+
+ }
+
+ //鏌ョ湅甯姪
+ var btnHelp = this.AddHelpControl();
+ btnHelp.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new AddGatewayHelpForm();
+ form.AddForm("Ap");
+ };
}
#endregion
--
Gitblit v1.8.0