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
+7
-6
@@ -41,6 +41,7 @@ ParticipantEdit::ParticipantEdit(LtsSession::LtsSession *session, bool asSupport
|
||||
, m_pbTreeViewDummy(new QPushButton(m_pbTreeView->text()))
|
||||
, m_pbTableViewDummy(new QPushButton(m_pbTableView->text()))
|
||||
, m_ui(new Ui::ParticipantEdit)
|
||||
, m_logger(getLogger("ParticipantEdit"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -318,7 +319,7 @@ void ParticipantEdit::onEnaDisa()
|
||||
bool enableRemove = false;
|
||||
if (m_pTreehandler->isSelectedIndexValid())
|
||||
{
|
||||
if (m_dtc->isAdlerVerbund(m_pTreehandler->getSelectedData().typeId()))
|
||||
if (m_dtc->isAdlerVerbund(m_pTreehandler->getSelectedData().typeId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Can't Edit Adler SAA Participants";
|
||||
enableEdit = true;
|
||||
@@ -349,8 +350,8 @@ void ParticipantEdit::onAddItem()
|
||||
ParticipantEditItem *newItemDlg = new ParticipantEditItem(m_asSupportService, m_session, this);
|
||||
ParticipantManagement::ParticipantData dataAll = m_pTreehandler->getSelectedData();
|
||||
ParticipantData data = ParticipantData();
|
||||
data.designator(dataAll.designator());
|
||||
data.tacticalIdentifier(dataAll.tacticalIdentifier());
|
||||
data.designator = dataAll.designator;
|
||||
data.tacticalIdentifier = dataAll.tacticalIdentifier;
|
||||
const bool addItem = true;
|
||||
newItemDlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
@@ -377,7 +378,7 @@ void ParticipantEdit::onAddItem()
|
||||
{
|
||||
|
||||
newItemDlg->setIsAdler(m_firingUnitValidator->isAdler(m_model, workingIndex));
|
||||
const int unitGearClassType = m_firingUnitValidator->getGearClassType(m_model, workingIndex);
|
||||
const int unitGearClassType = static_cast<int>(m_firingUnitValidator->getGearClassType(m_model, workingIndex));
|
||||
|
||||
newItemDlg->setFiringUnitRestrictions(m_model, false, m_firingUnitValidator->getRestrictions(m_model, workingIndex), m_firingUnitValidator, unitGearClassType);
|
||||
|
||||
@@ -403,7 +404,7 @@ void ParticipantEdit::onEditItem()
|
||||
return;
|
||||
|
||||
ParticipantManagement::ParticipantData data = m_pTreehandler->getSelectedData();
|
||||
if (data.isSimulated())
|
||||
if (data.isSimulated)
|
||||
showIsSimulated();
|
||||
|
||||
m_newItemDlg = new ParticipantEditItem(m_asSupportService, m_session, this);
|
||||
@@ -429,7 +430,7 @@ void ParticipantEdit::onEditItem()
|
||||
|
||||
if (m_firingUnitValidator)
|
||||
{
|
||||
const int unitGearClassType = m_firingUnitValidator->getGearClassType(m_model, workingIndex);
|
||||
const int unitGearClassType = static_cast<int>(m_firingUnitValidator->getGearClassType(m_model, workingIndex));
|
||||
m_newItemDlg->setFiringUnitRestrictions(m_model, true, m_firingUnitValidator->getRestrictions(m_model, workingIndex), m_firingUnitValidator, unitGearClassType);
|
||||
}
|
||||
|
||||
|
||||
+52
-52
@@ -30,7 +30,7 @@ ParticipantOrgaModel::ParticipantOrgaModel(PartyOrganisationType orgType,
|
||||
{
|
||||
connect(m_dtc.get(), &ParticipantManagement::Interface::Dtc::participantOrganisationChanged,
|
||||
this, &ParticipantOrgaModel::onParticipantOrganisationChanged);
|
||||
m_dtc->participantOrganisations([this](const ParticipantOrganisation &org) { m_participantOrganization[org.participantId()] = org;});
|
||||
m_dtc->participantOrganisations([this](const ParticipantOrganisation &org) { m_participantOrganization[org.participantId] = org;});
|
||||
}
|
||||
|
||||
QVariant ParticipantOrgaModel::data(const QModelIndex &index, int role) const
|
||||
@@ -45,10 +45,10 @@ QVariant ParticipantOrgaModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case ColDescription:
|
||||
return QVariant(QString::fromStdString(participantData.designator()) + QLatin1Char('/') +
|
||||
QString::fromStdString(participantData.tacticalIdentifier()));
|
||||
return QVariant(QString::fromStdString(participantData.designator) + QLatin1Char('/') +
|
||||
QString::fromStdString(participantData.tacticalIdentifier));
|
||||
case ColParticipantId:
|
||||
return participantData.id();
|
||||
return participantData.id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,17 +104,17 @@ QMimeData *ParticipantOrgaModel::mimeData(const QModelIndexList &indexes) const
|
||||
}
|
||||
|
||||
const ParticipantData data = privateData(idx)->data().value<ParticipantManagement::ParticipantData>();
|
||||
if (data.id() == 0)
|
||||
if (data.id == 0)
|
||||
return nullptr;
|
||||
if (m_orgType == PartyOrganisationType::Detached)
|
||||
{
|
||||
|
||||
auto it = m_participantOrganization.find(data.id());
|
||||
if (it != m_participantOrganization.end() && it.value().currentPartyId() != 0)
|
||||
auto it = m_participantOrganization.find(data.id);
|
||||
if (it != m_participantOrganization.end() && it.value().currentPartyId != 0)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const QByteArray encodedData(QByteArray::number(data.id()));
|
||||
const QByteArray encodedData(QByteArray::number(data.id));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
switch (m_orgType)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ bool ParticipantOrgaModel::canDropMimeData(const QMimeData *data, Qt::DropAction
|
||||
{
|
||||
auto it = m_participantOrganization.find(participantId);
|
||||
if (it != m_participantOrganization.end() &&
|
||||
it.value().originPartyId() == m_partyId)
|
||||
it.value().originPartyId == m_partyId)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -209,8 +209,8 @@ bool ParticipantOrgaModel::dropMimeData(const QMimeData *data, Qt::DropAction ac
|
||||
return false;
|
||||
}
|
||||
|
||||
movedParticipants[0].superiorId(0);
|
||||
movedParticipants[0].hierarchyNumber(1);
|
||||
movedParticipants[0].superiorId = 0;
|
||||
movedParticipants[0].hierarchyNumber = 1;
|
||||
int rootParticipantId = 0;
|
||||
NGLTreeItem *rootItem = m_rootItem;
|
||||
QModelIndex rootModelIndex;
|
||||
@@ -224,15 +224,15 @@ bool ParticipantOrgaModel::dropMimeData(const QMimeData *data, Qt::DropAction ac
|
||||
if (!item->data().canConvert<ParticipantManagement::ParticipantData>())
|
||||
return false;
|
||||
const ParticipantManagement::ParticipantData participantData = item->data().value<ParticipantManagement::ParticipantData>();
|
||||
if (participantData.id() == 0)
|
||||
if (participantData.id == 0)
|
||||
return false;
|
||||
|
||||
rootParticipantId = participantData.id();
|
||||
rootParticipantId = participantData.id;
|
||||
rootItem = item;
|
||||
rootModelIndex = parent;
|
||||
|
||||
movedParticipants[0].superiorId(rootParticipantId);
|
||||
movedParticipants[0].hierarchyNumber(-1);
|
||||
movedParticipants[0].superiorId = rootParticipantId;
|
||||
movedParticipants[0].hierarchyNumber = -1;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Drop: #movedParticipants: " << movedParticipants.size();
|
||||
@@ -244,20 +244,20 @@ bool ParticipantOrgaModel::dropMimeData(const QMimeData *data, Qt::DropAction ac
|
||||
|
||||
for (const Participant &part : std::as_const(movedParticipants))
|
||||
{
|
||||
if (part.isDeleted())
|
||||
if (part.isDeleted)
|
||||
continue;
|
||||
|
||||
|
||||
parentId2id[part.superiorId()] += part.id();
|
||||
parentId2id[part.superiorId] += part.id;
|
||||
|
||||
tmap.insert(part.id(), m_dtc->convertParticipantToParticipantData(part));
|
||||
tmap.insert(part.id, m_dtc->convertParticipantToParticipantData(part));
|
||||
}
|
||||
|
||||
|
||||
insertChildrenOf(rootParticipantId, rootItem, rootModelIndex, parentId2id, tmap);
|
||||
|
||||
|
||||
emit participantDataChanged(movedParticipants.at(0).id());
|
||||
emit participantDataChanged(movedParticipants.at(0).id);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ bool ParticipantOrgaModel::isParticipantType(int source_row, const QModelIndex &
|
||||
if (!childItem->data().canConvert<ParticipantManagement::ParticipantData>())
|
||||
return false;
|
||||
const ParticipantManagement::ParticipantData participantData = childItem->data().value<ParticipantManagement::ParticipantData>();
|
||||
return !isUnitType(participantData.typeId());
|
||||
return !isUnitType(participantData.typeId);
|
||||
}
|
||||
|
||||
QVector<Participant> ParticipantOrgaModel::inferiorParticipants(int partId) const
|
||||
@@ -283,9 +283,9 @@ QVector<Participant> ParticipantOrgaModel::inferiorParticipants(int partId) cons
|
||||
|
||||
const Participant participant = m_dtc->participant(partId);
|
||||
|
||||
retVector.reserve(participant.inferiorIds().size() + retVector.size() + 1);
|
||||
retVector.reserve(participant.inferiorIds.size() + retVector.size() + 1);
|
||||
retVector.append(participant);
|
||||
for (int inferiorId : participant.inferiorIds())
|
||||
for (int inferiorId : participant.inferiorIds)
|
||||
retVector.append(inferiorParticipants(inferiorId));
|
||||
|
||||
return retVector;
|
||||
@@ -298,14 +298,14 @@ QVector<ParticipantData> ParticipantOrgaModel::getChildrenOf(NGLTreeItem *parent
|
||||
return ret;
|
||||
|
||||
ParticipantManagement::ParticipantData participantData = parentItem->data().value<ParticipantManagement::ParticipantData>();
|
||||
participantData.superiorModId(parentId);
|
||||
participantData.hierarchyNumber(hierarchyNumber);
|
||||
if (participantData.modId() == 0)
|
||||
participantData.modId(++highestModId);
|
||||
participantData.superiorModId = parentId;
|
||||
participantData.hierarchyNumber = hierarchyNumber;
|
||||
if (participantData.modId == 0)
|
||||
participantData.modId = ++highestModId;
|
||||
ret += participantData;
|
||||
|
||||
for (int i = 0; i < parentItem->childCount(); i++)
|
||||
ret.append(getChildrenOf(parentItem->child(i), participantData.modId(), i + 1, highestModId));
|
||||
ret.append(getChildrenOf(parentItem->child(i), participantData.modId, i + 1, highestModId));
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ QVector<ParticipantData> ParticipantOrgaModel::participantData(int partyId) cons
|
||||
ret += getChildrenOf(rootKnot, 0, 1, modId);
|
||||
}
|
||||
for (int i = 0; i < ret.size(); ++i)
|
||||
ret[i].partyId(partyId);
|
||||
ret[i].partyId = partyId;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -335,9 +335,9 @@ QVector<int> ParticipantOrgaModel::rootParticipantIds() const
|
||||
const NGLTreeItem *rootKnot = m_rootItem->child(i);
|
||||
const ParticipantManagement::ParticipantData participantData = rootKnot->data().value<ParticipantManagement::ParticipantData>();
|
||||
|
||||
if (participantData.id() == 0)
|
||||
if (participantData.id == 0)
|
||||
continue;
|
||||
ret += participantData.id();
|
||||
ret += participantData.id;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -347,8 +347,8 @@ void ParticipantOrgaModel::onReinitModel(int partyId)
|
||||
{
|
||||
m_partyId = partyId;
|
||||
const ParticipantManagement::Party &party = m_dtc->party(m_partyId);
|
||||
m_partyRole = AdvancedSymbology::roleToRole<>(party.role());
|
||||
m_partyColor = QColor::fromRgb(QRgb(party.color()));
|
||||
m_partyRole = AdvancedSymbology::roleToRole<>(party.role);
|
||||
m_partyColor = QColor::fromRgb(QRgb(party.color));
|
||||
m_symbolResultMapping.clear();
|
||||
|
||||
NGLTreeModel::resetModel();
|
||||
@@ -357,19 +357,19 @@ void ParticipantOrgaModel::onReinitModel(int partyId)
|
||||
QHash<int, QSet<int>> parentId2id;
|
||||
auto cb = [this, &tmap, &parentId2id](const Participant & part)
|
||||
{
|
||||
if (part.isDeleted())
|
||||
if (part.isDeleted)
|
||||
return;
|
||||
if (m_orgType != PartyOrganisationType::Detached && part.partyId() != m_partyId)
|
||||
if (m_orgType != PartyOrganisationType::Detached && part.partyId != m_partyId)
|
||||
return;
|
||||
if (m_orgType == PartyOrganisationType::Detached && part.partyId() == m_partyId)
|
||||
if (m_orgType == PartyOrganisationType::Detached && part.partyId == m_partyId)
|
||||
return;
|
||||
if (part.superiorId() == 0 && !isRootParticipantRelevant(part, m_partyId))
|
||||
if (part.superiorId == 0 && !isRootParticipantRelevant(part, m_partyId))
|
||||
return;
|
||||
|
||||
|
||||
parentId2id[part.superiorId()] += part.id();
|
||||
parentId2id[part.superiorId] += part.id;
|
||||
|
||||
tmap.insert(part.id(), m_dtc->convertParticipantToParticipantData(part));
|
||||
tmap.insert(part.id, m_dtc->convertParticipantToParticipantData(part));
|
||||
};
|
||||
m_dtc->participants(cb);
|
||||
|
||||
@@ -383,10 +383,10 @@ void ParticipantOrgaModel::onParticipantOrganisationChanged(const ParticipantOrg
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_participantOrganization[data.participantId()] = data;
|
||||
m_participantOrganization[data.participantId] = data;
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_participantOrganization.remove(data.participantId());
|
||||
m_participantOrganization.remove(data.participantId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -410,9 +410,9 @@ void ParticipantOrgaModel::insertChildrenOf(int parentId,
|
||||
const ParticipantData &data = it.value();
|
||||
|
||||
int insertPos = 0;
|
||||
if (data.hierarchyNumber() > 0)
|
||||
if (data.hierarchyNumber > 0)
|
||||
{
|
||||
auto hierIt = currentHierachyNumbers.insert(data.hierarchyNumber(), data.hierarchyNumber());
|
||||
auto hierIt = currentHierachyNumbers.insert(data.hierarchyNumber, data.hierarchyNumber);
|
||||
insertPos = std::distance(currentHierachyNumbers.begin(), hierIt);
|
||||
}
|
||||
else
|
||||
@@ -424,11 +424,11 @@ void ParticipantOrgaModel::insertChildrenOf(int parentId,
|
||||
}
|
||||
|
||||
NGLTreeItem *childItem = createItem(QVariant::fromValue(data), QIcon());
|
||||
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
|
||||
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id << ", " << data.hierarchyNumber
|
||||
<< ") to parent " << parent << " at pos " << insertPos;
|
||||
insertRow(insertPos, parentIdx, childItem);
|
||||
const QModelIndex childIdx = index(insertPos, 0, parentIdx);
|
||||
insertChildrenOf(data.id(), childItem, childIdx, parentId2id, tmap);
|
||||
insertChildrenOf(data.id, childItem, childIdx, parentId2id, tmap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,20 +452,20 @@ QString ParticipantOrgaModel::headerFromOrganisationType(PartyOrganisationType o
|
||||
bool ParticipantOrgaModel::isRootParticipantRelevant(const Participant &participant, int partyId) const
|
||||
{
|
||||
|
||||
const int participantId = participant.id();
|
||||
const int participantPartyId = participant.partyId();
|
||||
const int participantId = participant.id;
|
||||
const int participantPartyId = participant.partyId;
|
||||
const ParticipantOrganisation org = m_participantOrganization.value(participantId);
|
||||
|
||||
switch (m_orgType)
|
||||
{
|
||||
case PartyOrganisationType::Party:
|
||||
return participantPartyId == partyId && org.participantId() == 0;
|
||||
return participantPartyId == partyId && org.participantId == 0;
|
||||
case PartyOrganisationType::Attached:
|
||||
return participantPartyId == partyId && org.participantId() == participantId && org.isAttached();
|
||||
return participantPartyId == partyId && org.participantId == participantId && org.isAttached;
|
||||
case PartyOrganisationType::Detached:
|
||||
return org.participantId() == participantId && org.originPartyId() == partyId;
|
||||
return org.participantId == participantId && org.originPartyId == partyId;
|
||||
case PartyOrganisationType::Cooperate:
|
||||
return participantPartyId == partyId && org.participantId() == participantId && org.isCooperate();
|
||||
return participantPartyId == partyId && org.participantId == participantId && org.isCooperate;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -474,11 +474,11 @@ NGLTreeItem *ParticipantOrgaModel::createItem(const QVariant &data, const QIcon
|
||||
{
|
||||
auto ret = NGLTreeModel::createItem(data, icon);
|
||||
const ParticipantData participantData = data.value<ParticipantData>();
|
||||
if (participantData.symbol().size() != 0)
|
||||
if (participantData.symbol.size() != 0)
|
||||
{
|
||||
ParticipantOrgaModel *that = const_cast<ParticipantOrgaModel*>(this);
|
||||
|
||||
that->tryRenderSymbol(QString::fromStdString(participantData.symbol()), ret);
|
||||
that->tryRenderSymbol(QString::fromStdString(participantData.symbol), ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
#include <ParticipantManagement/Gui/Common/participant_icon_model_base.h>
|
||||
#include <ParticipantManagement/logger.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
|
||||
#include <QtCore/QSortFilterProxyModel>
|
||||
#include <QtCore/QSet>
|
||||
|
||||
+33
-31
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "participant_organisation.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_participant_organisation.h"
|
||||
|
||||
#include "participant_unit_namer.h"
|
||||
@@ -38,6 +39,7 @@ ParticipantOrganisationDialog::ParticipantOrganisationDialog(LtsSession::LtsSess
|
||||
, m_session(session)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_ui(new Ui::ParticipantOrganisation)
|
||||
, m_logger(getLogger("ParticipantOrganisation"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->splitter->setStretchFactor(0, 1);
|
||||
@@ -232,16 +234,16 @@ void ParticipantOrganisationDialog::onPoolParticipantsChanged(const QVector<Part
|
||||
return;
|
||||
|
||||
ModifyParticipantDataRequest req;
|
||||
req.data(LtsUtils::convert<std::vector<ParticipantData>>(participants));
|
||||
req.data = LtsUtils::convert<std::vector<ParticipantData>>(participants);
|
||||
|
||||
if (originatorMimeType == ParticipantPartyAttached)
|
||||
{
|
||||
ParticipantOrganisation orga;
|
||||
orga.participantId(participants.first().id());
|
||||
orga.currentPartyId(0);
|
||||
orga.isAttached(false);
|
||||
orga.isCooperate(false);
|
||||
req.participantOrganisation(orga);
|
||||
orga.participantId = participants.first().id;
|
||||
orga.currentPartyId = 0;
|
||||
orga.isAttached = false;
|
||||
orga.isCooperate = false;
|
||||
req.participantOrganisation = orga;
|
||||
}
|
||||
|
||||
saveParticipantData(req);
|
||||
@@ -264,14 +266,14 @@ void ParticipantOrganisationDialog::onPartyParticipantsChanged(int addedParticip
|
||||
|
||||
|
||||
ParticipantOrganisation orga;
|
||||
orga.participantId(addedParticipantId);
|
||||
orga.originPartyId(curPartyId);
|
||||
orga.currentPartyId(curPartyId);
|
||||
req.participantOrganisation(orga);
|
||||
orga.participantId = addedParticipantId;
|
||||
orga.originPartyId = curPartyId;
|
||||
orga.currentPartyId = curPartyId;
|
||||
req.participantOrganisation = orga;
|
||||
}
|
||||
|
||||
const QVector<ParticipantData> participantData = m_partyModel->participantData(curPartyId);
|
||||
req.data(LtsUtils::convert<std::vector<ParticipantData>>(participantData));
|
||||
req.data = LtsUtils::convert<std::vector<ParticipantData>>(participantData);
|
||||
|
||||
saveParticipantData(req);
|
||||
}
|
||||
@@ -284,14 +286,14 @@ void ParticipantOrganisationDialog::onAttachedParticipantsChanged(int addedParti
|
||||
|
||||
ModifyParticipantDataRequest req;
|
||||
ParticipantOrganisation orga;
|
||||
orga.participantId(addedParticipantId);
|
||||
orga.currentPartyId(curPartyId);
|
||||
orga.isAttached(true);
|
||||
orga.isCooperate(false);
|
||||
req.participantOrganisation(orga);
|
||||
orga.participantId = addedParticipantId;
|
||||
orga.currentPartyId = curPartyId;
|
||||
orga.isAttached = true;
|
||||
orga.isCooperate = false;
|
||||
req.participantOrganisation = orga;
|
||||
|
||||
const QVector<ParticipantData> attachedtData = m_attachedModel->participantData(curPartyId);
|
||||
req.data(LtsUtils::convert<std::vector<ParticipantData>>(attachedtData));
|
||||
req.data = LtsUtils::convert<std::vector<ParticipantData>>(attachedtData);
|
||||
|
||||
saveParticipantData(req);
|
||||
}
|
||||
@@ -304,14 +306,14 @@ void ParticipantOrganisationDialog::onDetachedParticipantsChanged(int addedParti
|
||||
|
||||
ModifyParticipantDataRequest req;
|
||||
ParticipantOrganisation orga;
|
||||
orga.participantId(addedParticipantId);
|
||||
orga.originPartyId(curPartyId);
|
||||
orga.currentPartyId(0);
|
||||
req.participantOrganisation(orga);
|
||||
orga.participantId = addedParticipantId;
|
||||
orga.originPartyId = curPartyId;
|
||||
orga.currentPartyId = 0;
|
||||
req.participantOrganisation = orga;
|
||||
|
||||
const QVector<ParticipantData> participantData = m_partyModel->participantData(curPartyId);
|
||||
const QVector<ParticipantData> detachedtData = m_detachedModel->participantData(0);
|
||||
req.data(LtsUtils::convert<std::vector<ParticipantData>>(participantData + detachedtData));
|
||||
req.data = LtsUtils::convert<std::vector<ParticipantData>>(participantData + detachedtData);
|
||||
|
||||
saveParticipantData(req);
|
||||
}
|
||||
@@ -323,14 +325,14 @@ void ParticipantOrganisationDialog::onCooperateParticipantsChanged(int addedPart
|
||||
|
||||
ModifyParticipantDataRequest req;
|
||||
ParticipantOrganisation orga;
|
||||
orga.participantId(addedParticipantId);
|
||||
orga.currentPartyId(curPartyId);
|
||||
orga.isAttached(false);
|
||||
orga.isCooperate(true);
|
||||
req.participantOrganisation(orga);
|
||||
orga.participantId = addedParticipantId;
|
||||
orga.currentPartyId = curPartyId;
|
||||
orga.isAttached = false;
|
||||
orga.isCooperate = true;
|
||||
req.participantOrganisation = orga;
|
||||
|
||||
const QVector<ParticipantData> attachedtData = m_cooperateModel->participantData(curPartyId);
|
||||
req.data(LtsUtils::convert<std::vector<ParticipantData>>(attachedtData));
|
||||
req.data = LtsUtils::convert<std::vector<ParticipantData>>(attachedtData);
|
||||
|
||||
saveParticipantData(req);
|
||||
}
|
||||
@@ -342,7 +344,7 @@ void ParticipantOrganisationDialog::onStartTemplateUnitNamer(int templateId)
|
||||
{
|
||||
const TemplateParticipant tempPart = m_dtc->templateParticipant(templateId);
|
||||
|
||||
ParticipantUnitNamer *namer = new ParticipantUnitNamer(QString::fromStdString(tempPart.designator()), QString::fromStdString(tempPart.tacticalIdentifier()), this);
|
||||
ParticipantUnitNamer *namer = new ParticipantUnitNamer(QString::fromStdString(tempPart.designator), QString::fromStdString(tempPart.tacticalIdentifier), this);
|
||||
connect(namer, &ParticipantUnitNamer::newUnitNames, this, [this, templateId](const QString & designator, const QString & tactIdentifer)
|
||||
{
|
||||
m_poolModel->addNewTemplateToPool(templateId, designator, tactIdentifer);
|
||||
@@ -421,8 +423,8 @@ void ParticipantOrganisationDialog::showContextMenu(const QPoint &position)
|
||||
|
||||
|
||||
|
||||
DeleteDelegate::DeleteDelegate(QObject *parent) : QItemDelegate(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
DeleteDelegate::DeleteDelegate(QObject *parent) : QItemDelegate(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void DeleteDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
|
||||
+60
-59
@@ -28,6 +28,7 @@ ParticipantPoolModel::ParticipantPoolModel(QObject *parent,
|
||||
, AdvancedSymbology::TableModelSymbolRenderer<ParticipantPoolModel>(ColDesignatorIdentifier)
|
||||
, m_asSupportService(asSupportService)
|
||||
, m_dtc(dtc)
|
||||
, m_logger(getLogger("ParticipantPoolModel"))
|
||||
{
|
||||
|
||||
std::shared_ptr<AdvancedSymbology::ForeignDataInterface> asb;
|
||||
@@ -42,8 +43,8 @@ ParticipantPoolModel::ParticipantPoolModel(QObject *parent,
|
||||
m_dtc->participantOrganisations([this](const ParticipantOrganisation &org) { onParticipantOrganisationChanged(org, DataModification::eAdded); });
|
||||
|
||||
const ParticipantManagement::Party &party = m_dtc->party(poolPartyId());
|
||||
setDefaultRoleAndColor(AdvancedSymbology::roleToRole<>(party.role()),
|
||||
QColor::fromRgb(QRgb(party.color())));
|
||||
setDefaultRoleAndColor(AdvancedSymbology::roleToRole<>(party.role),
|
||||
QColor::fromRgb(QRgb(party.color)));
|
||||
}
|
||||
|
||||
bool ParticipantPoolModel::canRemoveRow(int row) const
|
||||
@@ -61,11 +62,11 @@ bool ParticipantPoolModel::removeRow(int row)
|
||||
return false;
|
||||
QVector<ParticipantData> datasToDelete;
|
||||
ParticipantManagement::ParticipantData dataToDelete = getRowData(row);
|
||||
removeRenderedSymbol(dataToDelete.id());
|
||||
removeRenderedSymbol(dataToDelete.id);
|
||||
|
||||
if (dataToDelete.id() != 0)
|
||||
if (dataToDelete.id != 0)
|
||||
{
|
||||
dataToDelete.isDeleted(true);
|
||||
dataToDelete.isDeleted = true;
|
||||
datasToDelete.append(dataToDelete);
|
||||
}
|
||||
|
||||
@@ -83,21 +84,21 @@ QVariant ParticipantPoolModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
const ParticipantManagement::ParticipantData &participantData = m_vecData.at(index.row());
|
||||
if (role == Qt::DecorationRole)
|
||||
return decorationData(index, participantData.id());
|
||||
return decorationData(index, participantData.id);
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case ColRemove:
|
||||
break;
|
||||
case ColDesignatorIdentifier:
|
||||
return QString(QString::fromStdString(participantData.designator()) + QLatin1Char('/') +
|
||||
QString::fromStdString(participantData.tacticalIdentifier()));
|
||||
return QString(QString::fromStdString(participantData.designator) + QLatin1Char('/') +
|
||||
QString::fromStdString(participantData.tacticalIdentifier));
|
||||
case ColTypeClass:
|
||||
return ParticipantManagement::toString(m_dtc->type(participantData.typeId()).typeClass());
|
||||
return ParticipantManagement::toString(m_dtc->type(participantData.typeId).typeClass);
|
||||
case ColType:
|
||||
return ParticipantManagement::trTypeName(m_dtc->type(participantData.typeId()).name());
|
||||
return ParticipantManagement::trTypeName(m_dtc->type(participantData.typeId).name);
|
||||
case ColParticipantId:
|
||||
return participantData.id();
|
||||
return participantData.id;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
@@ -124,12 +125,12 @@ QMimeData *ParticipantPoolModel::mimeData(const QModelIndexList &indexes) const
|
||||
return nullptr;
|
||||
|
||||
const ParticipantData &data = m_vecData.at(idx.row());
|
||||
if (data.id() == 0)
|
||||
if (data.id == 0)
|
||||
return nullptr;
|
||||
|
||||
const QByteArray encodedData(QByteArray::number(data.id()));
|
||||
const QByteArray encodedData(QByteArray::number(data.id));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
const QString mimeType = m_participantOrganization.contains(data.id()) ? ParticipantPoolDetached : ParticipantPoolRoot;
|
||||
const QString mimeType = m_participantOrganization.contains(data.id) ? ParticipantPoolDetached : ParticipantPoolRoot;
|
||||
mimeData->setData(mimeType, encodedData);
|
||||
return mimeData;
|
||||
}
|
||||
@@ -199,9 +200,9 @@ bool ParticipantPoolModel::onReinitModel()
|
||||
|
||||
for (const ParticipantManagement::Participant &part : participantMap)
|
||||
{
|
||||
if (part.superiorId() > 0 || part.partyId() != poolPartyId() || part.isDeleted())
|
||||
if (part.superiorId > 0 || part.partyId != poolPartyId() || part.isDeleted)
|
||||
continue;
|
||||
if (!isValidTypeClass(part.typeId()))
|
||||
if (!isValidTypeClass(part.typeId))
|
||||
continue;
|
||||
insertRow(part);
|
||||
}
|
||||
@@ -216,10 +217,10 @@ bool ParticipantPoolModel::addNewTemplateToPool(int id, const QString &designato
|
||||
|
||||
|
||||
TemplateParticipant &root = templateDatas[0];
|
||||
root.superiorTemplateId(0);
|
||||
root.hierarchyNumber(1);
|
||||
root.designator(designator.toStdString());
|
||||
root.tacticalIdentifier(tactIdentifier.toStdString());
|
||||
root.superiorTemplateId = 0;
|
||||
root.hierarchyNumber = 1;
|
||||
root.designator = designator.toStdString();
|
||||
root.tacticalIdentifier = tactIdentifier.toStdString();
|
||||
|
||||
|
||||
QVector<ParticipantManagement::ParticipantData> newPool;
|
||||
@@ -236,10 +237,10 @@ bool ParticipantPoolModel::addNewTemplateToPool(int id, const QString &designato
|
||||
|
||||
void ParticipantPoolModel::onParticipantDataChanged(const Participant &data, DataModification modType)
|
||||
{
|
||||
if (!isValidTypeClass(data.typeId()))
|
||||
if (!isValidTypeClass(data.typeId))
|
||||
return;
|
||||
|
||||
if (data.isDeleted())
|
||||
if (data.isDeleted)
|
||||
modType = DataModification::eRemoved;
|
||||
|
||||
switch (modType)
|
||||
@@ -248,17 +249,17 @@ void ParticipantPoolModel::onParticipantDataChanged(const Participant &data, Dat
|
||||
for (int i = 0; i < m_vecData.size(); ++i)
|
||||
{
|
||||
const ParticipantData &part = m_vecData.at(i);
|
||||
if (part.id() == data.id())
|
||||
if (part.id == data.id)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Modifed participant " << data.id() << ", old party: " << part.partyId() << ", new: " << data.partyId();
|
||||
DEBUG_LOG(m_logger) << "Modifed participant " << data.id << ", old party: " << part.partyId << ", new: " << data.partyId;
|
||||
|
||||
if (data.partyId() != poolPartyId())
|
||||
if (data.partyId != poolPartyId())
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
const int participantId = data.id();
|
||||
const int participantId = data.id;
|
||||
QTimer::singleShot(100, this, [this, participantId]() { tryRemoveParticipantFromModel(participantId); });
|
||||
}
|
||||
else
|
||||
@@ -271,16 +272,16 @@ void ParticipantPoolModel::onParticipantDataChanged(const Participant &data, Dat
|
||||
|
||||
Q_FALLTHROUGH();
|
||||
case DataModification::eAdded:
|
||||
if (data.superiorId() != 0 && !m_participantOrganization.contains(data.id()))
|
||||
if (data.superiorId != 0 && !m_participantOrganization.contains(data.id))
|
||||
return;
|
||||
if (data.partyId() != poolPartyId())
|
||||
if (data.partyId != poolPartyId())
|
||||
return;
|
||||
insertRow(data);
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
if (data.partyId() != poolPartyId())
|
||||
if (data.partyId != poolPartyId())
|
||||
return;
|
||||
tryRemoveParticipantFromModel(data.id());
|
||||
tryRemoveParticipantFromModel(data.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -291,10 +292,10 @@ void ParticipantPoolModel::onParticipantOrganisationChanged(const ParticipantOrg
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_participantOrganization[data.participantId()] = data;
|
||||
m_participantOrganization[data.participantId] = data;
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_participantOrganization.remove(data.participantId());
|
||||
m_participantOrganization.remove(data.participantId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -304,18 +305,18 @@ bool ParticipantPoolModel::moveFromPartyToPool(int rootParticipantId, const QStr
|
||||
ERROR_LOG(m_logger) << "Moving participant " << rootParticipantId << " from party to root with mime type " << mimeType;
|
||||
|
||||
const Participant part = m_dtc->participant(rootParticipantId);
|
||||
const QVector<Participant> newParticipants = getSuperiorParticipants(part.id());
|
||||
const QVector<Participant> newParticipants = getSuperiorParticipants(part.id);
|
||||
QVector<ParticipantData> dataToSend;
|
||||
dataToSend.reserve(newParticipants.size());
|
||||
for (const Participant &part : newParticipants)
|
||||
{
|
||||
ParticipantData data = m_dtc->convertParticipantToParticipantData(part);
|
||||
data.partyId(poolPartyId());
|
||||
if (data.id() == rootParticipantId)
|
||||
data.partyId = poolPartyId();
|
||||
if (data.id == rootParticipantId)
|
||||
{
|
||||
|
||||
data.superiorModId(0);
|
||||
data.hierarchyNumber(1);
|
||||
data.superiorModId = 0;
|
||||
data.hierarchyNumber = 1;
|
||||
}
|
||||
dataToSend.append(data);
|
||||
}
|
||||
@@ -333,7 +334,7 @@ QVector<Participant> ParticipantPoolModel::getSuperiorParticipants(int participa
|
||||
Participant part = m_dtc->participant(participantId);
|
||||
QVector<Participant> retParticipants;
|
||||
retParticipants.append(part);
|
||||
for (auto const &inferierPart : part.inferiorIds())
|
||||
for (auto const &inferierPart : part.inferiorIds)
|
||||
retParticipants.append(getSuperiorParticipants(inferierPart));
|
||||
return retParticipants;
|
||||
}
|
||||
@@ -341,39 +342,39 @@ QVector<Participant> ParticipantPoolModel::getSuperiorParticipants(int participa
|
||||
bool ParticipantPoolModel::convertFromParticipantTemplateToParticipantData(const TemplateParticipant &inputParticipant, ParticipantData &outPutData)
|
||||
{
|
||||
|
||||
outPutData.assignState(ParticipantManagement::ParticipantAssignState::NotAssigned);
|
||||
outPutData.assignState = ParticipantManagement::ParticipantAssignState::NotAssigned;
|
||||
|
||||
outPutData.id(0);
|
||||
outPutData.id = 0;
|
||||
|
||||
outPutData.partyId(poolPartyId());
|
||||
outPutData.partyId = poolPartyId();
|
||||
|
||||
|
||||
if (inputParticipant.equipmentNumber() != 0)
|
||||
if (inputParticipant.equipmentNumber != 0)
|
||||
{
|
||||
outPutData.equipmentNumber(inputParticipant.equipmentNumber());
|
||||
outPutData.assignState(ParticipantAssignState::HandoutExcon);
|
||||
outPutData.equipmentNumber = inputParticipant.equipmentNumber;
|
||||
outPutData.assignState = ParticipantAssignState::HandoutExcon;
|
||||
}
|
||||
outPutData.hierarchyNumber(inputParticipant.hierarchyNumber());
|
||||
outPutData.hierarchyNumber = inputParticipant.hierarchyNumber;
|
||||
|
||||
outPutData.info() = inputParticipant.info();
|
||||
outPutData.name() = inputParticipant.name();
|
||||
outPutData.designator() = inputParticipant.designator();
|
||||
outPutData.tacticalIdentifier(inputParticipant.tacticalIdentifier());
|
||||
outPutData.symbol(inputParticipant.symbol());
|
||||
outPutData.info = inputParticipant.info;
|
||||
outPutData.name = inputParticipant.name;
|
||||
outPutData.designator = inputParticipant.designator;
|
||||
outPutData.tacticalIdentifier = inputParticipant.tacticalIdentifier;
|
||||
outPutData.symbol = inputParticipant.symbol;
|
||||
|
||||
outPutData.typeId(inputParticipant.typeId());
|
||||
outPutData.isSimulated(false);
|
||||
outPutData.typeId = inputParticipant.typeId;
|
||||
outPutData.isSimulated = false;
|
||||
|
||||
outPutData.modId(inputParticipant.templateId());
|
||||
outPutData.superiorModId(inputParticipant.superiorTemplateId());
|
||||
outPutData.hierarchyNumber(inputParticipant.hierarchyNumber());
|
||||
outPutData.modId = inputParticipant.templateId;
|
||||
outPutData.superiorModId = inputParticipant.superiorTemplateId;
|
||||
outPutData.hierarchyNumber = inputParticipant.hierarchyNumber;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ParticipantPoolModel::isValidTypeClass(int typeId) const
|
||||
{
|
||||
const TypeClass tc = m_dtc->type(typeId).typeClass();
|
||||
switch (tc.underlying())
|
||||
const TypeClass tc = m_dtc->type(typeId).typeClass;
|
||||
switch (tc)
|
||||
{
|
||||
case TypeClass::Unit:
|
||||
return !m_asSupportService;
|
||||
@@ -387,7 +388,7 @@ bool ParticipantPoolModel::isValidTypeClass(int typeId) const
|
||||
|
||||
void ParticipantPoolModel::insertRow(const Participant &participant)
|
||||
{
|
||||
tryRenderSymbol(QString::fromStdString(participant.symbol()), participant.id());
|
||||
tryRenderSymbol(QString::fromStdString(participant.symbol), participant.id);
|
||||
|
||||
LtsWidgets::LtsAbstractTableModel<ParticipantManagement::ParticipantData>::insertRow(
|
||||
m_dtc->convertParticipantToParticipantData(participant));
|
||||
@@ -398,7 +399,7 @@ void ParticipantPoolModel::tryRemoveParticipantFromModel(int participantId)
|
||||
for (int i = 0; i < m_vecData.size(); ++i)
|
||||
{
|
||||
const ParticipantData &part = m_vecData.at(i);
|
||||
if (part.id() == participantId)
|
||||
if (part.id == participantId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing participant " << participantId;
|
||||
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ ParticipantUnitNamer::ParticipantUnitNamer(const QString &designator, const QStr
|
||||
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_ui(new Ui::ParticipantUnitNamer)
|
||||
, m_validator(new QRegularExpressionValidator(QRegularExpression(QStringLiteral("[^,;\"'´`]*")), this))
|
||||
, m_logger(getLogger("ParticipantTemplateChooser"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
|
||||
+14
-13
@@ -28,6 +28,7 @@ TacticalOrganisation::TacticalOrganisation(LtsSession::LtsSession *session, QWid
|
||||
, m_tvContextMenu(nullptr)
|
||||
, m_newItemDlg(nullptr)
|
||||
, m_ui(new Ui::TacticalOrganisation)
|
||||
, m_logger(getLogger("TacticalOrganisation"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
connect(m_addEquipmentNumberAction, &QAction::triggered,
|
||||
@@ -116,14 +117,14 @@ void TacticalOrganisation::retranslate()
|
||||
bool TacticalOrganisation::apply()
|
||||
{
|
||||
ModifyParticipantDataRequest req;
|
||||
std::vector<ParticipantData> &dataToSend = req.data();
|
||||
std::vector<ParticipantData> &dataToSend = req.data;
|
||||
for (const ParticipantEditModel *model : std::as_const(m_participantModels))
|
||||
{
|
||||
const auto c = model->participantData();
|
||||
dataToSend.insert(dataToSend.end(), c.begin(), c.end());
|
||||
}
|
||||
|
||||
if (req.data().size() == 0)
|
||||
if (req.data.size() == 0)
|
||||
return true;
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, req]()
|
||||
@@ -196,11 +197,11 @@ void TacticalOrganisation::onParticipantSelected(int participantId)
|
||||
return;
|
||||
|
||||
Participant participant = m_dtc->participant(participantId);
|
||||
if (participant.id() != participantId)
|
||||
if (participant.id != participantId)
|
||||
return;
|
||||
|
||||
ParticipantTreeFilterProxyModel *newModel = static_cast<ParticipantTreeFilterProxyModel *>(m_tvContextMenu->model());
|
||||
ParticipantEditModel *oldPem = editModelForParty(participant.partyId());
|
||||
ParticipantEditModel *oldPem = editModelForParty(participant.partyId);
|
||||
ParticipantEditModel *newPem = editModelForParty(newModel->partyId());
|
||||
|
||||
QModelIndex oldIdx = oldPem->indexFromParticipantId(participantId);
|
||||
@@ -348,18 +349,18 @@ void TacticalOrganisation::initLockedState()
|
||||
{
|
||||
Core::TryLockEntityRequest lockRequest;
|
||||
|
||||
lockRequest.id(0);
|
||||
lockRequest.entityTypeName(QString(QStringLiteral("PpmTacticalOrganisation")).toStdString());
|
||||
lockRequest.entityId(m_entityId);
|
||||
lockRequest.exerciseId(m_session->exerciseId());
|
||||
lockRequest.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
lockRequest.workstationId(LtsSessionData::LtsSessionData::getInstance()->getWorkstationId());
|
||||
lockRequest.id = 0;
|
||||
lockRequest.entityTypeName = QString(QStringLiteral("PpmTacticalOrganisation")).toStdString();
|
||||
lockRequest.entityId = m_entityId;
|
||||
lockRequest.exerciseId = m_session->exerciseId();
|
||||
lockRequest.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
lockRequest.workstationId = LtsSessionData::LtsSessionData::getInstance()->getWorkstationId();
|
||||
|
||||
Core::TryLockEntityReply lockReply = m_coreFtc->tryLockEntityRequest(lockRequest);
|
||||
|
||||
if (lockReply.alreadyLocked().is_set() && QString::fromStdString(lockReply.alreadyLocked().get().operatorName()) != LtsSessionData::LtsSessionData::getInstance()->getOperatorName())
|
||||
if (lockReply.alreadyLocked.has_value() && QString::fromStdString(lockReply.alreadyLocked.get().operatorName) != LtsSessionData::LtsSessionData::getInstance()->getOperatorName())
|
||||
{
|
||||
m_topicLockedBy = QString::fromStdString(lockReply.alreadyLocked().get().operatorName());
|
||||
m_topicLockedBy = QString::fromStdString(lockReply.alreadyLocked.get().operatorName);
|
||||
|
||||
setUnchangeable(true);
|
||||
retranslate();
|
||||
@@ -367,7 +368,7 @@ void TacticalOrganisation::initLockedState()
|
||||
return;
|
||||
}
|
||||
|
||||
m_unlockId = lockReply.id();
|
||||
m_unlockId = lockReply.id;
|
||||
}
|
||||
|
||||
void TacticalOrganisation::tableColumnOrganiserSetting()
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <ParticipantManagement/logger.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
#include <ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
Reference in new issue
Block a user