QGCHilFlightGearConfiguration.cc 1.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#include "QGCHilFlightGearConfiguration.h"
#include "ui_QGCHilFlightGearConfiguration.h"

#include "MainWindow.h"

QGCHilFlightGearConfiguration::QGCHilFlightGearConfiguration(UAS* mav,QWidget *parent) :
    QWidget(parent),
    mav(mav),
    ui(new Ui::QGCHilFlightGearConfiguration)
{
    ui->setupUi(this);
12 13 14 15 16 17

    QStringList items = QStringList();
    if (mav->getSystemType() == MAV_TYPE_FIXED_WING)
    {
        items << "Rascal110-JSBSim";
        items << "c172p";
Thomas Gubler's avatar
Thomas Gubler committed
18 19
        items << "YardStik";
        items << "Malolo1";
20 21 22 23 24 25 26 27 28 29
    }
    else if (mav->getSystemType() == MAV_TYPE_QUADROTOR)
    {
        items << "arducopter";
    }
    else
    {
        items << "<aircraft>";
    }
    ui->aircraftComboBox->addItems(items);
30 31 32 33 34 35 36 37 38
}

QGCHilFlightGearConfiguration::~QGCHilFlightGearConfiguration()
{
    delete ui;
}

void QGCHilFlightGearConfiguration::on_startButton_clicked()
{
39 40 41 42
    //XXX check validity of inputs
    QString options = ui->optionsPlainTextEdit->toPlainText();
    options.append(" --aircraft=" + ui->aircraftComboBox->currentText());
    mav->enableHilFlightGear(true,  options);
43
}