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:
torstenandCopilot committed 2026-08-19 06:06:24 +02:00
1 parent 010f91928a
commit b774f4035c
2785 files changed
+18754 -18316

No files matched your search

@@ -11,7 +11,7 @@
#include <QObject>
#include <memory>
#include <DDS/Core/function_reply_object.h>
#include <DDS/Core/core_types.h>
namespace ParticipantManagement
{
@@ -19,7 +19,6 @@ namespace ParticipantManagement
GetParticipants::GetParticipants(MainHandler *mainHandler)
: Interface::Fts::GetParticipantsRequestHandler(mainHandler->fts())
, m_mainHandler(mainHandler)
, m_logger(getLogger("GetParticipants"))
{}
GetParticipants::~GetParticipants()
@@ -30,7 +29,7 @@ GetParticipants::~GetParticipants()
void GetParticipants::onGetParticipantsRequest(const rti::core::SampleIdentity &cookie,
const GetParticipantsRequest &request)
{
DEBUG_LOG(m_logger) << "onGetParticipantsRequest" << request;
DEBUG_LOG() << "onGetParticipantsRequest" << request;
// Initialize RecordReplay to get initial participants
@@ -55,7 +54,7 @@ void GetParticipants::onGetParticipantsRequest(const rti::core::SampleIdentity &
participants[p.id()] = std::move(p);
}
DEBUG_LOG(m_logger) << "Starting to read participant from record replay. Size: "
DEBUG_LOG() << "Starting to read participant from record replay. Size: "
<< participants.size();
GetParticipantsReply reply;
@@ -26,7 +26,5 @@ private:
private:
MainHandler *m_mainHandler;
NGL::INGLLogger &m_logger;
};
}
@@ -124,7 +124,7 @@ bool Participant::setPosition(const TrainingAreaBase::EquipmentPosition &newPosi
if (!mountedParticipant)
{
WARNING_LOG(m_logger) << "Mounted Participant with equipNo " << mountedEqId << " not found - ignoring";
WARNING_LOG() << "Mounted Participant with equipNo " << mountedEqId << " not found - ignoring";
continue;
}
@@ -133,7 +133,7 @@ bool Participant::setPosition(const TrainingAreaBase::EquipmentPosition &newPosi
mountedParticipant->publishPosition();
newMountedParticipantIds.push_back(mountedParticipant->id());
INFO_LOG(m_logger) << "Mounting Participant with id: " << mountedParticipant->id() << " to id: " << id();
INFO_LOG() << "Mounting Participant with id: " << mountedParticipant->id() << " to id: " << id();
}
// unmount current mounted participants that are not in the list anymore
@@ -164,7 +164,7 @@ bool Participant::setPosition(const ParticipantPosition &newPosition, bool bForc
{
if (!bForce && !isValidPosition(newPosition.sampleTime(), newPosition.pos(), newPosition.reportingSource()))
{
WARNING_LOG(m_logger) << "position for participant " << m_participantData.id()
WARNING_LOG() << "position for participant " << m_participantData.id()
<< " is outdated: " << newPosition
<< " , cur pos sample time: " << m_positionPublished.sampleTime();
return false;
@@ -188,7 +188,7 @@ bool Participant::setPosition(const TrainingAreaBase::EquipmentPosition &newPosi
{
if (mountedToId == id())
{
WARNING_LOG(m_logger) << "Trying to mount to ourself: " << id();
WARNING_LOG() << "Trying to mount to ourself: " << id();
return false;
}
TrainingAreaBase::EquipmentPosition mountedPosition = newPosition;
@@ -213,7 +213,7 @@ void Participant::unmountParticipantById(const TrainingAreaBase::EquipmentPositi
Participant *unmountedParticipant = particpantHandler()->participantById(id);
unmountedParticipant->setPosition(newPosition, 0);
unmountedParticipant->publishPosition();
INFO_LOG(m_logger) << "Unmounting Participant with ID: " << unmountedParticipant->id() << "from ID: " << this->id();
INFO_LOG() << "Unmounting Participant with ID: " << unmountedParticipant->id() << "from ID: " << this->id();
}
@@ -259,7 +259,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
if (bits.test(i))
{
mainVulState = static_cast<ProjectDataManagement::VulnerabilityState_def::type>(i);
//WARNING_LOG(m_logger) << "mainVulState was manipulated into: " << i;
//WARNING_LOG() << "mainVulState was manipulated into: " << i;
break;
}
}
@@ -267,9 +267,9 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
// if mainVulnState *still* is BC (VBG12), something went wrong on the sender side (TNE?)
if (mainVulState == ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged)
WARNING_LOG(m_logger) << "Sending a BC (VBG12) if the last vuln is CR (VBG0) is not allowed! Something went wrong on the sender side (TNE?)";
WARNING_LOG() << "Sending a BC (VBG12) if the last vuln is CR (VBG0) is not allowed! Something went wrong on the sender side (TNE?)";
DEBUG_LOG(m_logger) << "setState for eqid: " << newState.equipmentNumber()
DEBUG_LOG() << "setState for eqid: " << newState.equipmentNumber()
<< "\nvuln was: " << (int)newState.vulnerabilityState().underlying()
<< "\nvuln now: " << (int)mainVulState.underlying()
<< "\nbits (DEC): " << newState.vulnerabilityBits()
@@ -283,7 +283,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
{
const int idx = static_cast<int>(mainVulState.underlying());
vulnerabilityBits = (1 << idx);
WARNING_LOG(m_logger) << "Missing vulnerabilityBits! bailing by supplementing by adding this vuln state to the bits";
WARNING_LOG() << "Missing vulnerabilityBits! bailing by supplementing by adding this vuln state to the bits";
}
// check if it is a (younger) CombatReady state - remove older
@@ -318,7 +318,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
if (newState.originatorId() > 255)
{
WARNING_LOG(m_logger) << "Participant with EqNo "
WARNING_LOG() << "Participant with EqNo "
<< m_participantData.equipmentNumber()
<< " sent wrong Enum Values (Sanitation Eval / ~ Result): "
<< newState.originatorId()
@@ -330,12 +330,12 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
if (sanEvaluationVal > 2) // Todo: Check against valid enum values in a better way!
{
WARNING_LOG(m_logger) << "Cannot cast upper 2 Bits to SanEvaluation! Defaulting to Okay";
WARNING_LOG() << "Cannot cast upper 2 Bits to SanEvaluation! Defaulting to Okay";
sanEvaluationVal = 0;
}
if (sanResultVal > 4) // Todo: Check against valid enum values in a better way!
{
WARNING_LOG(m_logger) << "Cannot cast lower 6 Bits to SanResult! Defaulting to Unhandled";
WARNING_LOG() << "Cannot cast lower 6 Bits to SanResult! Defaulting to Unhandled";
sanResultVal = 1;
}
sanEvaluation = static_cast<SanitationEvaluation::inner_enum>(sanEvaluationVal);
@@ -408,7 +408,7 @@ bool Participant::setSpecialSensorData(const TrainingAreaBase::SpecialSensorData
bool Participant::setGear(const TrainingAreaBase::EquipmentGearAssignment &gearAssignment)
{
DEBUG_LOG(m_logger) << "Gear Assignment";
DEBUG_LOG() << "Gear Assignment";
// outdated?
if (m_lastGearUsage > gearAssignment.sampleTime())
return false;
@@ -426,7 +426,7 @@ bool Participant::setGear(const TrainingAreaBase::EquipmentGearAssignment &gearA
{
if (gear.gearId() == 0)
{
WARNING_LOG(m_logger) << "Got a gear assignment but gear id is 0 - old Saab AGDUS? - ignoring";
WARNING_LOG() << "Got a gear assignment but gear id is 0 - old Saab AGDUS? - ignoring";
continue;
}
newGearIds += gear.gearId();
@@ -444,7 +444,7 @@ bool Participant::setGear(const TrainingAreaBase::EquipmentGearAssignment &gearA
++it;
else
{
DEBUG_LOG(m_logger) << "Gear Assignment: Removing Designation with gearId: " << it->gearId();
DEBUG_LOG() << "Gear Assignment: Removing Designation with gearId: " << it->gearId();
it = m_dynamicData.designations().erase(it);
}
}
@@ -649,10 +649,10 @@ bool Participant::setGearCharge(const GearInformation &gearInfo)
if (bAdjustTurretInfo)
{
int substr = m_dynamicData.gear()[index_wanne].remain();
INFO_LOG(m_logger) << "Adjust Turret - substracting index wanne " << substr;
INFO_LOG() << "Adjust Turret - substracting index wanne " << substr;
if (gi.remain() >= substr)
gi.remain() = gi.remain() - m_dynamicData.gear()[index_wanne].remain();
INFO_LOG(m_logger) << "Turret remain " << gi.remain();
INFO_LOG() << "Turret remain " << gi.remain();
gi.gearId(2);
}
if (gearInfo.chargeCounting())
@@ -705,7 +705,7 @@ bool Participant::isNewAssignStateValid(const ParticipantAssignState &newAssignS
case ParticipantAssignState::NotAssigned:
if (equipmentNumber)
{
WARNING_LOG(m_logger) << "Not assigned, but equipmentnumber is set";
WARNING_LOG() << "Not assigned, but equipmentnumber is set";
return false;
}
break;
@@ -715,7 +715,7 @@ bool Participant::isNewAssignStateValid(const ParticipantAssignState &newAssignS
// equipment number changed -> allow
if (oldAssignState == ParticipantAssignState::AssignedWms && equipmentNumber != 0)
return true;
WARNING_LOG(m_logger) << "Now assigned from WMS, but no equipmentnumber or old assign state != NotAssigned: "
WARNING_LOG() << "Now assigned from WMS, but no equipmentnumber or old assign state != NotAssigned: "
<< equipmentNumber << ", " << newAssignState << ", " << oldAssignState;
return false;
}
@@ -730,7 +730,7 @@ bool Participant::isNewAssignStateValid(const ParticipantAssignState &newAssignS
// equipment number changed -> allow
if (oldAssignState == ParticipantAssignState::HandoutWms && equipmentNumber != 0)
return true;
WARNING_LOG(m_logger) << "Now assigned from WMS (handout), but no equipmentnumber or old assign state != NotAssigned/AssignedWms: "
WARNING_LOG() << "Now assigned from WMS (handout), but no equipmentnumber or old assign state != NotAssigned/AssignedWms: "
<< equipmentNumber << ", " << newAssignState << ", " << oldAssignState;
return false;
}
@@ -747,7 +747,7 @@ bool Participant::isNewAssignStateValid(const ParticipantAssignState &newAssignS
// Assign state HandoutExcon + equipmentNumber = 0 -> reserved participant for EXCON in WH (WH must not touch it)
if (equipmentNumber == 0)
return true;
WARNING_LOG(m_logger) << "Now assigned from EXCON, but no equipmentnumber or old assign state != NotAssigned: "
WARNING_LOG() << "Now assigned from EXCON, but no equipmentnumber or old assign state != NotAssigned: "
<< equipmentNumber << ", " << newAssignState << ", " << oldAssignState;
return false;
}
@@ -762,7 +762,7 @@ bool Participant::isNewAssignStateValid(const ParticipantAssignState &newAssignS
oldAssignState != ParticipantAssignState::HandoutWms &&
equipmentNumber != 0)
{
WARNING_LOG(m_logger) << "Now assigned from ExconWmsOverruled, old assign state != AssignedWms or != HandoutWms or equipment number is set: "
WARNING_LOG() << "Now assigned from ExconWmsOverruled, old assign state != AssignedWms or != HandoutWms or equipment number is set: "
<< equipmentNumber << ", " << newAssignState << ", " << oldAssignState;
return false;
}
@@ -789,7 +789,7 @@ bool Participant::hasToBeChanged(const ParticipantManagement::Participant &data)
bool Participant::hasToBeChanged(const ParticipantManagement::ParticipantBase &data)
{
DEBUG_LOG(m_logger) << "hasToBeChanged: " << data;
DEBUG_LOG() << "hasToBeChanged: " << data;
ParticipantManagement::ParticipantBase &curData = m_participantData;
bool hasChanges = (curData != data);
@@ -62,7 +62,7 @@ bool ParticipantHandler::init()
if (!m_webSocketHandler->init(Settings::getWebSocketServerPortRange(2)))
{
ERROR_LOG(m_logger) << "could not init websockethandler";
ERROR_LOG() << "could not init websockethandler";
return false;
}
@@ -71,14 +71,14 @@ bool ParticipantHandler::init()
void ParticipantHandler::setEquipmentNumberForParticipant(int oldEqNo, int newEqNo, int participantId)
{
DEBUG_LOG(m_logger) << "setEquipmentNumberForParticipant, old: " << oldEqNo << ", new: " << newEqNo << ", participant: " << participantId;
DEBUG_LOG() << "setEquipmentNumberForParticipant, old: " << oldEqNo << ", new: " << newEqNo << ", participant: " << participantId;
if (oldEqNo > 0)
m_equipNumber2ParticipantId.remove(oldEqNo);
if (newEqNo > 0)
{
int &val = m_equipNumber2ParticipantId[newEqNo];
if (val != 0 && val != participantId)
WARNING_LOG(m_logger) << "Another participant (" << val << ") already has the equipment number " << newEqNo << " - overriding it with participant "
WARNING_LOG() << "Another participant (" << val << ") already has the equipment number " << newEqNo << " - overriding it with participant "
<< participantId;
val = participantId;
}
@@ -89,7 +89,7 @@ Participant *ParticipantHandler::participantById(int32_t participantId) const {
Participant *ParticipantHandler::participantByEquipmentNumber(int32_t equipmentNumber)
{
const int participantId = m_equipNumber2ParticipantId.value(equipmentNumber);
DEBUG_LOG(m_logger) << " >>>>>> [ParticipantHandler] participantByEquipmentNumber participantId: " << participantId << " | equipNumb: " << equipmentNumber;
DEBUG_LOG() << " >>>>>> [ParticipantHandler] participantByEquipmentNumber participantId: " << participantId << " | equipNumb: " << equipmentNumber;
return participantById(participantId);
}
@@ -97,7 +97,7 @@ void ParticipantHandler::onNewGearEvent(const TrainingAreaBase::EquipmentGearEve
{
if (isTelegramInFuture(gearEvent))
{
WARNING_LOG(m_logger) << "Got an EquipmentGearEvent which has a timestamp in the future: " << gearEvent.sampleTime();
WARNING_LOG() << "Got an EquipmentGearEvent which has a timestamp in the future: " << gearEvent.sampleTime();
return;
}
@@ -106,7 +106,7 @@ void ParticipantHandler::onNewGearEvent(const TrainingAreaBase::EquipmentGearEve
Participant *participantToBeChanged = participantByEquipmentNumber(gearEvent.equipmentNumber());
if (!participantToBeChanged)
{
WARNING_LOG(m_logger) << "Got gear charge state for unknown equipment number " << gearEvent.equipmentNumber();
WARNING_LOG() << "Got gear charge state for unknown equipment number " << gearEvent.equipmentNumber();
return;
}
@@ -125,7 +125,7 @@ void ParticipantHandler::onNewGearChargeStateFromProxy(const TrainingAreaBase::E
{
if (isTelegramInFuture(chargeState))
{
WARNING_LOG(m_logger) << "Got an EquipmentGearChargeState which has a timestamp in the future: " << chargeState.sampleTime();
WARNING_LOG() << "Got an EquipmentGearChargeState which has a timestamp in the future: " << chargeState.sampleTime();
return;
}
@@ -134,7 +134,7 @@ void ParticipantHandler::onNewGearChargeStateFromProxy(const TrainingAreaBase::E
if (!participantToBeChanged)
{
WARNING_LOG(m_logger) << "Got gear charge state for unknown equipment number " << chargeState.equipmentNumber();
WARNING_LOG() << "Got gear charge state for unknown equipment number " << chargeState.equipmentNumber();
return;
}
@@ -149,13 +149,13 @@ void ParticipantHandler::onNewGearAssignmentFromProxy(const TrainingAreaBase::Eq
{
if (isTelegramInFuture(gearAssignment))
{
WARNING_LOG(m_logger) << "Got an EquipmentGearAssignment which has a timestamp in the future: " << gearAssignment.sampleTime();
WARNING_LOG() << "Got an EquipmentGearAssignment which has a timestamp in the future: " << gearAssignment.sampleTime();
return;
}
Participant *participantToBeChanged = participantByEquipmentNumber(gearAssignment.equipmentNumber());
if (!participantToBeChanged)
{
WARNING_LOG(m_logger) << "Got gear assignment for unknown equipment number " << gearAssignment.equipmentNumber();
WARNING_LOG() << "Got gear assignment for unknown equipment number " << gearAssignment.equipmentNumber();
return;
}
@@ -167,7 +167,7 @@ void ParticipantHandler::onNewStateFromProxy(const TrainingAreaBase::EquipmentSt
{
if (isTelegramInFuture(data))
{
WARNING_LOG(m_logger) << "Got an EquipmentState which has a timestamp in the future: " << data.sampleTime();
WARNING_LOG() << "Got an EquipmentState which has a timestamp in the future: " << data.sampleTime();
return;
}
@@ -185,7 +185,7 @@ void ParticipantHandler::onNewStateFromProxy(const TrainingAreaBase::EquipmentSt
Participant *participantToBeChanged = participantByEquipmentNumber(data.equipmentNumber());
if (!participantToBeChanged)
{
WARNING_LOG(m_logger) << "Got equipment state for unknown equipment number " << data.equipmentNumber();
WARNING_LOG() << "Got equipment state for unknown equipment number " << data.equipmentNumber();
return;
}
@@ -242,15 +242,15 @@ void ParticipantHandler::onNewPositionFromProxy(const TrainingAreaBase::Equipmen
{
if (isTelegramInFuture(position))
{
WARNING_LOG(m_logger) << "Got an EquipmentPosition which has a timestamp in the future: " << position.sampleTime();
WARNING_LOG() << "Got an EquipmentPosition which has a timestamp in the future: " << position.sampleTime();
return;
}
if (isTelegramOutdated(position) && position.position().reportingSource() != Core::PositionReportingSource::SetByOperator)
{
INFO_LOG(m_logger) << "position is outdated: " << position;
INFO_LOG() << "position is outdated: " << position;
return;
}
DEBUG_LOG(m_logger) << "Got new position from proxy: " << position;
DEBUG_LOG() << "Got new position from proxy: " << position;
const int equipNo = position.equipmentNumber();
// negative - treat as participantId
@@ -258,7 +258,7 @@ void ParticipantHandler::onNewPositionFromProxy(const TrainingAreaBase::Equipmen
if (!participantWithNewPosition)
{
WARNING_LOG(m_logger) << "Got EquipmentPosition " << position << " for unknown equipment number: " << equipNo;
WARNING_LOG() << "Got EquipmentPosition " << position << " for unknown equipment number: " << equipNo;
return;
}
@@ -270,14 +270,14 @@ void ParticipantHandler::onNewEquipmentOperationalStateFromProxy(const TrainingA
{
if (isTelegramInFuture(operationalState))
{
WARNING_LOG(m_logger) << "Got an EquipmentOperationalState which has a timestamp in the future: " << operationalState.sampleTime();
WARNING_LOG() << "Got an EquipmentOperationalState which has a timestamp in the future: " << operationalState.sampleTime();
return;
}
Participant *participantToUpdate = participantByEquipmentNumber(operationalState.equipmentNumber());
if (!participantToUpdate)
{
WARNING_LOG(m_logger) << "Got EquipmentOperationalState for unknown equipment number: " << operationalState;
WARNING_LOG() << "Got EquipmentOperationalState for unknown equipment number: " << operationalState;
return;
}
@@ -289,12 +289,12 @@ void ParticipantHandler::onNewBiteFromProxy(const TrainingAreaBase::EquipmentBit
{
if (isTelegramInFuture(bite))
{
WARNING_LOG(m_logger) << "Got an EquipmentBite which has a timestamp in the future: " << bite.sampleTime();
WARNING_LOG() << "Got an EquipmentBite which has a timestamp in the future: " << bite.sampleTime();
return;
}
if (isTelegramOutdated(bite))
{
WARNING_LOG(m_logger) << "Got an EquipmentBite which has a timestamp in the past: " << bite.sampleTime();
WARNING_LOG() << "Got an EquipmentBite which has a timestamp in the past: " << bite.sampleTime();
return;
}
@@ -334,19 +334,19 @@ void ParticipantHandler::onNewParticipantModeReport(const TrainingAreaBase::Part
{
if (isTelegramInFuture(report))
{
WARNING_LOG(m_logger) << "Got a ParticipantModeReport which has a timestamp in the future: " << report.sampleTime();
WARNING_LOG() << "Got a ParticipantModeReport which has a timestamp in the future: " << report.sampleTime();
return;
}
if (isTelegramOutdated(report))
{
WARNING_LOG(m_logger) << "Got a ParticipantModeReport which has a timestamp in the past: " << report.sampleTime();
WARNING_LOG() << "Got a ParticipantModeReport which has a timestamp in the past: " << report.sampleTime();
return;
}
Participant *participant = participantByEquipmentNumber(report.equipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << report.equipmentNumber();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << report.equipmentNumber();
return;
}
@@ -375,12 +375,12 @@ void ParticipantHandler::onNewSpecialSensorData(const TrainingAreaBase::SpecialS
{
if (isTelegramInFuture(data))
{
WARNING_LOG(m_logger) << "Got a SpecialSensorData which has a timestamp in the future: " << data.sampleTime();
WARNING_LOG() << "Got a SpecialSensorData which has a timestamp in the future: " << data.sampleTime();
return;
}
if (isTelegramOutdated(data))
{
WARNING_LOG(m_logger) << "Got a SpecialSensorData which has a timestamp in the past: " << data.sampleTime();
WARNING_LOG() << "Got a SpecialSensorData which has a timestamp in the past: " << data.sampleTime();
return;
}
@@ -388,7 +388,7 @@ void ParticipantHandler::onNewSpecialSensorData(const TrainingAreaBase::SpecialS
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
@@ -409,54 +409,54 @@ void ParticipantHandler::onNewSpecialSensorData(const TrainingAreaBase::SpecialS
void ParticipantHandler::onNewLaserDesignation(const TrainingAreaBase::LaserDesignation &data)
{
DEBUG_LOG(m_logger) << "New Laser Designation: "
DEBUG_LOG() << "New Laser Designation: "
<< "Code: " << data.code() << ", GearID: " << data.gearId() << ", EqNo: " << data.equipmentNumber() << ", Lon: " << data.spotLocation().lon()
<< ", Lat: " << data.spotLocation().lat() << ", Power: " << data.outputPower();
Participant *participant = participantByEquipmentNumber(data.equipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
DynamicParticipantData dpd = participant->dynamicParticipantData();
DEBUG_LOG(m_logger) << "Begin Update Laser Designation: ";
DEBUG_LOG() << "Begin Update Laser Designation: ";
updateLaserDesignation(dpd, data);
DEBUG_LOG(m_logger) << "End Update Laser Designation: ";
DEBUG_LOG() << "End Update Laser Designation: ";
DEBUG_LOG(m_logger) << "Set DPD and publish ";
DEBUG_LOG() << "Set DPD and publish ";
participant->setDynamicData(dpd);
participant->publishDynamicData();
}
void ParticipantHandler::onLaserDesignationRemoved(int equipmentNumber, int gearId)
{
DEBUG_LOG(m_logger) << "On Remove Laser Designation: ";
DEBUG_LOG() << "On Remove Laser Designation: ";
Participant *participant = participantByEquipmentNumber(equipmentNumber);
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << equipmentNumber;
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << equipmentNumber;
return;
}
DynamicParticipantData dpd = participant->dynamicParticipantData();
DEBUG_LOG(m_logger) << "Begin Remove Laser Designation: ";
DEBUG_LOG() << "Begin Remove Laser Designation: ";
removeLaserDesignation(dpd, gearId);
DEBUG_LOG(m_logger) << "End Remove Laser Designation: ";
DEBUG_LOG() << "End Remove Laser Designation: ";
DEBUG_LOG(m_logger) << "Set DPD and publish ";
DEBUG_LOG() << "Set DPD and publish ";
participant->setDynamicData(dpd);
participant->publishDynamicData();
}
void ParticipantHandler::onBuildingHitLineInfo(const Buildings::BuildingHitLineInfo &data)
{
DEBUG_LOG(m_logger) << "onBuildingHitLineInfo "
DEBUG_LOG() << "onBuildingHitLineInfo "
<< "BuildingId=" << data.buildingId() << " originatorParticipantId=" << data.originatorParticipantId();
auto dtcPdm = m_bdp->pdmDtc();
// NOTE: igniterTypeId/IgniterFunction = 0 as long as BuildingHitLineInfo does not contain values
@@ -467,36 +467,36 @@ void ParticipantHandler::onBuildingHitLineInfo(const Buildings::BuildingHitLineI
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with participantId: " << data.originatorParticipantId();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with participantId: " << data.originatorParticipantId();
return;
}
DynamicParticipantData dpd = participant->dynamicParticipantData();
DEBUG_LOG(m_logger) << "Begin Update Laser Designation: ";
DEBUG_LOG() << "Begin Update Laser Designation: ";
updateLaserDesignation(dpd, data);
DEBUG_LOG(m_logger) << "End Update Laser Designation: ";
DEBUG_LOG() << "End Update Laser Designation: ";
DEBUG_LOG(m_logger) << "setDynamicData";
DEBUG_LOG() << "setDynamicData";
participant->setDynamicData(dpd);
DEBUG_LOG(m_logger) << "publishDynamicData"
DEBUG_LOG() << "publishDynamicData"
<< " dpd.designations().size()=" << dpd.designations().size();
participant->publishDynamicData();
}
void ParticipantHandler::onSanitaryMaterialStockReport(const TrainingAreaBase::ParticipantSanitaryMaterialStockReport &data)
{
DEBUG_LOG(m_logger) << "onSanitaryMaterialStockReport";
DEBUG_LOG() << "onSanitaryMaterialStockReport";
Participant *participant = participantByEquipmentNumber(data.equipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
if (data.qualification() == TrainingAreaBase::Qualification::NotDefined)
{
DEBUG_LOG(m_logger) << "!!! Clear Materials : equipment number " << data.equipmentNumber();
DEBUG_LOG(m_logger) << "!!! Clear Materials : sample time " << data.sampleTime();
DEBUG_LOG() << "!!! Clear Materials : equipment number " << data.equipmentNumber();
DEBUG_LOG() << "!!! Clear Materials : sample time " << data.sampleTime();
participant->setSanitationMaterial(0,
std::vector<int>(),
data.uniqueId(),
@@ -506,8 +506,8 @@ void ParticipantHandler::onSanitaryMaterialStockReport(const TrainingAreaBase::P
}
else
{
DEBUG_LOG(m_logger) << "!!! Set Materials : equipment number " << data.equipmentNumber();
DEBUG_LOG(m_logger) << "!!! Set Materials : sample time " << data.sampleTime();
DEBUG_LOG() << "!!! Set Materials : equipment number " << data.equipmentNumber();
DEBUG_LOG() << "!!! Set Materials : sample time " << data.sampleTime();
participant->setSanitationMaterial(data.sanitaryMaterialCount(),
data.sanitaryMaterialStock(),
data.uniqueId(),
@@ -524,7 +524,7 @@ void ParticipantHandler::onParticipantSanitation(const TrainingAreaBase::Partici
Participant *participantOrig = participantByEquipmentNumber(data.originatorEquipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
int participantOrigId = data.originatorEquipmentNumber();
@@ -533,14 +533,14 @@ void ParticipantHandler::onParticipantSanitation(const TrainingAreaBase::Partici
if (data.qualification() == TrainingAreaBase::Qualification::NotDefined && data.proceduresTaken() == 0)
{
DEBUG_LOG(m_logger) << "!!! Clear Sanitation = " << data.sampleTime();
DEBUG_LOG(m_logger) << "!!! Clear Sanitation: equipNo = " << data.equipmentNumber();
DEBUG_LOG() << "!!! Clear Sanitation = " << data.sampleTime();
DEBUG_LOG() << "!!! Clear Sanitation: equipNo = " << data.equipmentNumber();
participant->setSanitationMaterial(0, std::vector<int>(), 0, data.sampleTime(), Qualification::NotAssigned, 0); // this is a deassociation so clear material
}
else
{
DEBUG_LOG(m_logger) << "!!! SetSanitation: sample time = " << data.sampleTime();
DEBUG_LOG(m_logger) << "!!! SetSanitation: equipNo = " << data.equipmentNumber();
DEBUG_LOG() << "!!! SetSanitation: sample time = " << data.sampleTime();
DEBUG_LOG() << "!!! SetSanitation: equipNo = " << data.equipmentNumber();
participant->setSanitation(data.proceduresTaken(), data.sanitationResult(), data.sanitationEvaluation(), participantOrigId, data.qualification(), data.sampleTime());
}
participant->publishDynamicData();
@@ -555,7 +555,7 @@ void ParticipantHandler::onOperatorAction(const TrainingAreaBase::OperatorAction
Participant *participant = participantByEquipmentNumber(data.equipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
@@ -586,7 +586,7 @@ void ParticipantHandler::onNewFunctionalAreaEntryChanged(const TrainingAreaBase:
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
@@ -640,7 +640,7 @@ void ParticipantHandler::setPosition(const ParticipantManagement::ParticipantPos
if (!participant)
{
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with id " << data.participantId();
ERROR_LOG() << Q_FUNC_INFO << "Could not find participant with id " << data.participantId();
return;
}
@@ -685,14 +685,14 @@ quint16 ParticipantHandler::getWebSocketPort() const { return m_webSocketHandler
void ParticipantHandler::updateLaserDesignation(DynamicParticipantData &data, const TrainingAreaBase::LaserDesignation &newLaserDesignation)
{
LOGGER_T m_logger = getLogger("ParticipantHandler.Laser");
DEBUG_LOG(m_logger) << "-Update Laser Designation - Start ";
DEBUG_LOG() << "-Update Laser Designation - Start ";
for (LaserDesignation &laserDesignation : data.designations())
{
if (laserDesignation.gearId() != newLaserDesignation.gearId())
continue;
DEBUG_LOG(m_logger) << "-Update Laser Designation - Gear with id " << laserDesignation.gearId() << " found in designations";
DEBUG_LOG() << "-Update Laser Designation - Gear with id " << laserDesignation.gearId() << " found in designations";
laserDesignation.code(newLaserDesignation.code());
if (!qFuzzyIsNull(laserDesignation.outputPower()) && !qFuzzyIsNull(newLaserDesignation.spotLocation().lat())
@@ -704,22 +704,22 @@ void ParticipantHandler::updateLaserDesignation(DynamicParticipantData &data, co
laserDesignation.spotLocation(Core::GeoPosition(0.0, 0.0, 0.0));
laserDesignation.outputPower(newLaserDesignation.outputPower());
DEBUG_LOG(m_logger) << "-Update Laser Designation - Data updated, returning";
DEBUG_LOG() << "-Update Laser Designation - Data updated, returning";
return;
}
DEBUG_LOG(m_logger) << "-Update Laser Designation - Gear with id " << newLaserDesignation.gearId() << " NOT found in designations";
DEBUG_LOG() << "-Update Laser Designation - Gear with id " << newLaserDesignation.gearId() << " NOT found in designations";
int gearId = newLaserDesignation.gearId();
auto it = std::find_if(data.gear().cbegin(), data.gear().cend(), [gearId](const GearInformation &gi) { return gearId == gi.gearId(); });
if (it == data.gear().cend()) // No gear, no designation...
{
DEBUG_LOG(m_logger) << "-Update Laser Designation - Gear with id " << newLaserDesignation.gearId() << " NOT found in Gears";
DEBUG_LOG() << "-Update Laser Designation - Gear with id " << newLaserDesignation.gearId() << " NOT found in Gears";
return;
}
DEBUG_LOG(m_logger) << "-Update Laser Designation - Gear with id " << newLaserDesignation.gearId() << " found in Gears";
DEBUG_LOG(m_logger) << "-Update Laser Designation - Adding new designation";
DEBUG_LOG() << "-Update Laser Designation - Gear with id " << newLaserDesignation.gearId() << " found in Gears";
DEBUG_LOG() << "-Update Laser Designation - Adding new designation";
data.designations().emplace_back(newLaserDesignation.gearId(),
Core::GeoPosition(newLaserDesignation.spotLocation().lon(), newLaserDesignation.spotLocation().lat(), 0.0),
newLaserDesignation.code(),
@@ -731,11 +731,11 @@ void ParticipantHandler::updateLaserDesignation(DynamicParticipantData &dataInOu
LOGGER_T m_logger = getLogger("ParticipantHandler.Laser");
// Todo: Die erste vorhandene LaserDesignation wird angepasst. Ein Laser On muss vorher gekommen sein, damit das Element da ist.
// Mehrere Designatoren pro Teilnehmer werden nicht unterstützt.
DEBUG_LOG(m_logger) << "-Update Laser Designation by Building Hitline Info";
DEBUG_LOG() << "-Update Laser Designation by Building Hitline Info";
for (LaserDesignation &laserDesignation : dataInOut.designations())
{
DEBUG_LOG(m_logger) << "-Update Laser Designation by Building Hitline Info - Updating (first) Designation with GearId " << laserDesignation.gearId();
DEBUG_LOG() << "-Update Laser Designation by Building Hitline Info - Updating (first) Designation with GearId " << laserDesignation.gearId();
laserDesignation.outputPower(1.0);
laserDesignation.spotLocation(newLaserDesignation.buildingPos());
return;
@@ -751,9 +751,9 @@ void ParticipantHandler::updateLaserDesignation(DynamicParticipantData &dataInOu
ld.spotLocation() = newLaserDesignation.buildingPos();
ld.outputPower(1.0);
dataInOut.designations().emplace_back(ld);
ERROR_LOG(m_logger) << "-Update Laser Designation by Building Hitline Info - Added Designation";
ERROR_LOG() << "-Update Laser Designation by Building Hitline Info - Added Designation";
}
ERROR_LOG(m_logger) << "-Update Laser Designation by Building Hitline Info - No laserDesignation available participantId="
ERROR_LOG() << "-Update Laser Designation by Building Hitline Info - No laserDesignation available participantId="
<< newLaserDesignation.originatorParticipantId();
}
@@ -761,17 +761,17 @@ void ParticipantHandler::removeLaserDesignation(DynamicParticipantData &data, qi
{
LOGGER_T m_logger = getLogger("ParticipantHandler.Laser");
DEBUG_LOG(m_logger) << "-Remove Laser Designation: Start";
DEBUG_LOG() << "-Remove Laser Designation: Start";
auto validationFunction = [gearId](ParticipantManagement::LaserDesignation laserDesignation) { return laserDesignation.gearId() == gearId; };
auto eraseIterator = std::find_if(data.designations().begin(), data.designations().end(), validationFunction);
if (eraseIterator == data.designations().end())
{
DEBUG_LOG(m_logger) << "-Remove Laser Designation: GearId NOT found";
DEBUG_LOG() << "-Remove Laser Designation: GearId NOT found";
return;
}
DEBUG_LOG(m_logger) << "-Remove Laser Designation: Removing Designation";
DEBUG_LOG() << "-Remove Laser Designation: Removing Designation";
data.designations().erase(eraseIterator);
}
@@ -166,8 +166,6 @@ class ParticipantHandler
QMap<int, HitLineInfo> m_hitLineInfoMap;
BaseDataProvider *m_bdp;
LOGGER_T m_logger;
std::shared_ptr<WebSocketHandler> m_webSocketHandler;
friend class Participant;
@@ -18,7 +18,6 @@ namespace ParticipantHandling
ProxyListener::ProxyListener(MainHandler *mainHandler)
: QObject()
, m_mainHandler(mainHandler)
, m_logger(getLogger("ProxyListener"))
{}
bool ProxyListener::init()
@@ -30,7 +29,7 @@ bool ProxyListener::init()
this, &ProxyListener::onProxyEquipmentBiteChanged);
if (!m_tabDtc->enableEquipmentBite())
{
ERROR_LOG(m_logger) << "Could not initialize TraininAreaBase data topic client";
ERROR_LOG() << "Could not initialize TraininAreaBase data topic client";
return false;
}
@@ -92,7 +91,7 @@ bool ProxyListener::init()
!m_tabDtc->enableUASMissionStatus() ||
!m_bldDtc->enableBuildingHitLineInfo())
{
ERROR_LOG(m_logger) << "Could not initialize TraininAreaBase data topic client";
ERROR_LOG() << "Could not initialize TraininAreaBase data topic client";
return false;
}
}
@@ -105,7 +104,7 @@ void ProxyListener::onProxyEquipmentPositionChanged(const TrainingAreaBase::Equi
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new position data from proxy " << data;
DEBUG_LOG() << "Got new position data from proxy " << data;
emit newPosition(data);
}
@@ -115,7 +114,7 @@ void ProxyListener::onProxyEquipmentGearAssignmentChanged(const TrainingAreaBase
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new gear assignment from proxy " << data;
DEBUG_LOG() << "Got new gear assignment from proxy " << data;
emit newGearAssignment(data);
}
@@ -125,7 +124,7 @@ void ProxyListener::onProxyEquipmentGearEventChanged(const TrainingAreaBase::Equ
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new gear event " << data;
DEBUG_LOG() << "Got new gear event " << data;
emit newGearEvent(data);
}
@@ -135,19 +134,19 @@ void ProxyListener::onProxyEquipmentGearChargeStateChanged(const TrainingAreaBas
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new gear charge state " << data;
DEBUG_LOG() << "Got new gear charge state " << data;
emit newGearChargeState(data);
}
void ProxyListener::onProxyParticipantSanitaryMaterialStockReportChanged(const TrainingAreaBase::ParticipantSanitaryMaterialStockReport &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "FUCKING FUCK FUCK" << data;
DEBUG_LOG() << "FUCKING FUCK FUCK" << data;
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new material stock report" << data;
DEBUG_LOG() << "Got new material stock report" << data;
emit newSanitaryMaterialStockReport(data);
}
@@ -157,7 +156,7 @@ void ProxyListener::onProxyEquipmentStateChanged(const TrainingAreaBase::Equipme
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new equipment state " << data;
DEBUG_LOG() << "Got new equipment state " << data;
emit newState(data);
}
@@ -167,7 +166,7 @@ void ProxyListener::onProxyEquipmentOperationalStateChanged(const TrainingAreaBa
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new equipment operational state " << data;
DEBUG_LOG() << "Got new equipment operational state " << data;
emit newEquipmentOperationalState(data);
}
@@ -177,7 +176,7 @@ void ProxyListener::onProxyEquipmentBiteChanged(const TrainingAreaBase::Equipmen
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new equipment bite " << data;
DEBUG_LOG() << "Got new equipment bite " << data;
emit newEquipmentBite(data);
}
@@ -187,7 +186,7 @@ void ProxyListener::onProxyCtaDataErrorChanged(const TrainingAreaBase::CtaDataEr
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new Combat Training Area Data error: " << data;
DEBUG_LOG() << "Got new Combat Training Area Data error: " << data;
emit newCtaDataError(data);
}
@@ -197,7 +196,7 @@ void ProxyListener::onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSe
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new Special Sensor data: " << data;
DEBUG_LOG() << "Got new Special Sensor data: " << data;
emit newSpecialSensorData(data);
}
@@ -207,7 +206,7 @@ void ProxyListener::onFunctionalAreaEntryChanged(const TrainingAreaBase::Functio
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got functional area entry: " << data;
DEBUG_LOG() << "Got functional area entry: " << data;
emit newFunctionalAreaEntryChanged(data);
}
@@ -216,12 +215,12 @@ void ProxyListener::onLaserDesignationChanged(const TrainingAreaBase::LaserDesig
{
if (modType == DataModification::eRemoved)
{
DEBUG_LOG(m_logger) << "Got no laser designation data: " << data;
DEBUG_LOG() << "Got no laser designation data: " << data;
emit laserDesignationRemoved(data.equipmentNumber(), data.gearId());
return;
}
DEBUG_LOG(m_logger) << "Got laser designation data: " << data;
DEBUG_LOG() << "Got laser designation data: " << data;
emit newLaserDesignationData(data);
}
@@ -231,7 +230,7 @@ void ProxyListener::onProxyParticipantSanitationChanged(const TrainingAreaBase::
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new Participant Sanitation" << data;
DEBUG_LOG() << "Got new Participant Sanitation" << data;
emit newParticipantSanitation(data);
}
@@ -241,7 +240,7 @@ void ProxyListener::onOperatorActionChanged(const TrainingAreaBase::OperatorActi
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new Operator Action" << data;
DEBUG_LOG() << "Got new Operator Action" << data;
emit newOperatorAction(data);
}
@@ -251,7 +250,7 @@ void ProxyListener::onEquipmentEventChanged(const TrainingAreaBase::EquipmentEve
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new Operator Action" << data;
DEBUG_LOG() << "Got new Operator Action" << data;
emit newEquipmentEvent(data);
@@ -276,13 +275,13 @@ void ProxyListener::onUASStatusChanged(const TrainingAreaBase::UASStatus &data,
UASRadioLinkConnectionStatus newState;
newState.id(uas.id());
newState.uasState(data.uasState());
DEBUG_LOG(m_logger) << "Publish new UAS State " << newState;
DEBUG_LOG() << "Publish new UAS State " << newState;
m_mainHandler->ddsHandler()->exAnyDts()->publish(newState);
}
void ProxyListener::onUASMissionStatusChanged(const TrainingAreaBase::UASMissionStatus &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "currentTask = " << (int)data.currentTask().underlying() << ", currentMissionName = " << data.currentMissionName() << ", name of ended mission: " << data.missionEnded();
DEBUG_LOG() << "currentTask = " << (int)data.currentTask().underlying() << ", currentMissionName = " << data.currentMissionName() << ", name of ended mission: " << data.missionEnded();
/*
was wenn random mehrfach hintereinander loiter gesendet wird??
dann überspringt er eine action! der tab darf also nur senden wenn wirklich ein state change kam
@@ -291,14 +290,14 @@ void ProxyListener::onUASMissionStatusChanged(const TrainingAreaBase::UASMission
*/
if (modType == DataModification::eRemoved)
{
DEBUG_LOG(m_logger) << "removed - stop";
DEBUG_LOG() << "removed - stop";
return;
}
if (!data.currentMissionName().empty() || data.currentTask().underlying() != ProjectDataManagement::UasActionTask::Loiter || data.missionEnded().empty())
{
//DEBUG As this will happen a lot
DEBUG_LOG(m_logger) << "not fulfilling current mission ("<<data.currentMissionName()<<") action because either a mission is still active or current task ("<<(int)data.currentTask().underlying()<<") is not Loiter or mission not ended ("<< data.missionEnded() << (data.missionEnded().empty() ? " [NOT ENDED]" : " [ ENDED ]")<<")";
DEBUG_LOG() << "not fulfilling current mission ("<<data.currentMissionName()<<") action because either a mission is still active or current task ("<<(int)data.currentTask().underlying()<<") is not Loiter or mission not ended ("<< data.missionEnded() << (data.missionEnded().empty() ? " [NOT ENDED]" : " [ ENDED ]")<<")";
return;
}
@@ -306,7 +305,7 @@ void ProxyListener::onUASMissionStatusChanged(const TrainingAreaBase::UASMission
const int participantId = m_mainHandler->ddsHandler()->dtc()->participantIdByEquipmentNumber(data.equipmentNumber());
if (participantId <= 0)
{
ERROR_LOG(m_logger) << "participant for eqid " << data.equipmentNumber() << " not found - unable to fulfill current mission action";
ERROR_LOG() << "participant for eqid " << data.equipmentNumber() << " not found - unable to fulfill current mission action";
return;
}
@@ -315,11 +314,11 @@ void ProxyListener::onUASMissionStatusChanged(const TrainingAreaBase::UASMission
// mission empty & task = loiter? mission done, run next mission (by setting current mission's current action as fulfilled, which will trigger the next action automatically (see ces))
if (!m_mainHandler->missionPlanHandler()->setCurrentMissionActionFulfilled(participantId, QString::fromStdString(data.missionEnded())))
{
ERROR_LOG(m_logger) << "setCurrentMissionActionFulfilled didn't work out";
ERROR_LOG() << "setCurrentMissionActionFulfilled didn't work out";
return;
}
DEBUG_LOG(m_logger) << "setCurrentMissionActionFulfilled done !";
DEBUG_LOG() << "setCurrentMissionActionFulfilled done !";
});
}
@@ -328,7 +327,7 @@ void ProxyListener::onBuildingHitLineInfoChanged(const Buildings::BuildingHitLin
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new Building Hitline Info" << data;
DEBUG_LOG() << "Got new Building Hitline Info" << data;
emit newBuildingHitLineInfo(data);
@@ -339,7 +338,7 @@ void ProxyListener::onProxyParticipantModeReportChanged(const TrainingAreaBase::
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got new Participant Mode Report Training Area Data error " << data;
DEBUG_LOG() << "Got new Participant Mode Report Training Area Data error " << data;
emit newParticipantModeReport(data);
}
@@ -354,7 +353,7 @@ Core::FunctionReplyObject ProxyListener::demandVulnerabilityStateChange(const rt
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "VulnerabilityStateChange timeout for " << requestId;
INFO_LOG() << "VulnerabilityStateChange timeout for " << requestId;
onDemandVulnerabilityStateChangeReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -374,14 +373,14 @@ void ProxyListener::onDemandVulnerabilityStateChangeReply(const Core::FunctionRe
Core::FunctionReplyObject ProxyListener::sendModifyUasStateRequest(const rti::core::SampleIdentity &cookie,
const TrainingAreaBase::SendModifyUasStateRequest &req)
{
DEBUG_LOG(m_logger) << " -- [ProxyListener] sendModifyUasStateRequest uasId: " << req.uasId();
DEBUG_LOG() << " -- [ProxyListener] sendModifyUasStateRequest uasId: " << req.uasId();
if (!m_mainHandler->tabFtc()->sendModifyUasStateRequest(req, this))
return Core::FunctionReplyObject(tr_lts("dds", "Error passing the UAS state change request to the proxy"));
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "ModifyUasState timeout for " << requestId;
INFO_LOG() << "ModifyUasState timeout for " << requestId;
onSendModifyUasStateReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -407,7 +406,7 @@ Core::FunctionReplyObject ProxyListener::demandInitRequest(const rti::core::Samp
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "DemandInit timeout for " << requestId;
INFO_LOG() << "DemandInit timeout for " << requestId;
onDemandInitReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -434,7 +433,7 @@ Core::FunctionReplyObject ProxyListener::sendEquipmentMessage(const rti::core::S
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "SendMessage timeout for " << requestId;
INFO_LOG() << "SendMessage timeout for " << requestId;
onSendEquipmentMessageReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -461,7 +460,7 @@ Core::FunctionReplyObject ProxyListener::sendParticipantModeRequest(const rti::c
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "SendParticipantMode timeout for " << requestId;
INFO_LOG() << "SendParticipantMode timeout for " << requestId;
onSendParticipantModeReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -485,7 +484,7 @@ Core::FunctionReplyObject ProxyListener::sendSetSanitationRequest(const rti::cor
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "sendSetSanitationRequest timeout for " << requestId;
INFO_LOG() << "sendSetSanitationRequest timeout for " << requestId;
onSendSetSanitationReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -508,7 +507,7 @@ Core::FunctionReplyObject ProxyListener::selectiveReammunitionRequest(const rti:
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "selectiveReammunitionRequest timeout for " << requestId;
INFO_LOG() << "selectiveReammunitionRequest timeout for " << requestId;
onSendSelectiveReammunitionReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -534,7 +533,7 @@ Core::FunctionReplyObject ProxyListener::sendOcCommandRequest(const rti::core::S
const int requestId = req.requestId();
auto cb = [this, requestId]()
{
INFO_LOG(m_logger) << "SendOcCommand timeout for " << requestId;
INFO_LOG() << "SendOcCommand timeout for " << requestId;
onSendOcCommandReply(Core::FunctionReplyObject(requestId, tr_lts("dds", "Timeout while waiting for the proxy")));
};
addToTrainingAreaRequests(cb, req.requestId(), cookie);
@@ -568,7 +567,7 @@ void ProxyListener::handleReply(const std::function<void(const rti::core::Sample
const char *requestType)
{
if (replyObject.error())
WARNING_LOG(m_logger) << requestType << ": " << replyObject();
WARNING_LOG() << requestType << ": " << replyObject();
auto it = m_trainingAreaRequests.find(replyObject.id());
if (it != m_trainingAreaRequests.end())
@@ -581,7 +580,7 @@ void ProxyListener::handleReply(const std::function<void(const rti::core::Sample
m_trainingAreaRequests.erase(it);
}
else
WARNING_LOG(m_logger) << requestType << " with request id " << replyObject.id() << " was not replied to by the proxy";
WARNING_LOG() << requestType << " with request id " << replyObject.id() << " was not replied to by the proxy";
}
@@ -27,7 +27,6 @@ UnitPositionCalculator::UnitPositionCalculator(ParticipantHandler *participantHa
, m_bSomethingChangedSinceLastCalculation(false)
, m_timer(new QTimer(this))
, m_bRunning(true)
, m_logger(getLogger("UnitPositionCalculator"))
{
connect(m_timer, &QTimer::timeout, this, &UnitPositionCalculator::calculate);
m_timer->setSingleShot(true);
@@ -46,7 +45,7 @@ UnitPositionCalculator::~UnitPositionCalculator()
void UnitPositionCalculator::startCalculation()
{
DEBUG_LOG(m_logger) << "Starting calculation timer";
DEBUG_LOG() << "Starting calculation timer";
m_timer->start();
m_bRunning = true;
}
@@ -68,7 +67,7 @@ void UnitPositionCalculator::waitForCalculationFinished()
void UnitPositionCalculator::onParticipantDeleted(int participantId)
{
DEBUG_LOG(m_logger) << "Participant " << participantId << " deleted";
DEBUG_LOG() << "Participant " << participantId << " deleted";
auto it = m_participantData.find(participantId);
if (it == m_participantData.end())
return;
@@ -77,7 +76,7 @@ void UnitPositionCalculator::onParticipantDeleted(int participantId)
void UnitPositionCalculator::onPositionChanged(int participantId, int64_t positionTime, const Core::GeoPosition &pos)
{
DEBUG_LOG(m_logger) << "Position for participant " << participantId << " changed to "
DEBUG_LOG() << "Position for participant " << participantId << " changed to "
<< pos << " (" << positionTime / 1000 << "s)";
CalculatedUnitPosition &data = getParticipant(participantId);
if (data.sampleTimeLeader() >= positionTime)
@@ -92,7 +91,7 @@ void UnitPositionCalculator::onPositionChanged(int participantId, int64_t positi
void UnitPositionCalculator::onSuperiorChanged(int participantId, int superiorId)
{
DEBUG_LOG(m_logger) << "Superior for participant " << participantId << " changed to " << superiorId;
DEBUG_LOG() << "Superior for participant " << participantId << " changed to " << superiorId;
CalculatedUnitPosition &data = getParticipant(participantId);
data.superiorId = superiorId;
m_bSomethingChangedSinceLastCalculation = true;
@@ -106,7 +105,7 @@ void UnitPositionCalculator::onInferiorChanged(int participantId, const std::vec
slIds.reserve(inferiorIds.size());
for (int id : inferiorIds)
slIds += QString::number(id);
DEBUG_LOG(m_logger) << "Inferior for participant " << participantId << " changed, size: " << slIds.join(QLatin1Char(' '));
DEBUG_LOG() << "Inferior for participant " << participantId << " changed, size: " << slIds.join(QLatin1Char(' '));
}
CalculatedUnitPosition &data = getParticipant(participantId);
@@ -119,7 +118,7 @@ UnitPositionCalculator::CalculatedUnitPosition &UnitPositionCalculator::getParti
auto it = m_participantData.find(participantId);
if (it == m_participantData.end())
{
DEBUG_LOG(m_logger) << "No information for participant " << participantId << " - creating dummy data";
DEBUG_LOG() << "No information for participant " << participantId << " - creating dummy data";
CalculatedUnitPosition data;
data.participantId(participantId);
@@ -139,7 +138,7 @@ void UnitPositionCalculator::calculate()
if (!m_bSomethingChangedSinceLastCalculation)
{
if (!s_bDebugOnce)
DEBUG_LOG(m_logger) << "Nothing changed - no calculation needed -> waiting for new data";
DEBUG_LOG() << "Nothing changed - no calculation needed -> waiting for new data";
s_bDebugOnce = true;
m_timer->start(1000);
return;
@@ -311,7 +310,7 @@ void UnitPositionCalculator::onCalculationDone()
if (it != m_publishedPositionData.end())
{
ParticipantManagement::UnitPosition &up = it->second;
DEBUG_LOG(m_logger) << "old: " << up << ", new: " << pos << ", equal: " << (up == pos);
DEBUG_LOG() << "old: " << up << ", new: " << pos << ", equal: " << (up == pos);
if (up == pos)
continue;
// nan == nan is always false, have to check it on our own
@@ -70,7 +70,6 @@ private:
bool m_bSomethingChangedSinceLastCalculation;
QTimer *m_timer;
bool m_bRunning;
NGL::INGLLogger &m_logger;
};
} // namespace ParticipantHandling