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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user