Commit ae153170 authored by Bart Slinger's avatar Bart Slinger

Revert "fix code style"

This reverts commit ae976049ca7b4818616e6b8be07a028fc7dfc26f.
parent 0f035389
This diff is collapsed.
......@@ -36,7 +36,7 @@ class QGCXPlaneLink : public QGCHilLink
//Q_INTERFACES(QGCXPlaneLinkInterface:LinkInterface)
public:
QGCXPlaneLink(Vehicle *vehicle, QString remoteHost = QString("127.0.0.1:49000"), QHostAddress localHost = QHostAddress::Any, quint16 localPort = 49005);
QGCXPlaneLink(Vehicle* vehicle, QString remoteHost=QString("127.0.0.1:49000"), QHostAddress localHost = QHostAddress::Any, quint16 localPort = 49005);
~QGCXPlaneLink();
/**
......@@ -51,8 +51,7 @@ public:
bool isConnected();
qint64 bytesAvailable();
int getPort() const
{
int getPort() const {
return localPort;
}
......@@ -89,13 +88,11 @@ public:
return (int)airframeID;
}
bool sensorHilEnabled()
{
bool sensorHilEnabled() {
return _sensorHilEnabled;
}
bool useHilActuatorControls()
{
bool useHilActuatorControls() {
return _useHilActuatorControls;
}
......@@ -107,7 +104,7 @@ public slots:
// void setAddress(QString address);
void setPort(int port);
/** @brief Add a new host to broadcast messages to */
void setRemoteHost(const QString &host);
void setRemoteHost(const QString& host);
/** @brief Send new control states to the simulation */
void updateControls(quint64 time, float rollAilerons, float pitchElevator, float yawRudder, float throttle, quint8 systemMode, quint8 navMode);
/** @brief Send new control commands to the simulation */
......@@ -130,16 +127,14 @@ public slots:
float ctl_15,
quint8 mode);
/** @brief Set the simulator version as text string */
void setVersion(const QString &version);
void setVersion(const QString& version);
/** @brief Set the simulator version as integer */
void setVersion(unsigned int version);
void enableSensorHIL(bool enable)
{
void enableSensorHIL(bool enable) {
if (enable != _sensorHilEnabled)
_sensorHilEnabled = enable;
emit sensorHilChanged(enable);
emit sensorHilChanged(enable);
}
void enableHilActuatorControls(bool enable);
......@@ -164,7 +159,7 @@ public slots:
* @brief Select airplane model
* @param plane the name of the airplane
*/
void selectAirframe(const QString &airframe);
void selectAirframe(const QString& airframe);
/**
* @brief Set the airplane position and attitude
* @param lat
......@@ -187,14 +182,14 @@ public slots:
void setRandomAttitude();
protected:
Vehicle *_vehicle;
Vehicle* _vehicle;
QString name;
QHostAddress localHost;
quint16 localPort;
QHostAddress remoteHost;
quint16 remotePort;
int id;
QUdpSocket *socket;
QUdpSocket* socket;
bool connectState;
quint64 bitsSentTotal;
......@@ -207,8 +202,8 @@ protected:
QMutex statisticsMutex;
QMutex dataMutex;
QTimer refreshTimer;
QProcess *process;
QProcess *terraSync;
QProcess* process;
QProcess* terraSync;
bool gpsReceived;
bool attitudeReceived;
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,7 @@
#include "QGCXPlaneLink.h"
#include "QGCHilConfiguration.h"
QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink *link, QGCHilConfiguration *parent) :
QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink* link, QGCHilConfiguration *parent) :
QWidget(parent),
ui(new Ui::QGCHilXPlaneConfiguration)
{
......@@ -12,7 +12,7 @@ QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink *link, QGCHilCon
connect(ui->startButton, &QPushButton::clicked, this, &QGCHilXPlaneConfiguration::toggleSimulation);
connect(ui->hostComboBox, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
connect(ui->hostComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated),
link, &QGCHilLink::setRemoteHost);
connect(link, &QGCHilLink::remoteChanged, ui->hostComboBox, &QComboBox::setEditText);
......@@ -23,7 +23,7 @@ QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink *link, QGCHilCon
ui->startButton->setText(tr("Connect"));
QGCXPlaneLink *xplane = dynamic_cast<QGCXPlaneLink *>(link);
QGCXPlaneLink* xplane = dynamic_cast<QGCXPlaneLink*>(link);
if (xplane)
{
......@@ -58,20 +58,17 @@ void QGCHilXPlaneConfiguration::setVersion(int version)
void QGCHilXPlaneConfiguration::toggleSimulation(bool connect)
{
if (!link)
{
if (!link) {
return;
}
Q_UNUSED(connect);
if (!link->isConnected())
{
link->setRemoteHost(ui->hostComboBox->currentText());
link->connectSimulation();
ui->startButton->setText(tr("Disconnect"));
}
else
{
link->disconnectSimulation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment