Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
1 parent
5485a90385
commit
881d44f4dd
512 files changed
+6887
-6426
No files matched your search
+21
-21
@@ -81,7 +81,7 @@ bool Participant::isValidPosition(qint64 sampleTime, const Core::GeoPosition &po
|
||||
return false;
|
||||
|
||||
// an operator can set an invalid position (so the participant is not displayed on the map)
|
||||
if (repSource == Core::PositionReportingSource_def::SetByOperator)
|
||||
if (repSource == Core::PositionReportingSource::SetByOperator)
|
||||
return true;
|
||||
|
||||
if (std::isnan(pos.lon()) ||
|
||||
@@ -224,7 +224,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
// search for CombatReady state, ignore newState if it is older
|
||||
for (const auto &s : stateHistory)
|
||||
{
|
||||
if (s.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::inner_enum::CombatReady &&
|
||||
if (s.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady &&
|
||||
s.stateTime() > newState.sampleTime())
|
||||
{
|
||||
return false;
|
||||
@@ -235,7 +235,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
bits.set(static_cast<int>(newState.vulnerabilityState().underlying()));
|
||||
|
||||
QStringList bitsList;
|
||||
for (int i = (int)ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill; i > 0; --i)
|
||||
for (int i = (int)ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill; i > 0; --i)
|
||||
{
|
||||
if (bits.test(i))
|
||||
bitsList += QString::number(i);
|
||||
@@ -244,9 +244,9 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
bool vulnIgnored = true;
|
||||
// find current main state
|
||||
ProjectDataManagement::VulnerabilityState mainVulState = newState.vulnerabilityState();
|
||||
if (newState.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::TemporarySeverance &&
|
||||
newState.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::NearMiss &&
|
||||
newState.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::HitWithNoEffect)
|
||||
if (newState.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance &&
|
||||
newState.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::VulnerabilityState_NearMiss &&
|
||||
newState.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::VulnerabilityState_HitWithNoEffect)
|
||||
{
|
||||
vulnIgnored = false;
|
||||
|
||||
@@ -254,11 +254,11 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
/* NOTE: 'i > 0' is intended. This ignores vuln CR (VBG0). That's because CR is a special case where
|
||||
* the history is resetted, etc. Fortunately the TNE never sends a BC (VBG12) if the last vuln is CR,
|
||||
* but sends a CR instead. */
|
||||
for (int i = (int)ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill; i > 0; --i)
|
||||
for (int i = (int)ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill; i > 0; --i)
|
||||
{
|
||||
if (bits.test(i))
|
||||
{
|
||||
mainVulState = static_cast<ProjectDataManagement::VulnerabilityState_def::type>(i);
|
||||
mainVulState = static_cast<ProjectDataManagement::VulnerabilityState>(i);
|
||||
//WARNING_LOG(m_logger) << "mainVulState was manipulated into: " << i;
|
||||
break;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ 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)
|
||||
if (mainVulState == ProjectDataManagement::VulnerabilityState::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?)";
|
||||
|
||||
DEBUG_LOG(m_logger) << "setState for eqid: " << newState.equipmentNumber()
|
||||
@@ -287,7 +287,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
}
|
||||
|
||||
// check if it is a (younger) CombatReady state - remove older
|
||||
if (mainVulState == ProjectDataManagement::VulnerabilityState::inner_enum::CombatReady)
|
||||
if (mainVulState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady)
|
||||
{
|
||||
std::vector<ParticipantManagement::StateInformation> currentStates;
|
||||
for (const auto &s : stateHistory)
|
||||
@@ -338,15 +338,15 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
WARNING_LOG(m_logger) << "Cannot cast lower 6 Bits to SanResult! Defaulting to Unhandled";
|
||||
sanResultVal = 1;
|
||||
}
|
||||
sanEvaluation = static_cast<SanitationEvaluation::inner_enum>(sanEvaluationVal);
|
||||
sanResult = static_cast<SanitationResult::inner_enum>(sanResultVal);
|
||||
sanEvaluation = static_cast<SanitationEvaluation>(sanEvaluationVal);
|
||||
sanResult = static_cast<SanitationResult>(sanResultVal);
|
||||
}
|
||||
#endif
|
||||
|
||||
//new state Temp Vis Damage
|
||||
if(newState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage ||
|
||||
newState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::NearMiss ||
|
||||
newState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::HitWithNoEffect)
|
||||
if(newState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleWeaponSystemDamage ||
|
||||
newState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_NearMiss ||
|
||||
newState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_HitWithNoEffect)
|
||||
{
|
||||
//Get last state in history and use that result
|
||||
const ParticipantManagement::StateInformation lastState = ParticipantManagement::youngestStateInformation(stateHistory, false, false); //Don't Skip Sanitation!
|
||||
@@ -355,7 +355,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
}
|
||||
|
||||
|
||||
if(mainVulState == ProjectDataManagement::VulnerabilityState::CombatReady ||
|
||||
if(mainVulState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady ||
|
||||
newState.originatorType() == ProjectDataManagement::StateChangeOriginator::FunctionalArea)
|
||||
sanResult = SanitationResult::NoEffect;
|
||||
|
||||
@@ -363,7 +363,7 @@ bool Participant::setState(const TrainingAreaBase::EquipmentState &newState, int
|
||||
// ICD 52 Kapitel 3.3.2.6.72 VBA / Vitalitaet / Anzeigeindex
|
||||
int32_t vitality = newState.vitality();
|
||||
|
||||
if(mainVulState == ProjectDataManagement::VulnerabilityState::CombatReady)
|
||||
if(mainVulState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady)
|
||||
vitality = 100;
|
||||
|
||||
ParticipantManagement::StateInformation state(mainVulState,
|
||||
@@ -510,8 +510,8 @@ bool Participant::setSanitation(qint64 sanitationProceduresTaken, TrainingAreaBa
|
||||
state.vulnerabilityKindId(lastState.vulnerabilityKindId());
|
||||
state.vulnerabilityState(lastState.vulnerabilityState());
|
||||
state.sanitationProceduresTaken(sanitationProceduresTaken);
|
||||
state.sanitationResult(static_cast<ParticipantManagement::SanitationResult::inner_enum>(sanitationResult.underlying()));
|
||||
state.sanitationEvaluation(static_cast<ParticipantManagement::SanitationEvaluation::inner_enum>(sanitationEvaluation.underlying()));
|
||||
state.sanitationResult(static_cast<ParticipantManagement::SanitationResult>(sanitationResult.underlying()));
|
||||
state.sanitationEvaluation(static_cast<ParticipantManagement::SanitationEvaluation>(sanitationEvaluation.underlying()));
|
||||
state.stateTime(sampleTime);
|
||||
|
||||
m_mutex.lock();
|
||||
@@ -542,8 +542,8 @@ bool Participant::setOperatorAction(int action, int originatorId, qint64 sampleT
|
||||
state.vulnerabilityState(lastState.vulnerabilityState());
|
||||
// 08: Wound paused
|
||||
// 35: Wound Continued
|
||||
state.sanitationResult(ParticipantManagement::SanitationResult_def::NoEffect);
|
||||
state.sanitationEvaluation(ParticipantManagement::SanitationEvaluation_def::NotApplicable);
|
||||
state.sanitationResult(ParticipantManagement::SanitationResult::NoEffect);
|
||||
state.sanitationEvaluation(ParticipantManagement::SanitationEvaluation::NotApplicable);
|
||||
state.stateTime(sampleTime);
|
||||
|
||||
m_mutex.lock();
|
||||
|
||||
+4
-4
@@ -202,7 +202,7 @@ void ParticipantHandler::onNewStateFromProxy(const TrainingAreaBase::EquipmentSt
|
||||
|
||||
// Make Laser Designations to Laser Designations
|
||||
auto dtcPdm = m_bdp->pdmDtc();
|
||||
if (dtcPdm && dtcPdm->getChargeTypeSpecialProperty(data.originatorChargeTypeId(), 0, 0) == ProjectDataManagement::ChargeTypeProperty_def::LTD && originParticipant)
|
||||
if (dtcPdm && dtcPdm->getChargeTypeSpecialProperty(data.originatorChargeTypeId(), 0, 0) == ProjectDataManagement::ChargeTypeProperty::LTD && originParticipant)
|
||||
{
|
||||
QSet<int> ldGearTypes{1043}; // Need Property for LTD...
|
||||
DynamicParticipantData dpd = originParticipant->dynamicParticipantData();
|
||||
@@ -459,7 +459,7 @@ void ParticipantHandler::onBuildingHitLineInfo(const Buildings::BuildingHitLineI
|
||||
<< "BuildingId=" << data.buildingId() << " originatorParticipantId=" << data.originatorParticipantId();
|
||||
auto dtcPdm = m_bdp->pdmDtc();
|
||||
// NOTE: igniterTypeId/IgniterFunction = 0 as long as BuildingHitLineInfo does not contain values
|
||||
if (dtcPdm->getChargeTypeSpecialProperty(data.chargeTypeId(), 0, 0) != ProjectDataManagement::ChargeTypeProperty_def::LTD)
|
||||
if (dtcPdm->getChargeTypeSpecialProperty(data.chargeTypeId(), 0, 0) != ProjectDataManagement::ChargeTypeProperty::LTD)
|
||||
return;
|
||||
|
||||
Participant *participant = participantById(data.originatorParticipantId());
|
||||
@@ -511,7 +511,7 @@ void ParticipantHandler::onSanitaryMaterialStockReport(const TrainingAreaBase::P
|
||||
data.sanitaryMaterialStock(),
|
||||
data.uniqueId(),
|
||||
data.sampleTime(),
|
||||
static_cast<ParticipantManagement::Qualification_def::type>(data.qualification().underlying()),
|
||||
static_cast<ParticipantManagement::Qualification>(data.qualification().underlying()),
|
||||
data.originatorEquipmentNumber());
|
||||
}
|
||||
participant->publishDynamicData();
|
||||
@@ -603,7 +603,7 @@ void ParticipantHandler::onNewFunctionalAreaEntryChanged(const TrainingAreaBase:
|
||||
state.originatorId(data.aesItemId());
|
||||
state.originatorType(ProjectDataManagement::StateChangeOriginator::FunctionalArea);
|
||||
state.sampleTime(data.sampleTime());
|
||||
state.vulnerabilityState(ProjectDataManagement::VulnerabilityState::HitWithNoEffect); // no effect - it's an entry into a functional area
|
||||
state.vulnerabilityState(ProjectDataManagement::VulnerabilityState::VulnerabilityState_HitWithNoEffect); // no effect - it's an entry into a functional area
|
||||
state.vulnerabilityBits(oldState.vulnerabilityBits());
|
||||
state.vulnerabilityKindId(oldState.vulnerabilityKindId());
|
||||
state.vitality(oldState.vitality());
|
||||
|
||||
+6
-6
@@ -1259,7 +1259,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::setSanitationRequest(co
|
||||
tabRequest.equipmentNumber(participant->equipmentNumber());
|
||||
tabRequest.originatorEquipmentNumber(request.data().originatorEquipmentNumber());
|
||||
tabRequest.participantId(request.id());
|
||||
tabRequest.qualification(static_cast<TrainingAreaBase::Qualification::inner_enum>(request.data().qualification().underlying()));
|
||||
tabRequest.qualification(static_cast<TrainingAreaBase::Qualification>(request.data().qualification().underlying()));
|
||||
tabRequest.sanitationProceduresTaken(request.data().sanitationProceduresTaken());
|
||||
|
||||
return m_proxyListener->sendSetSanitationRequest(cookie, tabRequest);
|
||||
@@ -1916,7 +1916,7 @@ void ParticipantHandlerForExercise::customedSetGearCharges(Participant *particip
|
||||
{
|
||||
const auto ppType = m_mainHandler->typeHandler()->typeById(participant->typeId());
|
||||
|
||||
if (!ppType || ppType->typeClass() == TypeClass_def::Unknown || ppType->properties().empty())
|
||||
if (!ppType || ppType->typeClass() == TypeClass::Unknown || ppType->properties().empty())
|
||||
return;
|
||||
const QJsonObject &typObj = QJsonDocument::fromJson(QByteArray::fromStdString(ppType->properties())).object();
|
||||
if (typObj.isEmpty())
|
||||
@@ -1924,10 +1924,10 @@ void ParticipantHandlerForExercise::customedSetGearCharges(Participant *particip
|
||||
|
||||
const bool isArtillery = typObj[QStringLiteral("isArtillery")].toBool(false);
|
||||
const int gearClassId = typObj[QStringLiteral("gearClassId")].toInt(0);
|
||||
const ProjectDataManagement::GearClass_def::type gearClass = static_cast<ProjectDataManagement::GearClass_def::type>(gearClassId);
|
||||
static QVector<ProjectDataManagement::GearClass_def::type> validGearTypes{ProjectDataManagement::GearClass_def::Mortar,
|
||||
ProjectDataManagement::GearClass_def::Rocket,
|
||||
ProjectDataManagement::GearClass_def::Artillery};
|
||||
const ProjectDataManagement::GearClass gearClass = static_cast<ProjectDataManagement::GearClass>(gearClassId);
|
||||
static QVector<ProjectDataManagement::GearClass> validGearTypes{ProjectDataManagement::GearClass::Mortar,
|
||||
ProjectDataManagement::GearClass::Rocket,
|
||||
ProjectDataManagement::GearClass::Artillery};
|
||||
if (!isArtillery || !validGearTypes.contains(gearClass))
|
||||
return;
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ ParticipantManagement::Party ParticipantManagement::PartyHandling::Party::toDdsP
|
||||
result.fadingColor(m_data.fadingColor);
|
||||
result.name(m_data.name.toStdString());
|
||||
result.role(m_data.roleId);
|
||||
result.hlaForceIdentifier(static_cast<HlaForceIdentifierEnum::inner_enum>(m_data.hlaForceIdentifier));
|
||||
result.hlaForceIdentifier(static_cast<HlaForceIdentifierEnum>(m_data.hlaForceIdentifier));
|
||||
result.isUsedBy(m_data.isUsedBy);
|
||||
result.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
result.properties(m_data.properties.toStdString());
|
||||
|
||||
+1
-1
@@ -305,7 +305,7 @@ void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleId
|
||||
req.fadingColor(partyEx0.fadingColor);
|
||||
req.name(partyEx0.name.toStdString());
|
||||
req.role(partyEx0.roleId);
|
||||
req.hlaForceIdentifier(static_cast<HlaForceIdentifierEnum::inner_enum>(partyEx0.hlaForceIdentifier));
|
||||
req.hlaForceIdentifier(static_cast<HlaForceIdentifierEnum>(partyEx0.hlaForceIdentifier));
|
||||
|
||||
// this remains as it is
|
||||
req.isUsedBy(partyEx->isUsedBy());
|
||||
|
||||
+2
-2
@@ -237,9 +237,9 @@ TargetInformation ObjectTargetInformation::toDdsData(const Database::PpmTargetIn
|
||||
ddsData.participantId(dbData.participantId);
|
||||
|
||||
ddsData.prewarningInterval(dbData.preWarningInterval);
|
||||
ddsData.prewarningEffect(static_cast<ProjectDataManagement::VulnerabilityState::inner_enum>(dbData.preWarningEffect));
|
||||
ddsData.prewarningEffect(static_cast<ProjectDataManagement::VulnerabilityState>(dbData.preWarningEffect));
|
||||
ddsData.takedownInterval(dbData.takeDownInterval);
|
||||
ddsData.takedownEffect(static_cast<ProjectDataManagement::VulnerabilityState::inner_enum>(dbData.takeDownEffect));
|
||||
ddsData.takedownEffect(static_cast<ProjectDataManagement::VulnerabilityState>(dbData.takeDownEffect));
|
||||
|
||||
const QByteArray &propertiesBa = dbData.properties.toUtf8();
|
||||
QJsonParseError parserError;
|
||||
|
||||
+22
-22
@@ -44,17 +44,17 @@ bool TypeHandler::isSupportType(int typeId) const
|
||||
|
||||
switch (type->typeClass().underlying())
|
||||
{
|
||||
case TypeClass_def::SupportEntity:
|
||||
case TypeClass_def::SupportUnit:
|
||||
case TypeClass::SupportEntity:
|
||||
case TypeClass::SupportUnit:
|
||||
return true;
|
||||
case TypeClass_def::Unit:
|
||||
case TypeClass_def::Human:
|
||||
case TypeClass_def::GroundVehicle:
|
||||
case TypeClass_def::WeaponSystem:
|
||||
case TypeClass_def::Aircraft:
|
||||
case TypeClass_def::Vessel:
|
||||
case TypeClass_def::VehicleWithGear:
|
||||
case TypeClass_def::Unknown:
|
||||
case TypeClass::Unit:
|
||||
case TypeClass::Human:
|
||||
case TypeClass::GroundVehicle:
|
||||
case TypeClass::WeaponSystem:
|
||||
case TypeClass::Aircraft:
|
||||
case TypeClass::Vessel:
|
||||
case TypeClass::VehicleWithGear:
|
||||
case TypeClass::Unknown:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
@@ -68,17 +68,17 @@ bool TypeHandler::isParticipantType(int typeId) const
|
||||
|
||||
switch (type->typeClass().underlying())
|
||||
{
|
||||
case TypeClass_def::SupportEntity:
|
||||
case TypeClass_def::SupportUnit:
|
||||
case TypeClass_def::Unknown:
|
||||
case TypeClass::SupportEntity:
|
||||
case TypeClass::SupportUnit:
|
||||
case TypeClass::Unknown:
|
||||
return false;
|
||||
case TypeClass_def::Unit:
|
||||
case TypeClass_def::Human:
|
||||
case TypeClass_def::GroundVehicle:
|
||||
case TypeClass_def::WeaponSystem:
|
||||
case TypeClass_def::Aircraft:
|
||||
case TypeClass_def::Vessel:
|
||||
case TypeClass_def::VehicleWithGear:
|
||||
case TypeClass::Unit:
|
||||
case TypeClass::Human:
|
||||
case TypeClass::GroundVehicle:
|
||||
case TypeClass::WeaponSystem:
|
||||
case TypeClass::Aircraft:
|
||||
case TypeClass::Vessel:
|
||||
case TypeClass::VehicleWithGear:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -92,8 +92,8 @@ bool TypeHandler::isUnitType(int typeId) const
|
||||
|
||||
switch (type->typeClass().underlying())
|
||||
{
|
||||
case TypeClass_def::Unit:
|
||||
case TypeClass_def::SupportUnit:
|
||||
case TypeClass::Unit:
|
||||
case TypeClass::SupportUnit:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ bool MissionPlanHandler::isUasCombatReady(int participantId)
|
||||
youngestState = si;
|
||||
}
|
||||
|
||||
return (youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady);
|
||||
return (youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject MissionPlanHandler::createMissionPlanRequest(const ModifyMissionPlanRequest &request)
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ UAS Uas::toDdsUas() const
|
||||
|
||||
result.id(m_data.id);
|
||||
result.deviceIdentifier(m_data.deviceIdentifier.toStdString());
|
||||
result.uasState(static_cast<ProjectDataManagement::UasState::inner_enum>(m_data.uasStateId));
|
||||
result.uasState(static_cast<ProjectDataManagement::UasState>(m_data.uasStateId));
|
||||
result.participantId(m_data.participantId);
|
||||
result.exerciseId(m_data.exerciseId);
|
||||
result.hostname(m_data.hostname.toStdString());
|
||||
|
||||
@@ -39,9 +39,9 @@ StateInformation youngestStateInformation(const std::vector<ParticipantManagemen
|
||||
// for (const ParticipantManagement::StateInformation &si : qAsConst(stateList))
|
||||
// {
|
||||
// if (si.originatorId() == 0
|
||||
// && si.originatorType() == ProjectDataManagement::StateChangeOriginator_def::ExerciseControl
|
||||
// && (si.vulnerabilityState() == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill
|
||||
// || si.vulnerabilityState() == ProjectDataManagement::VulnerabilityState_def::CombatReady)
|
||||
// && si.originatorType() == ProjectDataManagement::StateChangeOriginator::ExerciseControl
|
||||
// && (si.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CatastrophicKill
|
||||
// || si.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady)
|
||||
// )
|
||||
// readyToDebug = true;
|
||||
// }
|
||||
|
||||
Reference in new issue
Block a user