Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2785 files changed
+18754
-18316
No files matched your search
+1
-1
@@ -31,7 +31,7 @@ void Dispatcher::ReportCBitStatus(const std::string &KeyId, const M_BuiltInTest:
|
||||
{
|
||||
if (IsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isRemoved";
|
||||
DEBUG_LOG() << "isRemoved";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ public:
|
||||
Dispatcher();
|
||||
void ReportCBitStatus(const std::string &KeyId, const M_BuiltInTest::BitStatusType &status, bool IsRemoved) override;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -37,23 +37,23 @@ Dispatcher::Dispatcher()
|
||||
|
||||
void Dispatcher::ReportDeviceStatus(M_Device::DeviceStatusType const& status, bool IsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start";
|
||||
DEBUG_LOG() << "start";
|
||||
|
||||
if (IsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isRemoved";
|
||||
DEBUG_LOG() << "isRemoved";
|
||||
return;
|
||||
}
|
||||
|
||||
if (status.OperationStatus.Mode.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "no mode!";
|
||||
DEBUG_LOG() << "no mode!";
|
||||
return;
|
||||
}
|
||||
|
||||
if (status.OperationStatus.Mode.front().EnumeratedValue.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "no enum value in mode!";
|
||||
DEBUG_LOG() << "no enum value in mode!";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ void Dispatcher::ReportDeviceStatus(M_Device::DeviceStatusType const& status, bo
|
||||
Message msg;
|
||||
msg.Status = operationModeStateKindFromTms(val);
|
||||
|
||||
DEBUG_LOG(m_logger) << "dispatch!";
|
||||
DEBUG_LOG() << "dispatch!";
|
||||
|
||||
dispatch(msg);
|
||||
}
|
||||
|
||||
-1
@@ -26,7 +26,6 @@ public:
|
||||
Dispatcher();
|
||||
void ReportDeviceStatus(M_Device::DeviceStatusType const& status, bool IsRemoved) override;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -47,19 +47,19 @@ void Dispatcher::ReportMissionStatus(M_MissionCtrl::MissionStatusType const& Mis
|
||||
{
|
||||
if (IsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isRemoved";
|
||||
DEBUG_LOG() << "isRemoved";
|
||||
return;
|
||||
}
|
||||
|
||||
if (MissionStatus.CurrentAction.CurrentTask.EnumeratedValue.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty";
|
||||
DEBUG_LOG() << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MissionStatus.CurrentAction.CurrentTask.TextualValue.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "text: " << QString::fromStdString(MissionStatus.CurrentAction.CurrentTask.TextualValue.front());
|
||||
DEBUG_LOG() << "text: " << QString::fromStdString(MissionStatus.CurrentAction.CurrentTask.TextualValue.front());
|
||||
}
|
||||
const Task currentTask = taskFromTms(MissionStatus.CurrentAction.CurrentTask.EnumeratedValue.front());
|
||||
|
||||
@@ -81,7 +81,7 @@ void Dispatcher::ReportMissionStatus(M_MissionCtrl::MissionStatusType const& Mis
|
||||
}
|
||||
|
||||
std::string missionName = MissionStatus.CurrentMissionName;
|
||||
DEBUG_LOG(m_logger) << "missionName before: " << missionName;
|
||||
DEBUG_LOG() << "missionName before: " << missionName;
|
||||
if (missionName.empty())
|
||||
{
|
||||
for (const auto &additionalInfo : std::as_const(MissionStatus.CurrentAction.CurrentTask.AdditionalInfo))
|
||||
@@ -93,7 +93,7 @@ void Dispatcher::ReportMissionStatus(M_MissionCtrl::MissionStatusType const& Mis
|
||||
}
|
||||
}
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "missionName after: " << missionName;
|
||||
DEBUG_LOG() << "missionName after: " << missionName;
|
||||
|
||||
dispatch({ missionName, currentTask, currentlyAllowedTasks, {} });
|
||||
}
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ public:
|
||||
Dispatcher();
|
||||
void ReportMissionStatus(M_MissionCtrl::MissionStatusType const& MissionStatus, bool IsRemoved) override;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -17,7 +17,7 @@ Dispatcher::Dispatcher()
|
||||
|
||||
void Dispatcher::ReportPoint(const M_Common::ObjectIdType &KeyId, const M_ObjectManager::PointObjectType &, bool IsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start";
|
||||
DEBUG_LOG() << "start";
|
||||
|
||||
Message msg;
|
||||
|
||||
@@ -25,13 +25,13 @@ void Dispatcher::ReportPoint(const M_Common::ObjectIdType &KeyId, const M_Object
|
||||
msg.uasId = std::stoi(KeyId);
|
||||
}catch(...)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "KeyId not an int !";
|
||||
ERROR_LOG() << "KeyId not an int !";
|
||||
return;
|
||||
}
|
||||
|
||||
msg.isRemoved = IsRemoved;
|
||||
|
||||
DEBUG_LOG(m_logger) << "dispatch!";
|
||||
DEBUG_LOG() << "dispatch!";
|
||||
|
||||
dispatch(msg);
|
||||
}
|
||||
|
||||
-1
@@ -23,7 +23,6 @@ public:
|
||||
Dispatcher();
|
||||
void ReportPoint(const M_Common::ObjectIdType &KeyId, const M_ObjectManager::PointObjectType &Obj, bool IsRemoved) override;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -19,14 +19,14 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit
|
||||
{
|
||||
if (IsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isRemoved";
|
||||
DEBUG_LOG() << "isRemoved";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (KeyId != "UTM_GLOBAL_POSITION" && KeyId != "CURRENT_AIRFRAME_RAW" && KeyId != "CURRENT_AIRFRAME")
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "KeyId unwanted (is '" << QString::fromStdString(KeyId) << "')";
|
||||
DEBUG_LOG() << "KeyId unwanted (is '" << QString::fromStdString(KeyId) << "')";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit
|
||||
|
||||
if (PositionList.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "PositionList is empty";
|
||||
DEBUG_LOG() << "PositionList is empty";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit
|
||||
|
||||
if (pos.Ellipsoidal.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "PositionList.Ellipsoidal is empty";
|
||||
DEBUG_LOG() << "PositionList.Ellipsoidal is empty";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit
|
||||
|
||||
if (elip.Altitude.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "PositionList.Ellipsoidal.Altitude is empty";
|
||||
DEBUG_LOG() << "PositionList.Ellipsoidal.Altitude is empty";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit
|
||||
|
||||
if (pos.Timestamp.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "PositionList[0].Timestamp is empty";
|
||||
DEBUG_LOG() << "PositionList[0].Timestamp is empty";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -23,7 +23,6 @@ public:
|
||||
Dispatcher();
|
||||
void ReportPositions(const std::string &KeyId, const M_Common::PositionListType &PositionList, bool IsRemoved) override;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,13 +34,13 @@ void Dispatcher::ReportRadioConnectionStatus(const std::string &, const M_Teleop
|
||||
{
|
||||
if (IsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isRemoved";
|
||||
DEBUG_LOG() << "isRemoved";
|
||||
return;
|
||||
}
|
||||
|
||||
if (RadioConnectionStatus.LinkConnectionState == M_Teleoperation::RadioLinkConnectionState::Undefined)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty";
|
||||
DEBUG_LOG() << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ public:
|
||||
Dispatcher();
|
||||
void ReportRadioConnectionStatus(std::string const& KeyId, M_Teleoperation::RadioConnectionStatusType const& RadioConnectionStatus, bool IsRemoved) override;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+5
-9
@@ -52,7 +52,6 @@ private:
|
||||
bool m_isReady { false };
|
||||
std::function<void()> m_isReady_Callback;
|
||||
InterfaceAdapterInitializer *m_iai;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
@@ -67,9 +66,8 @@ public:
|
||||
, m_master("UAV_ObjectManager", 4)
|
||||
, m_reader(m_master.dispatcher())
|
||||
, m_writer(m_master.client())
|
||||
, m_logger(getLogger("InterfaceAdapterInitializer"))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ctor";
|
||||
ERROR_LOG() << "ctor";
|
||||
|
||||
connect(m_reader.readerSignal(), &ReaderSignal::dataReady, this, &InterfaceAdapterInitializer::updatePoint);
|
||||
|
||||
@@ -79,7 +77,7 @@ public:
|
||||
{
|
||||
if (m_activeUas.empty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "trying to stop active uas - DONE!";
|
||||
ERROR_LOG() << "trying to stop active uas - DONE!";
|
||||
|
||||
t->stop();
|
||||
m_parent->setReady();
|
||||
@@ -87,7 +85,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
ERROR_LOG(m_logger) << "trying to stop active uas:" << m_activeUas.size();
|
||||
ERROR_LOG() << "trying to stop active uas:" << m_activeUas.size();
|
||||
|
||||
for (const int activeUas : m_activeUas)
|
||||
{
|
||||
@@ -133,15 +131,13 @@ private:
|
||||
M_ObjectManager::Client m_writer;
|
||||
|
||||
std::set<int> m_activeUas;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
TmsIfAdapterImpl::TmsIfAdapterImpl()
|
||||
: m_iai(new InterfaceAdapterInitializer(this))
|
||||
, m_logger(getLogger("TmsIfAdapterImpl"))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "TmsIfAdapter running!";
|
||||
ERROR_LOG() << "TmsIfAdapter running!";
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +145,7 @@ TmsIfAdapterImpl::~TmsIfAdapterImpl()
|
||||
{
|
||||
delete m_iai;
|
||||
delete m_guard;
|
||||
ERROR_LOG(m_logger) << "!!! TmsIfAdapterImpl DTOR!";
|
||||
ERROR_LOG() << "!!! TmsIfAdapterImpl DTOR!";
|
||||
}
|
||||
|
||||
|
||||
|
||||
+58
-61
@@ -32,9 +32,8 @@ UAVCommanderImpl::UAVCommanderImpl(int domainId, int uasId, QObject *parent)
|
||||
, m_BuildInTest(std::string("UAV_BuiltInTest_") + std::to_string(uasId), domainId)
|
||||
, m_Device(std::string("UAV_Device_") + std::to_string(uasId), domainId)
|
||||
, m_CoordinateFrame(std::string("UAV_CoordinateFrame_") + std::to_string(uasId), domainId)
|
||||
, m_logger(getLogger("UAVCommanderImpl"))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ctor: " << (quintptr)this;
|
||||
ERROR_LOG() << "ctor: " << (quintptr)this;
|
||||
|
||||
connect(m_MissionCtrl.reader.readerSignal(), &ReaderSignal::dataReady, this, &UAVCommanderImpl::updateMissionStatus);
|
||||
connect(m_TeleOperation.reader.readerSignal(), &ReaderSignal::dataReady, this, &UAVCommanderImpl::updateOperationalState);
|
||||
@@ -82,7 +81,7 @@ UAVCommanderImpl::MissionCtrlContainer::MissionCtrlContainer(const std::string &
|
||||
|
||||
UAVCommanderImpl::~UAVCommanderImpl()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "dtor: " << (quintptr)this;
|
||||
ERROR_LOG() << "dtor: " << (quintptr)this;
|
||||
|
||||
if (m_createInterfaceAdapterInstance)
|
||||
{
|
||||
@@ -109,13 +108,13 @@ void UAVCommanderImpl::updateMissionStatus()
|
||||
|
||||
const auto oldTask = m_MissionCtrl.currentTask;
|
||||
m_MissionCtrl.currentTask = msg.currentTask;
|
||||
ERROR_LOG(m_logger) << "currentTask = " << (int)m_MissionCtrl.currentTask;
|
||||
ERROR_LOG() << "currentTask = " << (int)m_MissionCtrl.currentTask;
|
||||
|
||||
const auto oldMission = m_MissionCtrl.currentMission;
|
||||
m_MissionCtrl.currentMission = QString::fromStdString(msg.currentMissionName);
|
||||
ERROR_LOG(m_logger) << "oldTask = " << (int)oldTask;
|
||||
ERROR_LOG() << "oldTask = " << (int)oldTask;
|
||||
|
||||
ERROR_LOG(m_logger) << "currentMission = " << QString::fromStdString(msg.currentMissionName);
|
||||
ERROR_LOG() << "currentMission = " << QString::fromStdString(msg.currentMissionName);
|
||||
|
||||
m_MissionCtrl.currentlyAllowedTasks.swap(msg.currentlyAllowedTasks);
|
||||
|
||||
@@ -123,7 +122,7 @@ void UAVCommanderImpl::updateMissionStatus()
|
||||
{
|
||||
|
||||
|
||||
ERROR_LOG(m_logger) << "Old Task" << oldTask << "new task " << m_MissionCtrl.currentTask ;
|
||||
ERROR_LOG() << "Old Task" << oldTask << "new task " << m_MissionCtrl.currentTask ;
|
||||
if (oldTask != m_MissionCtrl.currentTask)
|
||||
{
|
||||
if (!oldMission.isEmpty() && m_MissionCtrl.currentMission.isEmpty())
|
||||
@@ -132,11 +131,11 @@ void UAVCommanderImpl::updateMissionStatus()
|
||||
}
|
||||
|
||||
m_MissionCtrl.ReportMissionStatus_Callback(msg);
|
||||
ERROR_LOG(m_logger) << "################################# sending " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this;
|
||||
ERROR_LOG() << "################################# sending " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this;
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG(m_logger) << "################################# VERWERFING ! " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this;
|
||||
ERROR_LOG() << "################################# VERWERFING ! " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +151,7 @@ void UAVCommanderImpl::updateMissionStatus()
|
||||
case MissionCtrl::Shutdown:
|
||||
{
|
||||
m_isReady = false;
|
||||
ERROR_LOG(m_logger) << "UAV not ready yet! currentTask: " << (int)m_MissionCtrl.currentTask;
|
||||
ERROR_LOG() << "UAV not ready yet! currentTask: " << (int)m_MissionCtrl.currentTask;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -167,7 +166,7 @@ void UAVCommanderImpl::updateMissionStatus()
|
||||
{
|
||||
m_isReady_Callback();
|
||||
}
|
||||
ERROR_LOG(m_logger) << "UAV now ready!";
|
||||
ERROR_LOG() << "UAV now ready!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +253,7 @@ void UAVCommanderImpl::updateCBitStaus()
|
||||
|
||||
void UAVCommanderImpl::updateDeviceModeState()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "start";
|
||||
ERROR_LOG() << "start";
|
||||
|
||||
while (true)
|
||||
{
|
||||
@@ -265,10 +264,10 @@ void UAVCommanderImpl::updateDeviceModeState()
|
||||
m_Device.currentMessage.clear();
|
||||
m_Device.currentMessage.emplace_back(msg);
|
||||
|
||||
ERROR_LOG(m_logger) << "before callback";
|
||||
ERROR_LOG() << "before callback";
|
||||
if (m_Device.ReportDeviceStatus_Callback)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "callback!";
|
||||
ERROR_LOG() << "callback!";
|
||||
m_Device.ReportDeviceStatus_Callback(msg);
|
||||
}
|
||||
}
|
||||
@@ -282,11 +281,11 @@ void UAVCommanderImpl::updateDeviceModeState()
|
||||
|
||||
void UAVCommanderImpl::prepareMission(Resolver *resolver)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "resolver = " << (quintptr)resolver;
|
||||
ERROR_LOG() << "resolver = " << (quintptr)resolver;
|
||||
|
||||
if (isTaskAllowed(MissionCtrl::Task::Observe) || m_MissionCtrl.currentTask == MissionCtrl::Task::Connect )
|
||||
{
|
||||
ERROR_LOG(m_logger) << "DONE! resolving " << (quintptr)resolver;
|
||||
ERROR_LOG() << "DONE! resolving " << (quintptr)resolver;
|
||||
emit resolver->resolve();
|
||||
return;
|
||||
}
|
||||
@@ -295,7 +294,7 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver)
|
||||
connect(r, &Resolver::reject, resolver, &Resolver::reject);
|
||||
connect(r, &Resolver::resolve, resolver, [this, resolver]()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "r ("<<(quintptr)resolver<<")! resolving!";
|
||||
ERROR_LOG() << "r ("<<(quintptr)resolver<<")! resolving!";
|
||||
Resolver *r2 = new Resolver(this);
|
||||
connect(r2, &Resolver::reject, resolver, &Resolver::reject);
|
||||
connect(r2, &Resolver::resolve, resolver, &Resolver::resolve);
|
||||
@@ -304,7 +303,7 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver)
|
||||
|
||||
if (!m_MissionCtrl.currentMission.isEmpty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << " > mission '"<< m_MissionCtrl.currentMission << "' currently active - aborting mission and waiting for loitering";
|
||||
ERROR_LOG() << " > mission '"<< m_MissionCtrl.currentMission << "' currently active - aborting mission and waiting for loitering";
|
||||
sendCommand(r, {QStringLiteral("mission:abort (%1)").arg(m_MissionCtrl.currentMission), MissionCtrl::Task::Connect, [this]() { _abortMission(m_MissionCtrl.currentMission); }});
|
||||
return;
|
||||
}
|
||||
@@ -313,28 +312,28 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver)
|
||||
{
|
||||
case MissionCtrl::Task::Disarm:
|
||||
{
|
||||
ERROR_LOG(m_logger) << " > arm";
|
||||
ERROR_LOG() << " > arm";
|
||||
arm(r);
|
||||
break;
|
||||
}
|
||||
|
||||
case MissionCtrl::Task::Arm:
|
||||
{
|
||||
ERROR_LOG(m_logger) << " > takeoff";
|
||||
ERROR_LOG() << " > takeoff";
|
||||
takeoff(r);
|
||||
break;
|
||||
}
|
||||
|
||||
case MissionCtrl::Task::Takeoff:
|
||||
{
|
||||
ERROR_LOG(m_logger) << " > waiting for Loiter ...";
|
||||
ERROR_LOG() << " > waiting for Loiter ...";
|
||||
sendCommand(r, {QStringLiteral("loiter"), MissionCtrl::Task::Loiter, nullptr});
|
||||
break;
|
||||
}
|
||||
|
||||
case MissionCtrl::Task::Loiter:
|
||||
{
|
||||
ERROR_LOG(m_logger) << " >WE loiter start to resolve";
|
||||
ERROR_LOG() << " >WE loiter start to resolve";
|
||||
emit resolver->resolve();
|
||||
break;
|
||||
}
|
||||
@@ -343,7 +342,7 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver)
|
||||
|
||||
default:
|
||||
{
|
||||
ERROR_LOG(m_logger) << "help, I don't know what to do with "<<(int)m_MissionCtrl.currentTask<<" :(";
|
||||
ERROR_LOG() << "help, I don't know what to do with "<<(int)m_MissionCtrl.currentTask<<" :(";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -354,7 +353,7 @@ void UAVCommanderImpl::sendMission(double lat, double lon, double alt, const QSt
|
||||
{
|
||||
if (!m_isReady)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "not ready";
|
||||
ERROR_LOG() << "not ready";
|
||||
throw std::runtime_error("UAV not ready");
|
||||
}
|
||||
|
||||
@@ -374,21 +373,21 @@ void UAVCommanderImpl::sendMission(double lat, double lon, double alt, const QSt
|
||||
}
|
||||
|
||||
Resolver *r = new Resolver(this);
|
||||
connect(r, &Resolver::reject, this, [this](const QString &msg) { ERROR_LOG(m_logger) << "rejected: " << msg; });
|
||||
connect(r, &Resolver::reject, this, [this](const QString &msg) { ERROR_LOG() << "rejected: " << msg; });
|
||||
connect(r, &Resolver::resolve, [this, lat, lon, alt, missionName]()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!! going to observe now!!";
|
||||
ERROR_LOG() << "!!!!!!!!!!!!!!!!!!!!!! going to observe now!!";
|
||||
|
||||
|
||||
Resolver *r2 = new Resolver(this);
|
||||
connect(r2, &Resolver::reject, [this](const QString &msg) { ERROR_LOG(m_logger) << "################ failed to start mission :( " << msg; });
|
||||
connect(r2, &Resolver::reject, [this](const QString &msg) { ERROR_LOG() << "################ failed to start mission :( " << msg; });
|
||||
connect(r2, &Resolver::resolve, [this, missionName]()
|
||||
{
|
||||
Resolver *r3 = new Resolver(this);
|
||||
connect(r3, &Resolver::reject, [this](const QString &msg) { ERROR_LOG(m_logger) << "################ failed to wait for loiter :( " << msg; });
|
||||
connect(r3, &Resolver::reject, [this](const QString &msg) { ERROR_LOG() << "################ failed to wait for loiter :( " << msg; });
|
||||
connect(r3, &Resolver::resolve, [this, missionName]()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "################ mission done" << missionName << " " << this << " ";
|
||||
ERROR_LOG() << "################ mission done" << missionName << " " << this << " ";
|
||||
|
||||
|
||||
|
||||
@@ -396,7 +395,7 @@ void UAVCommanderImpl::sendMission(double lat, double lon, double alt, const QSt
|
||||
|
||||
});
|
||||
sendCommand(r3, {QStringLiteral("wait for mission to end (Loiter)"), MissionCtrl::Task::Loiter, nullptr}, -1);
|
||||
ERROR_LOG(m_logger) << "################ successfully started mission :)";
|
||||
ERROR_LOG() << "################ successfully started mission :)";
|
||||
});
|
||||
sendCommand(r2, { QStringLiteral("mission:observe"), MissionCtrl::Task::Observe, [this, lat, lon, alt, missionName]() { _sendMission(lat, lon, alt, missionName); } });
|
||||
});
|
||||
@@ -420,18 +419,18 @@ void UAVCommanderImpl::_abortMission(const QString &missionName)
|
||||
|
||||
void UAVCommanderImpl::_sendMission(double lat, double lon, double alt, const QString &missionName)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "lat = " << lat << ", lon = " << lon << ", alt = " << alt << ", missionName = " << missionName;
|
||||
ERROR_LOG() << "lat = " << lat << ", lon = " << lon << ", alt = " << alt << ", missionName = " << missionName;
|
||||
|
||||
M_Common::EllipsoidalPositionType pos;
|
||||
|
||||
if (alt <= 0.1)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "alt very low (<= 0.1) !";
|
||||
ERROR_LOG() << "alt very low (<= 0.1) !";
|
||||
}
|
||||
|
||||
pos.Latitude = lat / LtsCoordTrans::deg2rad();
|
||||
pos.Longitude = lon / LtsCoordTrans::deg2rad();
|
||||
ERROR_LOG(m_logger) << "DEG lat = " << pos.Latitude << ", lon = " << pos.Longitude << ", alt = " << alt << ", missionName = " << missionName;
|
||||
ERROR_LOG() << "DEG lat = " << pos.Latitude << ", lon = " << pos.Longitude << ", alt = " << alt << ", missionName = " << missionName;
|
||||
|
||||
pos.Altitude.push_back(alt);
|
||||
|
||||
@@ -448,8 +447,8 @@ void UAVCommanderImpl::_sendMission(double lat, double lon, double alt, const QS
|
||||
void UAVCommanderImpl::returnToHome()
|
||||
{
|
||||
Resolver *r = new Resolver(this);
|
||||
connect(r, &Resolver::reject, this, [this](const QString &error) { ERROR_LOG(m_logger) << "returnToHome failed: " << error; });
|
||||
connect(r, &Resolver::resolve, this, [this]() { ERROR_LOG(m_logger) << "returnToHome done :)"; });
|
||||
connect(r, &Resolver::reject, this, [this](const QString &error) { ERROR_LOG() << "returnToHome failed: " << error; });
|
||||
connect(r, &Resolver::resolve, this, [this]() { ERROR_LOG() << "returnToHome done :)"; });
|
||||
sendCommand(r, { QStringLiteral("return"), MissionCtrl::Task::Return, [this]() { _returnToHome(); } }, -1 );
|
||||
}
|
||||
|
||||
@@ -468,12 +467,12 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
|
||||
if (m_tried != 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << commandName << ": another request already running - replacing ("<<m_tried__ACTIVE<<")";
|
||||
ERROR_LOG() << commandName << ": another request already running - replacing ("<<m_tried__ACTIVE<<")";
|
||||
}
|
||||
|
||||
if (m_MissionCtrl.currentTask == type)
|
||||
{
|
||||
ERROR_LOG(m_logger) << commandName << ": current task already matches new task '"<< commandName <<"' - replacing anyways";
|
||||
ERROR_LOG() << commandName << ": current task already matches new task '"<< commandName <<"' - replacing anyways";
|
||||
}
|
||||
|
||||
if (m_currentResolver)
|
||||
@@ -482,7 +481,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
}
|
||||
m_currentResolver = resolver;
|
||||
|
||||
ERROR_LOG(m_logger) << commandName << ": sending '" << commandName <<"' command ...";
|
||||
ERROR_LOG() << commandName << ": sending '" << commandName <<"' command ...";
|
||||
m_tried = 1;
|
||||
m_tried__ACTIVE = cmd.name;
|
||||
|
||||
@@ -495,14 +494,14 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
{
|
||||
if (commandFn)
|
||||
{
|
||||
ERROR_LOG(m_logger) << commandName << ": sending '"<< commandName <<"' command failed - timeout, trying again !";
|
||||
ERROR_LOG() << commandName << ": sending '"<< commandName <<"' command failed - timeout, trying again !";
|
||||
try
|
||||
{
|
||||
commandFn();
|
||||
}
|
||||
catch(const std::exception &ex)
|
||||
{
|
||||
ERROR_LOG(m_logger) << commandName << ": sending '"<< commandName <<"' command failed:" << ex.what();
|
||||
ERROR_LOG() << commandName << ": sending '"<< commandName <<"' command failed:" << ex.what();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -522,7 +521,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
{
|
||||
timeout->stop();
|
||||
guard->deleteLater();
|
||||
ERROR_LOG(m_logger) << commandName << ": sending '"<< commandName <<"' command failed - max tries reached, giving up !";
|
||||
ERROR_LOG() << commandName << ": sending '"<< commandName <<"' command failed - max tries reached, giving up !";
|
||||
m_tried = 0;
|
||||
m_currentResolver.clear();
|
||||
emit resolver->reject(QStringLiteral("Sending %1 command timed out!").arg(commandName));
|
||||
@@ -541,7 +540,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
connect(reader->readerSignal(), &ReaderSignal::dataReady,
|
||||
this, [this, reader, guard, timeout, commandName, type, resolver]()
|
||||
{
|
||||
ERROR_LOG(m_logger) << commandName << ": reader signal for '"<< commandName <<"' !";
|
||||
ERROR_LOG() << commandName << ": reader signal for '"<< commandName <<"' !";
|
||||
|
||||
while(true)
|
||||
{
|
||||
@@ -549,14 +548,14 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
{
|
||||
const auto msg = reader->getNext();
|
||||
|
||||
ERROR_LOG(m_logger) << "########## READER SIGNAL (should: " << (int)type << ", is: " << (int)msg.currentTask << ")";
|
||||
ERROR_LOG() << "########## READER SIGNAL (should: " << (int)type << ", is: " << (int)msg.currentTask << ")";
|
||||
|
||||
if (msg.currentTask == type
|
||||
|
||||
|| (type == MissionCtrl::Task::Takeoff && msg.currentTask == MissionCtrl::Task::Connect)
|
||||
|| (type == MissionCtrl::Task::Return && (msg.currentTask == MissionCtrl::Task::Disarm || msg.currentTask == MissionCtrl::Task::Land)))
|
||||
{
|
||||
ERROR_LOG(m_logger) << commandName << ": successfully set new task '"<< commandName <<"' !";
|
||||
ERROR_LOG() << commandName << ": successfully set new task '"<< commandName <<"' !";
|
||||
|
||||
|
||||
QTimer *x = new QTimer(guard);
|
||||
@@ -566,7 +565,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
connect(guard, &QObject::destroyed, x, &QTimer::stop);
|
||||
connect(x, &QTimer::timeout, this, [this, timeout, guard, resolver]()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "############# RESOLVE AFTER 1s";
|
||||
ERROR_LOG() << "############# RESOLVE AFTER 1s";
|
||||
|
||||
m_tried = 0;
|
||||
if (timeout != nullptr)
|
||||
@@ -589,7 +588,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t
|
||||
}
|
||||
}
|
||||
|
||||
ERROR_LOG(m_logger) << commandName << ": command '"<< commandName <<"' not accepted (yet)";
|
||||
ERROR_LOG() << commandName << ": command '"<< commandName <<"' not accepted (yet)";
|
||||
|
||||
|
||||
});
|
||||
@@ -643,7 +642,7 @@ void UAVCommanderImpl::sendTryReclaimAutoMode()
|
||||
}
|
||||
catch(const std::exception &ex)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to send DeviceMode:" << ex.what();
|
||||
ERROR_LOG() << "Failed to send DeviceMode:" << ex.what();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,30 +665,29 @@ CreateInterfaceAdapterInstance::CreateInterfaceAdapterInstance(int uasId, const
|
||||
, m_port(port)
|
||||
, m_useTcp(useTcp)
|
||||
, m_timeout(new QTimer(this))
|
||||
, m_logger(getLogger("CreateInterfaceAdapterInstance"))
|
||||
{
|
||||
connect(m_reader.readerSignal(), &ReaderSignal::dataReady,
|
||||
this, [this, uasId]()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "readerSignal for uasId" << m_uasId;
|
||||
ERROR_LOG() << "readerSignal for uasId" << m_uasId;
|
||||
|
||||
const auto msgs = readAll<ObjectManager::ReportPoint::Message>(m_reader);
|
||||
ERROR_LOG(m_logger) << "msgs.size" << msgs.size() << m_uasId;
|
||||
ERROR_LOG() << "msgs.size" << msgs.size() << m_uasId;
|
||||
|
||||
for (const auto &msg : msgs)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "msg uas" << msg.uasId << "removed" << msg.isRemoved;
|
||||
ERROR_LOG() << "msg uas" << msg.uasId << "removed" << msg.isRemoved;
|
||||
if (msg.uasId == uasId && !msg.isRemoved)
|
||||
{
|
||||
|
||||
ERROR_LOG(m_logger) << "DONE!!";
|
||||
ERROR_LOG() << "DONE!!";
|
||||
m_timeout->stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ERROR_LOG(m_logger) << "no ia instance for"<<m_uasId<<"found !! starting timeout";
|
||||
ERROR_LOG() << "no ia instance for"<<m_uasId<<"found !! starting timeout";
|
||||
if (!m_timeout->isActive())
|
||||
{
|
||||
m_timeout->start();
|
||||
@@ -708,7 +706,7 @@ CreateInterfaceAdapterInstance::CreateInterfaceAdapterInstance(int uasId, const
|
||||
|
||||
void CreateInterfaceAdapterInstance::onStart()
|
||||
{
|
||||
ERROR_LOG(m_logger) << " -- CreateInterfaceAdapterInstance -- ::onStart() CmdAddUpdatePoint" << m_uasId<<" ip: "<<m_ip<<" use TCP ? "<<m_useTcp;
|
||||
ERROR_LOG() << " -- CreateInterfaceAdapterInstance -- ::onStart() CmdAddUpdatePoint" << m_uasId<<" ip: "<<m_ip<<" use TCP ? "<<m_useTcp;
|
||||
|
||||
M_ObjectManager::PointObjectType pot;
|
||||
pot.AdditionalInfo.push_back({ "IP", m_ip, {}, {}, M_Common::PropertyAccessKind::Type::Undefined });
|
||||
@@ -722,7 +720,7 @@ void CreateInterfaceAdapterInstance::onStart()
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "CmdAddUpdatePoint FAILED!" << m_uasId << ":" << ex.what();
|
||||
ERROR_LOG() << "CmdAddUpdatePoint FAILED!" << m_uasId << ":" << ex.what();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,7 +733,6 @@ KillInterfaceAdapterInstanceAsync::KillInterfaceAdapterInstanceAsync(int uasId)
|
||||
, m_writer(m_master.client())
|
||||
, m_uasId(uasId)
|
||||
, m_timeout(new QTimer(this))
|
||||
, m_logger(getLogger("KillInterfaceAdapterInstanceAsync"))
|
||||
{
|
||||
connect(m_reader.readerSignal(), &ReaderSignal::dataReady,
|
||||
this, [this, uasId]()
|
||||
@@ -745,18 +742,18 @@ KillInterfaceAdapterInstanceAsync::KillInterfaceAdapterInstanceAsync(int uasId)
|
||||
return;
|
||||
}
|
||||
|
||||
ERROR_LOG(m_logger) << "readerSignal for uasId" << m_uasId;
|
||||
ERROR_LOG() << "readerSignal for uasId" << m_uasId;
|
||||
|
||||
const auto msgs = readAll<ObjectManager::ReportPoint::Message>(m_reader);
|
||||
ERROR_LOG(m_logger) << "msgs.size" << msgs.size() << m_uasId;
|
||||
ERROR_LOG() << "msgs.size" << msgs.size() << m_uasId;
|
||||
|
||||
for (const auto &msg : msgs)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "msg uas" << msg.uasId << "removed" << msg.isRemoved;
|
||||
ERROR_LOG() << "msg uas" << msg.uasId << "removed" << msg.isRemoved;
|
||||
if (msg.uasId == uasId && msg.isRemoved)
|
||||
{
|
||||
|
||||
ERROR_LOG(m_logger) << "DONE!!";
|
||||
ERROR_LOG() << "DONE!!";
|
||||
m_done = true;
|
||||
deleteLater();
|
||||
return;
|
||||
@@ -781,7 +778,7 @@ void KillInterfaceAdapterInstanceAsync::onStop()
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "CmdRemove" << m_uasId << ":" << ex.what();
|
||||
ERROR_LOG() << "CmdRemove" << m_uasId << ":" << ex.what();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-5
@@ -56,7 +56,6 @@ private:
|
||||
uint16_t m_port;
|
||||
bool m_useTcp;
|
||||
QTimer *m_timeout;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
@@ -78,7 +77,6 @@ private:
|
||||
std::string m_ip;
|
||||
uint16_t m_port;
|
||||
QTimer *m_timeout;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
@@ -230,9 +228,6 @@ private:
|
||||
|
||||
CoordinateFrame::ReportPositions::CallbackFn ReportPosition_Callback;
|
||||
} m_CoordinateFrame;
|
||||
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user