| | |
| | | ms.WriteByte (common.SubnetID); |
| | | ms.WriteByte (common.DeviceID); |
| | | } |
| | | Console.WriteLine ("搜索网关,搜索地址是:" + CommonPage.EndPoint.ToString () + " " + CommonPage.GateWayList.Count); |
| | | Utlis.WriteLine ("搜索网关,搜索地址是:" + CommonPage.EndPoint.ToString () + " " + CommonPage.GateWayList.Count); |
| | | Control control = new Control (); |
| | | control.Send (new Target () { |
| | | IPEndPoint = CommonPage.EndPoint, |
| | |
| | | ShowGateWayView (); |
| | | }); |
| | | } catch (Exception ex) { |
| | | Console.WriteLine (ex.ToString ()); |
| | | Utlis.WriteLine (ex.ToString ()); |
| | | } finally { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Hide (); |
| | |
| | | continue; |
| | | } |
| | | // buspro上传的数据 |
| | | if (commGateway.obj1 == 1 && (str [1].ToString () == DeviceType.OnePortWirelessFR.ToString () || str [1].ToString () == DeviceType.SuperWireless.ToString () || str [1].ToString () == DeviceType.OnePortBus.ToString ())) { |
| | | if (commGateway.obj1 == 1 |
| | | && (str [1].ToString () == DeviceType.OnePortWirelessFR.ToString () |
| | | || str [1].ToString () == DeviceType.OnePortMqttFR.ToString () |
| | | || str [1].ToString () == DeviceType.SuperWireless.ToString () |
| | | || str [1].ToString () == DeviceType.OnePortBus.ToString ())) { |
| | | if (firstInitOfflintOnePortBus) { |
| | | FrameLayout OnePortWirelessFRFrameLayout = new FrameLayout () { |
| | | Height = Application.GetRealHeight (98), |
| | |
| | | VerticalScrolViewMiddle.AddChidren (wirelessView); |
| | | |
| | | AddWirelessGateway (commGateway, null, wirelessView); |
| | | } else if (str [1].ToString () == DeviceType.OnePortWirelessFR.ToString () || str [1].ToString () == DeviceType.SuperWireless.ToString ()) { |
| | | var onePortWirelessFR = Newtonsoft.Json.JsonConvert.DeserializeObject<OnePortWirelessFR> (one); |
| | | } else if (str [1].ToString () == DeviceType.OnePortWirelessFR.ToString () |
| | | || str [1].ToString () == DeviceType.OnePortMqttFR.ToString () |
| | | || str [1].ToString () == DeviceType.SuperWireless.ToString ()) { |
| | | OnePortWirelessFR onePortWirelessFR; |
| | | if(str [1].ToString () == DeviceType.OnePortMqttFR.ToString ()) { |
| | | onePortWirelessFR = Newtonsoft.Json.JsonConvert.DeserializeObject<OnePortMqttFR> (one); |
| | | } else { |
| | | onePortWirelessFR = Newtonsoft.Json.JsonConvert.DeserializeObject<OnePortWirelessFR> (one); |
| | | } |
| | | |
| | | if (onePortWirelessFR == null) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | InitBottomButton (); |
| | | } catch (Exception ex) { |
| | | Console.WriteLine (ex.ToString ()); |
| | | Utlis.WriteLine (ex.ToString ()); |
| | | } |
| | | } |
| | | |
| | |
| | | var gateWayList = gateWayListZ.FindAll ((obj) => { |
| | | return obj.Split ('_') [1].ToString () == DeviceType.OnePortBus.ToString () || |
| | | obj.Split ('_') [1].ToString () == DeviceType.RCU.ToString () || |
| | | obj.Split ('_') [1].ToString () == DeviceType.OnePortMqttFR.ToString () || |
| | | obj.Split ('_') [1].ToString () == DeviceType.OnePortWirelessFR.ToString (); |
| | | }); |
| | | |
| | |
| | | var tempStrings = gatewayFileName.Split ('_'); |
| | | if (tempStrings [1].ToString () == DeviceType.OnePortBus.ToString () || |
| | | tempStrings [1].ToString () == DeviceType.RCU.ToString () || |
| | | tempStrings [1].ToString () == DeviceType.OnePortMqttFR.ToString () || |
| | | tempStrings [1].ToString () == DeviceType.OnePortWirelessFR.ToString ()) { |
| | | var one = System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (gatewayFileName)); |
| | | if (one.Length == 0) { |
| | |
| | | textButton1.Text = onePortWirelessFR.Name; |
| | | button1.SelectedImagePath = "Item/WirelessSelected.png"; |
| | | button1.UnSelectedImagePath = "Item/Wireless.png"; |
| | | } else if (tempStrings [1].ToString () == DeviceType.OnePortMqttFR.ToString ()) { |
| | | var onePortMqttFR = Newtonsoft.Json.JsonConvert.DeserializeObject<OnePortMqttFR> (one); |
| | | textButton1.Text = onePortMqttFR.Name; |
| | | button1.SelectedImagePath = "Item/OnePortSelected.png"; |
| | | button1.UnSelectedImagePath = "Item/OnePort.png"; |
| | | } else if (tempStrings [1].ToString () == DeviceType.OnePortBus.ToString ()) { |
| | | var onePortBus = Newtonsoft.Json.JsonConvert.DeserializeObject<OnePortBus> (one); |
| | | textButton1.Text = onePortBus.Name; |