QGCHilConfiguration.cc 1.2 KB
Newer Older
1 2 3
#include "QGCHilConfiguration.h"
#include "ui_QGCHilConfiguration.h"

4 5 6 7
#include "QGCHilFlightGearConfiguration.h"
#include "QGCHilXPlaneConfiguration.h"

QGCHilConfiguration::QGCHilConfiguration(UAS *mav, QWidget *parent) :
8
    QWidget(parent),
9
    mav(mav),
10 11 12 13 14
    ui(new Ui::QGCHilConfiguration)
{
    ui->setupUi(this);
}

15 16 17 18 19
void QGCHilConfiguration::receiveStatusMessage(const QString& message)
{
    ui->statusLabel->setText(message);
}

20 21 22 23 24 25
QGCHilConfiguration::~QGCHilConfiguration()
{
    delete ui;
}

void QGCHilConfiguration::on_simComboBox_currentIndexChanged(int index)
26
{
27
    if(1 == index)
28
    {
Lorenz Meier's avatar
Lorenz Meier committed
29 30
        // Ensure the sim exists and is disabled
        mav->enableHilFlightGear(false, "");
31 32 33 34
        QGCHilFlightGearConfiguration* hfgconf = new QGCHilFlightGearConfiguration(mav, this);
        hfgconf->show();
        ui->simulatorConfigurationDockWidget->setWidget(hfgconf);

35
    }
36
    else if(2 == index || 3 == index)
37
    {
Lorenz Meier's avatar
Lorenz Meier committed
38 39
        // Ensure the sim exists and is disabled
        mav->enableHilXPlane(false);
40 41 42
        QGCHilXPlaneConfiguration* hxpconf = new QGCHilXPlaneConfiguration(mav->getHILSimulation(), this);
        hxpconf->show();
        ui->simulatorConfigurationDockWidget->setWidget(hxpconf);
43

44
    }
45
}