QGCHilFlightGearConfiguration.cc 1.19 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

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

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

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

void QGCHilFlightGearConfiguration::on_stopButton_clicked()
{
    mav->stopHil();
}