| | |
| | | /// 未知版本 |
| | | /// 无需升级 2022-12-08 14:23:07 |
| | | /// </summary> |
| | | string text_UnknownVersion = "无需升级"; |
| | | string text_UnknownVersion = "其他版本"; |
| | | /// <summary> |
| | | /// 读取失败 |
| | | /// </summary> |
| | |
| | | text_Upgraded = "Upgraded"; |
| | | text_Upgrading = "Upgrading"; |
| | | text_UpgradeFailed = "Upgrade failed"; |
| | | text_UnknownVersion = "No upgrade required"; |
| | | text_UnknownVersion = "Other version"; |
| | | text_readFailure = "Read failure"; |
| | | text_search = "Search and configure"; |
| | | text_reading = "Reading"; |
| | |
| | | /// 底部 |
| | | /// </summary> |
| | | Button AddSystemEquipmentButton = new Button () { |
| | | Y = Application.GetRealHeight (846 + 80), |
| | | Y = Application.GetRealHeight (846 + 80 ), |
| | | Height = Application.GetRealHeight (90), |
| | | Text = text_search, |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | AddChidren (AddSystemEquipmentButton); |
| | | AddSystemEquipmentButton.MouseUpEventHandler += (sender, e) => { |
| | | VerticalScrolViewMiddle.RemoveAll (); |
| | | CommonPage.FindGateway = true; |
| | | MainPage.Loading.Start (); |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | try { |
| | |
| | | CommonPage.RandomHigh = (byte)new Random ().Next (255); |
| | | CommonPage.RandomLow = (byte)new Random ().Next (255); |
| | | CommonPage.GateWayList.Clear (); |
| | | CommonPage.FindGateway = true; |
| | | //如果两次都没有数据反馈,就不读取 |
| | | int readCount = 2; |
| | | while (0 < readCount) { |
| | |
| | | Control control = new Control (); |
| | | control.Send (new Target () { |
| | | IPEndPoint = CommonPage.EndPoint, |
| | | Command = Command.ReadGateway, |
| | | Command = Command.ReadRemark, |
| | | //Command = Command.ReadGateway, |
| | | SubnetID = 0xFF, |
| | | DeviceID = 0xFF, |
| | | AddData = ms.ToArray () |
| | | AddData = new byte [] { }, |
| | | }, SendCount.Zero, false); |
| | | |
| | | control.Send (new Target () { |
| | | IPEndPoint = new System.Net.IPEndPoint (new Net.NetWiFi ().BroadcastIpAddress, 6000), |
| | | Command = Command.ReadGateway, |
| | | SubnetID = 0xFF, |
| | | DeviceID = 0xFF, |
| | | AddData = ms.ToArray () |
| | | }, SendCount.Zero, false); |
| | | //control.Send (new Target () { |
| | | // IPEndPoint = new System.Net.IPEndPoint (new Net.NetWiFi ().BroadcastIpAddress, 6000), |
| | | // Command = Command.ReadRemark, |
| | | // //Command = Command.ReadGateway, |
| | | // SubnetID = 0xFF, |
| | | // DeviceID = 0xFF, |
| | | // AddData = ms.ToArray () |
| | | //}, SendCount.Zero, false); |
| | | |
| | | System.Threading.Thread.Sleep (800); |
| | | //如果数量不相等,就重置次数 |
| | |
| | | readCount = 2; |
| | | } |
| | | } |
| | | CommonPage.FindGateway = false; |
| | | |
| | | |
| | | Application.RunOnMainThread (() => { |
| | |
| | | |
| | | 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, |