ardupilot/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs
Michael Oborne 0fe874eec6 APM Planner 1.1.97
add toy Mode
fix some mono issues
fix opengl hud issue
change config font size
modify mylabel for mono
modify default telem rates
add extra sonar option
remove 0 home alt check
fix terminal hang issue
remove application idle call, causes 100% cpu on mono
update gimbal icons
modify graph line thinkness
2012-07-12 22:06:22 +08:00

54 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ArdupilotMega.Controls
{
public partial class ConnectionControl : UserControl
{
public ConnectionControl()
{
InitializeComponent();
this.linkLabel1.Click += (sender, e) =>
{
if (ShowLinkStats!=null)
ShowLinkStats.Invoke(this, EventArgs.Empty);
};
}
public event EventHandler ShowLinkStats;
public ComboBox CMB_baudrate { get { return this.cmb_Baud; } }
public ComboBox CMB_serialport { get { return this.cmb_Connection; } }
public ComboBox TOOL_APMFirmware { get { return this.cmb_ConnectionType; } }
/// <summary>
/// Called from the main form - set whether we are connected or not currently.
/// UI will be updated accordingly
/// </summary>
/// <param name="isConnected">Whether we are connected</param>
public void IsConnected(bool isConnected)
{
this.linkLabel1.Visible = isConnected;
cmb_Baud.Enabled = !isConnected;
cmb_Connection.Enabled = !isConnected;
}
private void ConnectionControl_MouseClick(object sender, MouseEventArgs e)
{
if (e.X > cmb_ConnectionType.Location.X &&
e.Y > cmb_ConnectionType.Location.Y &&
e.X < cmb_ConnectionType.Right &&
e.Y < cmb_ConnectionType.Bottom)
{
cmb_ConnectionType.Visible = true;
}
}
}
}