Migrates OcSituation and ServiceManagement to generated rtiddsgen API
Converts accessor calls to plain member access in osc, oss and obd services.
This commit is contained in:
30 files changed
+1000
-1007
No files matched your search
+211
-211
@@ -35,282 +35,282 @@ bool CentralAesByteReader::getRemoveMessage(size_t &pos, CentralAesByteReader::R
|
||||
|
||||
bool CentralAesByteReader::getNContamination(size_t &pos, AreaEffectSimulation::NContaminationModifyRequest &nContamination) const
|
||||
{
|
||||
bool result = getAesItemId(pos, nContamination.id());
|
||||
result &= getName(pos, nContamination.name());
|
||||
result &= getOptionalNumber(pos, nContamination.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, nContamination.effectDuration());
|
||||
result &= getChargeTypeId(pos, nContamination.chargeTypeId());
|
||||
result &= getImpactPosition(pos, nContamination.impactPosition());
|
||||
result &= getBorderLengthInner(pos, nContamination.borderLengthInner());
|
||||
result &= getBorderLengthOuter(pos, nContamination.borderLengthOuter());
|
||||
result &= getImpactRadius(pos, nContamination.impactRadius());
|
||||
result &= getSpanAngle(pos, nContamination.spanAngle());
|
||||
result &= getRotationAngle(pos, nContamination.rotationAngle());
|
||||
result &= getDetonationValue(pos, nContamination.detonationValue());
|
||||
result &= getOptionalNumber(pos, nContamination.partyId(), &CentralAesByteReader::getPartyId);
|
||||
bool result = getAesItemId(pos, nContamination.id);
|
||||
result &= getName(pos, nContamination.name);
|
||||
result &= getOptionalNumber(pos, nContamination.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, nContamination.effectDuration);
|
||||
result &= getChargeTypeId(pos, nContamination.chargeTypeId);
|
||||
result &= getImpactPosition(pos, nContamination.impactPosition);
|
||||
result &= getBorderLengthInner(pos, nContamination.borderLengthInner);
|
||||
result &= getBorderLengthOuter(pos, nContamination.borderLengthOuter);
|
||||
result &= getImpactRadius(pos, nContamination.impactRadius);
|
||||
result &= getSpanAngle(pos, nContamination.spanAngle);
|
||||
result &= getRotationAngle(pos, nContamination.rotationAngle);
|
||||
result &= getDetonationValue(pos, nContamination.detonationValue);
|
||||
result &= getOptionalNumber(pos, nContamination.partyId, &CentralAesByteReader::getPartyId);
|
||||
|
||||
nContamination.weatherSource(AreaEffectSimulation::AesWeatherSource::AwsNoUpdate);
|
||||
nContamination.weatherSource = AreaEffectSimulation::AesWeatherSource::AwsNoUpdate;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got NContamination:"
|
||||
<< "\nid = " << nContamination.id()
|
||||
<< "\nname = " << nContamination.name()
|
||||
<< "\neffectStart = " << nContamination.effectStart()
|
||||
<< "\neffectDuration = " << nContamination.effectDuration()
|
||||
<< "\nchargeTypeId = " << nContamination.chargeTypeId()
|
||||
<< "\nimpactPosition = " << nContamination.impactPosition()
|
||||
<< "\nborderLengthInner = " << nContamination.borderLengthInner()
|
||||
<< "\nborderLengthOuter = " << nContamination.borderLengthOuter()
|
||||
<< "\nimpactRadius = " << nContamination.impactRadius()
|
||||
<< "\nspanAngle = " << nContamination.spanAngle()
|
||||
<< "\nrotationAngle = " << nContamination.rotationAngle()
|
||||
<< "\ndetonationValue = " << nContamination.detonationValue()
|
||||
<< "\npartyId = " << nContamination.partyId();
|
||||
<< "\nid = " << nContamination.id
|
||||
<< "\nname = " << nContamination.name
|
||||
<< "\neffectStart = " << nContamination.effectStart
|
||||
<< "\neffectDuration = " << nContamination.effectDuration
|
||||
<< "\nchargeTypeId = " << nContamination.chargeTypeId
|
||||
<< "\nimpactPosition = " << nContamination.impactPosition
|
||||
<< "\nborderLengthInner = " << nContamination.borderLengthInner
|
||||
<< "\nborderLengthOuter = " << nContamination.borderLengthOuter
|
||||
<< "\nimpactRadius = " << nContamination.impactRadius
|
||||
<< "\nspanAngle = " << nContamination.spanAngle
|
||||
<< "\nrotationAngle = " << nContamination.rotationAngle
|
||||
<< "\ndetonationValue = " << nContamination.detonationValue
|
||||
<< "\npartyId = " << nContamination.partyId;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getBCContamination(size_t &pos, AreaEffectSimulation::BCContaminationModifyRequest &bCContamination) const
|
||||
{
|
||||
bool result = getAesItemId(pos, bCContamination.id());
|
||||
result &= getName(pos, bCContamination.name());
|
||||
result &= getOptionalNumber(pos, bCContamination.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, bCContamination.effectDuration());
|
||||
result &= getChargeTypeId(pos, bCContamination.chargeTypeId());
|
||||
result &= getImpactPosition(pos, bCContamination.impactPosition());
|
||||
result &= getImpactRadius(pos, bCContamination.impactRadius());
|
||||
result &= getOptionalNumber(pos, bCContamination.partyId(), &CentralAesByteReader::getPartyId);
|
||||
result &= getOptionalNumber(pos, bCContamination.propagationDirection(), &CentralAesByteReader::getPropagationDirection);
|
||||
result &= getOptionalNumber(pos, bCContamination.windSpeed(), &CentralAesByteReader::getWindSpeed);
|
||||
bool result = getAesItemId(pos, bCContamination.id);
|
||||
result &= getName(pos, bCContamination.name);
|
||||
result &= getOptionalNumber(pos, bCContamination.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, bCContamination.effectDuration);
|
||||
result &= getChargeTypeId(pos, bCContamination.chargeTypeId);
|
||||
result &= getImpactPosition(pos, bCContamination.impactPosition);
|
||||
result &= getImpactRadius(pos, bCContamination.impactRadius);
|
||||
result &= getOptionalNumber(pos, bCContamination.partyId, &CentralAesByteReader::getPartyId);
|
||||
result &= getOptionalNumber(pos, bCContamination.propagationDirection, &CentralAesByteReader::getPropagationDirection);
|
||||
result &= getOptionalNumber(pos, bCContamination.windSpeed, &CentralAesByteReader::getWindSpeed);
|
||||
|
||||
bCContamination.weatherSource(AreaEffectSimulation::AesWeatherSource::AwsNoUpdate);
|
||||
bCContamination.weatherSource = AreaEffectSimulation::AesWeatherSource::AwsNoUpdate;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got BCContamination:"
|
||||
<< "\nid = " << bCContamination.id()
|
||||
<< "\nname = " << bCContamination.name()
|
||||
<< "\neffectStart = " << bCContamination.effectStart()
|
||||
<< "\neffectDuration = " << bCContamination.effectDuration()
|
||||
<< "\nchargeTypeId = " << bCContamination.chargeTypeId()
|
||||
<< "\nimpactPosition = " << bCContamination.impactPosition()
|
||||
<< "\nimpactRadius = " << bCContamination.impactRadius()
|
||||
<< "\nweatherSource = " << bCContamination.weatherSource()
|
||||
<< "\npartyId = " << bCContamination.partyId()
|
||||
<< "\npropagationDirection = " << bCContamination.propagationDirection()
|
||||
<< "\nwindSpeed = " << bCContamination.windSpeed()
|
||||
<< "\nweatherPosition = " << bCContamination.weatherPosition()
|
||||
<< "\nweatherTimestamp = " << bCContamination.weatherTimestamp();
|
||||
<< "\nid = " << bCContamination.id
|
||||
<< "\nname = " << bCContamination.name
|
||||
<< "\neffectStart = " << bCContamination.effectStart
|
||||
<< "\neffectDuration = " << bCContamination.effectDuration
|
||||
<< "\nchargeTypeId = " << bCContamination.chargeTypeId
|
||||
<< "\nimpactPosition = " << bCContamination.impactPosition
|
||||
<< "\nimpactRadius = " << bCContamination.impactRadius
|
||||
<< "\nweatherSource = " << bCContamination.weatherSource
|
||||
<< "\npartyId = " << bCContamination.partyId
|
||||
<< "\npropagationDirection = " << bCContamination.propagationDirection
|
||||
<< "\nwindSpeed = " << bCContamination.windSpeed
|
||||
<< "\nweatherPosition = " << bCContamination.weatherPosition
|
||||
<< "\nweatherTimestamp = " << bCContamination.weatherTimestamp;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getExplosionArea(size_t &pos, AreaEffectSimulation::ExplosionAreaModifyRequest &explosionArea) const
|
||||
{
|
||||
bool result = getAesItemId(pos, explosionArea.id());
|
||||
result &= getName(pos, explosionArea.name());
|
||||
result &= getOptionalNumber(pos, explosionArea.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, explosionArea.effectDuration());
|
||||
result &= getChargeTypeId(pos, explosionArea.chargeTypeId());
|
||||
result &= getArea(pos, explosionArea.area());
|
||||
result &= getOptionalNumber(pos, explosionArea.partyId(), &CentralAesByteReader::getPartyId);
|
||||
result &= getCannonCount(pos, explosionArea.cannonCount());
|
||||
result &= getCannonRounds(pos, explosionArea.cannonRounds());
|
||||
result &= getFireRequestTime(pos, explosionArea.fireRequestTime());
|
||||
result &= getAltitude(pos, explosionArea.altitude());
|
||||
result &= getPurpose(pos, explosionArea.purpose());
|
||||
bool result = getAesItemId(pos, explosionArea.id);
|
||||
result &= getName(pos, explosionArea.name);
|
||||
result &= getOptionalNumber(pos, explosionArea.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, explosionArea.effectDuration);
|
||||
result &= getChargeTypeId(pos, explosionArea.chargeTypeId);
|
||||
result &= getArea(pos, explosionArea.area);
|
||||
result &= getOptionalNumber(pos, explosionArea.partyId, &CentralAesByteReader::getPartyId);
|
||||
result &= getCannonCount(pos, explosionArea.cannonCount);
|
||||
result &= getCannonRounds(pos, explosionArea.cannonRounds);
|
||||
result &= getFireRequestTime(pos, explosionArea.fireRequestTime);
|
||||
result &= getAltitude(pos, explosionArea.altitude);
|
||||
result &= getPurpose(pos, explosionArea.purpose);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionArea:"
|
||||
<< "\nid = " << explosionArea.id()
|
||||
<< "\nname = " << explosionArea.name()
|
||||
<< "\neffectStart = " << explosionArea.effectStart()
|
||||
<< "\neffectDuration = " << explosionArea.effectDuration()
|
||||
<< "\nchargeTypeId = " << explosionArea.chargeTypeId()
|
||||
<< "\narea = " << explosionArea.area()
|
||||
<< "\npartyId = " << explosionArea.partyId()
|
||||
<< "\ncannonCount = " << explosionArea.cannonCount()
|
||||
<< "\ncannonRounds = " << explosionArea.cannonRounds()
|
||||
<< "\nfireRequestTime = " << explosionArea.fireRequestTime()
|
||||
<< "\naltitude = " << explosionArea.altitude()
|
||||
<< "\npurpose = " << explosionArea.purpose();
|
||||
<< "\nid = " << explosionArea.id
|
||||
<< "\nname = " << explosionArea.name
|
||||
<< "\neffectStart = " << explosionArea.effectStart
|
||||
<< "\neffectDuration = " << explosionArea.effectDuration
|
||||
<< "\nchargeTypeId = " << explosionArea.chargeTypeId
|
||||
<< "\narea = " << explosionArea.area
|
||||
<< "\npartyId = " << explosionArea.partyId
|
||||
<< "\ncannonCount = " << explosionArea.cannonCount
|
||||
<< "\ncannonRounds = " << explosionArea.cannonRounds
|
||||
<< "\nfireRequestTime = " << explosionArea.fireRequestTime
|
||||
<< "\naltitude = " << explosionArea.altitude
|
||||
<< "\npurpose = " << explosionArea.purpose;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getExplosionSingle(size_t &pos, AreaEffectSimulation::ExplosionSingleModifyRequest &explosionSingle) const
|
||||
{
|
||||
bool result = getAesItemId(pos, explosionSingle.id());
|
||||
result &= getName(pos, explosionSingle.name());
|
||||
result &= getOptionalNumber(pos, explosionSingle.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getChargeTypeId(pos, explosionSingle.chargeTypeId());
|
||||
result &= getImpactPosition(pos, explosionSingle.impactPosition());
|
||||
result &= getOptionalNumber(pos, explosionSingle.partyId(), &CentralAesByteReader::getPartyId);
|
||||
result &= getFireRequestTime(pos, explosionSingle.fireRequestTime());
|
||||
result &= getAltitude(pos, explosionSingle.altitude());
|
||||
result &= getPurpose(pos, explosionSingle.purpose());
|
||||
bool result = getAesItemId(pos, explosionSingle.id);
|
||||
result &= getName(pos, explosionSingle.name);
|
||||
result &= getOptionalNumber(pos, explosionSingle.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getChargeTypeId(pos, explosionSingle.chargeTypeId);
|
||||
result &= getImpactPosition(pos, explosionSingle.impactPosition);
|
||||
result &= getOptionalNumber(pos, explosionSingle.partyId, &CentralAesByteReader::getPartyId);
|
||||
result &= getFireRequestTime(pos, explosionSingle.fireRequestTime);
|
||||
result &= getAltitude(pos, explosionSingle.altitude);
|
||||
result &= getPurpose(pos, explosionSingle.purpose);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionSingle:"
|
||||
<< "\nid = " << explosionSingle.id()
|
||||
<< "\nname = " << explosionSingle.name()
|
||||
<< "\neffectStart = " << explosionSingle.effectStart()
|
||||
<< "\nchargeTypeId = " << explosionSingle.chargeTypeId()
|
||||
<< "\nimpactPosition = " << explosionSingle.impactPosition()
|
||||
<< "\npartyId = " << explosionSingle.partyId()
|
||||
<< "\nfireRequestTime = " << explosionSingle.fireRequestTime()
|
||||
<< "\naltitude = " << explosionSingle.altitude()
|
||||
<< "\npurpose = " << explosionSingle.purpose();
|
||||
<< "\nid = " << explosionSingle.id
|
||||
<< "\nname = " << explosionSingle.name
|
||||
<< "\neffectStart = " << explosionSingle.effectStart
|
||||
<< "\nchargeTypeId = " << explosionSingle.chargeTypeId
|
||||
<< "\nimpactPosition = " << explosionSingle.impactPosition
|
||||
<< "\npartyId = " << explosionSingle.partyId
|
||||
<< "\nfireRequestTime = " << explosionSingle.fireRequestTime
|
||||
<< "\naltitude = " << explosionSingle.altitude
|
||||
<< "\npurpose = " << explosionSingle.purpose;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getMineArea(size_t &pos, AreaEffectSimulation::MineAreaModifyRequest &mineArea) const
|
||||
{
|
||||
bool result = getAesItemId(pos, mineArea.id());
|
||||
result &= getName(pos, mineArea.name());
|
||||
result &= getOptionalNumber(pos, mineArea.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, mineArea.effectDuration());
|
||||
result &= getDensity(pos, mineArea.density());
|
||||
result &= getWidth(pos, mineArea.width());
|
||||
result &= getChargeTypeId(pos, mineArea.chargeStruct().chargeTypeId());
|
||||
result &= getOptionalNumber(pos, mineArea.partyId(), &CentralAesByteReader::getPartyId);
|
||||
result &= getAesMaLayingProcedureType(pos, mineArea.layingProcedureType());
|
||||
result &= getIsLayedHidden(pos, mineArea.isLaidHidden());
|
||||
result &= getIsCenterLine(pos, mineArea.isCenterLine());
|
||||
result &= getSegments(pos, mineArea.segments());
|
||||
bool result = getAesItemId(pos, mineArea.id);
|
||||
result &= getName(pos, mineArea.name);
|
||||
result &= getOptionalNumber(pos, mineArea.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, mineArea.effectDuration);
|
||||
result &= getDensity(pos, mineArea.density);
|
||||
result &= getWidth(pos, mineArea.width);
|
||||
result &= getChargeTypeId(pos, mineArea.chargeStruct.chargeTypeId);
|
||||
result &= getOptionalNumber(pos, mineArea.partyId, &CentralAesByteReader::getPartyId);
|
||||
result &= getAesMaLayingProcedureType(pos, mineArea.layingProcedureType);
|
||||
result &= getIsLayedHidden(pos, mineArea.isLaidHidden);
|
||||
result &= getIsCenterLine(pos, mineArea.isCenterLine);
|
||||
result &= getSegments(pos, mineArea.segments);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got MineArea:"
|
||||
<< "\nid = " << mineArea.id()
|
||||
<< "\nname = " << mineArea.name()
|
||||
<< "\neffectStart = " << mineArea.effectStart()
|
||||
<< "\neffectDuration = " << mineArea.effectDuration()
|
||||
<< "\ndensity = " << mineArea.density()
|
||||
<< "\nwidth = " << mineArea.width()
|
||||
<< "\nchargeTypeId = " << mineArea.chargeStruct().chargeTypeId()
|
||||
<< "\npartyId = " << mineArea.partyId()
|
||||
<< "\nlayingProcedureType = " << mineArea.layingProcedureType()
|
||||
<< "\nisLaidHidden = " << mineArea.isLaidHidden()
|
||||
<< "\nisCenterLine = " << mineArea.isCenterLine()
|
||||
<< "\nsegments.size = " << mineArea.segments().size();
|
||||
<< "\nid = " << mineArea.id
|
||||
<< "\nname = " << mineArea.name
|
||||
<< "\neffectStart = " << mineArea.effectStart
|
||||
<< "\neffectDuration = " << mineArea.effectDuration
|
||||
<< "\ndensity = " << mineArea.density
|
||||
<< "\nwidth = " << mineArea.width
|
||||
<< "\nchargeTypeId = " << mineArea.chargeStruct.chargeTypeId
|
||||
<< "\npartyId = " << mineArea.partyId
|
||||
<< "\nlayingProcedureType = " << mineArea.layingProcedureType
|
||||
<< "\nisLaidHidden = " << mineArea.isLaidHidden
|
||||
<< "\nisCenterLine = " << mineArea.isCenterLine
|
||||
<< "\nsegments.size = " << mineArea.segments.size();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getFunctionalArea(size_t &pos, AreaEffectSimulation::FunctionalAreaModifyRequest &functionalArea) const
|
||||
{
|
||||
bool result = getAesItemId(pos, functionalArea.id());
|
||||
result &= getName(pos, functionalArea.name());
|
||||
result &= getOptionalNumber(pos, functionalArea.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, functionalArea.effectDuration());
|
||||
result &= getChargeTypeId(pos, functionalArea.chargeTypeId());
|
||||
result &= getArea(pos, functionalArea.area());
|
||||
result &= getOptionalNumber(pos, functionalArea.partyId(), &CentralAesByteReader::getPartyId);
|
||||
bool result = getAesItemId(pos, functionalArea.id);
|
||||
result &= getName(pos, functionalArea.name);
|
||||
result &= getOptionalNumber(pos, functionalArea.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getEffectDuration(pos, functionalArea.effectDuration);
|
||||
result &= getChargeTypeId(pos, functionalArea.chargeTypeId);
|
||||
result &= getArea(pos, functionalArea.area);
|
||||
result &= getOptionalNumber(pos, functionalArea.partyId, &CentralAesByteReader::getPartyId);
|
||||
std::string pointSymbol;
|
||||
result &= getPointSymbol(pos, pointSymbol);
|
||||
if (pointSymbol != std::string())
|
||||
functionalArea.pointSymbol().set(pointSymbol);
|
||||
result &= getFunctionalAreaTypeId(pos, functionalArea.functionalAreaTypeId());
|
||||
result &= getDeconMode(pos, functionalArea.deconMode());
|
||||
result &= getDeconTime(pos, functionalArea.deconTime());
|
||||
result &= getMaintMode(pos, functionalArea.maintMode());
|
||||
result &= getMaintTime(pos, functionalArea.maintTime());
|
||||
result &= getMedicMode(pos, functionalArea.medicMode());
|
||||
result &= getMedicTime(pos, functionalArea.medicTime());
|
||||
functionalArea.pointSymbol.set(pointSymbol);
|
||||
result &= getFunctionalAreaTypeId(pos, functionalArea.functionalAreaTypeId);
|
||||
result &= getDeconMode(pos, functionalArea.deconMode);
|
||||
result &= getDeconTime(pos, functionalArea.deconTime);
|
||||
result &= getMaintMode(pos, functionalArea.maintMode);
|
||||
result &= getMaintTime(pos, functionalArea.maintTime);
|
||||
result &= getMedicMode(pos, functionalArea.medicMode);
|
||||
result &= getMedicTime(pos, functionalArea.medicTime);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got MineArea:"
|
||||
<< "\nid = " << functionalArea.id()
|
||||
<< "\nname = " << functionalArea.name()
|
||||
<< "\neffectStart = " << functionalArea.effectStart()
|
||||
<< "\neffectDuration = " << functionalArea.effectDuration()
|
||||
<< "\nchargeTypeId = " << functionalArea.chargeTypeId()
|
||||
<< "\narea = " << functionalArea.area()
|
||||
<< "\npartyId = " << functionalArea.partyId()
|
||||
<< "\npointSymbol = " << functionalArea.pointSymbol()
|
||||
<< "\nfunctionalAreaTypeId = " << functionalArea.functionalAreaTypeId()
|
||||
<< "\ndeconMode = " << functionalArea.deconMode()
|
||||
<< "\ndeconTime = " << functionalArea.deconTime()
|
||||
<< "\nmaintMode = " << functionalArea.maintMode()
|
||||
<< "\nmaintTime = " << functionalArea.maintTime()
|
||||
<< "\nmedicMode = " << functionalArea.medicMode()
|
||||
<< "\n medicTime= " << functionalArea.medicTime();
|
||||
<< "\nid = " << functionalArea.id
|
||||
<< "\nname = " << functionalArea.name
|
||||
<< "\neffectStart = " << functionalArea.effectStart
|
||||
<< "\neffectDuration = " << functionalArea.effectDuration
|
||||
<< "\nchargeTypeId = " << functionalArea.chargeTypeId
|
||||
<< "\narea = " << functionalArea.area
|
||||
<< "\npartyId = " << functionalArea.partyId
|
||||
<< "\npointSymbol = " << functionalArea.pointSymbol
|
||||
<< "\nfunctionalAreaTypeId = " << functionalArea.functionalAreaTypeId
|
||||
<< "\ndeconMode = " << functionalArea.deconMode
|
||||
<< "\ndeconTime = " << functionalArea.deconTime
|
||||
<< "\nmaintMode = " << functionalArea.maintMode
|
||||
<< "\nmaintTime = " << functionalArea.maintTime
|
||||
<< "\nmedicMode = " << functionalArea.medicMode
|
||||
<< "\n medicTime= " << functionalArea.medicTime;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getBoobyTrap(size_t &pos, AreaEffectSimulation::BoobyTrapModifyRequest &boobyTrap) const
|
||||
{
|
||||
bool result = getAesItemId(pos, boobyTrap.id());
|
||||
result &= getName(pos, boobyTrap.name());
|
||||
result &= getEffectDuration(pos, boobyTrap.effectDuration());
|
||||
result &= getChargeTypeId(pos, boobyTrap.chargeTypeId());
|
||||
result &= getImpactPosition(pos, boobyTrap.impactPosition());
|
||||
result &= getImpactRadius(pos, boobyTrap.impactRadius());
|
||||
result &= getTriggerRadius(pos, boobyTrap.triggerRadius());
|
||||
result &= getOptionalNumber(pos, boobyTrap.rotationAngle(), &CentralAesByteReader::getRotationAngle);
|
||||
result &= getOptionalNumber(pos, boobyTrap.centralAngle(), &CentralAesByteReader::getCentralAngle);
|
||||
result &= getOptionalNumber(pos, boobyTrap.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getOptionalNumber(pos, boobyTrap.partyId(), &CentralAesByteReader::getPartyId);
|
||||
bool result = getAesItemId(pos, boobyTrap.id);
|
||||
result &= getName(pos, boobyTrap.name);
|
||||
result &= getEffectDuration(pos, boobyTrap.effectDuration);
|
||||
result &= getChargeTypeId(pos, boobyTrap.chargeTypeId);
|
||||
result &= getImpactPosition(pos, boobyTrap.impactPosition);
|
||||
result &= getImpactRadius(pos, boobyTrap.impactRadius);
|
||||
result &= getTriggerRadius(pos, boobyTrap.triggerRadius);
|
||||
result &= getOptionalNumber(pos, boobyTrap.rotationAngle, &CentralAesByteReader::getRotationAngle);
|
||||
result &= getOptionalNumber(pos, boobyTrap.centralAngle, &CentralAesByteReader::getCentralAngle);
|
||||
result &= getOptionalNumber(pos, boobyTrap.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getOptionalNumber(pos, boobyTrap.partyId, &CentralAesByteReader::getPartyId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got BoobyTrap:"
|
||||
<< "\nid = " << boobyTrap.id()
|
||||
<< "\nname = " << boobyTrap.name()
|
||||
<< "\neffectDuration = " << boobyTrap.effectDuration()
|
||||
<< "\nchargeTypeId = " << boobyTrap.chargeTypeId()
|
||||
<< "\nimpactPosition = " << boobyTrap.impactPosition()
|
||||
<< "\nimpactRadius = " << boobyTrap.impactRadius()
|
||||
<< "\ntriggerRadius = " << boobyTrap.triggerRadius()
|
||||
<< "\nrotationAngle = " << boobyTrap.rotationAngle()
|
||||
<< "\ncentralAngle = " << boobyTrap.centralAngle()
|
||||
<< "\neffectStart = " << boobyTrap.effectStart()
|
||||
<< "\npartyId = " << boobyTrap.partyId();
|
||||
<< "\nid = " << boobyTrap.id
|
||||
<< "\nname = " << boobyTrap.name
|
||||
<< "\neffectDuration = " << boobyTrap.effectDuration
|
||||
<< "\nchargeTypeId = " << boobyTrap.chargeTypeId
|
||||
<< "\nimpactPosition = " << boobyTrap.impactPosition
|
||||
<< "\nimpactRadius = " << boobyTrap.impactRadius
|
||||
<< "\ntriggerRadius = " << boobyTrap.triggerRadius
|
||||
<< "\nrotationAngle = " << boobyTrap.rotationAngle
|
||||
<< "\ncentralAngle = " << boobyTrap.centralAngle
|
||||
<< "\neffectStart = " << boobyTrap.effectStart
|
||||
<< "\npartyId = " << boobyTrap.partyId;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getOffRouteMine(size_t &pos, AreaEffectSimulation::OffRouteMineModifyRequest &offRouteMine) const
|
||||
{
|
||||
bool result = getAesItemId(pos, offRouteMine.id());
|
||||
result &= getName(pos, offRouteMine.name());
|
||||
result &= getEffectDuration(pos, offRouteMine.effectDuration());
|
||||
result &= getChargeTypeId(pos, offRouteMine.chargeTypeId());
|
||||
result &= getArea(pos, offRouteMine.area());
|
||||
result &= getOptionalNumber(pos, offRouteMine.impactRadius(), &CentralAesByteReader::getImpactRadius);
|
||||
result &= getOptionalNumber(pos, offRouteMine.effectStart(), &CentralAesByteReader::getEffectStart);
|
||||
result &= getOptionalNumber(pos, offRouteMine.partyId(), &CentralAesByteReader::getPartyId);
|
||||
bool result = getAesItemId(pos, offRouteMine.id);
|
||||
result &= getName(pos, offRouteMine.name);
|
||||
result &= getEffectDuration(pos, offRouteMine.effectDuration);
|
||||
result &= getChargeTypeId(pos, offRouteMine.chargeTypeId);
|
||||
result &= getArea(pos, offRouteMine.area);
|
||||
result &= getOptionalNumber(pos, offRouteMine.impactRadius, &CentralAesByteReader::getImpactRadius);
|
||||
result &= getOptionalNumber(pos, offRouteMine.effectStart, &CentralAesByteReader::getEffectStart);
|
||||
result &= getOptionalNumber(pos, offRouteMine.partyId, &CentralAesByteReader::getPartyId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got OffRouteMine: "
|
||||
<< "\nid: " << offRouteMine.id()
|
||||
<< "\nname = " << offRouteMine.name()
|
||||
<< "\neffectDuration = " << offRouteMine.effectDuration()
|
||||
<< "\nchargeTypeId = " << offRouteMine.chargeTypeId()
|
||||
<< "\narea = " << offRouteMine.area()
|
||||
<< "\nimpactRadius = " << offRouteMine.impactRadius()
|
||||
<< "\neffectStart = " << offRouteMine.effectStart()
|
||||
<< "\npartyId = " << offRouteMine.partyId();
|
||||
<< "\nid: " << offRouteMine.id
|
||||
<< "\nname = " << offRouteMine.name
|
||||
<< "\neffectDuration = " << offRouteMine.effectDuration
|
||||
<< "\nchargeTypeId = " << offRouteMine.chargeTypeId
|
||||
<< "\narea = " << offRouteMine.area
|
||||
<< "\nimpactRadius = " << offRouteMine.impactRadius
|
||||
<< "\neffectStart = " << offRouteMine.effectStart
|
||||
<< "\npartyId = " << offRouteMine.partyId;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CentralAesByteReader::getExplosionCluster(size_t &pos, AreaEffectSimulation::ExplosionClusterOcModifyRequest &explosionCluster) const
|
||||
{
|
||||
bool result = getAesItemId(pos, explosionCluster.id());
|
||||
result &= getName(pos, explosionCluster.name());
|
||||
result &= getEffectStart(pos, explosionCluster.effectStart());
|
||||
result &= getEffectDuration(pos, explosionCluster.effectDuration());
|
||||
result &= getArea(pos, explosionCluster.area());
|
||||
result &= getMhpCount(pos, explosionCluster.mhpCount());
|
||||
result &= getMhpRotation(pos, explosionCluster.mhpRotation());
|
||||
result &= getImpactCount(pos, explosionCluster.impactCount());
|
||||
result &= getChargeTypeId(pos, explosionCluster.chargeStruct().chargeTypeId());
|
||||
result &= getPartyId(pos, explosionCluster.partyId());
|
||||
bool result = getAesItemId(pos, explosionCluster.id);
|
||||
result &= getName(pos, explosionCluster.name);
|
||||
result &= getEffectStart(pos, explosionCluster.effectStart);
|
||||
result &= getEffectDuration(pos, explosionCluster.effectDuration);
|
||||
result &= getArea(pos, explosionCluster.area);
|
||||
result &= getMhpCount(pos, explosionCluster.mhpCount);
|
||||
result &= getMhpRotation(pos, explosionCluster.mhpRotation);
|
||||
result &= getImpactCount(pos, explosionCluster.impactCount);
|
||||
result &= getChargeTypeId(pos, explosionCluster.chargeStruct.chargeTypeId);
|
||||
result &= getPartyId(pos, explosionCluster.partyId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionCluster:"
|
||||
<< "\nid: " << explosionCluster.id()
|
||||
<< "\nname: " << explosionCluster.name()
|
||||
<< "\neffectStart: " << explosionCluster.effectStart()
|
||||
<< "\neffectDuration: " << explosionCluster.effectDuration()
|
||||
<< "\narea: " << explosionCluster.area()
|
||||
<< "\nmhpCount: " << explosionCluster.mhpCount()
|
||||
<< "\nmhpRotation: " << explosionCluster.mhpRotation()
|
||||
<< "\nimpactCount: " << explosionCluster.impactCount()
|
||||
<< "\nchargeTypeId: " << explosionCluster.chargeStruct().chargeTypeId()
|
||||
<< "\npartyId: " << explosionCluster.partyId();
|
||||
<< "\nid: " << explosionCluster.id
|
||||
<< "\nname: " << explosionCluster.name
|
||||
<< "\neffectStart: " << explosionCluster.effectStart
|
||||
<< "\neffectDuration: " << explosionCluster.effectDuration
|
||||
<< "\narea: " << explosionCluster.area
|
||||
<< "\nmhpCount: " << explosionCluster.mhpCount
|
||||
<< "\nmhpRotation: " << explosionCluster.mhpRotation
|
||||
<< "\nimpactCount: " << explosionCluster.impactCount
|
||||
<< "\nchargeTypeId: " << explosionCluster.chargeStruct.chargeTypeId
|
||||
<< "\npartyId: " << explosionCluster.partyId;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -337,10 +337,10 @@ bool CentralAesByteReader::getAltitude(size_t &pos, int32_t &altitude) const
|
||||
|
||||
bool CentralAesByteReader::getArea(size_t &pos, AreaEffectSimulation::Area &area) const
|
||||
{
|
||||
bool result = getPosition2D(pos, area.cornerBottomLeft());
|
||||
result &= LtsUtils::get8Byte(m_data, pos, area.width());
|
||||
result &= LtsUtils::get8Byte(m_data, pos, area.height());
|
||||
result &= LtsUtils::get8Byte(m_data, pos, area.rotation());
|
||||
bool result = getPosition2D(pos, area.cornerBottomLeft);
|
||||
result &= LtsUtils::get8Byte(m_data, pos, area.width);
|
||||
result &= LtsUtils::get8Byte(m_data, pos, area.height);
|
||||
result &= LtsUtils::get8Byte(m_data, pos, area.rotation);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -526,8 +526,8 @@ bool CentralAesByteReader::getPointSymbol(size_t &pos, std::string &pointSymbol)
|
||||
|
||||
bool CentralAesByteReader::getPosition2D(size_t &pos, Core::GeoPosition2D &position) const
|
||||
{
|
||||
bool result = LtsUtils::get8Byte(m_data, pos, position.lon());
|
||||
result &= LtsUtils::get8Byte(m_data, pos, position.lat());
|
||||
bool result = LtsUtils::get8Byte(m_data, pos, position.lon);
|
||||
result &= LtsUtils::get8Byte(m_data, pos, position.lat);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public:
|
||||
{}
|
||||
|
||||
RemoveMessage()
|
||||
: RemoveMessage(-1, AreaEffectSimulation::AesType::inner_enum::AtUnknown)
|
||||
: RemoveMessage(-1, AreaEffectSimulation::AesType::AtUnknown)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
qint64 DdsHandler::currentPartitionTime() const
|
||||
{
|
||||
return m_dtcCore->partitionTime().timeStamp();
|
||||
return m_dtcCore->partitionTime().timeStamp;
|
||||
}
|
||||
|
||||
} // namespace OcSituationClient
|
||||
+38
-38
@@ -144,19 +144,19 @@ void HandlerOcAesData::handleDangerAreas(const QByteArray &data, size_t pos)
|
||||
uint64_t tmp;
|
||||
int x = 0, y = 0;
|
||||
|
||||
req.chargeTypeId(311); // danger area
|
||||
req.chargeTypeId = 311; // danger area
|
||||
|
||||
for (int i = 0; i < cnt; ++i)
|
||||
{
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.id(tmp);
|
||||
req.name(data.mid(pos, 8).toStdString());
|
||||
req.id = tmp;
|
||||
req.name = data.mid(pos, 8).toStdString();
|
||||
pos += 8;
|
||||
LtsUtils::get4Byte(data, pos, tmp);
|
||||
if (tmp > 0)
|
||||
req.effectStart(dds::core::optional<rti::core::int64>(tmp * 1000));
|
||||
req.effectStart = dds::core::optional<rti::core::int64>(tmp * 1000);
|
||||
else
|
||||
req.effectStart(dds::core::optional<rti::core::int64>());
|
||||
req.effectStart = dds::core::optional<rti::core::int64>();
|
||||
|
||||
size_t segmentCnt = 0;
|
||||
LtsUtils::get1Byte(data, pos, segmentCnt);
|
||||
@@ -168,20 +168,20 @@ void HandlerOcAesData::handleDangerAreas(const QByteArray &data, size_t pos)
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
segments.emplace_back(relativeFromGeoPosition(x, y));
|
||||
}
|
||||
req.segments(segments);
|
||||
req.segments = segments;
|
||||
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "danger area: " << req;
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id) ? "Modifying " : "Creating ") << "danger area: " << req;
|
||||
|
||||
aesToBeDeleted.removeAll(req.id()); // item was created/modified -> does not need to be deleted
|
||||
req.id(req.id() * -1); // inverted id to mark as for oc
|
||||
aesToBeDeleted.removeAll(req.id); // item was created/modified -> does not need to be deleted
|
||||
req.id = req.id * -1; // inverted id to mark as for oc
|
||||
m_aesFtc->dangerAreaModifyRequest(req, this);
|
||||
}
|
||||
|
||||
for (int id : qAsConst(aesToBeDeleted))
|
||||
{
|
||||
if (m_aesDtc->dangerArea(id).isCentral())
|
||||
if (m_aesDtc->dangerArea(id).isCentral)
|
||||
continue;
|
||||
if (m_aesDtc->dangerArea(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
if (m_aesDtc->dangerArea(id).effectStateId > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing danger area id: " << id;
|
||||
m_aesFtc->dangerAreaRemoveRequest(Core::RemoveElementRequest(id), this);
|
||||
@@ -201,28 +201,28 @@ void HandlerOcAesData::handleIeds(const QByteArray &data, size_t pos)
|
||||
unsigned long tmp;
|
||||
int x = 0, y = 0;
|
||||
|
||||
def.pairingState(1); // not paired in OC application
|
||||
def.pairingState = 1; // not paired in OC application
|
||||
|
||||
for (int i = 0; i < cnt; ++i)
|
||||
{
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
def.iedId(tmp);
|
||||
def.iedId = tmp;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
def.type(tmp);
|
||||
def.type = tmp;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
def.tautWireTrigger((tmp >> 3) & 0x01);
|
||||
def.lightBarrierTrigger((tmp >> 2) & 0x01);
|
||||
def.switchTrigger((tmp >> 1) & 0x01);
|
||||
def.remoteTrigger((tmp >> 0) & 0x01);
|
||||
def.tautWireTrigger = (tmp >> 3) & 0x01;
|
||||
def.lightBarrierTrigger = (tmp >> 2) & 0x01;
|
||||
def.switchTrigger = (tmp >> 1) & 0x01;
|
||||
def.remoteTrigger = (tmp >> 0) & 0x01;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
def.explosiveForce(tmp);
|
||||
def.explosiveForce = tmp;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
def.partyId(tmp);
|
||||
def.partyId = tmp;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
def.tacticalState(tmp);
|
||||
def.tacticalState = tmp;
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
def.position(relativeFromGeoPosition(x, y));
|
||||
def.position = relativeFromGeoPosition(x, y);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing definition ied: " << def;
|
||||
|
||||
@@ -242,7 +242,7 @@ void HandlerOcAesData::handleIedPositions(const QByteArray &data, size_t pos)
|
||||
QMap<int, int> IedEqNumberToDdsId; // iedEqNumber, ddsId
|
||||
|
||||
for (const auto &ied : ieds)
|
||||
IedEqNumberToDdsId.insert(ied.equipmentNumber(), ied.id());
|
||||
IedEqNumberToDdsId.insert(ied.equipmentNumber, ied.id);
|
||||
|
||||
TrainingAreaBase::DefinitionIed def;
|
||||
unsigned long eqNumber;
|
||||
@@ -252,18 +252,18 @@ void HandlerOcAesData::handleIedPositions(const QByteArray &data, size_t pos)
|
||||
{
|
||||
LtsUtils::get2Byte(data, pos, eqNumber);
|
||||
const GuezIedManagement::Ied &ied = ieds.value(IedEqNumberToDdsId.value(eqNumber));
|
||||
def.iedId(eqNumber);
|
||||
def.type(ied.type().underlying());
|
||||
def.tautWireTrigger(ied.tautWireTrigger());
|
||||
def.lightBarrierTrigger(ied.lightBarrierTrigger());
|
||||
def.switchTrigger(ied.switchTrigger());
|
||||
def.remoteTrigger(ied.remoteTrigger());
|
||||
def.explosiveForce(ied.explosiveForce());
|
||||
def.partyId(ied.partyId());
|
||||
def.tacticalState(ied.tacticalState().underlying());
|
||||
def.iedId = eqNumber;
|
||||
def.type = ied.type;
|
||||
def.tautWireTrigger = ied.tautWireTrigger;
|
||||
def.lightBarrierTrigger = ied.lightBarrierTrigger;
|
||||
def.switchTrigger = ied.switchTrigger;
|
||||
def.remoteTrigger = ied.remoteTrigger;
|
||||
def.explosiveForce = ied.explosiveForce;
|
||||
def.partyId = ied.partyId;
|
||||
def.tacticalState = ied.tacticalState;
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
def.position(relativeFromGeoPosition(x, y));
|
||||
def.position = relativeFromGeoPosition(x, y);
|
||||
|
||||
m_tabDts->publish(def);
|
||||
}
|
||||
@@ -278,11 +278,11 @@ Core::GeoPosition2D HandlerOcAesData::relativeFromGeoPosition(int x, int y)
|
||||
void HandlerOcAesData::onSpecificsExerciseChanged(const TrainingAreaBaseOC::SpecificsExercise &data, DataModification mod)
|
||||
{
|
||||
if (mod == DataModification::eAdded || mod == DataModification::eModified)
|
||||
m_utmCoord = LtsCoordTrans::UtmCoordinate::fromMgrs(QString::number(data.zone()) +
|
||||
QLatin1Char(data.band()) +
|
||||
QString::fromStdString(data.square()) +
|
||||
QString::number(data.northing()).rightJustified(7, QLatin1Char('0')) +
|
||||
QString::number(data.easting()).rightJustified(7, QLatin1Char('0')));
|
||||
m_utmCoord = LtsCoordTrans::UtmCoordinate::fromMgrs(QString::number(data.zone) +
|
||||
QLatin1Char(data.band) +
|
||||
QString::fromStdString(data.square) +
|
||||
QString::number(data.northing).rightJustified(7, QLatin1Char('0')) +
|
||||
QString::number(data.easting).rightJustified(7, QLatin1Char('0')));
|
||||
}
|
||||
|
||||
} // namespace OcSituationClient
|
||||
+32
-32
@@ -64,82 +64,82 @@ bool HandlerOcCentralAesData::init()
|
||||
m_aesDtc->nContaminations(
|
||||
[this](const AreaEffectSimulation::NContamination &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtNContamination);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtNContamination);
|
||||
});
|
||||
|
||||
m_aesDtc->bCContaminations(
|
||||
[this](const AreaEffectSimulation::BCContamination &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtBCContamination);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtBCContamination);
|
||||
});
|
||||
|
||||
m_aesDtc->explosionAreas(
|
||||
[this](const AreaEffectSimulation::ExplosionArea &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtExplosionArea);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtExplosionArea);
|
||||
});
|
||||
|
||||
m_aesDtc->explosionSingles(
|
||||
[this](const AreaEffectSimulation::ExplosionSingle &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtExplosionSingle);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtExplosionSingle);
|
||||
});
|
||||
|
||||
m_aesDtc->mineAreas(
|
||||
[this](const AreaEffectSimulation::MineArea &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtMineArea);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtMineArea);
|
||||
});
|
||||
|
||||
m_aesDtc->functionalAreas(
|
||||
[this](const AreaEffectSimulation::FunctionalArea &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtFunctionalArea);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtFunctionalArea);
|
||||
});
|
||||
|
||||
m_aesDtc->boobyTraps(
|
||||
[this](const AreaEffectSimulation::BoobyTrap &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtBoobyTrap);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtBoobyTrap);
|
||||
});
|
||||
|
||||
m_aesDtc->offRouteMines(
|
||||
[this](const AreaEffectSimulation::OffRouteMine &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtOffRouteMine);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtOffRouteMine);
|
||||
});
|
||||
|
||||
m_aesDtc->explosionClusters(
|
||||
[this](const AreaEffectSimulation::ExplosionCluster &data)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
return;
|
||||
|
||||
m_allCentralAesItems.insert(data.id(), AreaEffectSimulation::AesType::AtExplosionCluster);
|
||||
m_allCentralAesItems.insert(data.id, AreaEffectSimulation::AesType::AtExplosionCluster);
|
||||
});
|
||||
|
||||
connect(m_aesDtc.get(), &AreaEffectSimulation::Interface::Dtc::nContaminationChanged, this, &HandlerOcCentralAesData::onNContaminationChanged);
|
||||
@@ -185,8 +185,8 @@ void HandlerOcCentralAesData::process(const QByteArray &data, bool bIsInitial)
|
||||
LtsUtils::get1Byte(data, centralAesItemsOverloaded);
|
||||
|
||||
TrainingAreaBaseOC::CentralAesOverload centralAesOverload;
|
||||
centralAesOverload.id(1);
|
||||
centralAesOverload.hasOverload(centralAesItemsOverloaded);
|
||||
centralAesOverload.id = 1;
|
||||
centralAesOverload.hasOverload = centralAesItemsOverloaded;
|
||||
m_tabocDts->publish(centralAesOverload);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Central AesItems overloaded: " << centralAesItemsOverloaded;
|
||||
@@ -232,7 +232,7 @@ void HandlerOcCentralAesData::process(const QByteArray &data, bool bIsInitial)
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got AesType " << aesType;
|
||||
|
||||
switch (aesType.underlying())
|
||||
switch (aesType)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtUnknown:
|
||||
case AreaEffectSimulation::AesType::AtDangerArea:
|
||||
@@ -249,7 +249,7 @@ void HandlerOcCentralAesData::process(const QByteArray &data, bool bIsInitial)
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
|
||||
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
|
||||
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
|
||||
FATAL_LOG(m_logger) << "Got false AesType: " << aesType.underlying() << " --> aborting.";
|
||||
FATAL_LOG(m_logger) << "Got false AesType: " << aesType << " --> aborting.";
|
||||
return;
|
||||
case AreaEffectSimulation::AesType::AtNContamination:
|
||||
{
|
||||
@@ -335,7 +335,7 @@ void HandlerOcCentralAesData::process(const QByteArray &data, bool bIsInitial)
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "MineArea added/modified.";
|
||||
|
||||
mineArea.distance() = 0.5;
|
||||
mineArea.distance = 0.5;
|
||||
checkId(mineArea);
|
||||
|
||||
m_aesFtc->mineAreaModifyRequest(mineArea, this);
|
||||
@@ -505,7 +505,7 @@ void HandlerOcCentralAesData::tryRemoveAesItem(qint32 aesItemId, AreaEffectSimul
|
||||
{
|
||||
using namespace AreaEffectSimulation;
|
||||
|
||||
switch (aesType.underlying())
|
||||
switch (aesType)
|
||||
{
|
||||
case AesType::AtUnknown:
|
||||
case AesType::AtDangerArea:
|
||||
@@ -522,7 +522,7 @@ void HandlerOcCentralAesData::tryRemoveAesItem(qint32 aesItemId, AreaEffectSimul
|
||||
case AesType::AtExplosionSingleCentralTrajectory:
|
||||
case AesType::AtBoobyTrapSecondary:
|
||||
case AesType::AtOffRouteMineSecondary:
|
||||
WARNING_LOG(m_logger) << "Got false AesType: " << aesType.underlying() << " --> aborting.";
|
||||
WARNING_LOG(m_logger) << "Got false AesType: " << aesType << " --> aborting.";
|
||||
break;
|
||||
case AesType::AtNContamination:
|
||||
removeAesItem(aesItemId, &AreaEffectSimulation::Interface::Ftc::nContaminationRemoveRequest);
|
||||
@@ -582,18 +582,18 @@ void HandlerOcCentralAesData::onReply(const Core::FunctionReplyObject &reply) co
|
||||
|
||||
template <typename T> void HandlerOcCentralAesData::onAesItemChanged(const T &aesItem, DataModification modType, AreaEffectSimulation::AesType aesType)
|
||||
{
|
||||
if (!aesItem.isCentral())
|
||||
if (!aesItem.isCentral)
|
||||
return;
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
m_allCentralAesItems[aesItem.id()] = aesType;
|
||||
DEBUG_LOG(m_logger) << "Added new AES Item: id=" << aesItem.id() << ", type=" << aesType;
|
||||
m_allCentralAesItems[aesItem.id] = aesType;
|
||||
DEBUG_LOG(m_logger) << "Added new AES Item: id=" << aesItem.id << ", type=" << aesType;
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_allCentralAesItems.remove(aesItem.id());
|
||||
DEBUG_LOG(m_logger) << "Removed AES Item with id=" << aesItem.id();
|
||||
m_allCentralAesItems.remove(aesItem.id);
|
||||
DEBUG_LOG(m_logger) << "Removed AES Item with id=" << aesItem.id;
|
||||
break;
|
||||
case DataModification::eModified:
|
||||
default:
|
||||
@@ -603,8 +603,8 @@ template <typename T> void HandlerOcCentralAesData::onAesItemChanged(const T &ae
|
||||
|
||||
template <typename T> void HandlerOcCentralAesData::checkId(T &aesItem) const
|
||||
{
|
||||
if (!m_allCentralAesItems.contains(aesItem.id()))
|
||||
aesItem.id(aesItem.id() * -1);
|
||||
if (!m_allCentralAesItems.contains(aesItem.id))
|
||||
aesItem.id = aesItem.id * -1;
|
||||
}
|
||||
|
||||
void HandlerOcCentralAesData::removeAesItem(
|
||||
|
||||
@@ -252,7 +252,7 @@ void HandlerOcData::onOcDataChanged(const TrainingAreaBase::OcData &data, DataMo
|
||||
if ((modType != DataModification::eAdded) && (modType != DataModification::eModified))
|
||||
return;
|
||||
|
||||
QByteArray payload = LtsUtils::toQByteArray(data.payload());
|
||||
QByteArray payload = LtsUtils::toQByteArray(data.payload);
|
||||
unsigned int telegramId;
|
||||
|
||||
LtsUtils::get1Byte(payload, telegramId);
|
||||
@@ -309,10 +309,10 @@ void HandlerOcData::onTechnicalStateSfmChanged(const TrainingAreaBaseOC::Technic
|
||||
if ((modType != DataModification::eAdded) && (modType != DataModification::eModified))
|
||||
return;
|
||||
|
||||
if (m_licensed != data.licensed())
|
||||
if (m_licensed != data.licensed)
|
||||
{
|
||||
m_licensed = data.licensed();
|
||||
if (data.licensed())
|
||||
m_licensed = data.licensed;
|
||||
if (data.licensed)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Newly licensed -> demanding situation / sending messages";
|
||||
demandSituation(true);
|
||||
@@ -327,13 +327,13 @@ void HandlerOcData::onOwnPosition(const TrainingAreaBaseOC::OwnPosition &data, D
|
||||
return;
|
||||
|
||||
TrainingAreaBase::EquipmentPosition out;
|
||||
out.sampleTime(data.timeStamp());
|
||||
out.position().position(Core::GeoPosition(data.position().lon(), data.position().lat(), 0));
|
||||
if (data.moutObjectId().is_set())
|
||||
out.position().moutObjectId().set(data.moutObjectId().get());
|
||||
if (data.moutRoomId().is_set())
|
||||
out.position().moutRoomId().set(data.moutRoomId().get());
|
||||
out.equipmentNumber(m_tabocDtc->specificsEquipment(1).equipmentNumber());
|
||||
out.sampleTime = data.timeStamp;
|
||||
out.position.position(Core::GeoPosition(data.position.lon, data.position.lat, 0));
|
||||
if (data.moutObjectId.is_set())
|
||||
out.position.moutObjectId.set(data.moutObjectId.get());
|
||||
if (data.moutRoomId.is_set())
|
||||
out.position.moutRoomId.set(data.moutRoomId.get());
|
||||
out.equipmentNumber = m_tabocDtc->specificsEquipment(1).equipmentNumber;
|
||||
|
||||
m_tabDts->publish(out);
|
||||
}
|
||||
@@ -342,12 +342,12 @@ void HandlerOcData::onOperatorMessageChanged(const Messaging::OperatorMessage &d
|
||||
{
|
||||
if (DataModification::eRemoved == modType)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << data.recipientId() << "new message changed is send" << data.isSend() << " id" << data.id() ;
|
||||
const int ownEqNo = m_tabocDtc->specificsEquipment(1).equipmentNumber();
|
||||
if (data.recipientId() > 0)
|
||||
DEBUG_LOG(m_logger) << data.recipientId << "new message changed is send" << data.isSend << " id" << data.id ;
|
||||
const int ownEqNo = m_tabocDtc->specificsEquipment(1).equipmentNumber;
|
||||
if (data.recipientId > 0)
|
||||
{
|
||||
if (data.isSend() ||
|
||||
((data.recipientType() == Messaging::AddressType::ObserverController) && (data.recipientId() == getParticipantIdByEquipmentNumber(ownEqNo))))
|
||||
if (data.isSend ||
|
||||
((data.recipientType == Messaging::AddressType::ObserverController) && (data.recipientId == getParticipantIdByEquipmentNumber(ownEqNo))))
|
||||
return; // is already send or its a message we have received from TETRA
|
||||
}
|
||||
else
|
||||
@@ -358,37 +358,37 @@ void HandlerOcData::onOperatorMessageChanged(const Messaging::OperatorMessage &d
|
||||
QByteArray payload;
|
||||
|
||||
LtsUtils::set1Byte(OcSituation::TelegramId::Message, payload);
|
||||
if (data.recipientType() == Messaging::AddressType::Operator)
|
||||
LtsUtils::set2Byte(data.recipientId(), payload);
|
||||
if (data.recipientType == Messaging::AddressType::Operator)
|
||||
LtsUtils::set2Byte(data.recipientId, payload);
|
||||
else
|
||||
{
|
||||
const auto participantEqNo = m_ppmDtc->participant(data.recipientId()).equipmentNumber();
|
||||
const auto participantEqNo = m_ppmDtc->participant(data.recipientId).equipmentNumber;
|
||||
if (!participantEqNo.is_set())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Recipient with id " << data.recipientId() << " has no equipment number set - can not send message";
|
||||
WARNING_LOG(m_logger) << "Recipient with id " << data.recipientId << " has no equipment number set - can not send message";
|
||||
return;
|
||||
}
|
||||
LtsUtils::set2Byte(participantEqNo.get(), payload);
|
||||
}
|
||||
LtsUtils::set1Byte(data.recipientType().underlying(), payload);
|
||||
LtsUtils::set1Byte(data.recipientType, payload);
|
||||
|
||||
// always send with our own equipment number
|
||||
LtsUtils::set2Byte(ownEqNo, payload);
|
||||
LtsUtils::set1Byte(Messaging::AddressType::ObserverController, payload);
|
||||
LtsUtils::set2Byte(data.exerciseId(), payload);
|
||||
LtsUtils::set2Byte(data.exerciseId, payload);
|
||||
|
||||
payload.append(QByteArray::fromStdString(data.subject()));
|
||||
payload.append(QByteArray::fromStdString(data.subject));
|
||||
payload.append('\n'); // separating subject from message
|
||||
payload.append(QByteArray::fromStdString(data.message()));
|
||||
payload.append(QByteArray::fromStdString(data.message));
|
||||
|
||||
TrainingAreaBase::SendOcDataRequest out;
|
||||
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
|
||||
out.payload = LtsUtils::convert<std::vector<uint8_t>>(payload);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Sending operator message: " << data;
|
||||
|
||||
m_tabFtc->sendOcDataRequest(out, this);
|
||||
|
||||
m_msgFtc->modifyOperatorMessageRequest(Messaging::ModifyOperatorMessageRequest(data.id(), data.isRead(), true, data.isDeleted()), this);
|
||||
m_msgFtc->modifyOperatorMessageRequest(Messaging::ModifyOperatorMessageRequest(data.id, data.isRead, true, data.isDeleted), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,14 +401,14 @@ void HandlerOcData::onUserChanged(const OperatorManagement::User &data, DataModi
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION;
|
||||
|
||||
if (modType != DataModification::eModified || data.id() == 99) // id 99 = Organisator
|
||||
if (modType != DataModification::eModified || data.id == 99) // id 99 = Organisator
|
||||
return;
|
||||
|
||||
// on the abt there is only one user logged in, so if the workstation id of any
|
||||
// user changes, we remember the user. now we are able to see, if the user logs out
|
||||
if (data.workstationId() != 0)
|
||||
if (data.workstationId != 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "User " << data.name() << " logged in.";
|
||||
DEBUG_LOG(m_logger) << "User " << data.name << " logged in.";
|
||||
|
||||
m_user = data;
|
||||
|
||||
@@ -417,9 +417,9 @@ void HandlerOcData::onUserChanged(const OperatorManagement::User &data, DataModi
|
||||
|
||||
// if we get new information about the user we remembered and the workstation id is 0, the use is logged out
|
||||
// or all applications are closed. now we have to stop situation data (if already requested) and forget the user.
|
||||
if (m_user.id() == data.id() && data.workstationId() == 0)
|
||||
if (m_user.id == data.id && data.workstationId == 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "User " << m_user.name() << " logged out.";
|
||||
DEBUG_LOG(m_logger) << "User " << m_user.name << " logged out.";
|
||||
|
||||
if (m_centerEquipmentId > 0 || m_position.is_set())
|
||||
{
|
||||
@@ -441,7 +441,7 @@ void HandlerOcData::onUserChanged(const OperatorManagement::User &data, DataModi
|
||||
|
||||
void HandlerOcData::onSendDemandEvaluationSchemaRequest(const rti::core::SampleIdentity &cookie, const SendDemandEvaluationSchemaRequest &request)
|
||||
{
|
||||
demandEvaluationSchema(request.schemaId());
|
||||
demandEvaluationSchema(request.schemaId);
|
||||
|
||||
m_fts->sendDemandEvaluationSchemaReply(cookie, Core::FunctionReplyObject());
|
||||
}
|
||||
@@ -451,20 +451,20 @@ void HandlerOcData::onSendEvaluationRequest(const rti::core::SampleIdentity &coo
|
||||
QByteArray payload;
|
||||
|
||||
LtsUtils::set1Byte(OcSituation::TelegramId::Evaluation, payload);
|
||||
LtsUtils::set2Byte(request.schemaId(), payload);
|
||||
LtsUtils::set4Byte(request.senderOperatorId(), payload);
|
||||
if (request.receiverOperatorId().is_set())
|
||||
LtsUtils::set4Byte(request.receiverOperatorId().get(), payload);
|
||||
LtsUtils::set2Byte(request.schemaId, payload);
|
||||
LtsUtils::set4Byte(request.senderOperatorId, payload);
|
||||
if (request.receiverOperatorId.is_set())
|
||||
LtsUtils::set4Byte(request.receiverOperatorId.get(), payload);
|
||||
else
|
||||
LtsUtils::set4Byte(0, payload);
|
||||
LtsUtils::set8Byte(request.timeStamp(), payload);
|
||||
LtsUtils::set2Byte(request.hierarchy().size(), payload);
|
||||
payload.append(request.hierarchy().c_str(), request.hierarchy().size());
|
||||
LtsUtils::set2Byte(request.text().size(), payload);
|
||||
payload.append(request.text().c_str(), request.text().size());
|
||||
LtsUtils::set8Byte(request.timeStamp, payload);
|
||||
LtsUtils::set2Byte(request.hierarchy.size(), payload);
|
||||
payload.append(request.hierarchy.c_str(), request.hierarchy.size());
|
||||
LtsUtils::set2Byte(request.text.size(), payload);
|
||||
payload.append(request.text.c_str(), request.text.size());
|
||||
|
||||
TrainingAreaBase::SendOcDataRequest out;
|
||||
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
|
||||
out.payload = LtsUtils::convert<std::vector<uint8_t>>(payload);
|
||||
|
||||
m_tabFtc->sendOcDataRequest(out, this);
|
||||
|
||||
@@ -475,12 +475,12 @@ void HandlerOcData::onSendDemandSituationRequest(const rti::core::SampleIdentity
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New demand situation request from UI: " << request;
|
||||
|
||||
m_centerEquipmentId = request.centerEquipmentId();
|
||||
m_radius = request.radius();
|
||||
m_position = request.position();
|
||||
m_useFilter = request.filterActive();
|
||||
m_typeClassList = request.typeClassList();
|
||||
m_partyList = request.partyList();
|
||||
m_centerEquipmentId = request.centerEquipmentId;
|
||||
m_radius = request.radius;
|
||||
m_position = request.position;
|
||||
m_useFilter = request.filterActive;
|
||||
m_typeClassList = request.typeClassList;
|
||||
m_partyList = request.partyList;
|
||||
|
||||
demandSituation(true);
|
||||
|
||||
@@ -490,7 +490,7 @@ void HandlerOcData::onSendDemandSituationRequest(const rti::core::SampleIdentity
|
||||
void HandlerOcData::onSendEquipmentMessageOcRequest(const rti::core::SampleIdentity &cookie, const OcSituationServer::SendEquipmentMessageRequest &request)
|
||||
{
|
||||
// just answer so the messaging service does work normally, messages are send when received from DTC
|
||||
m_ossFts->sendEquipmentMessageOcReply(cookie, Core::FunctionReplyObject(request.requestId()));
|
||||
m_ossFts->sendEquipmentMessageOcReply(cookie, Core::FunctionReplyObject(request.requestId));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -499,22 +499,22 @@ void HandlerOcData::onSendEquipmentErrorRegistrationRequest(const rti::core::Sam
|
||||
QByteArray payload;
|
||||
|
||||
LtsUtils::set1Byte(OcSituation::TelegramId::EquipmentErrorRegistration, payload);
|
||||
LtsUtils::set2Byte(request.ocEquipmentNumber(), payload);
|
||||
LtsUtils::set2Byte(request.ocEquipmentNumber, payload);
|
||||
|
||||
QByteArray faultEquipmentNumber(QByteArray::fromStdString(request.faultEquipmentNumber()));
|
||||
QByteArray faultEquipmentNumber(QByteArray::fromStdString(request.faultEquipmentNumber));
|
||||
faultEquipmentNumber.resize(36); // see ICD
|
||||
payload.append(faultEquipmentNumber);
|
||||
QByteArray device(QByteArray::fromStdString(request.device()));
|
||||
QByteArray device(QByteArray::fromStdString(request.device));
|
||||
device.resize(36); // see ICD
|
||||
payload.append(device);
|
||||
QByteArray text(QByteArray::fromStdString(request.text()));
|
||||
QByteArray text(QByteArray::fromStdString(request.text));
|
||||
if (text.size() > 255)
|
||||
text.resize(255);
|
||||
LtsUtils::set1Byte(text.size(), payload);
|
||||
payload.append(text);
|
||||
|
||||
TrainingAreaBase::SendOcDataRequest out;
|
||||
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
|
||||
out.payload = LtsUtils::convert<std::vector<uint8_t>>(payload);
|
||||
m_tabFtc->sendOcDataRequest(out, this);
|
||||
|
||||
m_fts->sendEquipmentErrorRegistrationReply(cookie, Core::FunctionReplyObject());
|
||||
@@ -525,12 +525,12 @@ void HandlerOcData::onSendEquipmentRegistrationRequest(const rti::core::SampleId
|
||||
QByteArray payload;
|
||||
|
||||
LtsUtils::set1Byte(OcSituation::TelegramId::EquipmentRegistration, payload);
|
||||
LtsUtils::set2Byte(request.participantId(), payload);
|
||||
LtsUtils::set2Byte(request.equipmentNumber(), payload);
|
||||
LtsUtils::set2Byte(request.participantId, payload);
|
||||
LtsUtils::set2Byte(request.equipmentNumber, payload);
|
||||
|
||||
|
||||
TrainingAreaBase::SendOcDataRequest out;
|
||||
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
|
||||
out.payload = LtsUtils::convert<std::vector<uint8_t>>(payload);
|
||||
m_tabFtc->sendOcDataRequest(out, this);
|
||||
DEBUG_LOG(m_logger) << "try send out to OcData";
|
||||
|
||||
@@ -547,14 +547,14 @@ void HandlerOcData::demandEvaluationSchema(int schemaId)
|
||||
LtsUtils::set2Byte(schemaId, payload);
|
||||
|
||||
TrainingAreaBase::SendOcDataRequest out;
|
||||
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
|
||||
out.payload = LtsUtils::convert<std::vector<uint8_t>>(payload);
|
||||
|
||||
m_tabFtc->sendOcDataRequest(out, this);
|
||||
}
|
||||
|
||||
void HandlerOcData::demandSituation(bool initial)
|
||||
{
|
||||
if (!m_tabocDtc->technicalStateSfm(1).licensed())
|
||||
if (!m_tabocDtc->technicalStateSfm(1).licensed)
|
||||
return;
|
||||
|
||||
if (m_centerEquipmentId < -1)
|
||||
@@ -592,8 +592,8 @@ void HandlerOcData::demandSituation(bool initial)
|
||||
if (m_position.is_set())
|
||||
{
|
||||
LtsUtils::set1Byte(OcSituation::SituationCenterType::Position, payload);
|
||||
LtsUtils::set8Byte(m_position.get().lon(), payload);
|
||||
LtsUtils::set8Byte(m_position.get().lat(), payload);
|
||||
LtsUtils::set8Byte(m_position.get().lon, payload);
|
||||
LtsUtils::set8Byte(m_position.get().lat, payload);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -615,7 +615,7 @@ void HandlerOcData::demandSituation(bool initial)
|
||||
}
|
||||
|
||||
TrainingAreaBase::SendOcDataRequest out;
|
||||
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
|
||||
out.payload = LtsUtils::convert<std::vector<uint8_t>>(payload);
|
||||
|
||||
m_tabFtc->sendOcDataRequest(out, this);
|
||||
|
||||
@@ -635,7 +635,7 @@ void HandlerOcData::demandAesItems(OcSituation::AesType aesType)
|
||||
LtsUtils::set1Byte(aesType, payload);
|
||||
|
||||
TrainingAreaBase::SendOcDataRequest out;
|
||||
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
|
||||
out.payload = LtsUtils::convert<std::vector<uint8_t>>(payload);
|
||||
|
||||
m_tabFtc->sendOcDataRequest(out, this);
|
||||
}
|
||||
@@ -646,7 +646,7 @@ void HandlerOcData::sendNewMessages()
|
||||
|
||||
auto cb = [this](const Messaging::OperatorMessage & message)
|
||||
{
|
||||
if (message.recipientId() > 0 && !message.isSend())
|
||||
if (message.recipientId > 0 && !message.isSend)
|
||||
onOperatorMessageChanged(message, DataModification::eModified);
|
||||
};
|
||||
m_msgDtc->operatorMessages(cb);
|
||||
@@ -662,9 +662,9 @@ void HandlerOcData::handleMessage(const QByteArray &data)
|
||||
// get receiver
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
|
||||
int ownParticipantId = getParticipantIdByEquipmentNumber(m_tabocDtc->specificsEquipment(1).equipmentNumber());
|
||||
int ownParticipantId = getParticipantIdByEquipmentNumber(m_tabocDtc->specificsEquipment(1).equipmentNumber);
|
||||
if (ownParticipantId > 0)
|
||||
out.recipientIds().push_back(ownParticipantId);
|
||||
out.recipientIds.push_back(ownParticipantId);
|
||||
else
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Receiver invalid, do not publish message.";
|
||||
@@ -673,14 +673,14 @@ void HandlerOcData::handleMessage(const QByteArray &data)
|
||||
|
||||
// get address type
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
out.recipientType(Messaging::AddressType::ObserverController);
|
||||
out.recipientType = Messaging::AddressType::ObserverController;
|
||||
|
||||
// get sender
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
out.senderId(tmp);
|
||||
out.senderId = tmp;
|
||||
// get address type
|
||||
LtsUtils::get1Byte(data, pos, addressType);
|
||||
out.senderType(static_cast<Messaging::AddressType::inner_enum>(addressType));
|
||||
out.senderType = static_cast<Messaging::AddressType>(addressType);
|
||||
/*
|
||||
if (addressType == Messaging::AddressType::ObserverController)
|
||||
{
|
||||
@@ -698,19 +698,19 @@ void HandlerOcData::handleMessage(const QByteArray &data)
|
||||
*/
|
||||
//excerciseID
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
out.exerciseId(tmp);
|
||||
out.exerciseId = tmp;
|
||||
//text
|
||||
const QByteArray msg(data.right(data.size() - pos));
|
||||
int idx = msg.indexOf('\n');
|
||||
if (idx < 0)
|
||||
{
|
||||
out.subject((tr("Message from %1").arg(out.senderId())).toStdString());
|
||||
out.message(msg.constData());
|
||||
out.subject = (tr("Message from %1").arg(out.senderId)).toStdString();
|
||||
out.message = msg.constData();
|
||||
}
|
||||
else
|
||||
{
|
||||
out.subject(msg.left(idx).constData());
|
||||
out.message(msg.mid(idx + 1).constData());
|
||||
out.subject = msg.left(idx).constData();
|
||||
out.message = msg.mid(idx + 1).constData();
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got new message: " << out;
|
||||
@@ -726,12 +726,12 @@ void HandlerOcData::handleEvaluationSchema(const QByteArray &data)
|
||||
|
||||
// get schema id
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
out.id(static_cast<int>(tmp) * -1); // to mark as from oc
|
||||
out.id = static_cast<int>(tmp) * -1; // to mark as from oc
|
||||
// get schema string
|
||||
const QByteArray uncompressed = MainHandler::tryUncompress(data.mid(pos), true);
|
||||
out.schemadata(uncompressed.toStdString());
|
||||
out.schemadata = uncompressed.toStdString();
|
||||
// set sendToTa true
|
||||
out.sendToTa(true);
|
||||
out.sendToTa = true;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got new evaluation schema: ";
|
||||
|
||||
|
||||
+64
-64
@@ -95,7 +95,7 @@ void HandlerOcSituationData::process(const QByteArray &data, bool bIsInitial)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Processing initial situation data.";
|
||||
|
||||
int ownEquipmentNumber = m_tabocDtc->specificsEquipment(1).equipmentNumber();
|
||||
int ownEquipmentNumber = m_tabocDtc->specificsEquipment(1).equipmentNumber;
|
||||
int ownParticipantId = -1;
|
||||
for (const int &participantId : qAsConst(m_participantId2EqId))
|
||||
{
|
||||
@@ -133,14 +133,14 @@ void HandlerOcSituationData::process(const QByteArray &data, bool bIsInitial)
|
||||
void HandlerOcSituationData::removeAllPositions()
|
||||
{
|
||||
TrainingAreaBase::EquipmentPosition invalidPos;
|
||||
invalidPos.position().position().lon(nan(""));
|
||||
invalidPos.position().position().lat(nan(""));
|
||||
invalidPos.position().reportingSource(Core::PositionReportingSource::SetByOperator); // SetByOperator -> nan is allowed
|
||||
invalidPos.sampleTime(m_dds->currentPartitionTime());
|
||||
invalidPos.position.position.lon = nan("");
|
||||
invalidPos.position.position.lat = nan("");
|
||||
invalidPos.position.reportingSource = Core::PositionReportingSource::SetByOperator; // SetByOperator -> nan is allowed
|
||||
invalidPos.sampleTime = m_dds->currentPartitionTime();
|
||||
|
||||
for (const auto eqNumber : qAsConst(m_participantId2EqId))
|
||||
{
|
||||
invalidPos.equipmentNumber(eqNumber);
|
||||
invalidPos.equipmentNumber = eqNumber;
|
||||
m_tabDts->publish(invalidPos);
|
||||
}
|
||||
}
|
||||
@@ -148,11 +148,11 @@ void HandlerOcSituationData::removeAllPositions()
|
||||
void HandlerOcSituationData::setInvalidPositionForParticipant(int participantId)
|
||||
{
|
||||
TrainingAreaBase::EquipmentPosition invalidPos;
|
||||
invalidPos.position().position().lon(nan(""));
|
||||
invalidPos.position().position().lat(nan(""));
|
||||
invalidPos.position().reportingSource(Core::PositionReportingSource::SetByOperator); // SetByOperator -> nan is allowed
|
||||
invalidPos.sampleTime(m_dds->currentPartitionTime());
|
||||
invalidPos.equipmentNumber(-participantId); // negative -> treat equipNo as participantId
|
||||
invalidPos.position.position.lon = nan("");
|
||||
invalidPos.position.position.lat = nan("");
|
||||
invalidPos.position.reportingSource = Core::PositionReportingSource::SetByOperator; // SetByOperator -> nan is allowed
|
||||
invalidPos.sampleTime = m_dds->currentPartitionTime();
|
||||
invalidPos.equipmentNumber = -participantId; // negative -> treat equipNo as participantId
|
||||
m_tabDts->publish(invalidPos);
|
||||
}
|
||||
|
||||
@@ -187,8 +187,8 @@ bool HandlerOcSituationData::decodeSituationData(const QByteArray &data)
|
||||
LtsUtils::get1Byte(data, participantOverloaded);
|
||||
//send overload topic
|
||||
TrainingAreaBaseOC::ParticipantsOverload participantsOverload;
|
||||
participantsOverload.id(1);
|
||||
participantsOverload.hasOverload(participantOverloaded);
|
||||
participantsOverload.id = 1;
|
||||
participantsOverload.hasOverload = participantOverloaded;
|
||||
m_tabocDts->publish(participantsOverload);
|
||||
DEBUG_LOG(m_logger) << "publish overload: " << participantOverloaded;
|
||||
|
||||
@@ -233,7 +233,7 @@ bool HandlerOcSituationData::decodeSituationData(const QByteArray &data)
|
||||
// position
|
||||
bool bRet = false;
|
||||
TrainingAreaBase::EquipmentPosition position;
|
||||
position.position().reportingSource(Core::PositionReportingSource::Gps); // we don't know better
|
||||
position.position.reportingSource = Core::PositionReportingSource::Gps; // we don't know better
|
||||
bRet |= getPosition2D(uncompressed, pos, position, (modifiedFlag & OcSituation::ModificationFlag::ePosition2D) == OcSituation::ModificationFlag::ePosition2D);
|
||||
bRet |= getPosition3D(uncompressed, pos, position, (modifiedFlag & OcSituation::ModificationFlag::ePosition3D) == OcSituation::ModificationFlag::ePosition3D);
|
||||
if (bRet)
|
||||
@@ -274,22 +274,22 @@ bool HandlerOcSituationData::decodeSituationData(const QByteArray &data)
|
||||
bRet |= getSymbolSidc(uncompressed, pos, participantData, (modifiedFlag & OcSituation::ModificationFlag::eSymbol) == OcSituation::ModificationFlag::eSymbol);
|
||||
//sanity
|
||||
bool bInsane = false;
|
||||
if (bRet && (participantData.partyId() <= 0 || participantData.id() <= 0 || participantData.typeId() <= 0))
|
||||
if (bRet && (participantData.partyId <= 0 || participantData.id <= 0 || participantData.typeId <= 0))
|
||||
bInsane = true;
|
||||
|
||||
if (bRet && !bInsane)
|
||||
{
|
||||
int unitId = Settings::unitOffset() + participantData.partyId();
|
||||
if (participantData.id() == 0) // if new participant
|
||||
int unitId = Settings::unitOffset() + participantData.partyId;
|
||||
if (participantData.id == 0) // if new participant
|
||||
{
|
||||
participantData.id(participantId);
|
||||
participantData.modId(modId++);
|
||||
participantData.hierarchyNumber(participantId); // it just needs to be unqiue here
|
||||
participantData.id = participantId;
|
||||
participantData.modId = modId++;
|
||||
participantData.hierarchyNumber = participantId; // it just needs to be unqiue here
|
||||
}
|
||||
//always set superiorModId! changeing party Id only won't work
|
||||
participantData.superiorModId(unitId);
|
||||
participantData.superiorModId = unitId;
|
||||
|
||||
participantData.assignState(ParticipantManagement::ParticipantAssignState::HandoutExcon); // set always as we can deduce it anyway //TODO cant reasign EQ nr
|
||||
participantData.assignState = ParticipantManagement::ParticipantAssignState::HandoutExcon; // set always as we can deduce it anyway //TODO cant reasign EQ nr
|
||||
|
||||
if (!m_participantData.contains(unitId)) // Adding Unit to participantData, if not already added
|
||||
{
|
||||
@@ -300,14 +300,14 @@ bool HandlerOcSituationData::decodeSituationData(const QByteArray &data)
|
||||
m_participantData.insert(participantId, participantData);
|
||||
DEBUG_LOG(m_logger) << "Adding ParticipantData to internal map: " << participantData;
|
||||
|
||||
if (participantData.equipmentNumber().is_set())
|
||||
m_participantId2EqId[participantId] = participantData.equipmentNumber().get();
|
||||
if (participantData.equipmentNumber.is_set())
|
||||
m_participantId2EqId[participantId] = participantData.equipmentNumber.get();
|
||||
else
|
||||
m_participantId2EqId[participantId] = 0; // so the positions can be removed, see e.g. removeAllPositions()
|
||||
}
|
||||
|
||||
// no position update for ourself. Easier to filter here than in server but a bit overhead in TETRA
|
||||
if (m_tabocDtc->specificsEquipment(1).equipmentNumber() == m_participantId2EqId.value(participantId))
|
||||
if (m_tabocDtc->specificsEquipment(1).equipmentNumber == m_participantId2EqId.value(participantId))
|
||||
m_equipmentPositions.remove(participantId);
|
||||
}
|
||||
|
||||
@@ -344,10 +344,10 @@ void HandlerOcSituationData::publishMap(QMap<int, T> &map)
|
||||
{
|
||||
for (auto it = map.begin(); it != map.end();)
|
||||
{
|
||||
if (m_participants.value(it.key()).id() > 0) // publishing only for existing participants
|
||||
if (m_participants.value(it.key()).id > 0) // publishing only for existing participants
|
||||
{
|
||||
auto topic = it.value();
|
||||
topic.equipmentNumber(m_participantId2EqId.value(it.key()));
|
||||
topic.equipmentNumber = m_participantId2EqId.value(it.key());
|
||||
m_tabDts->publish(topic);
|
||||
it = map.erase(it);
|
||||
}
|
||||
@@ -382,10 +382,10 @@ bool HandlerOcSituationData::getPosition2D(const QByteArray &buf, size_t &pos, T
|
||||
// lon, lat, sampleTime
|
||||
double tmp;
|
||||
bRet &= LtsUtils::get8Byte(buf, pos, tmp);
|
||||
position.position().position().lon(tmp);
|
||||
position.position.position.lon = tmp;
|
||||
bRet &= LtsUtils::get8Byte(buf, pos, tmp);
|
||||
position.position().position().lat(tmp);
|
||||
position.sampleTime(m_dds->currentPartitionTime());
|
||||
position.position.position.lat = tmp;
|
||||
position.sampleTime = m_dds->currentPartitionTime();
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -404,15 +404,15 @@ bool HandlerOcSituationData::getPosition3D(const QByteArray &buf, size_t &pos, T
|
||||
int buildingId = -1;
|
||||
|
||||
bRet &= LtsUtils::get8Byte(buf, pos, tmp);
|
||||
position.position().position().z(tmp);
|
||||
position.position.position.z = tmp;
|
||||
bRet &= LtsUtils::get2Byte(buf, pos, buildingId);
|
||||
bRet &= LtsUtils::get4Byte(buf, pos, roomId);
|
||||
|
||||
if (buildingId > 0 && roomId > 0)
|
||||
{
|
||||
position.position().moutRoomId().set(roomId);
|
||||
position.position().moutObjectId().set(buildingId);
|
||||
position.position().reportingSource() = (tmp >= 0.0) ? Core::PositionReportingSource::Ops : Core::PositionReportingSource::OpsTunnel;
|
||||
position.position.moutRoomId.set(roomId);
|
||||
position.position.moutObjectId.set(buildingId);
|
||||
position.position.reportingSource = (tmp >= 0.0) ? Core::PositionReportingSource::Ops : Core::PositionReportingSource::OpsTunnel;
|
||||
}
|
||||
|
||||
|
||||
@@ -429,11 +429,11 @@ bool HandlerOcSituationData::getVBG(const QByteArray &buf, size_t &pos, Training
|
||||
// vulnerabilityState, vulnerabilityBits, originatorParty, sampleTime
|
||||
uint64_t tmp;
|
||||
bRet &= LtsUtils::get1Byte(buf, pos, tmp);
|
||||
equipmentState.vulnerabilityState(ProjectDataManagement::VulnerabilityState::inner_enum(tmp));
|
||||
equipmentState.vulnerabilityState = ProjectDataManagement::VulnerabilityState::inner_enum(tmp);
|
||||
bRet &= LtsUtils::get4Byte(buf, pos, tmp);
|
||||
equipmentState.vulnerabilityKindId(tmp);
|
||||
equipmentState.vulnerabilityKindId = tmp;
|
||||
bRet &= LtsUtils::get2Byte(buf, pos, tmp);
|
||||
equipmentState.vulnerabilityBits(tmp);
|
||||
equipmentState.vulnerabilityBits = tmp;
|
||||
bRet &= LtsUtils::get1Byte(buf, pos, tmp);
|
||||
if (!m_knownParties.contains(tmp))
|
||||
{
|
||||
@@ -443,32 +443,32 @@ bool HandlerOcSituationData::getVBG(const QByteArray &buf, size_t &pos, Training
|
||||
//Sollte nicht passieren, doch falls ja gibt es goldene Kreuze beim Ausfall
|
||||
tmp = 1;
|
||||
}
|
||||
equipmentState.originatorId(Settings::unitOffset() + tmp);
|
||||
equipmentState.originatorId = Settings::unitOffset() + tmp;
|
||||
|
||||
if (m_bWithVBGTime)
|
||||
{
|
||||
bRet &= LtsUtils::get4Byte(buf, pos, tmp);
|
||||
equipmentState.sampleTime(tmp * 1000UL);
|
||||
equipmentState.sampleTime = tmp * 1000UL;
|
||||
}
|
||||
else
|
||||
equipmentState.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
equipmentState.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
quint8 vitRest;
|
||||
bRet &= LtsUtils::get1Byte(buf, pos, vitRest);
|
||||
if (bRet)
|
||||
{
|
||||
int vit = (vitRest & 0x0F) * 10;
|
||||
equipmentState.vitality(vit);
|
||||
equipmentState.vitality = vit;
|
||||
TrainingAreaBase::SanitationResult result = static_cast<TrainingAreaBase::SanitationResult_def::type>(vitRest >> 4);
|
||||
sanitation.sanitationResult(result);
|
||||
sanitation.proceduresTaken(1);
|
||||
sanitation.qualification(TrainingAreaBase::Qualification::SANPers);
|
||||
sanitation.sanitationResult = result;
|
||||
sanitation.proceduresTaken = 1;
|
||||
sanitation.qualification = TrainingAreaBase::Qualification::SANPers;
|
||||
|
||||
}
|
||||
qint8 originator = 0;
|
||||
bRet &= LtsUtils::get1Byte(buf, pos, originator);
|
||||
if (bRet)
|
||||
equipmentState.originatorType(ProjectDataManagement::StateChangeOriginator::inner_enum(originator));
|
||||
equipmentState.originatorType = ProjectDataManagement::StateChangeOriginator::inner_enum(originator);
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -483,12 +483,12 @@ bool HandlerOcSituationData::getState(const QByteArray &buf, size_t &pos, Traini
|
||||
int tmp;
|
||||
bRet &= LtsUtils::get1Byte(buf, pos, tmp);
|
||||
|
||||
specialSensorData.sampleTime(m_dds->currentPartitionTime());
|
||||
specialSensorData.sampleTime = m_dds->currentPartitionTime();
|
||||
|
||||
equipmentOperationalState.nbcProtectionActive((tmp & 0x02) || (tmp & 0x04));
|
||||
equipmentOperationalState.isManipulation(tmp & 0x02);
|
||||
equipmentOperationalState.nbcProtectionActive = (tmp & 0x02) || (tmp & 0x04);
|
||||
equipmentOperationalState.isManipulation = tmp & 0x02;
|
||||
|
||||
equipmentOperationalState.sampleTime(m_dds->currentPartitionTime());
|
||||
equipmentOperationalState.sampleTime = m_dds->currentPartitionTime();
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -502,15 +502,15 @@ bool HandlerOcSituationData::getStructure(const QByteArray &buf, size_t &pos, Pa
|
||||
// equipmentNumber, typeId, partyId
|
||||
int tmp;
|
||||
bRet &= LtsUtils::get2Byte(buf, pos, tmp);
|
||||
participant.equipmentNumber(dds::core::optional<int32_t>(tmp));
|
||||
participant.equipmentNumber = dds::core::optional<int32_t>(tmp);
|
||||
bRet &= LtsUtils::get2Byte(buf, pos, tmp);
|
||||
participant.typeId(tmp);
|
||||
participant.typeId = tmp;
|
||||
bRet &= LtsUtils::get2Byte(buf, pos, tmp);
|
||||
if (m_knownParties.contains(tmp))
|
||||
participant.partyId(tmp);
|
||||
participant.partyId = tmp;
|
||||
else
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Not setting new party: " << tmp << " for participant: " << participant.id() << " as the party is unknown -> do a base download.";
|
||||
WARNING_LOG(m_logger) << "Not setting new party: " << tmp << " for participant: " << participant.id << " as the party is unknown -> do a base download.";
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
@@ -540,12 +540,12 @@ bool HandlerOcSituationData::getDesignator(const QByteArray &buf, size_t &pos, P
|
||||
if ((size_t)buf.size() < pos + len1)
|
||||
bRet = false;
|
||||
if (bRet)
|
||||
participant.designator(buf.mid(pos, len1).toStdString());
|
||||
participant.designator = buf.mid(pos, len1).toStdString();
|
||||
pos += len1;
|
||||
if ((size_t)buf.size() < pos + len2)
|
||||
bRet = false;
|
||||
if (bRet)
|
||||
participant.tacticalIdentifier(buf.mid(pos, len2).toStdString());
|
||||
participant.tacticalIdentifier = buf.mid(pos, len2).toStdString();
|
||||
pos += len2;
|
||||
|
||||
return bRet;
|
||||
@@ -562,14 +562,14 @@ bool HandlerOcSituationData::getSymbolSidc(const QByteArray &buf, size_t &pos, P
|
||||
if (len == 0)
|
||||
{
|
||||
// get symbol from type id
|
||||
const auto type = m_ppmDtc->type(participant.typeId());
|
||||
participant.symbol(type.symbol());
|
||||
const auto type = m_ppmDtc->type(participant.typeId);
|
||||
participant.symbol = type.symbol;
|
||||
return bRet;
|
||||
}
|
||||
if ((size_t)buf.size() < pos + len)
|
||||
bRet = false;
|
||||
if (bRet)
|
||||
participant.symbol(buf.mid(pos, len).toStdString());
|
||||
participant.symbol = buf.mid(pos, len).toStdString();
|
||||
pos += len;
|
||||
|
||||
return bRet;
|
||||
@@ -581,10 +581,10 @@ void HandlerOcSituationData::onPartyChanged(const ParticipantManagement::Party &
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_knownParties.insert(party.id());
|
||||
m_knownParties.insert(party.id);
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_knownParties.remove(party.id());
|
||||
m_knownParties.remove(party.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -595,13 +595,13 @@ void HandlerOcSituationData::onParticipantChanged(const ParticipantManagement::P
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_participants[participant.id()] = participant;
|
||||
m_participants[participant.id] = participant;
|
||||
// if there is a participant but it has (currently) no equipno, remove it from sitmap by setting invalid position
|
||||
if (!m_participantId2EqId.contains(participant.id()))
|
||||
setInvalidPositionForParticipant(participant.id());
|
||||
if (!m_participantId2EqId.contains(participant.id))
|
||||
setInvalidPositionForParticipant(participant.id);
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_participants.remove(participant.id());
|
||||
m_participants.remove(participant.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user