forked from meee1/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConnectionOptions.cs
52 lines (43 loc) · 1.34 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
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MissionPlanner.Comms;
using System.Net.Sockets;
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)
{
}
}
}
}