Migrates Participant and OperatorManagement to generated rtiddsgen API
Converts accessor calls to plain member access in ppm and opm services and plugins.
This commit is contained in:
36 files changed
+513
-529
No files matched your search
+100
-100
@@ -38,7 +38,7 @@ bool DtcImplCustom::rootTemplates(QVector<TemplateParticipant> &templateVector)
|
||||
|
||||
for (const auto &sample : m_dtcTemplateParticipant->readAlive())
|
||||
{
|
||||
if (sample.data().superiorTemplateId() == 0)
|
||||
if (sample.data().superiorTemplateId == 0)
|
||||
templateVector.append(sample.data());
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ TemplateData DtcImplCustom::convertFromParticipantTemplateToTemplateData(const T
|
||||
TemplateBase &out = outputData;
|
||||
out = inputTemplate;
|
||||
// in cases where the ids are not updated by the treeModel
|
||||
outputData.modId(inputTemplate.templateId());
|
||||
outputData.superiorModId(inputTemplate.superiorTemplateId());
|
||||
outputData.modId = inputTemplate.templateId;
|
||||
outputData.superiorModId = inputTemplate.superiorTemplateId;
|
||||
|
||||
return outputData;
|
||||
}
|
||||
@@ -69,8 +69,8 @@ ParticipantData Interface::DtcImplCustom::convertParticipantToParticipantData(co
|
||||
ParticipantBase &out = outputData;
|
||||
out = inputParticipant;
|
||||
// in cases where the ids are not updated by the treeModel
|
||||
outputData.modId(inputParticipant.id());
|
||||
outputData.superiorModId(inputParticipant.superiorId());
|
||||
outputData.modId = inputParticipant.id;
|
||||
outputData.superiorModId = inputParticipant.superiorId;
|
||||
|
||||
return outputData;
|
||||
}
|
||||
@@ -104,14 +104,14 @@ QMap<int, Participant> DtcImplCustom::units() const
|
||||
QSet<int> unitTypeIds;
|
||||
for (const auto &sample : m_dtcType->readAlive())
|
||||
{
|
||||
if (sample.data().typeClass() == TypeClass::Unit || sample.data().typeClass() == TypeClass::SupportUnit)
|
||||
unitTypeIds.insert(sample.data().id());
|
||||
if (sample.data().typeClass == TypeClass::Unit || sample.data().typeClass == TypeClass::SupportUnit)
|
||||
unitTypeIds.insert(sample.data().id);
|
||||
}
|
||||
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (unitTypeIds.contains(sample.data().typeId()))
|
||||
ret.insert(sample.data().id(), sample.data());
|
||||
if (unitTypeIds.contains(sample.data().typeId))
|
||||
ret.insert(sample.data().id, sample.data());
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -120,11 +120,11 @@ QMap<int, Participant> DtcImplCustom::units() const
|
||||
bool DtcImplCustom::participantIdsByUnit(int unitId, const QMap<int, Participant> &participants, QSet<int> &participantIds)
|
||||
{
|
||||
const ParticipantManagement::Participant unit(participants.value(unitId));
|
||||
if (unit.id() != unitId)
|
||||
if (unit.id != unitId)
|
||||
return false;
|
||||
|
||||
const ParticipantManagement::Type unitType(type(unit.typeId()));
|
||||
if (unitType.typeClass() != ParticipantManagement::TypeClass::Unit && unitType.typeClass() != ParticipantManagement::TypeClass::SupportUnit)
|
||||
const ParticipantManagement::Type unitType(type(unit.typeId));
|
||||
if (unitType.typeClass != ParticipantManagement::TypeClass::Unit && unitType.typeClass != ParticipantManagement::TypeClass::SupportUnit)
|
||||
return false;
|
||||
|
||||
participantIds += recursiveInferiosForParticipant(unitId, participants);
|
||||
@@ -141,8 +141,8 @@ bool DtcImplCustom::visibleParties(QMap<int32_t, Party> &visibleParties, const Q
|
||||
|
||||
const bool bAll = (filter.size() == 1 && filter.first() == -1);
|
||||
for (const auto &sample : m_dtcParty->readAlive())
|
||||
if (bAll || filter.contains(sample.data().id()))
|
||||
visibleParties.insert(sample.data().id(), sample);
|
||||
if (bAll || filter.contains(sample.data().id))
|
||||
visibleParties.insert(sample.data().id, sample);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -161,11 +161,11 @@ bool DtcImplCustom::isEquipmentNumberInUse(int equipmentNumber, int &exerciseId)
|
||||
|
||||
for (const auto &sample : m_dtcEquipmentExerciseMapping->readAlive())
|
||||
{
|
||||
for (const Equipment2ParticipantId &e2p : sample.data().mapping())
|
||||
for (const Equipment2ParticipantId &e2p : sample.data().mapping)
|
||||
{
|
||||
if (e2p.equipmentNumber() == equipmentNumber)
|
||||
if (e2p.equipmentNumber == equipmentNumber)
|
||||
{
|
||||
exerciseId = sample.data().exerciseId();
|
||||
exerciseId = sample.data().exerciseId;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ bool DtcImplCustom::isTypeInUse(int typeId) const
|
||||
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (sample.data().typeId() == typeId)
|
||||
if (sample.data().typeId == typeId)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -193,8 +193,8 @@ int DtcImplCustom::participantIdByEquipmentNumber(int equipmentNumber) const
|
||||
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (sample.data().equipmentNumber().is_set() && sample.data().equipmentNumber().get() == equipmentNumber)
|
||||
return sample.data().id();
|
||||
if (sample.data().equipmentNumber.is_set() && sample.data().equipmentNumber.get() == equipmentNumber)
|
||||
return sample.data().id;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -207,10 +207,10 @@ int DtcImplCustom::equipmentNumberByParticipantId(int participantId) const
|
||||
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (sample.data().id() == participantId)
|
||||
if (sample.data().id == participantId)
|
||||
{
|
||||
if (sample.data().equipmentNumber().is_set())
|
||||
return sample.data().equipmentNumber().get();
|
||||
if (sample.data().equipmentNumber.is_set())
|
||||
return sample.data().equipmentNumber.get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,9 +231,9 @@ int DtcImplCustom::uasMissionIdByEquipmentNumber(int equipmentNumber) const
|
||||
}
|
||||
for (const auto &sample : m_dtcMissionPlan->readAlive())
|
||||
{
|
||||
if (sample.data().participantId() == participantId)
|
||||
if (sample.data().participantId == participantId)
|
||||
{
|
||||
return sample.data().id();
|
||||
return sample.data().id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,8 +247,8 @@ int DtcImplCustom::partyIdFromForceIdentifier(HlaForceIdentifierEnum inputForceI
|
||||
|
||||
for (const auto &sample : m_dtcParty->readAlive())
|
||||
{
|
||||
if (sample.data().hlaForceIdentifier() == inputForceIdentifier)
|
||||
return sample.data().id();
|
||||
if (sample.data().hlaForceIdentifier == inputForceIdentifier)
|
||||
return sample.data().id;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -268,16 +268,16 @@ ConnectState DtcImplCustom::saaConnectedState(const int partyId)
|
||||
|
||||
for (const auto &sample : m_dtcParty->readAlive())
|
||||
{
|
||||
if (partyId != sample.data().id())
|
||||
if (partyId != sample.data().id)
|
||||
continue;
|
||||
QJsonDocument doc = QJsonDocument::fromJson(QByteArray::fromStdString(sample.data().properties()));
|
||||
QJsonDocument doc = QJsonDocument::fromJson(QByteArray::fromStdString(sample.data().properties));
|
||||
QJsonObject prop = doc.object();
|
||||
QJsonObject propAdler;
|
||||
if (prop.contains(QStringLiteral("Adler")))
|
||||
{
|
||||
propAdler = prop[QStringLiteral("Adler")].toObject();
|
||||
if (propAdler.contains(QStringLiteral("saaConnectedState")))
|
||||
return static_cast<ConnectState::inner_enum>(propAdler[QStringLiteral("saaConnectedState")].toInt());
|
||||
return static_cast<ConnectState>(propAdler[QStringLiteral("saaConnectedState")].toInt());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@@ -291,8 +291,8 @@ QVector<int> DtcImplCustom::getSubordinatesByParticipant(const int participantId
|
||||
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (sample.data().superiorId() == participantId)
|
||||
result.append(sample.data().id());
|
||||
if (sample.data().superiorId == participantId)
|
||||
result.append(sample.data().id);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -317,8 +317,8 @@ QVector<int> DtcImplCustom::getParticipantsByPolygon(const QPolygonF &polygon, b
|
||||
}
|
||||
for (const auto &sample : m_dtcType->readAlive())
|
||||
{
|
||||
if (sample.data().typeClass() == TypeClass::Unit || sample.data().typeClass() == TypeClass::SupportUnit)
|
||||
unitTypeIds.insert(sample.data().id());
|
||||
if (sample.data().typeClass == TypeClass::Unit || sample.data().typeClass == TypeClass::SupportUnit)
|
||||
unitTypeIds.insert(sample.data().id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,17 +326,17 @@ QVector<int> DtcImplCustom::getParticipantsByPolygon(const QPolygonF &polygon, b
|
||||
|
||||
for (const auto ¤tPosition : m_dtcParticipantPosition->readAlive())
|
||||
{
|
||||
if (!includeUnits && unitTypeIds.contains(currentPosition.data().participantTypeId()))
|
||||
if (!includeUnits && unitTypeIds.contains(currentPosition.data().participantTypeId))
|
||||
continue;
|
||||
|
||||
if (!includeOc && currentPosition.data().partyId() == 1) // partyId 1 = OC
|
||||
if (!includeOc && currentPosition.data().partyId == 1) // partyId 1 = OC
|
||||
continue;
|
||||
|
||||
const Core::GeoPosition ¤tGeoPosition = currentPosition.data().pos();
|
||||
const QPointF positionPoint(currentGeoPosition.lon(), currentGeoPosition.lat());
|
||||
const Core::GeoPosition ¤tGeoPosition = currentPosition.data().pos;
|
||||
const QPointF positionPoint(currentGeoPosition.lon, currentGeoPosition.lat);
|
||||
|
||||
if (polygon.containsPoint(positionPoint, Qt::OddEvenFill))
|
||||
participantsInPolygon.append(currentPosition.data().participantId());
|
||||
participantsInPolygon.append(currentPosition.data().participantId);
|
||||
}
|
||||
|
||||
return participantsInPolygon;
|
||||
@@ -351,9 +351,9 @@ QVector<int> DtcImplCustom::getUasIds()
|
||||
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (isTypeUas(sample.data().typeId()))
|
||||
if (isTypeUas(sample.data().typeId))
|
||||
{
|
||||
result.append(sample.data().id());
|
||||
result.append(sample.data().id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,13 +363,13 @@ QVector<int> DtcImplCustom::getUasIds()
|
||||
UAS DtcImplCustom::getUasByParticipantId(int participantId, int exerciseId) const
|
||||
{
|
||||
ParticipantManagement::UAS uas;
|
||||
uas.id(-1); // if not found
|
||||
uas.id = -1; // if not found
|
||||
|
||||
for (const auto &sample : m_dtcUAS->readAlive())
|
||||
{
|
||||
if (sample.data().participantId() != participantId)
|
||||
if (sample.data().participantId != participantId)
|
||||
continue;
|
||||
if (sample.data().exerciseId() != exerciseId)
|
||||
if (sample.data().exerciseId != exerciseId)
|
||||
continue;
|
||||
uas = sample;
|
||||
break;
|
||||
@@ -380,20 +380,20 @@ UAS DtcImplCustom::getUasByParticipantId(int participantId, int exerciseId) cons
|
||||
MissionAction DtcImplCustom::currentMissionAction(int missionPlanId) const
|
||||
{
|
||||
ParticipantManagement::MissionAction missionAction;
|
||||
missionAction.planId(0); // default compare value in case nothing found
|
||||
missionAction.planId = 0; // default compare value in case nothing found
|
||||
for (const auto &sample : m_dtcMissionPlan->readAlive())
|
||||
{
|
||||
if (sample.data().id() != missionPlanId)
|
||||
if (sample.data().id != missionPlanId)
|
||||
continue;
|
||||
const std::vector<ParticipantManagement::MissionItem> &items = sample.data().items();
|
||||
const std::vector<ParticipantManagement::MissionItem> &items = sample.data().items;
|
||||
for (const auto &item : items)
|
||||
{
|
||||
if (item.fulfilled() > 0)
|
||||
if (item.fulfilled > 0)
|
||||
continue;
|
||||
const std::vector<ParticipantManagement::MissionAction> &actions = item.actions();
|
||||
const std::vector<ParticipantManagement::MissionAction> &actions = item.actions;
|
||||
for (const auto &action : actions)
|
||||
{
|
||||
if (action.fulfilled() > 0)
|
||||
if (action.fulfilled > 0)
|
||||
continue;
|
||||
return action;
|
||||
}
|
||||
@@ -406,11 +406,11 @@ ParticipantManagement::Participant DtcImplCustom::getParticipantByInternalName(i
|
||||
{
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (sample.data().partyId() != partyId)
|
||||
if (sample.data().partyId != partyId)
|
||||
continue;
|
||||
if (sample.data().isDeleted())
|
||||
if (sample.data().isDeleted)
|
||||
continue;
|
||||
if (sample.data().name() != unitName.toStdString())
|
||||
if (sample.data().name != unitName.toStdString())
|
||||
continue;
|
||||
// Found Unit
|
||||
|
||||
@@ -420,12 +420,12 @@ ParticipantManagement::Participant DtcImplCustom::getParticipantByInternalName(i
|
||||
return sample;
|
||||
}
|
||||
|
||||
for (auto inferiorId : sample.data().inferiorIds())
|
||||
for (auto inferiorId : sample.data().inferiorIds)
|
||||
{
|
||||
const auto &inferiorParticipant = m_participantCont.value(inferiorId);
|
||||
if (inferiorParticipant.id() <= 0 || inferiorParticipant.isDeleted())
|
||||
if (inferiorParticipant.id <= 0 || inferiorParticipant.isDeleted)
|
||||
continue;
|
||||
if (inferiorParticipant.name() == internalName.toStdString())
|
||||
if (inferiorParticipant.name == internalName.toStdString())
|
||||
return inferiorParticipant;
|
||||
}
|
||||
}
|
||||
@@ -442,7 +442,7 @@ QSet<int> DtcImplCustom::recursiveInferiosForParticipant(int32_t participantId,
|
||||
|
||||
result += participantId;
|
||||
const Participant &p = it.value();
|
||||
for (int childId : p.inferiorIds())
|
||||
for (int childId : p.inferiorIds)
|
||||
result += recursiveInferiosForParticipant(childId, participants);
|
||||
return result;
|
||||
}
|
||||
@@ -457,10 +457,10 @@ QString DtcImplCustom::lookUpHierachy(int participantId, const QMap<int, Partici
|
||||
return QString();
|
||||
const auto &part = itPart.value();
|
||||
|
||||
QString supStr = lookUpHierachy(part.superiorId(), participants);
|
||||
QString ret = QString::fromStdString(part.designator());
|
||||
QString supStr = lookUpHierachy(part.superiorId, participants);
|
||||
QString ret = QString::fromStdString(part.designator);
|
||||
// First separator is "./"
|
||||
if (part.superiorId() == 0)
|
||||
if (part.superiorId == 0)
|
||||
return (ret + QLatin1String("./"));
|
||||
|
||||
if (supStr.endsWith(QLatin1String("./")))
|
||||
@@ -476,10 +476,10 @@ QVector<TemplateParticipant> DtcImplCustom::inferiorTemplates(int templateId)
|
||||
const TemplateParticipant participant = templateParticipant(templateId);
|
||||
retVector.append(participant);
|
||||
|
||||
if (participant.inferiorIds().is_set())
|
||||
if (participant.inferiorIds.is_set())
|
||||
{
|
||||
retVector.reserve(participant.inferiorIds().get().size() + retVector.size());
|
||||
for (int inferiorId : participant.inferiorIds().get())
|
||||
retVector.reserve(participant.inferiorIds.get().size() + retVector.size());
|
||||
for (int inferiorId : participant.inferiorIds.get())
|
||||
retVector.append(inferiorTemplates(inferiorId));
|
||||
}
|
||||
|
||||
@@ -493,9 +493,9 @@ bool DtcImplCustom::isTypePatientSimulator(int typeId) const
|
||||
|
||||
for (const auto &sample : m_dtcParticipant->readAlive())
|
||||
{
|
||||
if (sample.data().typeId() == typeId)
|
||||
if (sample.data().typeId == typeId)
|
||||
{
|
||||
const std::string &str = sample.data().properties();
|
||||
const std::string &str = sample.data().properties;
|
||||
if (str.size() > 0 && getNeedsIp(str) && getNeedsPort(str))
|
||||
return true;
|
||||
else
|
||||
@@ -512,9 +512,9 @@ bool DtcImplCustom::isAdlerType(int typeId) const
|
||||
|
||||
for (const Type &type : m_dtcType->readAlive())
|
||||
{
|
||||
if (type.id() != typeId)
|
||||
if (type.id != typeId)
|
||||
continue;
|
||||
const auto &prob = type.properties();
|
||||
const auto &prob = type.properties;
|
||||
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(prob.c_str(), prob.size()));
|
||||
@@ -539,9 +539,9 @@ bool DtcImplCustom::isArtilleryType(int typeId) const
|
||||
|
||||
for (const Type &type : m_dtcType->readAlive())
|
||||
{
|
||||
if (type.id() != typeId)
|
||||
if (type.id != typeId)
|
||||
continue;
|
||||
const auto &prob = type.properties();
|
||||
const auto &prob = type.properties;
|
||||
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(prob.c_str(), prob.size()));
|
||||
@@ -566,9 +566,9 @@ bool DtcImplCustom::isEditable(int typeId) const
|
||||
|
||||
for (const Type &type : m_dtcType->readAlive())
|
||||
{
|
||||
if (type.id() != typeId)
|
||||
if (type.id != typeId)
|
||||
continue;
|
||||
const auto &prob = type.properties();
|
||||
const auto &prob = type.properties;
|
||||
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(prob.c_str(), prob.size()));
|
||||
@@ -593,9 +593,9 @@ bool DtcImplCustom::isAdlerVerbund(int typeId) const
|
||||
|
||||
for (const Type &type : m_dtcType->readAlive())
|
||||
{
|
||||
if (type.id() != typeId)
|
||||
if (type.id != typeId)
|
||||
continue;
|
||||
const auto &prob = type.properties();
|
||||
const auto &prob = type.properties;
|
||||
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(prob.c_str(), prob.size()));
|
||||
@@ -620,9 +620,9 @@ bool DtcImplCustom::isPartyAdlerVerbund(int partyId) const
|
||||
|
||||
for (const Party &party : m_dtcParty->readAlive())
|
||||
{
|
||||
if (party.id() != partyId)
|
||||
if (party.id != partyId)
|
||||
continue;
|
||||
const auto &prob = party.properties();
|
||||
const auto &prob = party.properties;
|
||||
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(prob.c_str(), prob.size()));
|
||||
@@ -654,11 +654,11 @@ Type DtcImplCustom::getTypeFromAdlerType(const QString &adlerTypeName, bool isUn
|
||||
|
||||
for (const Type &type : m_dtcType->readAlive())
|
||||
{
|
||||
if (isUnit && type.typeClass() != TypeClass::Unit)
|
||||
if (isUnit && type.typeClass != TypeClass::Unit)
|
||||
continue;
|
||||
if (!isUnit && type.typeClass() != TypeClass::WeaponSystem)
|
||||
if (!isUnit && type.typeClass != TypeClass::WeaponSystem)
|
||||
continue;
|
||||
const auto &prob = type.properties();
|
||||
const auto &prob = type.properties;
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(prob.c_str(), prob.size()));
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(props, &parserError));
|
||||
@@ -673,11 +673,11 @@ Type DtcImplCustom::getTypeFromAdlerType(const QString &adlerTypeName, bool isUn
|
||||
if (val.toString() != adlerTypeName)
|
||||
continue;
|
||||
|
||||
if (isAdlerVerbund(type.id()) != isVerbund)
|
||||
if (isAdlerVerbund(type.id) != isVerbund)
|
||||
continue;
|
||||
// Found exact Type
|
||||
DEBUG_LOG(m_logger) << "--- "
|
||||
<< "Found exact type --> typeId= " << type.id() << " ---";
|
||||
<< "Found exact type --> typeId= " << type.id << " ---";
|
||||
return type;
|
||||
}
|
||||
return ret;
|
||||
@@ -698,9 +698,9 @@ bool DtcImplCustom::isTypeUas(int typeId)
|
||||
for (const auto &sample : m_dtcType->readAlive())
|
||||
{
|
||||
// DEBUG_LOG(m_logger) << " sample equipmentTypeId=" << sample.data().equipmentTypeId();
|
||||
if (sample.data().id() == typeId)
|
||||
if (sample.data().id == typeId)
|
||||
{
|
||||
const std::string &str = sample.data().properties();
|
||||
const std::string &str = sample.data().properties;
|
||||
if (str.size() > 0 && getIsUAS(str))
|
||||
return true;
|
||||
else
|
||||
@@ -724,9 +724,9 @@ UAS DtcImplCustom::getUasByParticipantId(int participantId, int exerciseId)
|
||||
|
||||
for (const auto &sample : m_dtcUAS->readAlive())
|
||||
{
|
||||
if (sample.data().participantId() != participantId)
|
||||
if (sample.data().participantId != participantId)
|
||||
continue;
|
||||
if (sample.data().exerciseId() != exerciseId)
|
||||
if (sample.data().exerciseId != exerciseId)
|
||||
continue;
|
||||
return sample;
|
||||
}
|
||||
@@ -744,13 +744,13 @@ int DtcImplCustom::getParticipantFromPrf(int prf) const
|
||||
|
||||
for (const DynamicParticipantData &sample : m_dtcDynamicParticipantData->readAlive())
|
||||
{
|
||||
for (const auto &designation : qAsConst(sample.designations()))
|
||||
for (const auto &designation : qAsConst(sample.designations))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " code=" << designation.code();
|
||||
if (designation.code() == prf)
|
||||
DEBUG_LOG(m_logger) << " code=" << designation.code;
|
||||
if (designation.code == prf)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " return code=" << designation.code();
|
||||
return sample.participantId();
|
||||
DEBUG_LOG(m_logger) << " return code=" << designation.code;
|
||||
return sample.participantId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,16 +765,16 @@ int DtcImplCustom::getPrfFromParticipant(int participantId) const
|
||||
|
||||
for (const DynamicParticipantData &sample : m_dtcDynamicParticipantData->readAlive())
|
||||
{
|
||||
if (participantId == sample.participantId())
|
||||
if (participantId == sample.participantId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantId=" << sample.participantId() << " designations.size()=" << sample.designations().size();
|
||||
for (const auto &designation : qAsConst(sample.designations()))
|
||||
DEBUG_LOG(m_logger) << "participantId=" << sample.participantId << " designations.size()=" << sample.designations.size();
|
||||
for (const auto &designation : qAsConst(sample.designations))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " code=" << designation.code();
|
||||
if (designation.code() > 0)
|
||||
DEBUG_LOG(m_logger) << " code=" << designation.code;
|
||||
if (designation.code > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " return code=" << designation.code();
|
||||
return designation.code();
|
||||
DEBUG_LOG(m_logger) << " return code=" << designation.code;
|
||||
return designation.code;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
@@ -821,17 +821,17 @@ QMap<double, int> DtcImplCustom::sortByDistance(const double lon, const double l
|
||||
|
||||
for (const auto ¤tPosition : m_dtcParticipantPosition->readAlive())
|
||||
{
|
||||
if (participantIds.contains(currentPosition.data().participantId()))
|
||||
if (participantIds.contains(currentPosition.data().participantId))
|
||||
{
|
||||
auto pOrigin = LtsCoordTrans::UtmCoordinate::fromGeographic(lon, lat, zone);
|
||||
auto pPos = LtsCoordTrans::UtmCoordinate::fromGeographic(currentPosition.data().pos().lon(), currentPosition.data().pos().lat(), zone);
|
||||
auto pPos = LtsCoordTrans::UtmCoordinate::fromGeographic(currentPosition.data().pos.lon, currentPosition.data().pos.lat, zone);
|
||||
double distance = LtsCoordTrans::distance(pPos, pOrigin);
|
||||
DEBUG_LOG(m_logger) << distance;
|
||||
// Save distance and particiapnt Id into temporar map.
|
||||
// the map is sorted so we can use that later instead of writing a sort method vor a vec
|
||||
// for now
|
||||
distanceMapSorted.insert(distance, currentPosition.data().participantId());
|
||||
DEBUG_LOG(m_logger) << "insert distance=" << distance << ", participantId=" << currentPosition.data().participantId();
|
||||
distanceMapSorted.insert(distance, currentPosition.data().participantId);
|
||||
DEBUG_LOG(m_logger) << "insert distance=" << distance << ", participantId=" << currentPosition.data().participantId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user