diff --git a/ground/src/plugins/hitlnew/fgsimulator.cpp b/ground/src/plugins/hitlnew/fgsimulator.cpp index 07b846f82..a489c8c71 100644 --- a/ground/src/plugins/hitlnew/fgsimulator.cpp +++ b/ground/src/plugins/hitlnew/fgsimulator.cpp @@ -55,6 +55,8 @@ const float FGSimulator::FPS2CMPS = 30.48; FGSimulator::FGSimulator(const SimulatorSettings& params) : Simulator(params) { + udpCounterFGrecv = 0; + udpCounterGCSsend = 0; } FGSimulator::~FGSimulator() @@ -64,7 +66,10 @@ FGSimulator::~FGSimulator() void FGSimulator::setupUdpPorts(const QString& host, int inPort, int outPort) { - inSocket->bind(QHostAddress(host), inPort); + if(inSocket->bind(QHostAddress(host), inPort)) + emit processOutput("Successfully bound to address " + host + " on port " + QString::number(inPort) + "\n"); + else + emit processOutput("Cannot bind to address " + host + " on port " + QString::number(inPort) + "\n"); } bool FGSimulator::setupProcess() @@ -114,15 +119,28 @@ bool FGSimulator::setupProcess() "--in-air " + "--altitude=3000 " + "--vc=100 " + - "--generic=socket,out,50,localhost," + QString::number(settings.inPort) + ",udp,opfgprotocol"); + "--log-level=alert" + + "--generic=socket,out,20," + settings.hostAddress + "," + QString::number(settings.inPort) + ",udp,opfgprotocol"); if(!settings.manual) { - args.append(" --generic=socket,in,400,localhost," + QString::number(settings.outPort) + ",udp,opfgprotocol"); + args.append(" --generic=socket,in,400," + settings.remoteHostAddress + "," + QString::number(settings.outPort) + ",udp,opfgprotocol"); } - // Start FlightGear - QString cmd("\"" + settings.binPath + "\" " + args + "\n"); - simProcess->write(cmd.toAscii()); + // Start FlightGear - only if checkbox is selected in HITL options page + if (settings.startSim) + { + QString cmd("\"" + settings.binPath + "\" " + args + "\n"); + simProcess->write(cmd.toAscii()); + } + else + { + emit processOutput("Start Flightgear from the command line with the following arguments: \n\n" + args + "\n\n" + + "You can optionally run Flightgear from a networked computer.\n" + + "Make sure the computer running Flightgear can can ping your local interface adapter. ie." + settings.hostAddress + "\n" + "Remote computer must have the correct OpenPilot protocol installed."); + } + + udpCounterGCSsend = 0; return true; } @@ -139,21 +157,78 @@ void FGSimulator::processReadyRead() void FGSimulator::transmitUpdate() { - // Read ActuatorDesired from autopilot - ActuatorDesired::DataFields actData = actDesired->getData(); - float ailerons = actData.Roll; - float elevator = -actData.Pitch; - float rudder = actData.Yaw; - float throttle = actData.Throttle; + ActuatorDesired::DataFields actData; + ManualControlCommand::DataFields manCtrlData = manCtrlCommand->getData(); + + float ailerons = -1; + float elevator = -1; + float rudder = -1; + float throttle = -1; + + if(manCtrlData.FlightMode == ManualControlCommand::FLIGHTMODE_MANUAL) + { + // Read joystick input + if(manCtrlData.Armed == ManualControlCommand::ARMED_TRUE) + { + ailerons = manCtrlData.Roll; + elevator = -manCtrlData.Pitch; + rudder = manCtrlData.Yaw; + throttle = manCtrlData.Throttle; + } + } + else + { + // Read ActuatorDesired from autopilot + actData = actDesired->getData(); + + ailerons = actData.Roll; + elevator = -actData.Pitch; + rudder = actData.Yaw; + throttle = actData.Throttle; + } + + int allowableDifference = 10; + + if(udpCounterFGrecv == udpCounterGCSsend) + udpCounterGCSsend = 0; + + if(udpCounterGCSsend < allowableDifference ) //FG udp queue is not delayed + { + udpCounterGCSsend++; + // Send update to FlightGear QString cmd; - cmd = QString("%1,%2,%3,%4\n") - .arg(ailerons) - .arg(elevator) - .arg(rudder) - .arg(throttle); + cmd = QString("%1,%2,%3,%4,%5\n") + .arg(ailerons) //ailerons + .arg(elevator) //elevator + .arg(rudder) //rudder + .arg(throttle) //throttle + .arg(udpCounterGCSsend); //UDP packet counter delay + QByteArray data = cmd.toAscii(); - outSocket->writeDatagram(data, QHostAddress(settings.hostAddress), settings.outPort); + + if(outSocket->writeDatagram(data, QHostAddress(settings.remoteHostAddress), settings.outPort) == -1) + { + emit processOutput("Error sending UDP packet to FG: " + outSocket->errorString() + "\n"); + } + } + else + { + // don't send new packet. Flightgear cannot process UDP fast enough. + // V1.9.1 reads udp packets at set frequency and will get delayed if packets are sent too fast + // V2.0 does not currently work with --generic-protocol + } + + if(!settings.manual) + { + actData.Roll = ailerons; + actData.Pitch = elevator; + actData.Yaw = rudder; + actData.Throttle = throttle; + //actData.NumLongUpdates = (float)udpCounterFGrecv; + //actData.UpdateTime = (float)udpCounterGCSsend; + actDesired->setData(actData); + } } @@ -212,6 +287,10 @@ void FGSimulator::processUpdate(const QByteArray& inp) // Get VelocityActual Down (cm/s) float velocityActualNorth = fields[23].toFloat() * FPS2CMPS; + // Get UDP packets received by FG + int n = fields[24].toInt(); + udpCounterFGrecv = n; + //run once HomeLocation::DataFields homeData = posHome->getData(); if(!once) diff --git a/ground/src/plugins/hitlnew/fgsimulator.h b/ground/src/plugins/hitlnew/fgsimulator.h index db54d40fa..96e3a959a 100644 --- a/ground/src/plugins/hitlnew/fgsimulator.h +++ b/ground/src/plugins/hitlnew/fgsimulator.h @@ -52,6 +52,9 @@ private: static const float INHG2KPA; static const float FPS2CMPS; + int udpCounterGCSsend; //keeps track of udp packets sent to FG + int udpCounterFGrecv; //keeps track of udp packets received by FG + void processUpdate(const QByteArray& data); }; diff --git a/ground/src/plugins/hitlnew/hitlconfiguration.cpp b/ground/src/plugins/hitlnew/hitlconfiguration.cpp index 8351032fe..7cfcc4bac 100644 --- a/ground/src/plugins/hitlnew/hitlconfiguration.cpp +++ b/ground/src/plugins/hitlnew/hitlconfiguration.cpp @@ -35,6 +35,7 @@ HITLConfiguration::HITLConfiguration(QString classId, QSettings* qSettings, QObj settings.dataPath = ""; settings.manual = false; settings.hostAddress = "127.0.0.1"; + settings.remoteHostAddress = "127.0.0.1"; settings.outPort = 0; settings.inPort = 0; settings.latitude = ""; @@ -47,6 +48,7 @@ HITLConfiguration::HITLConfiguration(QString classId, QSettings* qSettings, QObj settings.dataPath = qSettings->value("dataPath").toString(); settings.manual = qSettings->value("manual").toBool(); settings.hostAddress = qSettings->value("hostAddress").toString(); + settings.remoteHostAddress = qSettings->value("remoteHostAddress").toString(); settings.outPort = qSettings->value("outPort").toInt(); settings.inPort = qSettings->value("inPort").toInt(); settings.latitude = qSettings->value("latitude").toString(); @@ -72,6 +74,7 @@ void HITLConfiguration::saveConfig(QSettings* qSettings) const { qSettings->setValue("dataPath", settings.dataPath); qSettings->setValue("manual", settings.manual); qSettings->setValue("hostAddress", settings.hostAddress); + qSettings->setValue("remoteHostAddress", settings.remoteHostAddress); qSettings->setValue("outPort", settings.outPort); qSettings->setValue("inPort", settings.inPort); qSettings->setValue("latitude", settings.latitude); diff --git a/ground/src/plugins/hitlnew/hitloptionspage.cpp b/ground/src/plugins/hitlnew/hitloptionspage.cpp index c48f34198..dd9cadb63 100644 --- a/ground/src/plugins/hitlnew/hitloptionspage.cpp +++ b/ground/src/plugins/hitlnew/hitloptionspage.cpp @@ -77,8 +77,10 @@ QWidget *HITLOptionsPage::createPage(QWidget *parent) m_optionsPage->executablePath->setPath(config->Settings().binPath); m_optionsPage->dataPath->setPath(config->Settings().dataPath); m_optionsPage->manualControl->setChecked(config->Settings().manual); + m_optionsPage->startSim->setChecked(config->Settings().startSim); - m_optionsPage->hostAddress->setText(config->Settings().hostAddress); + m_optionsPage->hostAddress->setText(config->Settings().hostAddress); + m_optionsPage->remoteHostAddress->setText(config->Settings().remoteHostAddress); m_optionsPage->outputPort->setText(QString::number(config->Settings().outPort)); m_optionsPage->inputPort->setText(QString::number(config->Settings().inPort)); m_optionsPage->latitude->setText(config->Settings().latitude); @@ -96,7 +98,9 @@ void HITLOptionsPage::apply() settings.binPath = m_optionsPage->executablePath->path(); settings.dataPath = m_optionsPage->dataPath->path(); settings.manual = m_optionsPage->manualControl->isChecked(); + settings.startSim = m_optionsPage->startSim->isChecked(); settings.hostAddress = m_optionsPage->hostAddress->text(); + settings.remoteHostAddress = m_optionsPage->remoteHostAddress->text(); settings.inPort = m_optionsPage->inputPort->text().toInt(); settings.outPort = m_optionsPage->outputPort->text().toInt(); diff --git a/ground/src/plugins/hitlnew/hitloptionspage.ui b/ground/src/plugins/hitlnew/hitloptionspage.ui index 892325eaa..8e5c6c60a 100644 --- a/ground/src/plugins/hitlnew/hitloptionspage.ui +++ b/ground/src/plugins/hitlnew/hitloptionspage.ui @@ -1,173 +1,230 @@ - - - HITLOptionsPage - - - - 0 - 0 - 400 - 320 - - - - - 0 - 0 - - - - Form - - - - 0 - - - - - Choose flight simulator: - - - - - - - - - - Qt::Horizontal - - - - - - - Latitude in degrees: - - - - - - - - - - Longitude in degrees: - - - - - - - - - - - 0 - 0 - - - - Path executable: - - - - - - - - 1 - 0 - - - - - - - - - 0 - 0 - - - - Data directory: - - - - - - - - - - - 0 - 0 - - - - Manual aircraft control (can be used when hardware is not available) - - - Manual aircraft control (can be used when hardware is not available) - - - - - - - Qt::Vertical - - - - 20 - 182 - - - - - - - - Host Address: - - - - - - - - - - - - - Output Port: - - - - - - - - - - Input Port: - - - - - - - - Utils::PathChooser - QWidget -
utils/pathchooser.h
- 1 -
-
- - -
+ + + HITLOptionsPage + + + + 0 + 0 + 577 + 367 + + + + + 0 + 0 + + + + Form + + + + 0 + + + + + Choose flight simulator: + + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 182 + + + + + + + + Local interface address (IP): + + + + + + + + 0 + 0 + + + + For communication with sim computer via network. Should be IP address of one of the local interfaces. + + + + + + + Latitude in degrees: + + + + + + + Longitude in degrees: + + + + + + + + 0 + 0 + + + + Data directory: + + + + + + + For receiving data from sim + + + + + + + + 1 + 0 + + + + + + + + Output Port: + + + + + + + + + + + + + For sending data to sim + + + + + + + + 0 + 0 + + + + Manual aircraft control (can be used when hardware is not available) + + + Manual aircraft control (can be used when hardware is not available) + + + + + + + + 0 + 0 + + + + Path executable: + + + + + + + + + + Input Port: + + + + + + + true + + + + 0 + 0 + + + + Check this box to start the simulator on the local computer + + + Start simulator on local machine + + + + + + + Remote interface address (IP): + + + + + + + + 0 + 0 + + + + Only required if running simulator on remote machine + + + + + + + + Utils::PathChooser + QWidget +
utils/pathchooser.h
+ 1 +
+
+ + +
diff --git a/ground/src/plugins/hitlnew/opfgprotocol.xml b/ground/src/plugins/hitlnew/opfgprotocol.xml index dc9b6d456..2031546b1 100644 --- a/ground/src/plugins/hitlnew/opfgprotocol.xml +++ b/ground/src/plugins/hitlnew/opfgprotocol.xml @@ -34,6 +34,13 @@ %f + + udpRecvByFGcount + /OP/udp-counter + int + %d + + @@ -209,6 +216,13 @@ %f + + udpRecvByFGcount + /OP/udp-counter + int + %d + + diff --git a/ground/src/plugins/hitlnew/simulator.cpp b/ground/src/plugins/hitlnew/simulator.cpp index ebcd95be2..bdcda50e4 100644 --- a/ground/src/plugins/hitlnew/simulator.cpp +++ b/ground/src/plugins/hitlnew/simulator.cpp @@ -40,8 +40,8 @@ Simulator::Simulator(const SimulatorSettings& params) : inSocket(NULL), outSocket(NULL), settings(params), - updatePeriod(50), - simTimeout(2000), + updatePeriod(50), + simTimeout(2000), autopilotConnectionStatus(false), simConnectionStatus(false), txTimer(NULL), @@ -50,7 +50,7 @@ Simulator::Simulator(const SimulatorSettings& params) : { // move to thread moveToThread(Core::ICore::instance()->threadManager()->getRealTimeThread()); - connect(this, SIGNAL(myStart()), this, SLOT(onStart()),Qt::QueuedConnection); + connect(this, SIGNAL(myStart()), this, SLOT(onStart()),Qt::QueuedConnection); emit myStart(); } @@ -116,6 +116,7 @@ void Simulator::onStart() ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager* objManager = pm->getObject(); actDesired = ActuatorDesired::GetInstance(objManager); + manCtrlCommand = ManualControlCommand::GetInstance(objManager); posHome = HomeLocation::GetInstance(objManager); velActual = VelocityActual::GetInstance(objManager); posActual = PositionActual::GetInstance(objManager); @@ -140,19 +141,21 @@ void Simulator::onStart() outSocket = new QUdpSocket(); setupUdpPorts(settings.hostAddress,settings.inPort,settings.outPort); - emit processOutput("\nHost: " + settings.hostAddress + "\n" + \ - "inputPort: " + QString::number(settings.inPort) + "\n" + \ - "outpurPort: " + QString::number(settings.outPort) + "\n"); + emit processOutput("\nLocal interface: " + settings.hostAddress + "\n" + \ + "Remote interface: " + settings.remoteHostAddress + "\n" + \ + "inputPort: " + QString::number(settings.inPort) + "\n" + \ + "outputPort: " + QString::number(settings.outPort) + "\n"); - qxtLog->info("\nHost: " + settings.hostAddress + "\n" + \ - "inputPort: " + QString::number(settings.inPort) + "\n" + \ - "outpurPort: " + QString::number(settings.outPort) + "\n"); + qxtLog->info("\nLocal interface: " + settings.hostAddress + "\n" + \ + "Remote interface: " + settings.remoteHostAddress + "\n" + \ + "inputPort: " + QString::number(settings.inPort) + "\n" + \ + "outputPort: " + QString::number(settings.outPort) + "\n"); -// if(!inSocket->waitForConnected(5000)) -// processOutput(QString("Can't connect to %1 on %2 port!").arg(settings.hostAddress).arg(settings.inPort)); - //outSocket->connectToHost(settings.hostAddress,settings.outPort); // FG - //if(!outSocket->waitForConnected(5000)) - // processOutput(QString("Can't connect to %1 on %2 port!").arg(settings.hostAddress).arg(settings.outPort)); +// if(!inSocket->waitForConnected(5000)) +// emit processOutput(QString("Can't connect to %1 on %2 port!").arg(settings.hostAddress).arg(settings.inPort)); +// outSocket->connectToHost(settings.hostAddress,settings.outPort); // FG +// if(!outSocket->waitForConnected(5000)) +// emit processOutput(QString("Can't connect to %1 on %2 port!").arg(settings.hostAddress).arg(settings.outPort)); connect(inSocket, SIGNAL(readyRead()), this, SLOT(receiveUpdate()),Qt::DirectConnection); @@ -173,6 +176,7 @@ void Simulator::onStart() time->start(); current.T=0; current.i=0; + } void Simulator::receiveUpdate() diff --git a/ground/src/plugins/hitlnew/simulator.h b/ground/src/plugins/hitlnew/simulator.h index 4fc14a7c9..f3e4b8883 100644 --- a/ground/src/plugins/hitlnew/simulator.h +++ b/ground/src/plugins/hitlnew/simulator.h @@ -36,6 +36,7 @@ #include "uavtalk/telemetrymanager.h" #include "uavobjects/uavobjectmanager.h" #include "uavobjects/actuatordesired.h" +#include "uavobjects/manualcontrolcommand.h" // #include "uavobjects/altitudeactual.h" #include "uavobjects/positionactual.h" #include "uavobjects/velocityactual.h" @@ -96,9 +97,11 @@ typedef struct _CONNECTION QString binPath; QString dataPath; QString hostAddress; + QString remoteHostAddress; int outPort; int inPort; bool manual; + bool startSim; QString latitude; QString longitude; } SimulatorSettings; @@ -159,6 +162,7 @@ protected: QUdpSocket* outSocket; ActuatorDesired* actDesired; + ManualControlCommand* manCtrlCommand; BaroAltitude* altActual; AttitudeActual* attActual; VelocityActual* velActual; diff --git a/ground/src/plugins/hitlnew/ui_hitloptionspage.h b/ground/src/plugins/hitlnew/ui_hitloptionspage.h index 4194fe5ad..0b3de73e8 100644 --- a/ground/src/plugins/hitlnew/ui_hitloptionspage.h +++ b/ground/src/plugins/hitlnew/ui_hitloptionspage.h @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading UI file 'hitloptionspage.ui' ** -** Created: Wed 25. Aug 11:43:47 2010 -** by: Qt User Interface Compiler version 4.6.2 +** Created: Wed Nov 24 20:23:33 2010 +** by: Qt User Interface Compiler version 4.7.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -34,28 +34,31 @@ public: QLabel *label_3; QComboBox *chooseFlightSimulator; QFrame *line; - QLabel *label_7; - QLineEdit *latitude; - QLabel *label_8; - QLineEdit *longitude; - QLabel *label; - Utils::PathChooser *executablePath; - QLabel *label_2; - Utils::PathChooser *dataPath; - QCheckBox *manualControl; QSpacerItem *verticalSpacer; QLabel *label_6; QLineEdit *hostAddress; - QLineEdit *outputPort; - QLabel *label_4; + QLabel *label_7; + QLabel *label_8; + QLabel *label_2; QLineEdit *inputPort; + Utils::PathChooser *executablePath; + QLabel *label_4; + Utils::PathChooser *dataPath; + QLineEdit *longitude; + QLineEdit *outputPort; + QCheckBox *manualControl; + QLabel *label; + QLineEdit *latitude; QLabel *label_5; + QCheckBox *startSim; + QLabel *label_9; + QLineEdit *remoteHostAddress; void setupUi(QWidget *HITLOptionsPage) { if (HITLOptionsPage->objectName().isEmpty()) HITLOptionsPage->setObjectName(QString::fromUtf8("HITLOptionsPage")); - HITLOptionsPage->resize(400, 320); + HITLOptionsPage->resize(577, 367); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -81,68 +84,9 @@ public: gridLayout->addWidget(line, 2, 1, 1, 4); - label_7 = new QLabel(HITLOptionsPage); - label_7->setObjectName(QString::fromUtf8("label_7")); - - gridLayout->addWidget(label_7, 5, 1, 1, 1); - - latitude = new QLineEdit(HITLOptionsPage); - latitude->setObjectName(QString::fromUtf8("latitude")); - - gridLayout->addWidget(latitude, 5, 2, 1, 1); - - label_8 = new QLabel(HITLOptionsPage); - label_8->setObjectName(QString::fromUtf8("label_8")); - - gridLayout->addWidget(label_8, 5, 3, 1, 1); - - longitude = new QLineEdit(HITLOptionsPage); - longitude->setObjectName(QString::fromUtf8("longitude")); - - gridLayout->addWidget(longitude, 5, 4, 1, 1); - - label = new QLabel(HITLOptionsPage); - label->setObjectName(QString::fromUtf8("label")); - QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(label->sizePolicy().hasHeightForWidth()); - label->setSizePolicy(sizePolicy1); - - gridLayout->addWidget(label, 6, 1, 1, 1); - - executablePath = new Utils::PathChooser(HITLOptionsPage); - executablePath->setObjectName(QString::fromUtf8("executablePath")); - QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Preferred); - sizePolicy2.setHorizontalStretch(1); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(executablePath->sizePolicy().hasHeightForWidth()); - executablePath->setSizePolicy(sizePolicy2); - - gridLayout->addWidget(executablePath, 6, 2, 1, 3); - - label_2 = new QLabel(HITLOptionsPage); - label_2->setObjectName(QString::fromUtf8("label_2")); - sizePolicy1.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth()); - label_2->setSizePolicy(sizePolicy1); - - gridLayout->addWidget(label_2, 7, 1, 1, 1); - - dataPath = new Utils::PathChooser(HITLOptionsPage); - dataPath->setObjectName(QString::fromUtf8("dataPath")); - - gridLayout->addWidget(dataPath, 7, 2, 1, 3); - - manualControl = new QCheckBox(HITLOptionsPage); - manualControl->setObjectName(QString::fromUtf8("manualControl")); - sizePolicy1.setHeightForWidth(manualControl->sizePolicy().hasHeightForWidth()); - manualControl->setSizePolicy(sizePolicy1); - - gridLayout->addWidget(manualControl, 8, 1, 1, 4); - verticalSpacer = new QSpacerItem(20, 182, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout->addItem(verticalSpacer, 11, 2, 1, 1); + gridLayout->addItem(verticalSpacer, 12, 2, 1, 1); label_6 = new QLabel(HITLOptionsPage); label_6->setObjectName(QString::fromUtf8("label_6")); @@ -151,28 +95,112 @@ public: hostAddress = new QLineEdit(HITLOptionsPage); hostAddress->setObjectName(QString::fromUtf8("hostAddress")); + QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(hostAddress->sizePolicy().hasHeightForWidth()); + hostAddress->setSizePolicy(sizePolicy1); - gridLayout->addWidget(hostAddress, 3, 2, 1, 1); + gridLayout->addWidget(hostAddress, 3, 2, 1, 2); - outputPort = new QLineEdit(HITLOptionsPage); - outputPort->setObjectName(QString::fromUtf8("outputPort")); + label_7 = new QLabel(HITLOptionsPage); + label_7->setObjectName(QString::fromUtf8("label_7")); - gridLayout->addWidget(outputPort, 4, 4, 1, 1); + gridLayout->addWidget(label_7, 6, 1, 1, 1); - label_4 = new QLabel(HITLOptionsPage); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_8 = new QLabel(HITLOptionsPage); + label_8->setObjectName(QString::fromUtf8("label_8")); - gridLayout->addWidget(label_4, 4, 3, 1, 1); + gridLayout->addWidget(label_8, 6, 3, 1, 1); + + label_2 = new QLabel(HITLOptionsPage); + label_2->setObjectName(QString::fromUtf8("label_2")); + QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Fixed); + sizePolicy2.setHorizontalStretch(0); + sizePolicy2.setVerticalStretch(0); + sizePolicy2.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth()); + label_2->setSizePolicy(sizePolicy2); + + gridLayout->addWidget(label_2, 8, 1, 1, 1); inputPort = new QLineEdit(HITLOptionsPage); inputPort->setObjectName(QString::fromUtf8("inputPort")); - gridLayout->addWidget(inputPort, 4, 2, 1, 1); + gridLayout->addWidget(inputPort, 5, 2, 1, 1); + + executablePath = new Utils::PathChooser(HITLOptionsPage); + executablePath->setObjectName(QString::fromUtf8("executablePath")); + QSizePolicy sizePolicy3(QSizePolicy::Preferred, QSizePolicy::Preferred); + sizePolicy3.setHorizontalStretch(1); + sizePolicy3.setVerticalStretch(0); + sizePolicy3.setHeightForWidth(executablePath->sizePolicy().hasHeightForWidth()); + executablePath->setSizePolicy(sizePolicy3); + + gridLayout->addWidget(executablePath, 7, 2, 1, 3); + + label_4 = new QLabel(HITLOptionsPage); + label_4->setObjectName(QString::fromUtf8("label_4")); + + gridLayout->addWidget(label_4, 5, 3, 1, 1); + + dataPath = new Utils::PathChooser(HITLOptionsPage); + dataPath->setObjectName(QString::fromUtf8("dataPath")); + + gridLayout->addWidget(dataPath, 8, 2, 1, 3); + + longitude = new QLineEdit(HITLOptionsPage); + longitude->setObjectName(QString::fromUtf8("longitude")); + + gridLayout->addWidget(longitude, 6, 4, 1, 1); + + outputPort = new QLineEdit(HITLOptionsPage); + outputPort->setObjectName(QString::fromUtf8("outputPort")); + + gridLayout->addWidget(outputPort, 5, 4, 1, 1); + + manualControl = new QCheckBox(HITLOptionsPage); + manualControl->setObjectName(QString::fromUtf8("manualControl")); + sizePolicy2.setHeightForWidth(manualControl->sizePolicy().hasHeightForWidth()); + manualControl->setSizePolicy(sizePolicy2); + + gridLayout->addWidget(manualControl, 9, 1, 1, 4); + + label = new QLabel(HITLOptionsPage); + label->setObjectName(QString::fromUtf8("label")); + sizePolicy2.setHeightForWidth(label->sizePolicy().hasHeightForWidth()); + label->setSizePolicy(sizePolicy2); + + gridLayout->addWidget(label, 7, 1, 1, 1); + + latitude = new QLineEdit(HITLOptionsPage); + latitude->setObjectName(QString::fromUtf8("latitude")); + + gridLayout->addWidget(latitude, 6, 2, 1, 1); label_5 = new QLabel(HITLOptionsPage); label_5->setObjectName(QString::fromUtf8("label_5")); - gridLayout->addWidget(label_5, 4, 1, 1, 1); + gridLayout->addWidget(label_5, 5, 1, 1, 1); + + startSim = new QCheckBox(HITLOptionsPage); + startSim->setObjectName(QString::fromUtf8("startSim")); + startSim->setEnabled(true); + sizePolicy2.setHeightForWidth(startSim->sizePolicy().hasHeightForWidth()); + startSim->setSizePolicy(sizePolicy2); + + gridLayout->addWidget(startSim, 10, 1, 1, 1); + + label_9 = new QLabel(HITLOptionsPage); + label_9->setObjectName(QString::fromUtf8("label_9")); + + gridLayout->addWidget(label_9, 4, 1, 1, 1); + + remoteHostAddress = new QLineEdit(HITLOptionsPage); + remoteHostAddress->setObjectName(QString::fromUtf8("remoteHostAddress")); + sizePolicy1.setHeightForWidth(remoteHostAddress->sizePolicy().hasHeightForWidth()); + remoteHostAddress->setSizePolicy(sizePolicy1); + + gridLayout->addWidget(remoteHostAddress, 4, 2, 1, 1); retranslateUi(HITLOptionsPage); @@ -184,17 +212,34 @@ public: { HITLOptionsPage->setWindowTitle(QApplication::translate("HITLOptionsPage", "Form", 0, QApplication::UnicodeUTF8)); label_3->setText(QApplication::translate("HITLOptionsPage", "Choose flight simulator:", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("HITLOptionsPage", "Local interface address (IP):", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + hostAddress->setToolTip(QApplication::translate("HITLOptionsPage", "For communication with sim computer via network. Should be IP address of one of the local interfaces. ", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP label_7->setText(QApplication::translate("HITLOptionsPage", "Latitude in degrees:", 0, QApplication::UnicodeUTF8)); label_8->setText(QApplication::translate("HITLOptionsPage", "Longitude in degrees:", 0, QApplication::UnicodeUTF8)); - label->setText(QApplication::translate("HITLOptionsPage", "Path executable:", 0, QApplication::UnicodeUTF8)); label_2->setText(QApplication::translate("HITLOptionsPage", "Data directory:", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + inputPort->setToolTip(QApplication::translate("HITLOptionsPage", "For receiving data from sim", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + label_4->setText(QApplication::translate("HITLOptionsPage", "Output Port:", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + outputPort->setToolTip(QApplication::translate("HITLOptionsPage", "For sending data to sim", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP #ifndef QT_NO_TOOLTIP manualControl->setToolTip(QApplication::translate("HITLOptionsPage", "Manual aircraft control (can be used when hardware is not available)", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP manualControl->setText(QApplication::translate("HITLOptionsPage", "Manual aircraft control (can be used when hardware is not available)", 0, QApplication::UnicodeUTF8)); - label_6->setText(QApplication::translate("HITLOptionsPage", "Host Address:", 0, QApplication::UnicodeUTF8)); - label_4->setText(QApplication::translate("HITLOptionsPage", "Output Port:", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("HITLOptionsPage", "Path executable:", 0, QApplication::UnicodeUTF8)); label_5->setText(QApplication::translate("HITLOptionsPage", "Input Port:", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + startSim->setToolTip(QApplication::translate("HITLOptionsPage", "Check this box to start the simulator on the local computer", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + startSim->setText(QApplication::translate("HITLOptionsPage", "Start simulator on local machine", 0, QApplication::UnicodeUTF8)); + label_9->setText(QApplication::translate("HITLOptionsPage", "Remote interface address (IP):", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + remoteHostAddress->setToolTip(QApplication::translate("HITLOptionsPage", "Only required if running simulator on remote machine ", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP } // retranslateUi };