9 changed files with 244 additions and 72 deletions
@ -0,0 +1,36 @@ |
|||||||
|
#include "QGCHilConfiguration.h" |
||||||
|
#include "ui_QGCHilConfiguration.h" |
||||||
|
|
||||||
|
QGCHilConfiguration::QGCHilConfiguration(QGCHilLink* link, QWidget *parent) : |
||||||
|
QWidget(parent), |
||||||
|
link(link), |
||||||
|
ui(new Ui::QGCHilConfiguration) |
||||||
|
{ |
||||||
|
ui->setupUi(this); |
||||||
|
|
||||||
|
connect(ui->startButton, SIGNAL(clicked(bool)), this, SLOT(toggleSimulation(bool))); |
||||||
|
connect(ui->hostComboBox, SIGNAL(activated(QString)), link, SLOT(setRemoteHost(QString))); |
||||||
|
|
||||||
|
ui->startButton->setText(tr("Connect")); |
||||||
|
} |
||||||
|
|
||||||
|
void QGCHilConfiguration::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")); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
QGCHilConfiguration::~QGCHilConfiguration() |
||||||
|
{ |
||||||
|
delete ui; |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
#ifndef QGCHILCONFIGURATION_H |
||||||
|
#define QGCHILCONFIGURATION_H |
||||||
|
|
||||||
|
#include <QWidget> |
||||||
|
|
||||||
|
#include "QGCHilLink.h" |
||||||
|
|
||||||
|
namespace Ui { |
||||||
|
class QGCHilConfiguration; |
||||||
|
} |
||||||
|
|
||||||
|
class QGCHilConfiguration : public QWidget |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
|
||||||
|
public: |
||||||
|
QGCHilConfiguration(QGCHilLink* link, QWidget *parent = 0); |
||||||
|
~QGCHilConfiguration(); |
||||||
|
|
||||||
|
public slots: |
||||||
|
/** Start / stop simulation */ |
||||||
|
void toggleSimulation(bool connect); |
||||||
|
|
||||||
|
protected: |
||||||
|
QGCHilLink* link; |
||||||
|
|
||||||
|
private: |
||||||
|
Ui::QGCHilConfiguration *ui; |
||||||
|
}; |
||||||
|
|
||||||
|
#endif // QGCHILCONFIGURATION_H
|
@ -0,0 +1,91 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<ui version="4.0"> |
||||||
|
<class>QGCHilConfiguration</class> |
||||||
|
<widget class="QWidget" name="QGCHilConfiguration"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>0</x> |
||||||
|
<y>0</y> |
||||||
|
<width>305</width> |
||||||
|
<height>172</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="windowTitle"> |
||||||
|
<string>Form</string> |
||||||
|
</property> |
||||||
|
<layout class="QGridLayout" name="gridLayout" columnstretch="40,60,50,50"> |
||||||
|
<item row="4" column="0" colspan="3"> |
||||||
|
<widget class="QLabel" name="statusLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Status</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="3" column="0" colspan="2"> |
||||||
|
<widget class="QPushButton" name="startButton"> |
||||||
|
<property name="text"> |
||||||
|
<string>Start</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item row="0" column="0"> |
||||||
|
<widget class="QLabel" name="simLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Simulator</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="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="0" column="1" colspan="3"> |
||||||
|
<widget class="QComboBox" name="simComboBox"> |
||||||
|
<item> |
||||||
|
<property name="text"> |
||||||
|
<string>X-Plane</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> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<resources/> |
||||||
|
<connections/> |
||||||
|
</ui> |
Loading…
Reference in new issue