Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1718 files changed
+126739
-18495
No files matched your search
+187
-185
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "ppm_handler.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <utility>
|
||||
#include "Core/core.hpp"
|
||||
|
||||
@@ -22,6 +23,7 @@ static const int ADLER_NOT_OPERATIONAL = 127;
|
||||
PpmHandler::PpmHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_sendParticipantDataTimer(new QTimer(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -77,17 +79,17 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId,
|
||||
ParticipantManagement::Party requestParty;
|
||||
requestParty = m_dtcPpm->party(partyId);
|
||||
|
||||
QJsonObject origObj = QJsonDocument::fromJson(requestParty.properties().c_str()).object();
|
||||
QJsonObject origObj = QJsonDocument::fromJson(requestParty.properties.c_str()).object();
|
||||
|
||||
QJsonObject adlerPropertiesObj = origObj[QStringLiteral("Adler")].toObject();
|
||||
adlerPropertiesObj[QStringLiteral("saaConnectedState")] = connectState.underlying();
|
||||
adlerPropertiesObj[QStringLiteral("saaConnectedState")] = static_cast<int>(connectState);
|
||||
adlerPropertiesObj[QStringLiteral("szenarName")] = szenarName;
|
||||
adlerPropertiesObj[QStringLiteral("saaName")] = saaName;
|
||||
adlerPropertiesObj[QStringLiteral("wsId")] = wsId;
|
||||
adlerPropertiesObj[QStringLiteral("assetId")] = ((connectState == ParticipantManagement::ConnectState::Connected) ? assetId : -1);
|
||||
adlerPropertiesObj[QStringLiteral("isVerbund")] = isVerbund;
|
||||
|
||||
const QByteArray &propertiesBa = requestParty.properties().c_str();
|
||||
const QByteArray &propertiesBa = requestParty.properties.c_str();
|
||||
QJsonParseError parserError;
|
||||
QJsonDocument doc(QJsonDocument::fromJson(propertiesBa, &parserError));
|
||||
|
||||
@@ -103,7 +105,7 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId,
|
||||
obj[QStringLiteral("Adler")] = adlerPropertiesObj;
|
||||
|
||||
const QByteArray propertiesStr = QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
requestParty.properties() = propertiesStr.data();
|
||||
requestParty.properties = propertiesStr.data();
|
||||
|
||||
m_ftcPpm->modifyPartyDataRequest(requestParty);
|
||||
}
|
||||
@@ -145,13 +147,13 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId)
|
||||
int superiorModId = 1000000007;
|
||||
ParticipantManagement::Participant pUnit = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund());
|
||||
|
||||
if (pUdata.modId() > 0)
|
||||
if (pUdata.modId > 0)
|
||||
{
|
||||
m_sendParticipantDataTimer->start();
|
||||
return;
|
||||
}
|
||||
|
||||
if (pUnit.id() > 0)
|
||||
if (pUnit.id > 0)
|
||||
{
|
||||
|
||||
|
||||
@@ -171,38 +173,38 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId)
|
||||
{
|
||||
std::vector<ParticipantManagement::ParticipantData> list;
|
||||
|
||||
const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType.underlying()), true, saa->getIsVerbund());
|
||||
const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), true, saa->getIsVerbund());
|
||||
|
||||
|
||||
|
||||
|
||||
const auto root = findRootUnit(saa->getPartyId());
|
||||
if (root.id() > 0)
|
||||
if (root.id > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Append FS Unit to root Unit";
|
||||
list.push_back(root);
|
||||
}
|
||||
|
||||
ParticipantManagement::ParticipantData data = findParticipantDataByInternalName(rndNmbr, verein, saa->getIsVerbund());
|
||||
data.id(0);
|
||||
data.partyId(saa->getPartyId());
|
||||
data.externalId(0);
|
||||
data.hierarchyNumber(1);
|
||||
data.name(verein.toStdString());
|
||||
data.designator(verein.toStdString());
|
||||
data.symbol(unitType.symbol());
|
||||
data.tacticalIdentifier(verein.toStdString());
|
||||
data.typeId(unitType.id());
|
||||
data.modId(superiorModId);
|
||||
data.isDeleted(false);
|
||||
data.isSimulated(false);
|
||||
data.superiorModId(root.modId());
|
||||
data.id = 0;
|
||||
data.partyId = saa->getPartyId();
|
||||
data.externalId = 0;
|
||||
data.hierarchyNumber = 1;
|
||||
data.name = verein.toStdString();
|
||||
data.designator = verein.toStdString();
|
||||
data.symbol = unitType.symbol;
|
||||
data.tacticalIdentifier = verein.toStdString();
|
||||
data.typeId = unitType.id;
|
||||
data.modId = superiorModId;
|
||||
data.isDeleted = false;
|
||||
data.isSimulated = false;
|
||||
data.superiorModId = root.modId;
|
||||
|
||||
list.push_back(data);
|
||||
|
||||
ParticipantManagement::ModifyParticipantDataRequest newRequest;
|
||||
newRequest.requestId(rndNmbr);
|
||||
newRequest.data(list);
|
||||
newRequest.requestId = rndNmbr;
|
||||
newRequest.data = list;
|
||||
|
||||
|
||||
m_tempPartDataList.insert(rndNmbr, list);
|
||||
@@ -250,7 +252,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
|
||||
m_tempPositionMap.insert(currentRandomNumber, posMap);
|
||||
|
||||
if (pp.id() > 0)
|
||||
if (pp.id > 0)
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "Found Participant only update pos";
|
||||
@@ -266,9 +268,9 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
{
|
||||
|
||||
|
||||
const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType.underlying()), false, saa->getIsVerbund());
|
||||
DEBUG_LOG(m_logger) << "found type with id: " << type.id() << " for name: " << waffensystemtypMap.key(internalType);
|
||||
if (type.id() <= 0)
|
||||
const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), false, saa->getIsVerbund());
|
||||
DEBUG_LOG(m_logger) << "found type with id: " << type.id << " for name: " << waffensystemtypMap.key(internalType);
|
||||
if (type.id <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "NO Type Found";
|
||||
return;
|
||||
@@ -280,27 +282,27 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
uint superiorModId = QRandomGenerator::global()->generate() / 2;
|
||||
|
||||
ParticipantManagement::Participant pUnit = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund());
|
||||
DEBUG_LOG(m_logger) << "Looking for Verein: " << verein << " found Unit: " << pUnit.id() << " foundData: " << pUdata.modId();
|
||||
DEBUG_LOG(m_logger) << "Looking for Verein: " << verein << " found Unit: " << pUnit.id << " foundData: " << pUdata.modId;
|
||||
|
||||
if (pUdata.modId() > 0)
|
||||
if (pUdata.modId > 0)
|
||||
{
|
||||
superiorModId = pUdata.modId();
|
||||
superiorModId = pUdata.modId;
|
||||
DEBUG_LOG(m_logger) << "FOUND UNIT in list use their modId " << superiorModId << " RND: " << currentRandomNumber;
|
||||
}
|
||||
else if (pUnit.id() > 0)
|
||||
else if (pUnit.id > 0)
|
||||
{
|
||||
|
||||
ParticipantManagement::ParticipantData pUData = m_dtcPpm->convertParticipantToParticipantData(pUnit);
|
||||
pUData.modId(superiorModId);
|
||||
pUData.hierarchyNumber(1);
|
||||
pUData.modId = superiorModId;
|
||||
pUData.hierarchyNumber = 1;
|
||||
|
||||
list.push_back(pUData);
|
||||
m_tempPartDataList.insert(currentRandomNumber, list);
|
||||
DEBUG_LOG(m_logger) << "CREATE Uit from ppm " << superiorModId << " RND: " << currentRandomNumber;
|
||||
ParticipantManagement::Participant tmp = pUnit;
|
||||
while (tmp.superiorId() > 0)
|
||||
while (tmp.superiorId > 0)
|
||||
{
|
||||
tmp = m_dtcPpm->participant(tmp.superiorId());
|
||||
tmp = m_dtcPpm->participant(tmp.superiorId);
|
||||
pUData = m_dtcPpm->convertParticipantToParticipantData(tmp);
|
||||
list.push_back(pUData);
|
||||
}
|
||||
@@ -312,7 +314,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
|
||||
|
||||
const auto root = findRootUnit(saa->getPartyId());
|
||||
if (root.id() > 0)
|
||||
if (root.id > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Append to Unit" << superiorModId << " RND: " << currentRandomNumber;
|
||||
list.push_back(root);
|
||||
@@ -320,19 +322,19 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), true, saa->getIsVerbund());
|
||||
DEBUG_LOG(m_logger) << "CREATE NEW Unit use supId" << superiorModId << " RND: " << currentRandomNumber;
|
||||
ParticipantManagement::ParticipantData data;
|
||||
data.id(0);
|
||||
data.partyId(saa->getPartyId());
|
||||
data.externalId(0);
|
||||
data.hierarchyNumber(1);
|
||||
data.name(verein.toStdString());
|
||||
data.designator(verein.toStdString());
|
||||
data.symbol(unitType.symbol());
|
||||
data.tacticalIdentifier(verein.toStdString());
|
||||
data.typeId(unitType.id());
|
||||
data.modId(superiorModId);
|
||||
data.isDeleted(false);
|
||||
data.isSimulated(false);
|
||||
data.superiorModId(root.modId());
|
||||
data.id = 0;
|
||||
data.partyId = saa->getPartyId();
|
||||
data.externalId = 0;
|
||||
data.hierarchyNumber = 1;
|
||||
data.name = verein.toStdString();
|
||||
data.designator = verein.toStdString();
|
||||
data.symbol = unitType.symbol;
|
||||
data.tacticalIdentifier = verein.toStdString();
|
||||
data.typeId = unitType.id;
|
||||
data.modId = superiorModId;
|
||||
data.isDeleted = false;
|
||||
data.isSimulated = false;
|
||||
data.superiorModId = root.modId;
|
||||
|
||||
list.push_back(data);
|
||||
}
|
||||
@@ -342,19 +344,19 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
|
||||
ParticipantManagement::ParticipantData data;
|
||||
|
||||
data.id(0);
|
||||
data.partyId(saa->getPartyId());
|
||||
data.externalId(0);
|
||||
data.hierarchyNumber(list.size());
|
||||
data.name(waffensystemkennerMap.key(internalName).toStdString());
|
||||
data.designator(waffensystemkennerMap.key(internalName).toStdString());
|
||||
data.symbol(type.symbol());
|
||||
data.tacticalIdentifier(verein.toStdString());
|
||||
data.typeId(type.id());
|
||||
data.modId(QRandomGenerator::global()->generate() / 2);
|
||||
data.isDeleted(false);
|
||||
data.isSimulated(false);
|
||||
data.superiorModId(superiorModId);
|
||||
data.id = 0;
|
||||
data.partyId = saa->getPartyId();
|
||||
data.externalId = 0;
|
||||
data.hierarchyNumber = list.size();
|
||||
data.name = waffensystemkennerMap.key(internalName).toStdString();
|
||||
data.designator = waffensystemkennerMap.key(internalName).toStdString();
|
||||
data.symbol = type.symbol;
|
||||
data.tacticalIdentifier = verein.toStdString();
|
||||
data.typeId = type.id;
|
||||
data.modId = QRandomGenerator::global()->generate() / 2;
|
||||
data.isDeleted = false;
|
||||
data.isSimulated = false;
|
||||
data.superiorModId = superiorModId;
|
||||
|
||||
|
||||
list.push_back(data);
|
||||
@@ -392,7 +394,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
|
||||
|
||||
ParticipantManagement::Participant pp = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund());
|
||||
const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(QStringLiteral("LP"), false, saa->getIsVerbund());
|
||||
if (pp.id() > 0)
|
||||
if (pp.id > 0)
|
||||
{
|
||||
|
||||
sendPositionFromTempMap(rndNmbr, saa->getPartyId(), saa->getIsVerbund());
|
||||
@@ -416,7 +418,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
|
||||
|
||||
|
||||
const auto root = findRootUnit(saa->getPartyId());
|
||||
if (root.id() > 0)
|
||||
if (root.id > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Append LP to Unit";
|
||||
list.push_back(root);
|
||||
@@ -424,23 +426,23 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
|
||||
|
||||
ParticipantManagement::ParticipantData data;
|
||||
|
||||
data.id(0);
|
||||
data.partyId(saa->getPartyId());
|
||||
data.externalId(0);
|
||||
data.hierarchyNumber(1);
|
||||
data.name(verein.toStdString());
|
||||
data.designator(verein.toStdString());
|
||||
data.symbol(type.symbol());
|
||||
data.tacticalIdentifier(verein.toStdString());
|
||||
data.typeId(type.id());
|
||||
data.modId(1000000001);
|
||||
data.isDeleted(false);
|
||||
data.isSimulated(false);
|
||||
data.superiorModId(root.modId());
|
||||
data.id = 0;
|
||||
data.partyId = saa->getPartyId();
|
||||
data.externalId = 0;
|
||||
data.hierarchyNumber = 1;
|
||||
data.name = verein.toStdString();
|
||||
data.designator = verein.toStdString();
|
||||
data.symbol = type.symbol;
|
||||
data.tacticalIdentifier = verein.toStdString();
|
||||
data.typeId = type.id;
|
||||
data.modId = 1000000001;
|
||||
data.isDeleted = false;
|
||||
data.isSimulated = false;
|
||||
data.superiorModId = root.modId;
|
||||
ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest();
|
||||
newRequest->requestId(rndNmbr);
|
||||
newRequest->requestId = rndNmbr;
|
||||
list.push_back(data);
|
||||
newRequest->data(list);
|
||||
newRequest->data = list;
|
||||
|
||||
|
||||
m_tempPartDataList.insert(rndNmbr, list);
|
||||
@@ -459,18 +461,18 @@ void PpmHandler::removeAllSAAParticipants(const int partyId)
|
||||
std::vector<ParticipantManagement::ParticipantData> list;
|
||||
for (const auto &part : std::as_const(participants))
|
||||
{
|
||||
const ParticipantManagement::Type &participantType = m_dtcPpm->type(part.typeId());
|
||||
const ParticipantManagement::Type &participantType = m_dtcPpm->type(part.typeId);
|
||||
bool isUnitType
|
||||
= (participantType.typeClass() == ParticipantManagement::TypeClass::Unit) || (participantType.typeClass() == ParticipantManagement::TypeClass::SupportUnit);
|
||||
= (participantType.typeClass == ParticipantManagement::TypeClass::Unit) || (participantType.typeClass == ParticipantManagement::TypeClass::SupportUnit);
|
||||
if (isUnitType)
|
||||
continue;
|
||||
|
||||
ParticipantManagement::ParticipantData pToDel;
|
||||
pToDel.id() = part.id();
|
||||
pToDel.isDeleted() = true;
|
||||
pToDel.id = part.id;
|
||||
pToDel.isDeleted = true;
|
||||
list.push_back(pToDel);
|
||||
}
|
||||
req.data(list);
|
||||
req.data = list;
|
||||
DEBUG_LOG(m_logger) << "Remove all participants (without Units): " << list.size();
|
||||
m_ftcPpm->modifyParticipantDataRequest(req, this);
|
||||
}
|
||||
@@ -484,24 +486,24 @@ void PpmHandler::onCreateParticipant()
|
||||
{
|
||||
ParticipantManagement::ParticipantData data;
|
||||
|
||||
data.id(0);
|
||||
data.partyId(3);
|
||||
data.externalId(0);
|
||||
data.hierarchyNumber(1);
|
||||
data.name("Noah Thiering");
|
||||
data.designator("Hund");
|
||||
data.symbol("AP6D|CMPL|10011000001308000000");
|
||||
data.tacticalIdentifier("14");
|
||||
data.typeId(177);
|
||||
data.modId(1000000001);
|
||||
data.isDeleted(false);
|
||||
data.isSimulated(false);
|
||||
data.superiorModId(0);
|
||||
data.id = 0;
|
||||
data.partyId = 3;
|
||||
data.externalId = 0;
|
||||
data.hierarchyNumber = 1;
|
||||
data.name = "Noah Thiering";
|
||||
data.designator = "Hund";
|
||||
data.symbol = "AP6D|CMPL|10011000001308000000";
|
||||
data.tacticalIdentifier = "14";
|
||||
data.typeId = 177;
|
||||
data.modId = 1000000001;
|
||||
data.isDeleted = false;
|
||||
data.isSimulated = false;
|
||||
data.superiorModId = 0;
|
||||
ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest();
|
||||
newRequest->requestId(2);
|
||||
newRequest->requestId = 2;
|
||||
std::vector<ParticipantManagement::ParticipantData> liste;
|
||||
liste.push_back(data);
|
||||
newRequest->data(liste);
|
||||
newRequest->data = liste;
|
||||
|
||||
|
||||
|
||||
@@ -556,26 +558,26 @@ bool PpmHandler::isEqNumberInExercise(const int equipmentNumber) const
|
||||
|
||||
void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &participant, DataModification modType)
|
||||
{
|
||||
if (!participant.equipmentNumber().is_set())
|
||||
if (!participant.equipmentNumber.has_value())
|
||||
{
|
||||
for (auto it = m_participantIdsByEqNo.begin(); it != m_participantIdsByEqNo.end(); ++it)
|
||||
if (it.value() == participant.id())
|
||||
if (it.value() == participant.id)
|
||||
{
|
||||
m_participantIdsByEqNo.remove(it.key());
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (participant.externalId() > 0)
|
||||
if (participant.externalId > 0)
|
||||
return;
|
||||
|
||||
QJsonObject headerJson;
|
||||
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber().get();
|
||||
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber.get();
|
||||
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
m_participantIdsByEqNo.remove(participant.equipmentNumber().get());
|
||||
m_participantIdsByEqNo.remove(participant.equipmentNumber.get());
|
||||
QJsonObject telegram;
|
||||
QJsonObject data;
|
||||
data[QStringLiteral("header")] = headerJson;
|
||||
@@ -587,39 +589,39 @@ void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &
|
||||
|
||||
return;
|
||||
}
|
||||
if (m_participantIdsByEqNo.contains(participant.equipmentNumber().get()))
|
||||
if (m_participantIdsByEqNo.contains(participant.equipmentNumber.get()))
|
||||
{
|
||||
if (m_participantIdsByEqNo[participant.equipmentNumber().get()] != participant.id())
|
||||
if (m_participantIdsByEqNo[participant.equipmentNumber.get()] != participant.id)
|
||||
{
|
||||
for (auto it = m_participantIdsByEqNo.begin(); it != m_participantIdsByEqNo.end(); ++it)
|
||||
if (it.value() == participant.id())
|
||||
if (it.value() == participant.id)
|
||||
{
|
||||
m_participantIdsByEqNo.remove(it.key());
|
||||
break;
|
||||
}
|
||||
m_participantIdsByEqNo[participant.equipmentNumber().get()] = participant.id();
|
||||
m_participantIdsByEqNo[participant.equipmentNumber.get()] = participant.id;
|
||||
}
|
||||
}
|
||||
else
|
||||
m_participantIdsByEqNo[participant.equipmentNumber().get()] = participant.id();
|
||||
m_participantIdsByEqNo[participant.equipmentNumber.get()] = participant.id;
|
||||
|
||||
ParticipantManagement::DynamicParticipantData dynamicData = m_dtcPpm->dynamicParticipantData(participant.id());
|
||||
ParticipantManagement::Party party = m_dtcPpm->party(participant.partyId());
|
||||
ParticipantManagement::Type type = m_dtcPpm->type(participant.typeId());
|
||||
ParticipantManagement::ParticipantPosition partPos = m_dtcPpm->participantPosition(participant.id());
|
||||
ParticipantManagement::DynamicParticipantData dynamicData = m_dtcPpm->dynamicParticipantData(participant.id);
|
||||
ParticipantManagement::Party party = m_dtcPpm->party(participant.partyId);
|
||||
ParticipantManagement::Type type = m_dtcPpm->type(participant.typeId);
|
||||
ParticipantManagement::ParticipantPosition partPos = m_dtcPpm->participantPosition(participant.id);
|
||||
|
||||
QJsonObject telegram;
|
||||
|
||||
QJsonObject geoPositionObj;
|
||||
geoPositionObj[QStringLiteral("lon")] = partPos.pos().lon();
|
||||
geoPositionObj[QStringLiteral("lat")] = partPos.pos().lat();
|
||||
geoPositionObj[QStringLiteral("z")] = partPos.pos().z();
|
||||
geoPositionObj[QStringLiteral("lon")] = partPos.pos.lon;
|
||||
geoPositionObj[QStringLiteral("lat")] = partPos.pos.lat;
|
||||
geoPositionObj[QStringLiteral("z")] = partPos.pos.z;
|
||||
|
||||
QJsonObject data;
|
||||
data[QStringLiteral("header")] = headerJson;
|
||||
|
||||
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynamicData.stateHistory()).vulnerabilityState().underlying());
|
||||
data[QStringLiteral("forceIdentifier")] = static_cast<int>(party.hlaForceIdentifier().underlying());
|
||||
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynamicData.stateHistory).vulnerabilityState);
|
||||
data[QStringLiteral("forceIdentifier")] = static_cast<int>(party.hlaForceIdentifier);
|
||||
|
||||
data[QStringLiteral("geoPosition")] = geoPositionObj;
|
||||
telegram[QStringLiteral("data")] = data;
|
||||
@@ -633,7 +635,7 @@ void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::Parti
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
const bool participantIsExternal = m_dtcPpm->participant(position.participantId()).externalId() > 0;
|
||||
const bool participantIsExternal = m_dtcPpm->participant(position.participantId).externalId > 0;
|
||||
|
||||
if (participantIsExternal)
|
||||
{
|
||||
@@ -650,9 +652,9 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(dynPartData.participantId());
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(dynPartData.participantId);
|
||||
|
||||
if (part.externalId() > 0 || !part.equipmentNumber().is_set())
|
||||
if (part.externalId > 0 || !part.equipmentNumber.has_value())
|
||||
return;
|
||||
|
||||
QJsonObject telegram;
|
||||
@@ -660,13 +662,13 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
|
||||
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaVulnerabilityStateChanged");
|
||||
|
||||
QJsonObject headerJson;
|
||||
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber().get();
|
||||
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber.get();
|
||||
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
|
||||
QJsonObject data;
|
||||
data[QStringLiteral("header")] = headerJson;
|
||||
|
||||
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynPartData.stateHistory()).vulnerabilityState().underlying());
|
||||
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynPartData.stateHistory).vulnerabilityState);
|
||||
telegram[QStringLiteral("data")] = data;
|
||||
|
||||
emit participantChanged(telegram);
|
||||
@@ -679,57 +681,57 @@ void PpmHandler::onSendParticipantDataTimeout()
|
||||
ERROR_LOG(m_logger) << "Cant Send ParticipantData RandomNumbers is empty";
|
||||
ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest();
|
||||
int currentRandomNumber = m_randomNumbers.first();
|
||||
newRequest->requestId(currentRandomNumber);
|
||||
newRequest->data(m_tempPartDataList.value(currentRandomNumber));
|
||||
newRequest->requestId = currentRandomNumber;
|
||||
newRequest->data = m_tempPartDataList.value(currentRandomNumber);
|
||||
|
||||
m_ftcPpm->modifyParticipantDataRequest(*newRequest, this);
|
||||
}
|
||||
|
||||
void PpmHandler::handleParticipantPositionChangedExternal(const ParticipantManagement::ParticipantPosition &position)
|
||||
{
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId);
|
||||
|
||||
const bool participantPreviouslyMounted = m_mountedParticipants.contains(part.equipmentNumber().get());
|
||||
const bool participantPreviouslyMounted = m_mountedParticipants.contains(part.equipmentNumber.get());
|
||||
if (!participantPreviouslyMounted)
|
||||
return;
|
||||
const bool mountedOnOtherParticipant = position.mountedOn().is_set();
|
||||
const bool mountedOnOtherParticipant = position.mountedOn.has_value();
|
||||
if (!mountedOnOtherParticipant)
|
||||
{
|
||||
sendParticipantUnmount(part);
|
||||
return;
|
||||
}
|
||||
const bool newMountedParticipantIsExternal = m_dtcPpm->participant(position.mountedOn().get()).externalId() != 0;
|
||||
const bool newMountedParticipantIsExternal = m_dtcPpm->participant(position.mountedOn.get()).externalId != 0;
|
||||
if (newMountedParticipantIsExternal)
|
||||
{
|
||||
m_mountedParticipants.remove(part.equipmentNumber().get());
|
||||
m_mountedParticipants.remove(part.equipmentNumber.get());
|
||||
}
|
||||
}
|
||||
|
||||
void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "handleParticipantPositionChangedInternal";
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId);
|
||||
|
||||
const bool hasMountedParticipants = position.mountedParticipants().is_set() && position.mountedParticipants().get().size() > 0;
|
||||
const bool hasMountedParticipants = position.mountedParticipants.has_value() && position.mountedParticipants.get().size() > 0;
|
||||
if (hasMountedParticipants)
|
||||
{
|
||||
const QVector<int32_t> mountedParticipantIds(position.mountedParticipants().get().begin(), position.mountedParticipants().get().end());
|
||||
const QVector<int32_t> mountedParticipantIds(position.mountedParticipants.get().begin(), position.mountedParticipants.get().end());
|
||||
|
||||
for (int mountedParticipantId : std::as_const(mountedParticipantIds))
|
||||
{
|
||||
ParticipantManagement::Participant mountedParticipant = m_dtcPpm->participant(mountedParticipantId);
|
||||
const bool isExternal = mountedParticipant.externalId() > 0;
|
||||
const bool wasMountedOnThisPart = m_mountedParticipants.contains(mountedParticipant.equipmentNumber().get())
|
||||
&& m_mountedParticipants[mountedParticipant.equipmentNumber().get()] == part.equipmentNumber().get();
|
||||
const bool isExternal = mountedParticipant.externalId > 0;
|
||||
const bool wasMountedOnThisPart = m_mountedParticipants.contains(mountedParticipant.equipmentNumber.get())
|
||||
&& m_mountedParticipants[mountedParticipant.equipmentNumber.get()] == part.equipmentNumber.get();
|
||||
if (!isExternal || wasMountedOnThisPart)
|
||||
continue;
|
||||
|
||||
if (!part.equipmentNumber().is_set())
|
||||
if (!part.equipmentNumber.has_value())
|
||||
continue;
|
||||
sendParticipantMount(mountedParticipant, part);
|
||||
}
|
||||
|
||||
if (part.equipmentNumber().is_set())
|
||||
if (part.equipmentNumber.has_value())
|
||||
{
|
||||
sendParticipantPositionChanged(position);
|
||||
}
|
||||
@@ -738,19 +740,19 @@ void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManag
|
||||
|
||||
void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant &part, const ParticipantManagement::Participant &partToBeMounted)
|
||||
{
|
||||
m_mountedParticipants.insert(part.equipmentNumber().get(), partToBeMounted.equipmentNumber().get());
|
||||
m_mountedParticipants.insert(part.equipmentNumber.get(), partToBeMounted.equipmentNumber.get());
|
||||
ERROR_LOG(m_logger) << "Mount Participant";
|
||||
QJsonObject telegram;
|
||||
|
||||
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantMount");
|
||||
|
||||
QJsonObject headerJson;
|
||||
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber().get();
|
||||
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber.get();
|
||||
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
|
||||
QJsonObject data;
|
||||
data[QStringLiteral("header")] = headerJson;
|
||||
data[QStringLiteral("mountedOn")] = QJsonValue(partToBeMounted.equipmentNumber().get());
|
||||
data[QStringLiteral("mountedOn")] = QJsonValue(partToBeMounted.equipmentNumber.get());
|
||||
|
||||
telegram[QStringLiteral("data")] = data;
|
||||
emit participantMount(telegram);
|
||||
@@ -758,14 +760,14 @@ void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant &
|
||||
|
||||
void PpmHandler::sendParticipantUnmount(const ParticipantManagement::Participant &participant)
|
||||
{
|
||||
m_mountedParticipants.remove(participant.equipmentNumber().get());
|
||||
m_mountedParticipants.remove(participant.equipmentNumber.get());
|
||||
DEBUG_LOG(m_logger) << "Unmount Participant";
|
||||
QJsonObject telegram;
|
||||
|
||||
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantUnmount");
|
||||
|
||||
QJsonObject headerJson;
|
||||
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber().get();
|
||||
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber.get();
|
||||
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
|
||||
QJsonObject data;
|
||||
@@ -777,21 +779,21 @@ void PpmHandler::sendParticipantUnmount(const ParticipantManagement::Participant
|
||||
void PpmHandler::sendParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &position)
|
||||
{
|
||||
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId);
|
||||
|
||||
QJsonObject telegram;
|
||||
|
||||
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaPositionChanged");
|
||||
|
||||
QJsonObject headerJson;
|
||||
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber().get();
|
||||
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber.get();
|
||||
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
|
||||
QJsonObject data;
|
||||
data[QStringLiteral("header")] = headerJson;
|
||||
data[QStringLiteral("lon")] = position.pos().lon();
|
||||
data[QStringLiteral("lat")] = position.pos().lat();
|
||||
data[QStringLiteral("z")] = position.pos().z();
|
||||
data[QStringLiteral("lon")] = position.pos.lon;
|
||||
data[QStringLiteral("lat")] = position.pos.lat;
|
||||
data[QStringLiteral("z")] = position.pos.z;
|
||||
|
||||
telegram[QStringLiteral("data")] = data;
|
||||
|
||||
@@ -808,7 +810,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r
|
||||
if (!m_tempPartDataList.contains(reply.id()))
|
||||
return;
|
||||
|
||||
const int partyId = m_tempPartDataList.value(reply.id()).data()->partyId();
|
||||
const int partyId = m_tempPartDataList.value(reply.id()).data()->partyId;
|
||||
|
||||
if (!m_mainDispatcher->jsonDispatcher()->getSAAByParty(partyId))
|
||||
return;
|
||||
@@ -853,11 +855,11 @@ QList<ParticipantManagement::Participant> PpmHandler::findAllSAAParticipants(con
|
||||
const auto &list = m_dtcPpm->participants();
|
||||
for (const auto &part : std::as_const(list))
|
||||
{
|
||||
if (part.partyId() != partyId || part.isDeleted())
|
||||
if (part.partyId != partyId || part.isDeleted)
|
||||
continue;
|
||||
if (!m_dtcPpm->isArtilleryType(part.typeId()))
|
||||
if (!m_dtcPpm->isArtilleryType(part.typeId))
|
||||
continue;
|
||||
if (part.name().empty())
|
||||
if (part.name.empty())
|
||||
continue;
|
||||
ret.append(part);
|
||||
}
|
||||
@@ -872,10 +874,10 @@ ParticipantManagement::ParticipantData PpmHandler::findParticipantDataByInternal
|
||||
{
|
||||
for (const auto &part : m_tempPartDataList.value(randomNumber))
|
||||
{
|
||||
if (part.name() != internalName.toStdString())
|
||||
if (part.name != internalName.toStdString())
|
||||
continue;
|
||||
|
||||
if (m_dtcPpm->isAdlerVerbund(part.typeId()) != isVerbund)
|
||||
if (m_dtcPpm->isAdlerVerbund(part.typeId) != isVerbund)
|
||||
continue;
|
||||
|
||||
randomNumberInOut = randomNumber;
|
||||
@@ -891,13 +893,13 @@ ParticipantManagement::ParticipantData PpmHandler::findRootUnit(const int partyI
|
||||
const auto &list = m_dtcPpm->participants();
|
||||
for (const auto &part : std::as_const(list))
|
||||
{
|
||||
if (part.partyId() != partyId || part.isDeleted())
|
||||
if (part.partyId != partyId || part.isDeleted)
|
||||
continue;
|
||||
if (m_dtcPpm->type(part.typeId()).typeClass() != ParticipantManagement::TypeClass::Unit)
|
||||
if (m_dtcPpm->type(part.typeId).typeClass != ParticipantManagement::TypeClass::Unit)
|
||||
continue;
|
||||
if (m_dtcPpm->isArtilleryType(part.typeId()))
|
||||
if (m_dtcPpm->isArtilleryType(part.typeId))
|
||||
continue;
|
||||
if (part.superiorId() > 0)
|
||||
if (part.superiorId > 0)
|
||||
continue;
|
||||
ret = m_dtcPpm->convertParticipantToParticipantData(part);
|
||||
}
|
||||
@@ -912,15 +914,15 @@ ParticipantManagement::Participant PpmHandler::findParticipantByInternalName(con
|
||||
auto participantMap = m_dtcPpm->participants();
|
||||
for (const auto &part : std::as_const(participantMap))
|
||||
{
|
||||
if (part.partyId() != partyId || part.isDeleted())
|
||||
if (part.partyId != partyId || part.isDeleted)
|
||||
continue;
|
||||
|
||||
if (!m_dtcPpm->isArtilleryType(part.typeId()))
|
||||
if (!m_dtcPpm->isArtilleryType(part.typeId))
|
||||
continue;
|
||||
if (m_dtcPpm->isAdlerVerbund(part.typeId()) != isVerbund)
|
||||
if (m_dtcPpm->isAdlerVerbund(part.typeId) != isVerbund)
|
||||
continue;
|
||||
|
||||
if (part.name() != internalName.toStdString())
|
||||
if (part.name != internalName.toStdString())
|
||||
continue;
|
||||
|
||||
pp = part;
|
||||
@@ -936,14 +938,14 @@ void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataMo
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
const ParticipantManagement::ConnectState connectState = m_dtcPpm->saaConnectedState(data.id());
|
||||
const ParticipantManagement::ConnectState connectState = m_dtcPpm->saaConnectedState(data.id);
|
||||
DEBUG_LOG(m_logger) << "++++ connectState: " << connectState;
|
||||
|
||||
|
||||
if (connectState != ParticipantManagement::ConnectState::Disconnecting)
|
||||
return;
|
||||
|
||||
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByParty(data.id());
|
||||
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByParty(data.id);
|
||||
if (!saa)
|
||||
return;
|
||||
|
||||
@@ -952,7 +954,7 @@ void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataMo
|
||||
EXStatus status;
|
||||
status.status = Szenarstatus::Gestoppt;
|
||||
m_mainDispatcher->jsonDispatcher()->onSAAStatus(saa->getWsId(), status);
|
||||
m_mainDispatcher->jsonDispatcher()->onSAADeregistration(saa->getWsId(), data.id());
|
||||
m_mainDispatcher->jsonDispatcher()->onSAADeregistration(saa->getWsId(), data.id);
|
||||
}
|
||||
|
||||
void PpmHandler::sendPositionFromTempMap(int rndNmbr, const int partyId, const bool isVerbund)
|
||||
@@ -967,22 +969,22 @@ void PpmHandler::sendPositionFromTempMap(int rndNmbr, const int partyId, const b
|
||||
{
|
||||
it.next();
|
||||
ParticipantManagement::Participant pp = findParticipantByInternalName(it.key(), partyId, isVerbund);
|
||||
if (pp.id() <= 0)
|
||||
if (pp.id <= 0)
|
||||
return;
|
||||
|
||||
TrainingAreaBase::EquipmentPosition equipPosReq;
|
||||
Core::GeoPosition tlnPos;
|
||||
TrainingAreaBase::TabPosition tabPos;
|
||||
tlnPos.lat(it.value().koordinate.latitude * (M_PI / 180.0));
|
||||
tlnPos.lon(it.value().koordinate.longitude * (M_PI / 180.0));
|
||||
tlnPos.lat = it.value().koordinate.latitude * (M_PI / 180.0);
|
||||
tlnPos.lon = it.value().koordinate.longitude * (M_PI / 180.0);
|
||||
|
||||
|
||||
tabPos.position(tlnPos);
|
||||
tabPos.reportingSource(Core::PositionReportingSource::SetByOperator);
|
||||
tabPos.position = tlnPos;
|
||||
tabPos.reportingSource = Core::PositionReportingSource::SetByOperator;
|
||||
|
||||
equipPosReq.sampleTime(m_mainDispatcher->ddsHandler()->partitionTime());
|
||||
equipPosReq.position(tabPos);
|
||||
equipPosReq.equipmentNumber(-1 * pp.id());
|
||||
equipPosReq.sampleTime = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
equipPosReq.position = tabPos;
|
||||
equipPosReq.equipmentNumber = -1 * pp.id;
|
||||
|
||||
|
||||
m_mainDispatcher->ddsHandler()->dtsTab()->publish(equipPosReq);
|
||||
@@ -1015,18 +1017,18 @@ void PpmHandler::sendChargesFromTempMap(const int rndNmbr, const int partyId, co
|
||||
if (chargeTypeId <= 0)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "---- participant.id:" << participant.id() << (participant.typeId() == type.id() ? " (Ladeplatz)" : "");
|
||||
DEBUG_LOG(m_logger) << "---- participant.id:" << participant.id << (participant.typeId == type.id ? " (Ladeplatz)" : "");
|
||||
|
||||
QVector<int> gearTypesIds = m_mainDispatcher->pdmHandler()->getDtc()->gearTypeIdFromChargeTypeId(chargeTypeId);
|
||||
|
||||
gc.gearTypeId() = !gearTypesIds.isEmpty() ? gearTypesIds.first() : 0;
|
||||
gc.gearId(participant.id());
|
||||
gc.chargeTypeId(chargeTypeId);
|
||||
gc.remain() = c.anzahl;
|
||||
gearChargeState.charge().push_back(gc);
|
||||
gc.gearTypeId = !gearTypesIds.isEmpty() ? gearTypesIds.first() : 0;
|
||||
gc.gearId = participant.id;
|
||||
gc.chargeTypeId = chargeTypeId;
|
||||
gc.remain = c.anzahl;
|
||||
gearChargeState.charge.push_back(gc);
|
||||
}
|
||||
gearChargeState.sampleTime(m_mainDispatcher->ddsHandler()->partitionTime());
|
||||
gearChargeState.equipmentNumber(-1 * participant.id());
|
||||
gearChargeState.sampleTime = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
gearChargeState.equipmentNumber = -1 * participant.id;
|
||||
m_mainDispatcher->ddsHandler()->dtsTab()->publish(gearChargeState);
|
||||
}
|
||||
m_tempChargesMap.remove(rndNmbr);
|
||||
@@ -1040,9 +1042,9 @@ void PpmHandler::sendReadyMessageFromTempMap(int rndNmbr, const int partyId, con
|
||||
{
|
||||
ParticipantManagement::Participant participant = findParticipantByInternalName(readyMsg.first, partyId, isVerbund);
|
||||
TrainingAreaBase::SpecialSensorData ssData;
|
||||
ssData.sampleTime(m_mainDispatcher->ddsHandler()->partitionTime());
|
||||
ssData.operationalState(convertStatus_L28(readyMsg.second));
|
||||
ssData.equipmentNumber(-1 * participant.id());
|
||||
ssData.sampleTime = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
ssData.operationalState = convertStatus_L28(readyMsg.second);
|
||||
ssData.equipmentNumber = -1 * participant.id;
|
||||
m_mainDispatcher->ddsHandler()->dtsTab()->publish(ssData);
|
||||
}
|
||||
|
||||
@@ -1051,7 +1053,7 @@ void PpmHandler::sendReadyMessageFromTempMap(int rndNmbr, const int partyId, con
|
||||
|
||||
int PpmHandler::convertStatus_L28(const ProjectDataManagement::L28_Status &status)
|
||||
{
|
||||
switch (status.underlying())
|
||||
switch (status)
|
||||
{
|
||||
case ProjectDataManagement::L28_Status::Einsatzbereit:
|
||||
return ADLER_OPERATIONAL;
|
||||
|
||||
Reference in new issue
Block a user