forked from ArduPilot/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConnectionOptions.cs
45 lines (36 loc) · 1.17 KB
/
ConnectionOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Windows.Forms;
using MissionPlanner.Comms;
using System.Threading;
using MissionPlanner.Utilities;
namespace MissionPlanner
{
public partial class ConnectionOptions : Form
{
// Thread signal.
public static ManualResetEvent tcpClientConnected = new ManualResetEvent(false);
public ConnectionOptions()
{
InitializeComponent();
CMB_serialport.Items.AddRange(SerialPort.GetPortNames());
CMB_serialport.Items.Add("TCP");
CMB_serialport.Items.Add("UDP");
CMB_serialport.Items.Add("UDPCl");
ThemeManager.ApplyThemeTo(this);
MissionPlanner.Utilities.Tracking.AddPage(this.GetType().ToString(), this.Text);
}
private void BUT_connect_Click(object sender, EventArgs e)
{
var mav = new MAVLinkInterface();
try
{
MainV2.instance.doConnect(mav, CMB_serialport.Text, CMB_baudrate.Text);
MainV2.Comports.Add(mav);
MainV2._connectionControl.UpdateSysIDS();
}
catch (Exception)
{
}
}
}
}