18 changed files with 501 additions and 227 deletions
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
#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); |
||||
} |
||||
|
||||
QGCHilFlightGearConfiguration::~QGCHilFlightGearConfiguration() |
||||
{ |
||||
delete ui; |
||||
} |
||||
|
||||
void QGCHilFlightGearConfiguration::on_startButton_clicked() |
||||
{ |
||||
mav->enableHilFlightGear(true, ui->optionsPlainTextEdit->toPlainText()); |
||||
} |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
#ifndef QGCHILFLIGHTGEARCONFIGURATION_H |
||||
#define QGCHILFLIGHTGEARCONFIGURATION_H |
||||
|
||||
#include <QWidget> |
||||
|
||||
#include "QGCHilLink.h" |
||||
#include "QGCFlightGearLink.h" |
||||
#include "UAS.h" |
||||
|
||||
namespace Ui { |
||||
class QGCHilFlightGearConfiguration; |
||||
} |
||||
|
||||
class QGCHilFlightGearConfiguration : public QWidget |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit QGCHilFlightGearConfiguration(UAS* mav, QWidget *parent = 0); |
||||
~QGCHilFlightGearConfiguration(); |
||||
|
||||
protected: |
||||
UAS* mav; |
||||
|
||||
private slots: |
||||
void on_startButton_clicked(); |
||||
|
||||
private: |
||||
Ui::QGCHilFlightGearConfiguration *ui; |
||||
}; |
||||
|
||||
#endif // QGCHILFLIGHTGEARCONFIGURATION_H
|
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QGCHilFlightGearConfiguration</class> |
||||
<widget class="QWidget" name="QGCHilFlightGearConfiguration"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>350</width> |
||||
<height>261</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Form</string> |
||||
</property> |
||||
<widget class="QWidget" name="gridLayoutWidget"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>0</y> |
||||
<width>331</width> |
||||
<height>261</height> |
||||
</rect> |
||||
</property> |
||||
<layout class="QGridLayout" name="gridLayout"> |
||||
<property name="margin"> |
||||
<number>9</number> |
||||
</property> |
||||
<item row="1" column="0"> |
||||
<widget class="QPlainTextEdit" name="optionsPlainTextEdit"> |
||||
<property name="plainText"> |
||||
<string>--in-air --roll=0 --pitch=0 --vc=90 --heading=300 --timeofday=noon --disable-hud-3d --disable-fullscreen --geometry=400x300 --disable-anti-alias-hud --wind=0@0 --turbulence=0.0 --prop:/sim/frame-rate-throttle-hz=30 --control=mouse --disable-intro-music --disable-sound --disable-random-objects --disable-ai-models --shading-flat --fog-disable --disable-specular-highlight --disable-random-objects --disable-panel --disable-clouds --fdm=jsb --units-meters --notrim --prop:/engines/engine/running=true</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="2" column="0"> |
||||
<widget class="QPushButton" name="startButton"> |
||||
<property name="text"> |
||||
<string>Start</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="3" column="0"> |
||||
<spacer name="verticalSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Vertical</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>20</width> |
||||
<height>68</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item row="0" column="0"> |
||||
<widget class="QLabel" name="plaintextInfoLabel"> |
||||
<property name="text"> |
||||
<string>Additional Options:</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
#include "QGCHilXPlaneConfiguration.h" |
||||
#include "ui_QGCHilXPlaneConfiguration.h" |
||||
#include "QGCXPlaneLink.h" |
||||
|
||||
QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink* link, QWidget *parent) : |
||||
QWidget(parent), |
||||
ui(new Ui::QGCHilXPlaneConfiguration) |
||||
{ |
||||
ui->setupUi(this); |
||||
|
||||
connect(ui->startButton, SIGNAL(clicked(bool)), this, SLOT(toggleSimulation(bool))); |
||||
connect(ui->hostComboBox, SIGNAL(activated(QString)), link, SLOT(setRemoteHost(QString))); |
||||
connect(link, SIGNAL(remoteChanged(QString)), ui->hostComboBox, SLOT(setEditText(QString))); |
||||
connect(link, SIGNAL(statusMessage(QString)), this, SLOT(receiveStatusMessage(QString))); |
||||
|
||||
ui->startButton->setText(tr("Connect")); |
||||
|
||||
QGCXPlaneLink* xplane = dynamic_cast<QGCXPlaneLink*>(link); |
||||
|
||||
if (xplane) |
||||
{ |
||||
connect(ui->randomAttitudeButton, SIGNAL(clicked()), link, SLOT(setRandomAttitude())); |
||||
connect(ui->randomPositionButton, SIGNAL(clicked()), link, SLOT(setRandomPosition())); |
||||
connect(ui->airframeComboBox, SIGNAL(activated(QString)), link, SLOT(setAirframe(QString))); |
||||
ui->airframeComboBox->setCurrentIndex(link->getAirFrameIndex()); |
||||
} |
||||
|
||||
ui->hostComboBox->clear(); |
||||
ui->hostComboBox->addItem(link->getRemoteHost()); |
||||
|
||||
|
||||
} |
||||
|
||||
void QGCHilXPlaneConfiguration::toggleSimulation(bool connect) |
||||
{ |
||||
Q_UNUSED(connect); |
||||
if (!link->isConnected()) |
||||
{ |
||||
link->setRemoteHost(ui->hostComboBox->currentText()); |
||||
link->connectSimulation(); |
||||
ui->startButton->setText(tr("Disconnect")); |
||||
} |
||||
else |
||||
{ |
||||
link->disconnectSimulation(); |
||||
ui->startButton->setText(tr("Connect")); |
||||
} |
||||
} |
||||
|
||||
QGCHilXPlaneConfiguration::~QGCHilXPlaneConfiguration() |
||||
{ |
||||
delete ui; |
||||
} |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
#ifndef QGCHILXPLANECONFIGURATION_H |
||||
#define QGCHILXPLANECONFIGURATION_H |
||||
|
||||
#include <QWidget> |
||||
|
||||
#include "QGCHilLink.h" |
||||
|
||||
namespace Ui { |
||||
class QGCHilXPlaneConfiguration; |
||||
} |
||||
|
||||
class QGCHilXPlaneConfiguration : public QWidget |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit QGCHilXPlaneConfiguration(QGCHilLink* link, QWidget *parent = 0); |
||||
~QGCHilXPlaneConfiguration(); |
||||
|
||||
public slots: |
||||
/** @brief Start / stop simulation */ |
||||
void toggleSimulation(bool connect); |
||||
|
||||
protected: |
||||
QGCHilLink* link; |
||||
|
||||
private: |
||||
Ui::QGCHilXPlaneConfiguration *ui; |
||||
}; |
||||
|
||||
#endif // QGCHILXPLANECONFIGURATION_H
|
@ -0,0 +1,145 @@
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QGCHilXPlaneConfiguration</class> |
||||
<widget class="QWidget" name="QGCHilXPlaneConfiguration"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>305</width> |
||||
<height>261</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Form</string> |
||||
</property> |
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="40,0,0,0"> |
||||
<item row="0" column="0"> |
||||
<widget class="QLabel" name="label"> |
||||
<property name="text"> |
||||
<string>Airframe</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="1" colspan="3"> |
||||
<widget class="QComboBox" name="airframeComboBox"> |
||||
<property name="editable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>X-Plane default</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>QRO_X/MK</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>QRO_X/Ardrone</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>QRO_X/PWM</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Unlimited</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Twinjet</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Early Bird</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Reno Racer</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Slowstick</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Tiny</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
<item row="3" column="2" colspan="2"> |
||||
<widget class="QPushButton" name="setHomeButton"> |
||||
<property name="text"> |
||||
<string>Set HOME</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="1" column="1" colspan="3"> |
||||
<widget class="QComboBox" name="hostComboBox"> |
||||
<property name="editable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>127.0.0.1:49000</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
<item row="5" column="2" colspan="2"> |
||||
<widget class="QPushButton" name="randomPositionButton"> |
||||
<property name="text"> |
||||
<string>Random POS</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="5" column="0" colspan="2"> |
||||
<widget class="QPushButton" name="randomAttitudeButton"> |
||||
<property name="text"> |
||||
<string>Random ATT</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="1" column="0"> |
||||
<widget class="QLabel" name="hostLabel"> |
||||
<property name="text"> |
||||
<string>Host</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="3" column="0" colspan="2"> |
||||
<widget class="QPushButton" name="startButton"> |
||||
<property name="text"> |
||||
<string>Start</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="6" column="0"> |
||||
<spacer name="verticalSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Vertical</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>20</width> |
||||
<height>40</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
Loading…
Reference in new issue