2012-04-05 21:50:04 -03:00
|
|
|
|
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;
|
|
|
|
|
using ArdupilotMega.Controls.BackstageView;
|
2012-04-29 21:32:33 -03:00
|
|
|
|
using ArdupilotMega.Utilities;
|
2012-04-05 21:50:04 -03:00
|
|
|
|
|
|
|
|
|
namespace ArdupilotMega.GCSViews.ConfigurationView
|
|
|
|
|
{
|
2012-04-25 07:10:11 -03:00
|
|
|
|
public partial class Setup : MyUserControl
|
2012-04-05 21:50:04 -03:00
|
|
|
|
{
|
|
|
|
|
public Setup()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
2012-04-25 07:10:11 -03:00
|
|
|
|
if (MainV2.comPort.BaseStream.IsOpen)
|
|
|
|
|
{
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigRadioInput(), "Radio Calibration"));
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFlightModes(), "Flight Modes"));
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigHardwareOptions(), "Hardware Options"));
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************HELI **************************/
|
|
|
|
|
if (MainV2.comPort.param["H_GYR_ENABLE"] != null) // heli
|
|
|
|
|
{
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"));
|
|
|
|
|
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigTradHeli(), "Heli Setup"));
|
|
|
|
|
|
|
|
|
|
var configpanel = new Controls.ConfigPanel();
|
|
|
|
|
configpanel.LoadXML("ArduCopterConfig.xml");
|
2012-04-30 07:48:52 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids"));
|
2012-04-25 07:10:11 -03:00
|
|
|
|
|
2012-05-20 02:54:35 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "ArduCopter Config"));
|
2012-04-25 07:10:11 -03:00
|
|
|
|
}
|
|
|
|
|
/****************************** ArduCopter **************************/
|
|
|
|
|
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2)
|
|
|
|
|
{
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"));
|
2012-04-06 05:27:26 -03:00
|
|
|
|
|
2012-04-25 07:10:11 -03:00
|
|
|
|
var configpanel = new Controls.ConfigPanel();
|
|
|
|
|
configpanel.LoadXML("ArduCopterConfig.xml");
|
2012-04-30 07:48:52 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids"));
|
2012-04-25 07:10:11 -03:00
|
|
|
|
|
2012-05-20 02:54:35 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "ArduCopter Config"));
|
2012-04-25 07:10:11 -03:00
|
|
|
|
}
|
|
|
|
|
/****************************** ArduPlane **************************/
|
|
|
|
|
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
|
|
|
|
|
{
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduPlane Level"));
|
2012-04-30 07:48:52 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArduplane(), "ArduPlane Pids"));
|
2012-04-25 07:10:11 -03:00
|
|
|
|
}
|
2012-05-16 09:21:27 -03:00
|
|
|
|
/****************************** ArduRover **************************/
|
|
|
|
|
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover)
|
|
|
|
|
{
|
|
|
|
|
//this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduRover Level"));
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArdurover(), "ArduRover Pids"));
|
|
|
|
|
}
|
2012-04-25 07:10:11 -03:00
|
|
|
|
|
2012-04-29 21:32:33 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params"));
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params"));
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigRawParams(), "Parameter List"));
|
2012-04-25 07:10:11 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-04-24 10:49:27 -03:00
|
|
|
|
|
2012-04-06 05:27:26 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ArdupilotMega._3DRradio(), "3DR Radio"));
|
|
|
|
|
|
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ArdupilotMega.Antenna.Tracker(), "Antenna Tracker"));
|
|
|
|
|
|
2012-04-25 07:10:11 -03:00
|
|
|
|
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigPlanner(), "Planner"));
|
|
|
|
|
|
2012-04-06 05:27:26 -03:00
|
|
|
|
this.backstageView.ActivatePage(backstageView.Pages[0]);
|
2012-04-15 10:51:07 -03:00
|
|
|
|
|
|
|
|
|
if (!MainV2.comPort.BaseStream.IsOpen)
|
|
|
|
|
{
|
2012-05-20 02:54:35 -03:00
|
|
|
|
Common.MessageShowAgain("Config Connect", "Please connect (click Connect Button) before using setup!!");
|
2012-04-15 10:51:07 -03:00
|
|
|
|
}
|
2012-04-06 05:27:26 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Setup_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Setup_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
backstageView.Close();
|
2012-04-05 21:50:04 -03:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-04-06 05:27:26 -03:00
|
|
|
|
}
|