- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document
C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+
Build status: BUILD_RTI=OFF successful (0 errors, warnings only)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
50 lines
1.8 KiB
C++
Executable File
50 lines
1.8 KiB
C++
Executable File
|
|
|
|
|
|
#include "plugin.h"
|
|
#include "plugin_instance.h"
|
|
|
|
#include <nglsettings/nglsettings_settings.h>
|
|
|
|
#include <QtCore/QSettings>
|
|
#include <QtCore/QDebug>
|
|
|
|
|
|
namespace UAS
|
|
{
|
|
std::shared_ptr<TrainingAreaBase::Plugin::Interface> TabPluginUAS::createInterface(TrainingAreaBase::Plugin::DataProvider *dataProvider,
|
|
const std::shared_ptr<TrainingAreaBase::RecvFromTab> &recvFromTabCb,
|
|
const std::shared_ptr<TrainingAreaBase::TxMixin> &,
|
|
const std::shared_ptr<TrainingAreaBase::DdsHandler> &ddsHandler,
|
|
NGL::Settings *settings)
|
|
{
|
|
qDebug() << "UAS Plugin starting for ex "<<dataProvider->exerciseId()<<"!\n";
|
|
|
|
|
|
|
|
const QString ip(settings->settings()->value(QStringLiteral("UAS/TmsIfIpAddress"), QStringLiteral("127.0.0.1")).toString());
|
|
qDebug() << "TabPluginUAS::createInterface: TMS-IF will be started on the network interface with ip address: '" << ip << "' \n";
|
|
qputenv("CYCLONEDDS_URI", QStringLiteral("<CycloneDDS><Domain><General><Interfaces><NetworkInterface address=\"%1\"></NetworkInterface></Interfaces></General></Domain></CycloneDDS>").arg(ip).toUtf8());
|
|
|
|
if ( !hostAvailable(ip))
|
|
return nullptr;
|
|
|
|
return std::make_shared<PluginInstance>(dataProvider, recvFromTabCb, ddsHandler, settings);
|
|
}
|
|
|
|
bool TabPluginUAS::hostAvailable(QString hostname) {
|
|
|
|
|
|
QHostInfo info = QHostInfo::fromName(hostname);
|
|
|
|
|
|
if (info.error() == QHostInfo::NoError) {
|
|
qCritical() << "Success! Host found. IP addresses:" << hostname;
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
}
|