| | |
| | | string text_entry_userName_tip = "请输入组名。"; |
| | | string text_entry_projectName_tip = "请输入工程名。"; |
| | | string text_entry_password_tip = "请输入密码。"; |
| | | string text_link = "连接一端口"; |
| | | string text_link = "连接"; |
| | | string text_back = "后退"; |
| | | string text_reading = "读取中"; |
| | | /// <summary> |
| | |
| | | string txt_linkSeverFailed = "连接服务器失败"; |
| | | string txt_DataError = "数据异常"; |
| | | string txt_QueryFailed = "查询失败"; |
| | | string txt_NoData = "无数据"; |
| | | string txt_Search = "搜索"; |
| | | #endregion |
| | | |
| | |
| | | txt_DataError = "Data exception"; |
| | | txt_QueryFailed = "Query failed"; |
| | | txt_Search = "search"; |
| | | txt_NoData = "No data"; |
| | | } |
| | | } |
| | | |
| | |
| | | userNameView.AddChidren (tvUserName); |
| | | |
| | | var btnLine = new Button () { |
| | | Height = Application.GetRealHeight (1), |
| | | Height = Application.GetRealHeight (2), |
| | | BackgroundColor = SkinStyle.Current.LineColor, |
| | | }; |
| | | infoView.AddChidren (btnLine); |
| | |
| | | var groupName = System.Text.Encoding.UTF8.GetString (oneProtData, 1, 20).Trim ('\0');//============= |
| | | var projectName22 = System.Text.Encoding.UTF8.GetString (oneProtData, 23, 20).Trim ('\0');//============= |
| | | var userName22 = System.Text.Encoding.UTF8.GetString (oneProtData, 43, 8).Trim ('\0');//============= |
| | | var isOnline = oneProtData [57] == 1; |
| | | Application.RunOnMainThread (() => { |
| | | |
| | | RowLayout wirelessView = new RowLayout () { |
| | |
| | | BackgroundColor = SkinStyle.Current.ViewColor, |
| | | }; |
| | | listView.AddChidren (wirelessView); |
| | | showGatewayRow (userName22,projectName22, wirelessView); |
| | | showGatewayRow (userName22,projectName22, wirelessView,isOnline); |
| | | }); |
| | | }catch (Exception ex) { |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | } else { |
| | | } |
| | | else if(sss[1] == 245) { |
| | | Application.RunOnMainThread (() => { |
| | | rightButton1.Text = txt_NoData; |
| | | rightButton1.TextColor = 0x99FF0000; |
| | | }); |
| | | } |
| | | else { |
| | | Application.RunOnMainThread (() => { |
| | | rightButton1.Text = txt_QueryFailed; |
| | | rightButton1.TextColor = 0x99FF0000; |
| | |
| | | /// <summary> |
| | | /// 显示 |
| | | /// </summary> |
| | | void showGatewayRow (string userName,string projectName, RowLayout wirelessView) |
| | | void showGatewayRow (string userName,string projectName, RowLayout wirelessView,bool isOnline) |
| | | { |
| | | |
| | | Button pointButton1 = new Button () { |
| | | Width = Application.GetRealHeight (13), |
| | | Height = Application.GetRealHeight (13), |
| | | Width = Application.GetRealHeight (20), |
| | | Height = Application.GetRealHeight (20), |
| | | X = Application.GetRealWidth (60), |
| | | UnSelectedImagePath = "Item/Point.png", |
| | | SelectedImagePath = "Item/PointSelected.png", |
| | | Radius = (uint)Application.GetRealHeight (7), |
| | | Gravity = Gravity.CenterVertical, |
| | | BackgroundColor = isOnline ? 0xFF00FF00: 0xFF000000 |
| | | }; |
| | | wirelessView.AddChidren (pointButton1); |
| | | |
| | | |
| | | Button nameButton1 = new Button () { |
| | | Width = Application.GetRealWidth (342), |
| | |
| | | |
| | | Button rightButton1 = new Button () { |
| | | X = Application.GetRealWidth (480), |
| | | Width = Application.GetRealWidth (100), |
| | | Width = Application.GetRealWidth (150), |
| | | Height = Application.GetRealHeight (40), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | IsMoreLines = true, |
| | | TextSize = 12, |
| | | Text = text_link, |
| | | }; |
| | | wirelessView.AddChidren (rightButton1); |
| | | if (isOnline) |
| | | wirelessView.AddChidren (rightButton1); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | LinkOnePort (userName,projectName); |