You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.2 KiB
81 lines
2.2 KiB
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; |
|
using ArdupilotMega.Controls; |
|
|
|
namespace ArdupilotMega.GCSViews.ConfigurationView |
|
{ |
|
public partial class ConfigAccelerometerCalibrationQuad : BackStageViewContentPanel |
|
{ |
|
public ConfigAccelerometerCalibrationQuad() |
|
{ |
|
InitializeComponent(); |
|
} |
|
|
|
private void pictureBoxQuadX_Click(object sender, EventArgs e) |
|
{ |
|
try |
|
{ |
|
MainV2.comPort.setParam("FRAME", 1f); |
|
CustomMessageBox.Show("Set to x"); |
|
} |
|
catch { CustomMessageBox.Show("Set frame failed"); } |
|
} |
|
|
|
private void BUT_levelac2_Click(object sender, EventArgs e) |
|
{ |
|
try |
|
{ |
|
#if MAVLINK10 |
|
int fixme; // needs to be accel only |
|
MainV2.comPort.doCommand(MAVLink.MAV_CMD.PREFLIGHT_CALIBRATION,1,1,1,1,1,1,1); |
|
#else |
|
MainV2.comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_CALIBRATE_ACC); |
|
#endif |
|
|
|
BUT_levelac2.Text = "Complete"; |
|
} |
|
catch |
|
{ |
|
CustomMessageBox.Show("Failed to level : ac2 2.0.37+ is required"); |
|
} |
|
} |
|
|
|
private void pictureBoxQuad_Click(object sender, EventArgs e) |
|
{ |
|
try |
|
{ |
|
MainV2.comPort.setParam("FRAME", 0f); |
|
CustomMessageBox.Show("Set to +"); |
|
} |
|
catch { CustomMessageBox.Show("Set frame failed"); } |
|
} |
|
|
|
private void ConfigAccelerometerCalibration_Load(object sender, EventArgs e) |
|
{ |
|
if (!MainV2.comPort.BaseStream.IsOpen) |
|
{ |
|
this.Enabled = false; |
|
return; |
|
} |
|
else |
|
{ |
|
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) |
|
{ |
|
this.Enabled = true; |
|
} |
|
else |
|
{ |
|
this.Enabled = false; |
|
return; |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|