Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -23,8 +23,7 @@ static int s_lastTypeUsed = -1;
ParticipantEditItemWidgetBase::ParticipantEditItemWidgetBase(bool asSupportService,
LtsSession::LtsSession *session,
QWidget *parent)
: QWidget(parent)
QWidget *parent) : QWidget(parent)
, m_asSupportService(asSupportService)
, m_bEditMode(false)
, m_typeMinimum(0)
@@ -34,8 +33,8 @@ ParticipantEditItemWidgetBase::ParticipantEditItemWidgetBase(bool asSupportServi
, m_dtc(nullptr)
, m_ppmGuiCbxIfc(nullptr)
, m_session(session)
, m_ui(new Ui::ParticipantEditItemWidgetBase)
{
, m_ui(new Ui::ParticipantEditItemWidgetBase),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
m_ui->setupUi(this);
setWindowTitle(tr("Edit Participant"));
connect(m_ui->pbIcon, &QToolButton::clicked, this, &ParticipantEditItemWidgetBase::onSymbolSelection);
@@ -106,7 +105,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptr<ParticipantManage
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asb,
const bool addItem)
{
DEBUG_LOG() << "init addItem=" << addItem
DEBUG_LOG(m_logger) << "init addItem=" << addItem
<< " m_bEditMode=" << m_bEditMode;
if (!dtc || !ppmGuiCbxIfc)
return false;
@@ -121,7 +120,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptr<ParticipantManage
slotRetranslate();
if (addItem)
{
DEBUG_LOG() << "setDesignatorData()";
DEBUG_LOG(m_logger) << "setDesignatorData()";
setDesignatorData();
m_ui->cbTypeClass->setCurrentIndex(m_ui->cbTypeClass->findData(s_lastTypeClassUsed));
const int idx = m_ui->cbType->findData(s_lastTypeUsed);
@@ -131,7 +130,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptr<ParticipantManage
else if (m_bEditMode)
{
DEBUG_LOG() << "setData()";
DEBUG_LOG(m_logger) << "setData()";
setData();
}
return true;
@@ -223,7 +222,7 @@ void ParticipantEditItemWidgetBase::onSymbolConfig()
void ParticipantEditItemWidgetBase::onChangeSymbol(const QString &sidc)
{
TRACE_LOG() << Q_FUNC_INFO << ", Changing symbol to " << sidc;
TRACE_LOG(m_logger) << Q_FUNC_INFO << ", Changing symbol to " << sidc;
if (!m_asbfc || sidc == m_sidc)
return;
@@ -250,7 +249,7 @@ void ParticipantEditItemWidgetBase::onChangeSymbol(const QString &sidc)
}
else
{
ERROR_LOG() << Q_FUNC_INFO << " sidc is not encoded, sidc = '" << sidc << "'";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " sidc is not encoded, sidc = '" << sidc << "'";
m_ui->pbSymbolConfig->setEnabled(false);
}
@@ -260,7 +259,7 @@ void ParticipantEditItemWidgetBase::onChangeSymbol(const QString &sidc)
m_symbolConfig = nullptr;
}
DEBUG_LOG() << "Changing symbol to " << sidc << " is in progress";
DEBUG_LOG(m_logger) << "Changing symbol to " << sidc << " is in progress";
}
ParticipantManagement::TypeClass ParticipantEditItemWidgetBase::typeClassIdFromTypeId(int typeId) const
@@ -36,6 +36,7 @@ public:
~ParticipantEditItemWidgetBase();
protected:
NGL::INGLLogger &m_logger;
bool init(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc,
const std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> &ppmGuiCbxIfc,
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asb,
@@ -56,6 +57,7 @@ protected Q_SLOTS:
void onChangeSymbol(const QString &sidc);
protected:
NGL::INGLLogger &m_logger;
ParticipantManagement::TypeClass typeClassIdFromTypeId(int typeId) const;
bool isUnitType(int typeId) const;
@@ -66,6 +68,7 @@ Q_SIGNALS:
void readyToClose();
protected:
NGL::INGLLogger &m_logger;
bool m_asSupportService;
bool m_bEditMode;
int m_typeMinimum;
@@ -360,7 +360,7 @@ bool ParticipantEditModel::canDropMimeData(const QMimeData *data,
if (!isUnitType(parentItem->participant.typeId()))
return false;
DEBUG_LOG() << "can drop on " << row << ", " << column << ", parent: "
DEBUG_LOG(m_logger) << "can drop on " << row << ", " << column << ", parent: "
<< parent.row() << "," << parent.column() << ", " << parent.isValid()
<< ", action: " << action;
@@ -389,7 +389,7 @@ bool ParticipantEditModel::canDropMimeData(const QMimeData *data,
if (idSource != 0 && isParentOf(parentItem, idSource))
{
DEBUG_LOG() << "isParentOf() for idSource: " << idSource << " is true - no drop";
DEBUG_LOG(m_logger) << "isParentOf() for idSource: " << idSource << " is true - no drop";
return false;
}
}
@@ -802,7 +802,7 @@ void ParticipantEditModel::insertChildrenOf(int parentId,
auto it = tmap.constFind(childId);
if (it == tmap.constEnd())
{
WARNING_LOG() << "Can not find participant with id " << childId << " - ignoring";
WARNING_LOG(m_logger) << "Can not find participant with id " << childId << " - ignoring";
continue;
}
const ParticipantData &data = it.value();
@@ -827,11 +827,11 @@ void ParticipantEditModel::insertChildrenOf(int parentId,
childItem->participant = data;
childItem->bIsChecked = isChecked(checkedParticipants.contains(data.id()), cs);
DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
<< ") to parent " << parent << " at pos " << insertPos;
if ( data.id() == 0 && data.hierarchyNumber() == 0)
{
WARNING_LOG() << "avoid endless loop in recursion";
WARNING_LOG(m_logger) << "avoid endless loop in recursion";
return;
}
insertRow(insertPos, parentIdx, childItem);
@@ -1086,7 +1086,7 @@ void ParticipantEditModel::onParticipantChanged(const ParticipantManagement::Par
CheckedTreeItem *childItem = static_cast<CheckedTreeItem *>(createItem(QVariant(), QIcon()));
childItem->participant = m_dtc->convertParticipantToParticipantData(data);
DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
<< ") to parent " << ctiParent << " at pos " << insertPos;
insertRow(insertPos, indexFromItem(ctiParent), childItem);
tryRenderSymbol(QString::fromStdString(data.symbol()), childItem);
@@ -101,6 +101,7 @@ public:
QString getHierarchyFromIndex(const QModelIndex &index) const;
protected:
NGL::INGLLogger &m_logger;
void gatherParticipants(QHash<int, ParticipantData> &tmap,
QHash<int, QSet<int>> &parentId2id) const;
@@ -148,6 +149,7 @@ signals:
void internalDataChanged();
protected:
NGL::INGLLogger &m_logger;
int m_partyId;
bool m_bRowsAreCheckable;
bool m_bUnitsSelectable;
@@ -176,6 +178,7 @@ public:
int partyId() const { return m_sourceModel ? m_sourceModel->partyId() : -1; }
protected:
NGL::INGLLogger &m_logger;
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
@@ -249,6 +252,7 @@ public:
SortData sortData() const { return m_sortData; }
protected:
NGL::INGLLogger &m_logger;
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override;
bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
@@ -75,7 +75,7 @@ void ParticipantIconModelBase::tryRenderSymbol(const QString &symbol, NGLTreeIte
{
AdvancedSymbology::SymbolDataToRender symDataToRender(symbol);
symDataToRender.role = m_partyRole;
DEBUG_LOG() << "Rendering symbol '" << symbol << "' for item " << item;
DEBUG_LOG(m_logger) << "Rendering symbol '" << symbol << "' for item " << item;
if (m_partyColor.isValid())
{
symDataToRender.fillColor = m_partyColor;
@@ -92,7 +92,7 @@ void ParticipantIconModelBase::tryRenderSymbol(const QString &symbol, NGLTreeIte
AdvancedSymbology::SymbolResult *symResPtr = symRes.data();
if (!symResPtr)
{
WARNING_LOG() << "Can not render symbol for sidc '" << symbol << "'";
WARNING_LOG(m_logger) << "Can not render symbol for sidc '" << symbol << "'";
return;
}
@@ -138,11 +138,11 @@ void ParticipantIconModelBase::symbolRendered(AdvancedSymbology::SymbolResult *s
const QIcon icon(QPixmap::fromImage(symResData.result->symbolImage().image()));
for (NGLTreeItem *item : symResData.treeItems)
{
DEBUG_LOG() << "Symbol for " << item << " ready";
DEBUG_LOG(m_logger) << "Symbol for " << item << " ready";
if (!updateIcon(QModelIndex(), item, icon))
WARNING_LOG() << "updateIcon failed for item " << item;
WARNING_LOG(m_logger) << "updateIcon failed for item " << item;
}
m_symbolResultMapping.erase(it);
@@ -35,6 +35,7 @@ class PPMCOMMON_EXPORT ParticipantIconModelBase : public NGLTreeModel
{
Q_OBJECT
protected:
NGL::INGLLogger &m_logger;
ParticipantIconModelBase(const std::shared_ptr<Interface::Dtc> &ppmDtc,
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asbIfc,
const QStringList &hdr,
@@ -53,10 +54,12 @@ protected:
bool updateIcon(const QModelIndex &currentIndex, NGLTreeItem *itemToUpdate, const QIcon &icon);
protected:
NGL::INGLLogger &m_logger;
void onTypeChanged(const ParticipantManagement::Type &data, DataModification modType);
protected:
NGL::INGLLogger &m_logger;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
QHash<qint32, ParticipantManagement::Type> m_types;
@@ -40,6 +40,8 @@ public:
const std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> &ppmGuiCbxIfc);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override;
void lock() override;
@@ -45,6 +45,8 @@ public:
const QString &nameParty);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
protected slots:
@@ -43,6 +43,8 @@ public:
protected:
NGL::INGLLogger &m_logger;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
};
}
@@ -40,6 +40,8 @@ public:
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asbIfc);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void onSelectionChanged();
@@ -16,7 +16,7 @@ ParticipantPlanningModel::ParticipantPlanningModel(QObject *parent,
{
m_titles += tr("Hierarchy");
DEBUG_LOG() << "ParticipantPlanningModel::ParticipantPlanningModel";
DEBUG_LOG(m_logger) << "ParticipantPlanningModel::ParticipantPlanningModel";
}
QVariant ParticipantPlanningModel::data(const QModelIndex &index, int role) const
@@ -28,5 +28,7 @@ signals:
void newData();
private:
NGL::INGLLogger &m_logger;
};
}
@@ -234,17 +234,17 @@ void ParticipantEdit::showIsSimulated()
void ParticipantEdit::lock()
{
DEBUG_LOG() << Q_FUNC_INFO << " START";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
m_ui->cbParty->setEnabled(true);
DEBUG_LOG() << Q_FUNC_INFO << " END";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantEdit::unlock()
{
DEBUG_LOG() << Q_FUNC_INFO << " START";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
m_ui->cbParty->setEnabled(true);
DEBUG_LOG() << Q_FUNC_INFO << " END";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantEdit::onPartyChanged()
@@ -320,7 +320,7 @@ void ParticipantEdit::onEnaDisa()
{
if (m_dtc->isAdlerVerbund(m_pTreehandler->getSelectedData().typeId()))
{
DEBUG_LOG() << "Can't Edit Adler SAA Participants";
DEBUG_LOG(m_logger) << "Can't Edit Adler SAA Participants";
enableEdit = true;
}
else
@@ -60,6 +60,7 @@ public:
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asbIfc);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override;
void showIsSimulated();
@@ -88,6 +89,7 @@ private slots:
private:
NGL::INGLLogger &m_logger;
void tableColumnOrganiserSetting() override;
bool m_asSupportService;
@@ -78,7 +78,7 @@ void ParticipantOrganisationDialog::retranslate()
void ParticipantOrganisationDialog::lock()
{
DEBUG_LOG() << Q_FUNC_INFO << " START";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
m_ui->cbParty->setEnabled(true);
@@ -90,12 +90,12 @@ void ParticipantOrganisationDialog::lock()
m_ui->tvDetached->setEnabled(false);
DEBUG_LOG() << Q_FUNC_INFO << " END";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantOrganisationDialog::unlock()
{
DEBUG_LOG() << Q_FUNC_INFO << " START";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
m_ui->cbParty->setEnabled(true);
@@ -103,7 +103,7 @@ void ParticipantOrganisationDialog::unlock()
m_ui->tvAttached->setEnabled(true);
m_ui->tvCooperate->setEnabled(true);
m_ui->tvDetached->setEnabled(true);
DEBUG_LOG() << Q_FUNC_INFO << " END";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
}
bool ParticipantOrganisationDialog::init(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc,
@@ -356,7 +356,7 @@ void ParticipantOrganisationDialog::onPartyChanged()
s_preselectedParty = curPartyId;
DEBUG_LOG() << Q_FUNC_INFO << " START, curPartyId" << curPartyId
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, curPartyId" << curPartyId
<< ", m_asSupportService=" << m_asSupportService;
@@ -421,9 +421,8 @@ void ParticipantOrganisationDialog::showContextMenu(const QPoint &position)
DeleteDelegate::DeleteDelegate(QObject *parent)
: QItemDelegate(parent)
{
DeleteDelegate::DeleteDelegate(QObject *parent) : QItemDelegate(parent),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
}
void DeleteDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
@@ -72,6 +72,8 @@ public:
void unlock() override;
private:
NGL::INGLLogger &m_logger;
QModelIndex selectedIndexView() const;
bool saveParticipantData(const ModifyParticipantDataRequest &request);
@@ -153,7 +153,7 @@ bool ParticipantPoolModel::dropMimeData(const QMimeData *data, Qt::DropAction ac
if (action != Qt::CopyAction && action != Qt::MoveAction)
return false;
DEBUG_LOG() << "dropMimeData: " << data->formats().join(QLatin1Char(','));
DEBUG_LOG(m_logger) << "dropMimeData: " << data->formats().join(QLatin1Char(','));
if (!data->hasFormat(ParticipantTemplateRoot) &&
!data->hasFormat(ParticipantPartyRoot) &&
@@ -250,7 +250,7 @@ void ParticipantPoolModel::onParticipantDataChanged(const Participant &data, Dat
const ParticipantData &part = m_vecData.at(i);
if (part.id() == data.id())
{
DEBUG_LOG() << "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())
{
@@ -301,7 +301,7 @@ void ParticipantPoolModel::onParticipantOrganisationChanged(const ParticipantOrg
bool ParticipantPoolModel::moveFromPartyToPool(int rootParticipantId, const QString &mimeType)
{
ERROR_LOG() << "Moving participant " << rootParticipantId << " from party to root with mime type " << mimeType;
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());
@@ -400,7 +400,7 @@ void ParticipantPoolModel::tryRemoveParticipantFromModel(int participantId)
const ParticipantData &part = m_vecData.at(i);
if (part.id() == participantId)
{
DEBUG_LOG() << "Removing participant " << participantId;
DEBUG_LOG(m_logger) << "Removing participant " << participantId;
LtsWidgets::LtsAbstractTableModel<ParticipantManagement::ParticipantData>::removeRow(i);
break;
@@ -64,6 +64,7 @@ Q_SIGNALS:
void modifyParticipantData(const QVector<ParticipantData> &participantData, const QString &originatorMimeType);
private:
NGL::INGLLogger &m_logger;
bool moveFromPartyToPool(int rootParticipantId, const QString &mimeType);
QVector<Participant> getSuperiorParticipants(int participantId);
bool convertFromParticipantTemplateToParticipantData(const ParticipantManagement::TemplateParticipant &inputParticipant, ParticipantManagement::ParticipantData &outPutData);
@@ -74,6 +75,7 @@ private:
int poolPartyId() const { return m_asSupportService ? 1 : 0; }
private:
NGL::INGLLogger &m_logger;
bool m_asSupportService;
QVector<ParticipantData> m_fullPoolData;
QVector<ParticipantData> m_dataToDelete;
@@ -28,6 +28,8 @@ Q_SIGNALS:
void newUnitNames(const QString &, const QString &);
private:
NGL::INGLLogger &m_logger;
Ui::ParticipantUnitNamer *m_ui;
QValidator *m_validator;
};
@@ -63,7 +63,7 @@ bool TacticalOrganisation::init(const std::shared_ptr<ParticipantManagement::Int
if (!m_session->createTopicClient<Core::Interface::Ftc>(m_coreFtc))
{
ERROR_LOG() << Q_FUNC_INFO << " create coreFtc failed";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " create coreFtc failed";
return false;
}
@@ -150,7 +150,7 @@ void TacticalOrganisation::onReinitLeft()
s_preselectedPartyLeft = partyId;
auto *model = modelForParty(partyId, true);
INFO_LOG() << "Set model left: " << model;
INFO_LOG(m_logger) << "Set model left: " << model;
m_ui->dvPartyLeft->setModel(model);
#ifndef LTS_DEBUG
m_ui->dvPartyLeft->setColumnHidden(ParticipantEditModel::ColParticipantId, true);
@@ -164,7 +164,7 @@ void TacticalOrganisation::onReinitRight()
s_preselectedPartyRight = partyId;
auto *model = modelForParty(partyId, false);
INFO_LOG() << "Set model right: " << model;
INFO_LOG(m_logger) << "Set model right: " << model;
m_ui->dvPartyRight->setModel(model);
#ifndef LTS_DEBUG
m_ui->dvPartyRight->setColumnHidden(ParticipantEditModel::ColParticipantId, true);
@@ -53,6 +53,7 @@ public:
void retranslate() override;
protected:
NGL::INGLLogger &m_logger;
bool apply() override;
void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override;
private Q_SLOTS:
@@ -55,6 +55,8 @@ public:
void onCallBiteReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void addLabel(const QString &text, int row, int column, LabelType labelType = LabelType::Normal);
int checkArguments(bool available, bool statusOk, qint64 bitValue, int i);
@@ -346,7 +346,7 @@ void ParticipantConfigDialog::onSelectionChanged()
for (const QModelIndex &index : currentlySelectedParticipants)
{
DEBUG_LOG() << "setChildrenSelected row =" << index.row() << " column=" << index.column();
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
ParticipantManagement::ParticipantData data = m_model->getParticipantData(index);
TypeClass tc = m_dtc->type(data.typeId()).typeClass();
if (tc != TypeClass::Human && tc != TypeClass::Unit)
@@ -61,6 +61,7 @@ public:
private:
NGL::INGLLogger &m_logger;
void onModifyStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onInitParticipantReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onSendMessageReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
@@ -80,6 +81,7 @@ private slots:
void onSelectionChanged();
private:
NGL::INGLLogger &m_logger;
bool apply() override final;
void changeLabelText(QLabel *label, int value);
@@ -370,7 +370,7 @@ bool ParticipantConfigModel::canDropMimeData(const QMimeData *data,
if (!isUnitType(parentItem->participant.typeId()))
return false;
DEBUG_LOG() << "can drop on " << row << ", " << column << ", parent: "
DEBUG_LOG(m_logger) << "can drop on " << row << ", " << column << ", parent: "
<< parent.row() << "," << parent.column() << ", " << parent.isValid()
<< ", action: " << action;
@@ -399,7 +399,7 @@ bool ParticipantConfigModel::canDropMimeData(const QMimeData *data,
if (idSource != 0 && isParentOf(parentItem, idSource))
{
DEBUG_LOG() << "isParentOf() for idSource: " << idSource << " is true - no drop";
DEBUG_LOG(m_logger) << "isParentOf() for idSource: " << idSource << " is true - no drop";
return false;
}
}
@@ -759,7 +759,7 @@ void ParticipantConfigModel::insertChildrenOf(int parentId,
auto it = tmap.constFind(childId);
if (it == tmap.constEnd())
{
WARNING_LOG() << "Can not find participant with id " << childId << " - ignoring";
WARNING_LOG(m_logger) << "Can not find participant with id " << childId << " - ignoring";
continue;
}
const ParticipantData &data = it.value();
@@ -784,7 +784,7 @@ void ParticipantConfigModel::insertChildrenOf(int parentId,
childItem->participant = data;
childItem->bIsChecked = isChecked(checkedParticipants.contains(data.id()), cs);
DEBUG_LOG() << "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);
tryRenderSymbol(QString::fromStdString(data.symbol()), childItem);
@@ -1074,7 +1074,7 @@ void ParticipantConfigModel::onParticipantChanged(const ParticipantManagement::P
CheckedTreeItem *childItem = static_cast<CheckedTreeItem *>(createItem(QVariant(), QIcon()));
childItem->participant = m_dtc->convertParticipantToParticipantData(data);
DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
<< ") to parent " << ctiParent << " at pos " << insertPos;
insertRow(insertPos, indexFromItem(ctiParent), childItem);
tryRenderSymbol(QString::fromStdString(data.symbol()), childItem);
@@ -103,6 +103,7 @@ public:
QString getHierarchyFromIndex(const QModelIndex &index) const;
protected:
NGL::INGLLogger &m_logger;
void gatherParticipants(QHash<int, ParticipantData> &tmap,
QHash<int, QSet<int>> &parentId2id) const;
@@ -151,6 +152,7 @@ signals:
void internalDataChanged();
protected:
NGL::INGLLogger &m_logger;
int m_partyId;
bool m_bRowsAreCheckable;
bool m_bUnitsSelectable;
@@ -178,6 +180,7 @@ public:
int partyId() const { return m_sourceModel ? m_sourceModel->partyId() : -1; }
protected:
NGL::INGLLogger &m_logger;
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
@@ -251,6 +254,7 @@ public:
SortData sortData() const { return m_sortData; }
protected:
NGL::INGLLogger &m_logger;
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override;
bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
@@ -55,7 +55,7 @@ bool ParticipantFollowDialog::init(LtsSession::LtsSession *session,
const std::shared_ptr<Interface::Dtc> &dtc,
const std::shared_ptr<ForeignParticipantInfoGuiInterface> &ppmGuiIfc)
{
DEBUG_LOG() << "ParticipantFollowDialog::init";
DEBUG_LOG(m_logger) << "ParticipantFollowDialog::init";
m_dtc = dtc;
m_ppmGuiIfc = ppmGuiIfc;
enadisa();
@@ -227,7 +227,7 @@ void ParticipantFollowDialog::onDoubleClicked()
m_followParticipantId = data.id();
m_followEquipmentNo = getEquipmentNumber(m_followParticipantId);
enadisa();
DEBUG_LOG() << "onDoubleClicked follow Participant Id =" << m_followParticipantId
DEBUG_LOG(m_logger) << "onDoubleClicked follow Participant Id =" << m_followParticipantId
<< " m_followEquipmentNo=" << m_followEquipmentNo;
}
@@ -337,7 +337,7 @@ void ParticipantFollowDialog::fillParticipantMapFromTree(const QModelIndex &pare
int ParticipantFollowDialog::getEquipmentNumber(const int participantId)
{
DEBUG_LOG() << "getEquipmentNumber(" << participantId << ")";
DEBUG_LOG(m_logger) << "getEquipmentNumber(" << participantId << ")";
int equipmentNumber = 0;
QMapIterator<int, int> iter(m_participantMap);
@@ -345,10 +345,10 @@ int ParticipantFollowDialog::getEquipmentNumber(const int participantId)
while (iter.hasNext())
{
iter.next();
DEBUG_LOG() << iter.key() << " : " << iter.value();
DEBUG_LOG(m_logger) << iter.key() << " : " << iter.value();
if (iter.value() == participantId)
{
DEBUG_LOG() << "return: " << iter.key();
DEBUG_LOG(m_logger) << "return: " << iter.key();
return (iter.key());
}
}
@@ -358,13 +358,13 @@ int ParticipantFollowDialog::getEquipmentNumber(const int participantId)
void ParticipantFollowDialog::onStartFollowClicked()
{
int participantId = m_participantMap.value(m_equipNo);
DEBUG_LOG() << "Follow Participant id=" << participantId << " on Map";
DEBUG_LOG(m_logger) << "Follow Participant id=" << participantId << " on Map";
if (!m_ui->cbAll->isChecked())
onDoubleClicked();
else
{
DEBUG_LOG() << "Start Follow Participant id=" << participantId << " on Map";
DEBUG_LOG(m_logger) << "Start Follow Participant id=" << participantId << " on Map";
m_followParticipantId = participantId;
m_followEquipmentNo = m_equipNo;
}
@@ -373,7 +373,7 @@ void ParticipantFollowDialog::onStartFollowClicked()
void ParticipantFollowDialog::onStopFollowClicked()
{
DEBUG_LOG() << "Stop Follow Participant id=" << m_followParticipantId << " on Map";
DEBUG_LOG(m_logger) << "Stop Follow Participant id=" << m_followParticipantId << " on Map";
m_followParticipantId = 0;
m_followEquipmentNo = 0;
enadisa();
@@ -408,9 +408,9 @@ void ParticipantFollowDialog::enadisa()
labelText.append(QStringLiteral(")"));
}
m_ui->lbFollow->setText(labelText);
DEBUG_LOG() << "labelText=" << labelText;
DEBUG_LOG() << " m_ui->lbFollow->getText()" << m_ui->lbFollow->text();
DEBUG_LOG() << "newFollowEquipment(" << m_followEquipmentNo << ", "
DEBUG_LOG(m_logger) << "labelText=" << labelText;
DEBUG_LOG(m_logger) << " m_ui->lbFollow->getText()" << m_ui->lbFollow->text();
DEBUG_LOG(m_logger) << "newFollowEquipment(" << m_followEquipmentNo << ", "
<< m_followParticipantId << ")";
emit newFollowEquipment(m_followEquipmentNo,m_followParticipantId );
}
@@ -64,13 +64,13 @@ bool ParticipantGearRestock::init(LtsSession::LtsSession *session, bool showAllO
if (!m_pdmDtc->canRestock(m_gearTypeId) && m_dialogMode == DialogMode::DM_Restock)
{
WARNING_LOG() << "Not possible to restock gearTypeId = " << m_gearTypeId;
WARNING_LOG(m_logger) << "Not possible to restock gearTypeId = " << m_gearTypeId;
return false;
}
if (!m_pdmDtc->canSetDefaults(m_gearTypeId) && m_dialogMode == DialogMode::DM_SetRestockDefaults)
{
WARNING_LOG() << "Not possible to set restock defaults gearTypeId = " << m_gearTypeId;
WARNING_LOG(m_logger) << "Not possible to set restock defaults gearTypeId = " << m_gearTypeId;
return false;
}
@@ -107,7 +107,7 @@ bool ParticipantGearRestock::init(LtsSession::LtsSession *session, bool showAllO
int chargeTypeId = gearType2ChargeType.chargeTypeId();
int maxCharge = m_pdmDtc->maxCharge(m_gearTypeId, chargeTypeId);
DEBUG_LOG() << "maxCharge = " << maxCharge;
DEBUG_LOG(m_logger) << "maxCharge = " << maxCharge;
ParticipantGearRestockCharge* pgrc = new ParticipantGearRestockCharge(m_ui->scrollArea, showAllOptions);
pgrc->init(chargeTypeId, m_pdmDtc->trChargeTypeShortName(chargeTypeId, true), m_pdmDtc->factoryDefault(m_gearTypeId, chargeTypeId), maxCharge);
@@ -47,6 +47,7 @@ public:
bool init(LtsSession::LtsSession *session, bool showAllOptions = false);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override final;
void onSelectiveReammunitionReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
@@ -55,6 +56,7 @@ private slots:
void validate(int newVal);
private:
NGL::INGLLogger &m_logger;
LtsUtils::RequestHelper *m_requestHelper;
LtsSession::LtsSession *m_session;
@@ -36,6 +36,8 @@ public:
const std::shared_ptr<AreaEffectSimulation::Interface::Dtc> &aesDtc);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
int m_ddsId;
@@ -43,6 +43,8 @@ private Q_SLOTS:
void onDynamicParticipantDataChanged(const DynamicParticipantData &data, DataModification modType);
private:
NGL::INGLLogger &m_logger;
void reinitModel(const std::vector<StateInformation> &newData);
QVariant dataInternal(const QModelIndex &index) const;
@@ -69,7 +69,7 @@ bool HitLineInfoDialog::init(const std::shared_ptr<ParticipantManagement::Interf
{
if (data.id() == m_hitLineId)
{
DEBUG_LOG() << "Found HitLine Id: " << data.id();
DEBUG_LOG(m_logger) << "Found HitLine Id: " << data.id();
m_hitLineInfo = data;
@@ -81,14 +81,14 @@ bool HitLineInfoDialog::init(const std::shared_ptr<ParticipantManagement::Interf
});
if (!m_isInitialized)
WARNING_LOG() << "Non HitLineInfo data found for id: " << m_hitLineId;
WARNING_LOG(m_logger) << "Non HitLineInfo data found for id: " << m_hitLineId;
return m_isInitialized;
}
void HitLineInfoDialog::showHitLineInfos()
{
DEBUG_LOG() << Q_FUNC_INFO << " id:" << m_hitLineId;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id:" << m_hitLineId;
if (m_participantOriginator.id() <= 0 || m_participantInjury.id() <= 0)
return;
@@ -41,6 +41,8 @@ public:
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMapGuiIfc);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void showHitLineInfos();
void findOnMap(int id);
@@ -144,7 +144,7 @@ bool ParticipantInfoDialog::init(LtsSession::LtsSession *session,
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asbInterface,
const std::shared_ptr<ForeignParticipantInfoGuiInterface> &ppmGuiIfc)
{
DEBUG_LOG()<< "ParticipantInfoDialog::init";
DEBUG_LOG(m_logger)<< "ParticipantInfoDialog::init";
m_session = session;
m_dtc = dtc;
m_ftc = ftc;
@@ -187,7 +187,7 @@ bool ParticipantInfoDialog::init(LtsSession::LtsSession *session,
});
DEBUG_LOG()<< "Vor setUiValues";
DEBUG_LOG(m_logger)<< "Vor setUiValues";
return setUiValues();
}
@@ -197,7 +197,7 @@ bool ParticipantInfoDialog::setUiValues()
DEBUG_LOG() << "------------------setUiValues-----------------";
DEBUG_LOG(m_logger) << "------------------setUiValues-----------------";
if (!m_dtc || !m_ftc || m_participant.id() < 0)
return false;
@@ -224,7 +224,7 @@ bool ParticipantInfoDialog::setUiValues()
const bool isUas = m_dtc->isTypeUas(participantData.typeId());
DEBUG_LOG() << "------------------UAS-----------------"
DEBUG_LOG(m_logger) << "------------------UAS-----------------"
<< " isTypeUas" << isUas
<< " participantId=" <<participantData.id()
<< " typeId=" << participantData.typeId();
@@ -348,7 +348,7 @@ bool ParticipantInfoDialog::setUiValues()
}
case TypeClass::Vessel:
case TypeClass::Unknown:
ERROR_LOG() << Q_FUNC_INFO << m_typeClass;
ERROR_LOG(m_logger) << Q_FUNC_INFO << m_typeClass;
return false;
}
@@ -460,7 +460,7 @@ bool ParticipantInfoDialog::setUiValues()
setOnlineHelpFilename(QStringLiteral("Info_Dialog-Unit"));
break;
case TypeClass::Unknown:
ERROR_LOG() << Q_FUNC_INFO << m_typeClass;
ERROR_LOG(m_logger) << Q_FUNC_INFO << m_typeClass;
}
return true;
@@ -520,7 +520,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
youngestState.stateTime(0);
for (const StateInformation &si : history)
{
DEBUG_LOG() << "StateInformation "
DEBUG_LOG(m_logger) << "StateInformation "
<< " time=" << si.stateTime()
<< " vulnerabilityBits=" << si.vulnerabilityBits()
<< " vulnerabilityKindId=" << si.vulnerabilityKindId();
@@ -533,7 +533,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
m_ui->lblStatus->setText(ProjectDataManagement::toString(lastState.vulnerabilityState(), vc));
DEBUG_LOG()<<" >>> last state: "<<lastState.vitality() << "last kind: " <<lastState.vulnerabilityKindId();
DEBUG_LOG(m_logger)<<" >>> last state: "<<lastState.vitality() << "last kind: " <<lastState.vulnerabilityKindId();
m_ui->lblVitality->setText(QString::number(lastState.vitality()) + QStringLiteral("%"));
@@ -541,7 +541,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
const int BCONTAMINATION = 0x8000;
const int CCONTAMINATION = 0x10000;
QStringList contaminationList;
DEBUG_LOG() << "Set Contamination"
DEBUG_LOG(m_logger) << "Set Contamination"
<< " time=" << youngestState.stateTime()
<< " vulnerabilityKindId=" << youngestState.vulnerabilityKindId()
<< " vulnerabilityBits=" << youngestState.vulnerabilityBits()
@@ -549,7 +549,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
if ( youngestState.vulnerabilityBits() & NCONTAMINATION)
{
DEBUG_LOG() << "append N";
DEBUG_LOG(m_logger) << "append N";
const ProjectDataManagement::VulnerabilityState vs(static_cast<ProjectDataManagement::VulnerabilityState_def::type>(14));
QString fullName = ProjectDataManagement::toString(vs);
@@ -560,7 +560,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
}
if ( youngestState.vulnerabilityBits() & BCONTAMINATION)
{
DEBUG_LOG() << "append B";
DEBUG_LOG(m_logger) << "append B";
const ProjectDataManagement::VulnerabilityState vs(static_cast<ProjectDataManagement::VulnerabilityState_def::type>(15));
QString fullName = ProjectDataManagement::toString(vs);
@@ -571,7 +571,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
}
if ( youngestState.vulnerabilityBits() & CCONTAMINATION)
{
DEBUG_LOG() << "append C";
DEBUG_LOG(m_logger) << "append C";
const ProjectDataManagement::VulnerabilityState vs(static_cast<ProjectDataManagement::VulnerabilityState_def::type>(16));
QString fullName = ProjectDataManagement::toString(vs);
@@ -615,7 +615,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
m_ui->lbContamination->setHidden(contaminationListIsEmpty);
m_ui->lblContamination->setHidden(contaminationListIsEmpty);
DEBUG_LOG()<< "setBackgroundColor ="<< data.manipulation().size();
DEBUG_LOG(m_logger)<< "setBackgroundColor ="<< data.manipulation().size();
setBackgroundColor(m_ui->lblEquipNr, Qt::red, data.manipulation().size());
@@ -791,11 +791,11 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
{
m_ui->twGear->hide();
}
DEBUG_LOG() << "### m_sanMatStock: " << m_sanMatStock.size();
DEBUG_LOG(m_logger) << "### m_sanMatStock: " << m_sanMatStock.size();
DEBUG_LOG() << "### data.sanitationMaterialStock(): " << data.sanitationMaterialStock().size();
DEBUG_LOG() << "### data.participantId(): " << data.participantId();
DEBUG_LOG() << "### data.sampleTime(): " << data.sampleTime();
DEBUG_LOG(m_logger) << "### data.sanitationMaterialStock(): " << data.sanitationMaterialStock().size();
DEBUG_LOG(m_logger) << "### data.participantId(): " << data.participantId();
DEBUG_LOG(m_logger) << "### data.sampleTime(): " << data.sampleTime();
if (data.sanitationMaterialStock().size() == 0)
@@ -806,8 +806,8 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
}
else if (data.sanitationMaterialStock() != m_sanMatStock)
{
DEBUG_LOG() << "### data.qualification(): " << data.qualification();
DEBUG_LOG() << "### data.sanitationUniqueId(): " << data.sanitationUniqueId();
DEBUG_LOG(m_logger) << "### data.qualification(): " << data.qualification();
DEBUG_LOG(m_logger) << "### data.sanitationUniqueId(): " << data.sanitationUniqueId();
m_ui->gbSanitation->show();
m_ui->lblSanAssignState->setText(ParticipantManagement::toString(data.qualification().underlying()));
@@ -1008,7 +1008,7 @@ void ParticipantInfoDialog::onPositionChanged(const ParticipantPosition &positio
isOpsBuildingSource = true;
DEBUG_LOG() << "reportingSource = OpsBuilding true" ;
DEBUG_LOG(m_logger) << "reportingSource = OpsBuilding true" ;
setBackgroundColor(m_ui->lblPositionData, Qt::lightGray, isOpsBuildingSource );
onUpdatePosition(position.participantId(), position.pos(), position.sampleTime());
@@ -1214,7 +1214,7 @@ void ParticipantInfoDialog::setSanitationLabelColor(SanitationResult proceduresD
case SanitationResult::deprecatedNA:
break;
}
DEBUG_LOG() << "Set Color to: " << proceduresDone.underlying();
DEBUG_LOG(m_logger) << "Set Color to: " << proceduresDone.underlying();
m_ui->lblKind->setPalette(pal);
m_ui->lblKind->setAutoFillBackground(true);
m_ui->lblKind->setToolTip(toolTip);
@@ -1406,7 +1406,7 @@ void ParticipantInfoDialog::onPartitionTimeChanged(qint64 newPartitionTime)
{
if (LtsUtils::isPositionTimeOutdated(newPartitionTime, m_lastPositionMSec) )
{
DEBUG_LOG()<< "setBackgroundColor ="<< LtsUtils::isPositionTimeOutdated(newPartitionTime, m_lastPositionMSec);
DEBUG_LOG(m_logger)<< "setBackgroundColor ="<< LtsUtils::isPositionTimeOutdated(newPartitionTime, m_lastPositionMSec);
setBackgroundColor(m_ui->lblPositionData, Qt::red, true);
}
qint64 lastPosSec = (newPartitionTime - m_lastPositionMSec) / 1000;
@@ -1502,7 +1502,7 @@ void ParticipantInfoDialog::onTargetConfig()
{
if (!m_tgtFtc)
return;
INFO_LOG() << "onTargetConfig send TargetConfigRequest";
INFO_LOG(m_logger) << "onTargetConfig send TargetConfigRequest";
TargetManagement::ConfigureTargetRequest request;
@@ -1521,7 +1521,7 @@ void ParticipantInfoDialog::onTargetConfigChanged(const TargetManagement::Target
{
if (modType == DataModification::eRemoved)
return;
INFO_LOG() << "onTargetConfigChanged participantId = " << m_participant.id()
INFO_LOG(m_logger) << "onTargetConfigChanged participantId = " << m_participant.id()
<< " data.participantId = " << data.participantId();
if (data.participantId() != m_participant.id())
return;
@@ -1538,7 +1538,7 @@ void ParticipantInfoDialog::onTargetModeChangeed()
{
if (!m_tgtFtc)
return;
INFO_LOG() << "onTargetModeChangeed";
INFO_LOG(m_logger) << "onTargetModeChangeed";
TargetManagement::ConfigureTargetRequest request;
request.id(0);
@@ -1546,7 +1546,7 @@ void ParticipantInfoDialog::onTargetModeChangeed()
request.tgtCommand(TargetManagement::TgtCommand_def::SetMode);
int modeInt = m_ui->cbTargetMode->currentData().toInt();
TargetManagement::Mode mode = static_cast <TargetManagement::Mode_def::type>(modeInt);
INFO_LOG() << "onTargetModeChangeed=" << mode;
INFO_LOG(m_logger) << "onTargetModeChangeed=" << mode;
request.mode(mode);
auto cb = [request, this]()
@@ -1566,7 +1566,7 @@ void ParticipantInfoDialog::onTargetWeaponChanged()
request.participantId(m_participant.id());
request.tgtCommand(TargetManagement::TgtCommand_def::SetWeapon);
request.weapon(m_ui->cbTargetWeapon->currentData().toInt());
INFO_LOG() << "onTargetWeaponChangeed = " << request.weapon();
INFO_LOG(m_logger) << "onTargetWeaponChangeed = " << request.weapon();
auto cb = [request, this]()
{
@@ -1594,8 +1594,8 @@ void ParticipantInfoDialog::onContextMenuRequested(const QPoint &position)
GearInformation &gear = m_gearList[pointedItem->row()];
DEBUG_LOG() << "gear type selected = " << gear.gearTypeId();
DEBUG_LOG() << "gear Id = " << gear.gearId();
DEBUG_LOG(m_logger) << "gear type selected = " << gear.gearTypeId();
DEBUG_LOG(m_logger) << "gear Id = " << gear.gearId();
QList<QAction*> actions;
@@ -1677,16 +1677,16 @@ void ParticipantInfoDialog::onUnlockUAS()
{
UAS uas = m_dtc->getUasByParticipantId(m_participant.id(), m_session->exerciseId());
m_uasId = uas.id();
DEBUG_LOG()<<" -- onUnlockUAS uasId: "<< uas.id() <<" /// participantId: "<<uas.participantId()<<" /// equipmentNumber: "<<m_participant.equipmentNumber();
DEBUG_LOG(m_logger)<<" -- onUnlockUAS uasId: "<< uas.id() <<" /// participantId: "<<uas.participantId()<<" /// equipmentNumber: "<<m_participant.equipmentNumber();
if (uas.id() <= 0 )
{
ERROR_LOG()<<" -- onUnlockUAS invalid uasId: "<<uas.id()<<" !!!";
ERROR_LOG(m_logger)<<" -- onUnlockUAS invalid uasId: "<<uas.id()<<" !!!";
return;
}
if (!m_participant.equipmentNumber().is_set())
{
ERROR_LOG()<<" -- onUnlockUAS invalid EquipmentNumber for UAS: "<<uas.id()<<" !!!";
ERROR_LOG(m_logger)<<" -- onUnlockUAS invalid EquipmentNumber for UAS: "<<uas.id()<<" !!!";
return;
}
ModifyUasStateRequest req;
@@ -85,6 +85,7 @@ signals:
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool setUiValues();
static void setBackgroundColor(QWidget *w, Qt::GlobalColor color, bool bSetColor);
@@ -146,6 +147,7 @@ private Q_SLOTS:
void onOpenTargetConfigurationL400();
private:
NGL::INGLLogger &m_logger;
Participant m_participant;
int m_uasId;
qint64 m_lastPositionMSec;
@@ -11,16 +11,15 @@
namespace ParticipantManagement
{
ParticipantInfoLtdGearComponent::ParticipantInfoLtdGearComponent(QTableWidget *tableWidget)
: m_tableWidget(tableWidget)
{
ParticipantInfoLtdGearComponent::ParticipantInfoLtdGearComponent(QTableWidget *tableWidget) : m_tableWidget(tableWidget),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
if (!m_tableWidget)
ERROR_LOG() << "Got invalid table widget.";
ERROR_LOG(m_logger) << "Got invalid table widget.";
}
void ParticipantInfoLtdGearComponent::updateData(const std::vector<LaserDesignation> &newData)
{
TRACE_LOG() << Q_FUNC_INFO;
TRACE_LOG(m_logger) << Q_FUNC_INFO;
if (!m_tableWidget)
return;
@@ -36,7 +35,7 @@ void ParticipantInfoLtdGearComponent::updateData(const std::vector<LaserDesignat
void ParticipantInfoLtdGearComponent::addGear(int gearId, int row)
{
TRACE_LOG() << Q_FUNC_INFO;
TRACE_LOG(m_logger) << Q_FUNC_INFO;
if (!m_tableWidget)
return;
@@ -60,7 +59,7 @@ void ParticipantInfoLtdGearComponent::clear()
void ParticipantInfoLtdGearComponent::updateRow(const LaserDesignation &laserDesignation)
{
TRACE_LOG() << Q_FUNC_INFO << ": " << laserDesignation;
TRACE_LOG(m_logger) << Q_FUNC_INFO << ": " << laserDesignation;
if (!m_rowPerGearId.contains(laserDesignation.gearId()) || !m_rowPerGearId.value(laserDesignation.gearId()).isValid())
return;
@@ -71,7 +70,7 @@ void ParticipantInfoLtdGearComponent::updateRow(const LaserDesignation &laserDes
void ParticipantInfoLtdGearComponent::removeOutdatedData(const std::vector<LaserDesignation> &newData)
{
TRACE_LOG() << Q_FUNC_INFO;
TRACE_LOG(m_logger) << Q_FUNC_INFO;
if (!m_tableWidget)
return;
@@ -33,6 +33,7 @@ public:
static const int LTD_ID {1043};
private:
NGL::INGLLogger &m_logger;
struct LtdRow
{
QTableWidgetItem *chargeType {nullptr} ;
@@ -52,7 +52,7 @@ void ParticipantInfoTableDialog::retranslate()
bool ParticipantInfoTableDialog::init(LtsSession::LtsSession *session,
const std::shared_ptr<Interface::Dtc> &dtc)
{
DEBUG_LOG() << "**** init";
DEBUG_LOG(m_logger) << "**** init";
m_session = session;
m_dtc = dtc;
@@ -104,7 +104,7 @@ void ParticipantInfoTableDialog::onColumnContextMenu(const QPoint &position)
void ParticipantInfoTableDialog::onAddClicked()
{
DEBUG_LOG() << "**** onAddClicked() ";
DEBUG_LOG(m_logger) << "**** onAddClicked() ";
InfoTableAddDialog *addParticipantsDialog = new InfoTableAddDialog(this);
addParticipantsDialog->init(m_session, m_dtc);
@@ -118,7 +118,7 @@ void ParticipantInfoTableDialog::onAddClicked()
void ParticipantInfoTableDialog::onRemoveClicked()
{
DEBUG_LOG() << "**** onRemoveClicked() ";
DEBUG_LOG(m_logger) << "**** onRemoveClicked() ";
const QModelIndexList selectedRows = m_ui->tvParticipant->selectionModel()->selectedRows();
if (!selectedRows.count())
@@ -138,7 +138,7 @@ void ParticipantInfoTableDialog::onRemoveClicked()
void ParticipantInfoTableDialog::onSelectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
DEBUG_LOG() << "onSelectionChanged";
DEBUG_LOG(m_logger) << "onSelectionChanged";
Q_UNUSED(selected);
Q_UNUSED(deselected);
@@ -148,7 +148,7 @@ void ParticipantInfoTableDialog::onSelectionChanged(const QItemSelection &select
void ParticipantInfoTableDialog::onShowTlnInfo(const QModelIndex &idx)
{
DEBUG_LOG() << "onDoubleClick --> showTlnInfo";
DEBUG_LOG(m_logger) << "onDoubleClick --> showTlnInfo";
QModelIndex realIdx = m_sortFilterProxyModel->mapToSource(idx);
const int id = m_infoTableModel->getRowData(realIdx.row()).id();
@@ -42,7 +42,7 @@ bool ParticipantInfoTableModel::initModel(LtsSession::LtsSession *session,
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
bool bWithPositionandBiteResult)
{
DEBUG_LOG() << "**** initModel";
DEBUG_LOG(m_logger) << "**** initModel";
m_session = session;
m_ppmDtc = ppmDtc;
@@ -210,7 +210,7 @@ void ParticipantInfoTableModel::updateDataView(const QSet<int> &participantIds)
void ParticipantInfoTableModel::onParticipantChanged(const ParticipantManagement::DynamicParticipantData &data,
DataModification modType)
{
DEBUG_LOG() << "**** participantDataChanged";
DEBUG_LOG(m_logger) << "**** participantDataChanged";
const int row = findRowForId(data.participantId());
if (row < 0)
@@ -74,6 +74,7 @@ protected Q_SLOTS:
void onTimeoutCheck();
private:
NGL::INGLLogger &m_logger;
ParticipantInfo setInfoData(const ParticipantManagement::Participant &part) const;
void fillParticipantContent(ParticipantInfo &info,
const DynamicParticipantData &data) const;
@@ -56,6 +56,8 @@ private slots:
void leaveEvent(QEvent *e) override;
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
int changeLabelText(int value);
void onClicked();
@@ -175,7 +175,7 @@ void ParticipantSetInjuryDialog::setOldData(const DynamicParticipantData &data)
int index = m_ui->cbState->findData(lastState.vulnerabilityState().underlying());
DEBUG_LOG() << "Old vulnerability state = " << index;
DEBUG_LOG(m_logger) << "Old vulnerability state = " << index;
if (index > 0)
m_ui->cbState->setCurrentIndex(index);
@@ -188,10 +188,10 @@ uint32_t ParticipantSetInjuryDialog::getInjuryBit()
int side = m_bgSide->button(1)->isEnabled() ? m_bgSide->checkedId() : 0;
DEBUG_LOG() << "getInjuryBit() -------------- ";
DEBUG_LOG() << "Injury = " << m_bgInjury->checkedId();
DEBUG_LOG() << "Body = " << m_bgBodypart->checkedId();
DEBUG_LOG() << "Side = " << side;
DEBUG_LOG(m_logger) << "getInjuryBit() -------------- ";
DEBUG_LOG(m_logger) << "Injury = " << m_bgInjury->checkedId();
DEBUG_LOG(m_logger) << "Body = " << m_bgBodypart->checkedId();
DEBUG_LOG(m_logger) << "Side = " << side;
return (((((m_bgInjury->checkedId() * 16) + m_bgBodypart->checkedId()) * 4) + side) + 2048);
@@ -328,8 +328,8 @@ bool ParticipantSetInjuryDialog::apply()
req.participantIds({m_participantId});
req.vulnerabilityKind(getInjuryBit());
DEBUG_LOG() << "Saving vulnerability state = " << req.vulnerabilityState();
DEBUG_LOG() << "Saving vulnerability kind = " << req.vulnerabilityKind();
DEBUG_LOG(m_logger) << "Saving vulnerability state = " << req.vulnerabilityState();
DEBUG_LOG(m_logger) << "Saving vulnerability kind = " << req.vulnerabilityKind();
return m_requestHelper->startSingleRequest([req, this]()
{
@@ -78,6 +78,7 @@ public:
~ParticipantSetInjuryDialog();
private:
NGL::INGLLogger &m_logger;
void onModifyStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void retranslate() override;
@@ -93,9 +94,11 @@ private slots:
void resetRadioStates(bool onlySides = false);
private:
NGL::INGLLogger &m_logger;
bool apply() override final;
private:
NGL::INGLLogger &m_logger;
int m_participantId;
int m_eqId;
LtsSession::LtsSession *m_session;
@@ -197,8 +197,8 @@ bool ParticipantSetSanitationDialog::apply()
sanDat.originatorEquipmentNumber(0);
req.data(sanDat);
DEBUG_LOG() << "Medic treatment: qualification = " << sanDat.qualification();
DEBUG_LOG() << "Medic treatment: procedures = " << sanDat.sanitationProceduresTaken();
DEBUG_LOG(m_logger) << "Medic treatment: qualification = " << sanDat.qualification();
DEBUG_LOG(m_logger) << "Medic treatment: procedures = " << sanDat.sanitationProceduresTaken();
return m_requestHelper->startSingleRequest([req, this]()
{
@@ -46,6 +46,7 @@ public:
private slots:
void onQualificationChanged();
private:
NGL::INGLLogger &m_logger;
void fillCb();
void setCbxName();
qint64 getProcedures();
@@ -56,6 +57,7 @@ private:
void onSetSanitationReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
private:
NGL::INGLLogger &m_logger;
LtsUtils::RequestHelper *m_requestHelper;
int m_participantId;
int m_eqId{-1};
@@ -33,7 +33,7 @@ parent)
bool AreaModel::initModel(const TargetInformation &targetInformation)
{
INFO_LOG() << "initModel - #AreaModel: " << targetInformation.shootbackAreas().size();
INFO_LOG(m_logger) << "initModel - #AreaModel: " << targetInformation.shootbackAreas().size();
for (auto singleArea : std::as_const(targetInformation.shootbackAreas()))
onShootbackAreaChanged(singleArea, DataModification::eAdded);
@@ -79,7 +79,7 @@ QVariant AreaModel::headerData(int section, Qt::Orientation orientation, int rol
QVariant AreaModel::data(const QModelIndex &index, int role) const
{
INFO_LOG() << Q_FUNC_INFO << " role=" << role
INFO_LOG(m_logger) << Q_FUNC_INFO << " role=" << role
<< " index = " << index.column();
if (!indexIsValid(index))
@@ -36,16 +36,16 @@ ParticipantTargetConfigurationDialog::ParticipantTargetConfigurationDialog(QWidg
, m_requestHelper(new LtsUtils::RequestHelper(this))
, m_ui(new Ui::ParticipantTargetConfigurationDialog)
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
m_ui->setupUi(this);
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
ParticipantTargetConfigurationDialog::~ParticipantTargetConfigurationDialog()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
delete m_ui;
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantTargetConfigurationDialog::retranslate()
@@ -58,14 +58,14 @@ void ParticipantTargetConfigurationDialog::retranslate()
bool ParticipantTargetConfigurationDialog::apply()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
ModifyTargetInformationRequest req;
req.targetInfo(m_targetInformation);
DEBUG_LOG() << Q_FUNC_INFO << " update m_targetInformation: " << m_targetInformation;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " update m_targetInformation: " << m_targetInformation;
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
return m_requestHelper->startSingleRequest([req, this]()
{
return m_ftc->modifyTargetInformationRequest(req, this);
@@ -77,11 +77,11 @@ bool ParticipantTargetConfigurationDialog::init(int participantId,
const std::shared_ptr<Interface::Ftc> &ftc,
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMapGuiIfc)
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
m_participantId = participantId;
if (m_participantId <= 0)
{
ERROR_LOG() << Q_FUNC_INFO << " participant invalid, participantId = " << m_participantId;
ERROR_LOG(m_logger) << Q_FUNC_INFO << " participant invalid, participantId = " << m_participantId;
return false;
}
@@ -156,7 +156,7 @@ bool ParticipantTargetConfigurationDialog::init(int participantId,
{
onTargetInformationChanged(m_targetInformation, DataModification::eAdded);
} else {
DEBUG_LOG() << Q_FUNC_INFO << " targetInformation not found for participantId = " << m_participantId
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " targetInformation not found for participantId = " << m_participantId
<< " - use default.";
m_targetInformation.participantId(m_participantId);
}
@@ -167,7 +167,7 @@ bool ParticipantTargetConfigurationDialog::init(int participantId,
m_ui->cb_showOnMap->setChecked(true);
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
return true;
}
@@ -190,8 +190,8 @@ void ParticipantTargetConfigurationDialog::onDynamicParticipantDataChanged(const
const ProjectDataManagement::VulnerabilityState_def::type vulStateType = vulState.underlying();
int idx = m_ui->cb_status->findData(vulStateType);
DEBUG_LOG() << Q_FUNC_INFO << " cb_status: vulState=" << vulState;
DEBUG_LOG() << Q_FUNC_INFO << " cb_status: setCurrentIndex idx=" << idx;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " cb_status: vulState=" << vulState;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " cb_status: setCurrentIndex idx=" << idx;
m_ui->cb_status->setCurrentIndex(idx);
m_ui->cb_status->setEnabled(true);
}
@@ -213,7 +213,7 @@ void ParticipantTargetConfigurationDialog::onTargetInformationChanged(const Targ
case DataModification::eAdded:
case DataModification::eModified:
{
DEBUG_LOG() << Q_FUNC_INFO << " got new targetInformation from dds: " << data;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " got new targetInformation from dds: " << data;
m_targetInformation = data;
}
break;
@@ -224,7 +224,7 @@ void ParticipantTargetConfigurationDialog::onTargetInformationChanged(const Targ
void ParticipantTargetConfigurationDialog::onStatusChanged()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
m_ui->cb_status->setEnabled(false);
@@ -293,7 +293,7 @@ void ParticipantTargetConfigurationDialog::onStatusChanged()
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
@@ -400,7 +400,7 @@ bool updateValue(ProjectDataManagement::VulnerabilityState& oldValueRef, Project
void ParticipantTargetConfigurationDialog::onGuiChanged()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
bool hasChanged = false;
@@ -417,26 +417,26 @@ void ParticipantTargetConfigurationDialog::onGuiChanged()
hasChanged |= updateValue(m_targetInformation.takedownEffect(), static_cast<ProjectDataManagement::VulnerabilityState_def::type>(m_ui->cb_takeDownEffect->currentData().toInt()) );
hasChanged |= updateValue(m_targetInformation.takedownInterval(), m_ui->sb_takeDownInterval->value());
DEBUG_LOG() << Q_FUNC_INFO << " hasChanged=" << hasChanged;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " hasChanged=" << hasChanged;
const std::vector<ParticipantManagement::ShootbackArea> &modelAreasStdVec = m_areaModel.getDataStdVector();
if (modelAreasStdVec != m_targetInformation.shootbackAreas())
{
DEBUG_LOG() << Q_FUNC_INFO << " hasChanged=" << hasChanged;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " hasChanged=" << hasChanged;
hasChanged = true;
m_targetInformation.shootbackAreas(modelAreasStdVec);
}
DEBUG_LOG() << Q_FUNC_INFO << " slotChangesMade sChanged=" << hasChanged;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " slotChangesMade sChanged=" << hasChanged;
this->slotChangesMade();
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantTargetConfigurationDialog::onDataChanged()
{
TRACE_LOG() << Q_FUNC_INFO << " START, m_targetInformation=" << m_targetInformation;
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, m_targetInformation=" << m_targetInformation;
int idx;
@@ -461,12 +461,12 @@ void ParticipantTargetConfigurationDialog::onDataChanged()
QVector<ShootbackArea> qVec = QVector<ShootbackArea>(areas.begin(), areas.end());
m_areaModel.setData(qVec);
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantTargetConfigurationDialog::onAddBtnClicked()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
if (!m_sitMapGuiIfc)
return;
@@ -477,7 +477,7 @@ void ParticipantTargetConfigurationDialog::onAddBtnClicked()
s_minPoints,
s_maxPoints);
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
QPolygonF areaToPolygon(const ShootbackArea &area)
@@ -506,14 +506,14 @@ QPolygonF areaToPolygon(const ShootbackArea &area)
void ParticipantTargetConfigurationDialog::onEditBtnClicked()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
if (!m_sitMapGuiIfc)
return;
const QModelIndex curIdx = m_ui->ltsDataView->currentIndex();
if (!curIdx.isValid())
return;
INFO_LOG() << " edit...";
INFO_LOG(m_logger) << " edit...";
const ShootbackArea &area = m_areaModel.getRowData(curIdx.row());
@@ -531,24 +531,24 @@ void ParticipantTargetConfigurationDialog::onEditBtnClicked()
-1,
coordinates);
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantTargetConfigurationDialog::onRemoveBtnClicked()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
const QModelIndex curIdx = m_ui->ltsDataView->currentIndex();
if (!curIdx.isValid())
return;
INFO_LOG() << " remove...";
INFO_LOG(m_logger) << " remove...";
m_areaModel.removeRow(curIdx.row());
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantTargetConfigurationDialog::onShowOnMapChanged(int)
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
if (!m_sitMapGuiIfc)
return;
@@ -562,7 +562,7 @@ void ParticipantTargetConfigurationDialog::onShowOnMapChanged(int)
for (int row = 0; row < rowCount; ++row)
{
const ShootbackArea &currentArea = m_areaModel.getRowData(row);
INFO_LOG() << " row=" << row << " ; currentArea " << currentArea;
INFO_LOG(m_logger) << " row=" << row << " ; currentArea " << currentArea;
const QPolygonF &poly = areaToPolygon(currentArea);
polyVec.append(poly);
}
@@ -571,7 +571,7 @@ void ParticipantTargetConfigurationDialog::onShowOnMapChanged(int)
} else {
m_sitMapGuiIfc->removePreviewObject();
}
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
void ParticipantTargetConfigurationDialog::onSelectionChanged()
@@ -592,7 +592,7 @@ void ParticipantTargetConfigurationDialog::onSelectionChanged()
int row = curIdx.row();
ShootbackArea currentArea = m_areaModel.getRowData(row);
INFO_LOG() << " currentArea "<< currentArea;
INFO_LOG(m_logger) << " currentArea "<< currentArea;
m_previewPolygon = areaToPolygon(currentArea);
@@ -602,11 +602,11 @@ void ParticipantTargetConfigurationDialog::onSelectionChanged()
void ParticipantTargetConfigurationDialog::onPolygonData(const QPolygonF &poly)
{
INFO_LOG() << Q_FUNC_INFO << " START";
INFO_LOG(m_logger) << Q_FUNC_INFO << " START";
if (poly.size() < 3)
{
ERROR_LOG() << Q_FUNC_INFO << " polygon insufficiant, size=" << poly.size();
ERROR_LOG(m_logger) << Q_FUNC_INFO << " polygon insufficiant, size=" << poly.size();
return;
}
@@ -627,13 +627,13 @@ void ParticipantTargetConfigurationDialog::onPolygonData(const QPolygonF &poly)
return;
ShootbackArea temp = m_areaModel.getRowData(curIdx.row());
newArea.identifier(temp.identifier());
DEBUG_LOG() << Q_FUNC_INFO << "updating newArea = " << newArea;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "updating newArea = " << newArea;
m_areaModel.setRowData(curIdx.row(), newArea);
} else {
int size = m_areaModel.rowCount();
newArea.identifier(QString(QStringLiteral("Area_%1")).arg(size).toStdString());
DEBUG_LOG() << Q_FUNC_INFO << " adding tempArea = " << newArea;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " adding tempArea = " << newArea;
m_areaModel.insertRow(newArea);
QModelIndex mi = m_areaModel.index(size, 0);
@@ -649,22 +649,21 @@ void ParticipantTargetConfigurationDialog::onPolygonData(const QPolygonF &poly)
void ParticipantTargetConfigurationDialog::showPreviewObject()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
if (!m_sitMapGuiIfc || m_previewPolygon.isEmpty())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
EditNameDelegate::EditNameDelegate(QWidget *parent)
: QItemDelegate(parent)
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG() << Q_FUNC_INFO << " END";
EditNameDelegate::EditNameDelegate(QWidget *parent) : QItemDelegate(parent),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
QWidget *EditNameDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
@@ -691,7 +690,7 @@ void EditNameDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
QVariant v = index.data(Qt::EditRole);
le->setText(v.toString());
DEBUG_LOG() << Q_FUNC_INFO
DEBUG_LOG(m_logger) << Q_FUNC_INFO
<< " rox/column: " << index.row() << "/" << index.column()
<< " Input: " << v.toString();
}
@@ -704,7 +703,7 @@ void EditNameDelegate::setModelData(QWidget *editor,
if (!le)
return;
DEBUG_LOG() << Q_FUNC_INFO
DEBUG_LOG(m_logger) << Q_FUNC_INFO
<< " rox/column: " << index.row() << "/" << index.column()
<< " setData... Input: " << le->text();
@@ -45,7 +45,7 @@ void ParticipantsMountedTableDialog::onShowTlnInfo()
if (!m_ppmGuiIfc)
return;
DEBUG_LOG() << "onDoubleClick --> showTlnInfo";
DEBUG_LOG(m_logger) << "onDoubleClick --> showTlnInfo";
const QModelIndex idx = m_ui->tvMountedParticipants->currentIndex();
const int id = m_mountedTableModel->getRowData(idx.row()).id();
m_ppmGuiIfc->showParticipantInfoWindow(id);
@@ -43,7 +43,7 @@ bool CombatPower::init(const std::shared_ptr<ParticipantManagement::Interface::D
{
if (!dtc || !asbIfc || !ppmGuiCbxIfc)
{
ERROR_LOG() << "Could not load all interfaces needed";
ERROR_LOG(m_logger) << "Could not load all interfaces needed";
return false;
}
m_dtc = dtc;
@@ -67,7 +67,7 @@ bool CombatPower::init(const std::shared_ptr<ParticipantManagement::Interface::D
if (idx >= 0)
m_ui->cbParty->setCurrentIndex(idx);
DEBUG_LOG() << "Init CombatPower - parties: " << m_ui->cbParty->count();
DEBUG_LOG(m_logger) << "Init CombatPower - parties: " << m_ui->cbParty->count();
onPartyChanged();
m_ui->vLay->addWidget(m_orgChart);
return true;
@@ -75,7 +75,7 @@ bool CombatPower::init(const std::shared_ptr<ParticipantManagement::Interface::D
void CombatPower::onPartyChanged()
{
DEBUG_LOG() << "onPartyChanged - parties: " << m_ui->cbParty->count();
DEBUG_LOG(m_logger) << "onPartyChanged - parties: " << m_ui->cbParty->count();
if (s_preselectedParty == -1)
m_ui->cbParty->setCurrentIndex(s_preselectedParty);
s_preselectedParty = m_ui->cbParty->currentData().toUInt();
@@ -91,7 +91,7 @@ void CombatPower::onOpenInfo(int id)
void CombatPower::onUpdateParticipant(const Participant &data, DataModification modType)
{
DEBUG_LOG() << "onUpdateParticipant - parties: " << m_ui->cbParty->count();
DEBUG_LOG(m_logger) << "onUpdateParticipant - parties: " << m_ui->cbParty->count();
if (data.partyId() != m_ui->cbParty->currentData().toInt())
return;
if (modType == DataModification::eModified)
@@ -102,7 +102,7 @@ void CombatPower::onUpdateParticipant(const Participant &data, DataModification
void CombatPower::onUpdateDynamicParticipantData(const DynamicParticipantData &data, DataModification modType)
{
DEBUG_LOG() << "onUpdateDynamicParticipantData - parties: " << m_ui->cbParty->count();
DEBUG_LOG(m_logger) << "onUpdateDynamicParticipantData - parties: " << m_ui->cbParty->count();
if (m_dtc->participant(data.participantId()).partyId() != m_ui->cbParty->currentData().toInt())
return;
if (modType == DataModification::eModified)
@@ -42,6 +42,7 @@ private slots:
void onUpdateParticipant(const Participant &data, DataModification modType);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
ParticipantManagement::LtsParticipantsOrgChart *m_orgChart;
@@ -47,7 +47,9 @@ OrgChartMain::OrgChartMain(LtsSession::LtsSession *session
OrgChartMain::~OrgChartMain()
{
#ifdef BUILD_RTI
m_topicLockHanderData.disconnect();
#endif
m_orgChart->setParent(nullptr);
m_orgChart->deleteLater();
@@ -62,11 +64,11 @@ void OrgChartMain::retranslate()
void OrgChartMain::fillComboBoxes()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
if (!m_isTemplate)
m_ppmGuiCbxIfc->fillPartyComboBox(m_ui->cbParty);
DEBUG_LOG() << "Init OrgChartMain - parties: " << m_ui->cbParty->count() << " is template? " << m_isTemplate;
DEBUG_LOG(m_logger) << "Init OrgChartMain - parties: " << m_ui->cbParty->count() << " is template? " << m_isTemplate;
}
void OrgChartMain::updateButtonMimeData()
@@ -99,7 +101,7 @@ void OrgChartMain::updateButtonMimeData()
QColor OrgChartMain::currentPartyColor()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
QColor color = AdvancedSymbology::SymbolDataToRender::unknownColor();
int partyId = -1;
@@ -109,7 +111,7 @@ QColor OrgChartMain::currentPartyColor()
if (partyId > 0)
color = QColor::fromRgb(QRgb(m_dtc->party(partyId).color()));
TRACE_LOG() << Q_FUNC_INFO << " color=" << color.name()
TRACE_LOG(m_logger) << Q_FUNC_INFO << " color=" << color.name()
<< " (partyId = " << partyId << ")"
<< " (m_asSupportService=" << m_asSupportService << ")"
<< " (m_ui->cbParty->isVisible()=" << m_ui->cbParty->isVisible() << ")";
@@ -118,7 +120,7 @@ QColor OrgChartMain::currentPartyColor()
AdvancedSymbology::Role OrgChartMain::currentPartyRole()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
AdvancedSymbology::Role role = AdvancedSymbology::Role::Unknown;
@@ -129,7 +131,7 @@ AdvancedSymbology::Role OrgChartMain::currentPartyRole()
if (partyId > 0)
role = AdvancedSymbology::roleToRole<>(m_dtc->party(partyId).role());
TRACE_LOG() << Q_FUNC_INFO << " role=" << role
TRACE_LOG(m_logger) << Q_FUNC_INFO << " role=" << role
<< " (partyId = " << partyId << ")"
<< " (m_asSupportService=" << m_asSupportService << ")"
<< " (m_ui->cbParty->isVisible()=" << m_ui->cbParty->isVisible() << ")";
@@ -147,7 +149,7 @@ bool OrgChartMain::init(const std::shared_ptr<ParticipantManagement::Interface::
{
if (!dtc || !ftc || !ppmGuiCbxIfc || !asbIfc)
{
ERROR_LOG() << "Could not load all interfaces needed";
ERROR_LOG(m_logger) << "Could not load all interfaces needed";
return false;
}
m_dtc = dtc;
@@ -171,7 +173,9 @@ bool OrgChartMain::init(const std::shared_ptr<ParticipantManagement::Interface::
return false;
connect(m_dtc.get(), &Interface::Dtc::participantChanged, this, &OrgChartMain::onUpdateParticipant, Qt::UniqueConnection);
#ifdef BUILD_RTI
initTopicLockHandler();
#endif
m_ui->vLay->addWidget(m_orgChart);
if (m_session->partitionType() != IDL::PartitionType::Global)
@@ -181,7 +185,7 @@ bool OrgChartMain::init(const std::shared_ptr<ParticipantManagement::Interface::
this,
&OrgChartMain::onPartyChanged, Qt::UniqueConnection);
m_ppmGuiCbxIfc->fillPartyComboBox(m_ui->cbParty);
DEBUG_LOG() << "Init OrgChartMain - parties: " << m_ui->cbParty->count();
DEBUG_LOG(m_logger) << "Init OrgChartMain - parties: " << m_ui->cbParty->count();
onPartyChanged();
}
else
@@ -194,13 +198,14 @@ bool OrgChartMain::init(const std::shared_ptr<ParticipantManagement::Interface::
return initButtons();
}
#ifdef BUILD_RTI
void OrgChartMain::initTopicLockHandler()
{
std::shared_ptr<Core::Interface::Ftc> coreFtc;
if (!m_session->createTopicClient<Core::Interface::Ftc>(coreFtc))
{
ERROR_LOG() << Q_FUNC_INFO << " create coreFtc failed";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " create coreFtc failed";
return;
}
coreFtc->enableAll();
@@ -212,7 +217,7 @@ void OrgChartMain::initTopicLockHandler()
void OrgChartMain::onLockDataChanged()
{
DEBUG_LOG() << Q_FUNC_INFO << " START";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
m_ui->cbParty->setEnabled(true);
@@ -223,7 +228,7 @@ void OrgChartMain::onLockDataChanged()
if (m_topicLockedBy.isEmpty())
{
DEBUG_LOG() << Q_FUNC_INFO << " READ-WRITE";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " READ-WRITE";
setUnchangeable(false);
m_orgChart->setDisabled(false);
@@ -231,7 +236,7 @@ void OrgChartMain::onLockDataChanged()
else
{
DEBUG_LOG() << Q_FUNC_INFO << " READ-ONLY";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " READ-ONLY";
setUnchangeable(true);
m_orgChart->setDisabled(true);
@@ -239,7 +244,7 @@ void OrgChartMain::onLockDataChanged()
retranslate();
}
#endif
bool OrgChartMain::loadTemplate(int templateRootId, bool isSupport)
{
@@ -323,7 +328,7 @@ bool OrgChartMain::initButtons()
return true;
for (const ParticipantManagement::TemplateParticipant &templateData : std::as_const(templates))
{
DEBUG_LOG() << Q_FUNC_INFO << " templateId = " << templateData.templateId()
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " templateId = " << templateData.templateId()
<< " typeId = " << templateData.typeId()
<< " designator= " << templateData.designator().c_str()
<< " tactIdent= " << templateData.tacticalIdentifier().c_str();
@@ -363,7 +368,7 @@ bool OrgChartMain::initButtons()
m_templateMimeDataHelpers[icon] = mimeDataHelper;
if (!mimeDataHelper->init(icon, templateId, m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType()))
{
ERROR_LOG() << Q_FUNC_INFO << " init failed"
ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"
<< " (m_ui->cbParty->isVisible() " << m_ui->cbParty->isVisible() << ")";
continue;
}
@@ -553,14 +558,15 @@ void OrgChartMain::onPartyChanged()
__unchange__();
DEBUG_LOG() << "onPartyChanged - parties: " << m_ui->cbParty->count();
DEBUG_LOG(m_logger) << "onPartyChanged - parties: " << m_ui->cbParty->count();
m_party = m_ui->cbParty->currentData().toInt();
DEBUG_LOG() << " OrgChartMain::onPartyChanged()!!! -> newPartyId" << m_party;
DEBUG_LOG(m_logger) << " OrgChartMain::onPartyChanged()!!! -> newPartyId" << m_party;
m_ui->cbParty->setEnabled(false);
#ifdef BUILD_RTI
if (m_topicLockHanderData.isLocked())
{
@@ -573,6 +579,7 @@ void OrgChartMain::onPartyChanged()
topicInfo.setEntity(m_party);
topicInfo.setValid();
m_topicLockHanderData.slotTryLock(topicInfo);
#endif
if (m_orgChart)
m_orgChart->loadParty(m_party);
@@ -644,7 +651,7 @@ void OrgChartMain::onDelete(const QString &data)
void OrgChartMain::onUpdateItem(const QModelIndex &parent, const ParticipantData &editData)
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
Q_UNUSED(parent);
@@ -17,7 +17,9 @@
#include <LtsWidgets/lts_dialog.h>
#include <LtsSession/lts_session.h>
#ifdef BUILD_RTI
#include <LtsSession/lts_session_lock_handler.h>
#endif
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <QPointer>
@@ -50,13 +52,16 @@ public:
, bool useSymData = true
, bool asSupportService = false
, int templateId = -1);
#ifdef BUILD_RTI
void initTopicLockHandler();
#endif
void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onModifyTemplateDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
bool loadTemplate(int templateRootId, bool isSupport = false);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool initButtons();
QByteArray getMimeData(const Type &type, const QImage &image);
@@ -80,9 +85,12 @@ private slots:
void onReload();
void onUpdateParticipant(const Participant &data, DataModification modType);
#ifdef BUILD_RTI
void onLockDataChanged();
#endif
private:
NGL::INGLLogger &m_logger;
ParticipantManagement::LtsParticipantsOrgChart *m_orgChart;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
@@ -98,9 +106,9 @@ private:
QMap<QPointer<LtsWidgets::LtsDragIcon>, QPointer<OrgChartMain_MimeDataHelper>> m_templateMimeDataHelpers;
#ifdef BUILD_RTI
LtsSession::TopicLockHanderData m_topicLockHanderData;
#endif
bool m_useSymData;
bool m_asSupportService;
@@ -12,16 +12,16 @@ namespace ParticipantManagement
OrgChartMain_MimeDataHelper::OrgChartMain_MimeDataHelper(QObject *parent)
: QObject(parent)
{
TRACE_LOG() << Q_FUNC_INFO << "START";
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
OrgChartMain_MimeDataHelper::~OrgChartMain_MimeDataHelper()
{
TRACE_LOG() << Q_FUNC_INFO << "START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START";
delete m_bulkRendererFindImage;
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
bool OrgChartMain_MimeDataHelper::init(LtsWidgets::LtsDragIcon *widget,
@@ -29,14 +29,14 @@ bool OrgChartMain_MimeDataHelper::init(LtsWidgets::LtsDragIcon *widget,
const std::shared_ptr<Interface::Dtc> &dtc,
AdvancedSymbology::SymbologyType symbologyType)
{
TRACE_LOG() << Q_FUNC_INFO << "START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START";
m_templateId = templateId;
m_symbologyType = symbologyType;
if (!widget)
{
ERROR_LOG() << Q_FUNC_INFO << "no widget";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "no widget";
return false;
}
m_widget = widget;
@@ -44,18 +44,18 @@ bool OrgChartMain_MimeDataHelper::init(LtsWidgets::LtsDragIcon *widget,
if (!dtc)
{
ERROR_LOG() << "Could not load all interfaces needed";
ERROR_LOG(m_logger) << "Could not load all interfaces needed";
return false;
}
m_dtc = dtc;
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
return true;
}
void OrgChartMain_MimeDataHelper::run(AdvancedSymbology::Role role, const QColor &color)
{
TRACE_LOG() << Q_FUNC_INFO << "START"
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"
<< " m_symbologyType = " << m_symbologyType
<< " role = " << role
<< " color = " << color.name();
@@ -65,7 +65,7 @@ void OrgChartMain_MimeDataHelper::run(AdvancedSymbology::Role role, const QColor
if (!m_dtc)
{
ERROR_LOG() << "Could not load all interfaces needed";
ERROR_LOG(m_logger) << "Could not load all interfaces needed";
return;
}
@@ -83,12 +83,12 @@ void OrgChartMain_MimeDataHelper::run(AdvancedSymbology::Role role, const QColor
m_bulkRendererFindImage->run();
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
void OrgChartMain_MimeDataHelper::prepareBulkRenderer(int templateId)
{
TRACE_LOG() << Q_FUNC_INFO << "START"
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"
<< " templateId= " << templateId;
const TemplateParticipant &tPart = m_dtc->templateParticipant(templateId);
@@ -96,7 +96,7 @@ void OrgChartMain_MimeDataHelper::prepareBulkRenderer(int templateId)
const AdvancedSymbology::SymbolDataToRender &symDataToRender =
symbolDataToRender(QString::fromStdString(tPart.symbol()));
DEBUG_LOG() << Q_FUNC_INFO << " addRequest for templateId = " << templateId << ": "
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " addRequest for templateId = " << templateId << ": "
<< " tPart = " << tPart
<< " symDataToRender=" << symDataToRender.toString();
@@ -112,7 +112,7 @@ void OrgChartMain_MimeDataHelper::prepareBulkRenderer(int templateId)
prepareBulkRenderer(infId);
}
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
QJsonObject OrgChartMain_MimeDataHelper::getMimeData(int templateId)
@@ -141,7 +141,7 @@ QJsonObject OrgChartMain_MimeDataHelper::getMimeData(int templateId)
const AdvancedSymbology::SymbolDataToRender &symDataToRender =
symbolDataToRender(QString::fromStdString(tPart.symbol()));
DEBUG_LOG() << Q_FUNC_INFO << " getResult for templateId = " << templateId
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " getResult for templateId = " << templateId
<< " symDataToRender=" << symDataToRender.toString();
QSharedPointer<AdvancedSymbology::SymbolResultWatcher> watcher =
@@ -157,7 +157,7 @@ QJsonObject OrgChartMain_MimeDataHelper::getMimeData(int templateId)
.arg(QString::fromLatin1(data.toBase64()));
retObj.insert(QStringLiteral("image"), imageAdd);
} else {
ERROR_LOG() << Q_FUNC_INFO << " getResult failed! "
ERROR_LOG(m_logger) << Q_FUNC_INFO << " getResult failed! "
<< " templateId = " << templateId
<< " symDataToRender=" << symDataToRender.toString();
}
@@ -189,10 +189,10 @@ AdvancedSymbology::SymbolDataToRender OrgChartMain_MimeDataHelper::symbolDataToR
void OrgChartMain_MimeDataHelper::onRenderingFinished()
{
TRACE_LOG() << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size();
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size();
const QJsonObject &obj = getMimeData(m_templateId);
DEBUG_LOG() << Q_FUNC_INFO << " m_templateId =" << m_templateId
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_templateId =" << m_templateId
<< " obj.size = " << obj.size()
<< " size2 = " << QJsonDocument(obj).toJson().size();
@@ -202,7 +202,7 @@ void OrgChartMain_MimeDataHelper::onRenderingFinished()
m_widget->setEnabled(true);
}
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
}
@@ -41,6 +41,8 @@ protected slots:
void onRenderingFinished();
private:
NGL::INGLLogger &m_logger;
void prepareBulkRenderer(int templateId);
QJsonObject getMimeData(int templateId);
AdvancedSymbology::SymbolDataToRender symbolDataToRender(const QString &sidc);
@@ -127,7 +127,7 @@ bool LtsParticipantsOrgChart::init(const std::shared_ptr<ParticipantManagement::
void LtsParticipantsOrgChart::loadParty(int partyId)
{
TRACE_LOG() << "loadParty " << partyId;
TRACE_LOG(m_logger) << "loadParty " << partyId;
m_partyId = partyId;
const QMap<qint32, ParticipantManagement::Participant> participantMap = m_dtc->participants();
@@ -159,7 +159,7 @@ void LtsParticipantsOrgChart::loadParty(int partyId)
m_participantOrgChart_MimeDataHelper = new ParticipantOrgChart_MimeDataHelper(this);
if (!m_participantOrgChart_MimeDataHelper->init(m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType(), true))
{
ERROR_LOG() << Q_FUNC_INFO << " init failed";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed";
return;
}
@@ -175,7 +175,7 @@ void LtsParticipantsOrgChart::loadParty(int partyId)
void LtsParticipantsOrgChart::onParticipantOrgChart_MimeDataHelperFinished()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
QString preDefThing = QLatin1String(" var datascource = ");
@@ -205,13 +205,13 @@ void LtsParticipantsOrgChart::onParticipantOrgChart_MimeDataHelperFinished()
m_ui->wevOrgChart->reload();
}
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
bool LtsParticipantsOrgChart::loadTemplate(int templateRootId)
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
ParticipantManagement::TemplateParticipant root = m_dtc->templateParticipant(templateRootId);
if (m_ui->wevOrgChart->page()->url().toString() == QLatin1String("about:blank"))
@@ -224,7 +224,7 @@ bool LtsParticipantsOrgChart::loadTemplate(int templateRootId)
m_participantOrgChart_MimeDataHelper = new ParticipantOrgChart_MimeDataHelper(this);
if (!m_participantOrgChart_MimeDataHelper->init(m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType(), false))
{
ERROR_LOG() << Q_FUNC_INFO << " init failed";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed";
return false;
}
@@ -247,7 +247,7 @@ void LtsParticipantsOrgChart::updateParticipant(int participantId)
if (!helper->init(m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType(), true))
{
ERROR_LOG() << Q_FUNC_INFO << " init failed";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed";
return;
}
@@ -265,24 +265,24 @@ void LtsParticipantsOrgChart::updateParticipant(int participantId)
void LtsParticipantsOrgChart::onSingleParticipantOrgChart_MimeDataHelperFinished()
{
TRACE_LOG() << Q_FUNC_INFO << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
ParticipantOrgChart_MimeDataHelper *senderWatcher = qobject_cast<ParticipantOrgChart_MimeDataHelper*>(sender());
if (!senderWatcher)
{
ERROR_LOG() << Q_FUNC_INFO << " sender failed";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " sender failed";
return;
}
const int participantId = senderWatcher->getParticipantId();
const QJsonObject &newJson = senderWatcher->getMimeDataResult();
DEBUG_LOG() << Q_FUNC_INFO << " sendUpdateString:"
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " sendUpdateString:"
<< " participantId=" << participantId;
emit sendUpdateString(participantId, newJson);
TRACE_LOG() << Q_FUNC_INFO << " END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
}
@@ -298,12 +298,11 @@ void LtsParticipantsOrgChart::getWholeHierarchy()
WebNofitifier::WebNofitifier(QObject *parent)
: QObject(parent)
WebNofitifier::WebNofitifier(QObject *parent) : QObject(parent)
, m_currentJsonString(QString())
, m_updateString(QString())
, m_updateTimer(new QTimer(this))
{
, m_updateTimer(new QTimer(this)),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
connect(m_updateTimer, &QTimer::timeout, this, &WebNofitifier::onTimerTick);
}
@@ -96,6 +96,8 @@ signals:
void sendUpdateString(int, const QJsonObject &);
private:
NGL::INGLLogger &m_logger;
int m_partyId;
bool m_useSymData;
bool m_isMenuEnabled;
@@ -13,40 +13,40 @@ namespace ParticipantManagement
ParticipantOrgChart_MimeDataHelper::ParticipantOrgChart_MimeDataHelper(QObject *parent)
: QObject(parent)
{
TRACE_LOG() << Q_FUNC_INFO << "START";
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
ParticipantOrgChart_MimeDataHelper::~ParticipantOrgChart_MimeDataHelper()
{
TRACE_LOG() << Q_FUNC_INFO << "START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START";
delete m_bulkRendererFindImage;
delete m_bulkRendererFindBaseSymbol;
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
bool ParticipantOrgChart_MimeDataHelper::init(const std::shared_ptr<Interface::Dtc> &dtc,
AdvancedSymbology::SymbologyType symbologyType, bool participantMode)
{
TRACE_LOG() << Q_FUNC_INFO << "START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START";
m_symbologyType = symbologyType;
m_participantMode = participantMode;
if (!dtc)
{
ERROR_LOG() << "Could not load all interfaces needed";
ERROR_LOG(m_logger) << "Could not load all interfaces needed";
return false;
}
m_dtc = dtc;
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
return true;
}
void ParticipantOrgChart_MimeDataHelper::run(int participantId, bool single, AdvancedSymbology::Role role, const QColor &color, bool useSymData)
{
TRACE_LOG() << Q_FUNC_INFO << "START"
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"
<< ", participantId=" << participantId
<< ", single=" << single
<< ", role=" << role
@@ -61,7 +61,7 @@ void ParticipantOrgChart_MimeDataHelper::run(int participantId, bool single, Adv
if (!m_dtc)
{
ERROR_LOG() << "Could not load all interfaces needed";
ERROR_LOG(m_logger) << "Could not load all interfaces needed";
return;
}
@@ -87,14 +87,14 @@ void ParticipantOrgChart_MimeDataHelper::run(int participantId, bool single, Adv
else
m_bulkRendererFindBaseSymbol->run();
TRACE_LOG() << Q_FUNC_INFO << "END"
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"
<< ", color=" << color.name()
<< ", useSymData" << useSymData;
}
bool ParticipantOrgChart_MimeDataHelper::prepareBulkRenderer(int participantId, bool single)
{
TRACE_LOG() << Q_FUNC_INFO << "START"
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"
<< ", participantId=" << participantId
<< ", single=" << single;
@@ -139,13 +139,13 @@ bool ParticipantOrgChart_MimeDataHelper::prepareBulkRenderer(int participantId,
for (int infId : inferior)
prepareBulkRenderer(infId, single);
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
return true;
}
QJsonObject ParticipantOrgChart_MimeDataHelper::getMimeData(int participantId, bool single)
{
TRACE_LOG() << Q_FUNC_INFO << "START"
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"
<< ", participantId=" << participantId
<< ", single=" << single;
@@ -200,7 +200,7 @@ QJsonObject ParticipantOrgChart_MimeDataHelper::getMimeData(int participantId, b
.arg(QString::fromLatin1(data.toBase64()));
retObj.insert(QStringLiteral("image"), imageAdd);
} else {
ERROR_LOG() << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found";
}
@@ -223,7 +223,7 @@ QJsonObject ParticipantOrgChart_MimeDataHelper::getMimeData(int participantId, b
QJsonObject ParticipantOrgChart_MimeDataHelper::getTemplateMimeData(int participantId, bool single)
{
TRACE_LOG() << Q_FUNC_INFO << "START"
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"
<< ", participantTemplateId=" << participantId
<< ", single=" << single;
@@ -278,7 +278,7 @@ QJsonObject ParticipantOrgChart_MimeDataHelper::getTemplateMimeData(int particip
.arg(QString::fromLatin1(data.toBase64()));
retObj.insert(QStringLiteral("image"), imageAdd);
} else {
ERROR_LOG() << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found";
ERROR_LOG(m_logger) << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found";
}
@@ -350,12 +350,12 @@ AdvancedSymbology::SymbolDataToRender ParticipantOrgChart_MimeDataHelper::symbol
void ParticipantOrgChart_MimeDataHelper::onRenderingFinished()
{
TRACE_LOG() << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size();
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size();
if (m_participantMode)
m_mimeData = getMimeData(m_participantId, m_single);
else
m_mimeData = getTemplateMimeData(m_participantId, m_single);
DEBUG_LOG() << Q_FUNC_INFO
DEBUG_LOG(m_logger) << Q_FUNC_INFO
<< " m_participantId =" << m_participantId
<< " m_single = " << m_single
<< " m_mimeData.size = " << m_mimeData.size()
@@ -363,7 +363,7 @@ void ParticipantOrgChart_MimeDataHelper::onRenderingFinished()
emit finished();
TRACE_LOG() << Q_FUNC_INFO << "END";
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
}
}
@@ -39,6 +39,8 @@ protected slots:
void onRenderingFinished();
private:
NGL::INGLLogger &m_logger;
bool prepareBulkRenderer(int participantId, bool single = false);
QJsonObject getMimeData(int participantId, bool single = false);
QJsonObject getTemplateMimeData(int participantId, bool single = false);
@@ -62,6 +62,8 @@ private:
NGL::INGLLogger &m_logger;
protected slots:
void onEnaDisa();
@@ -657,7 +657,7 @@ void ParticipantSelectionModel::insertChildrenOf(int parentId,
auto it = tmap.constFind(childId);
if (it == tmap.constEnd())
{
WARNING_LOG() << "Can not find participant with id " << childId << " - ignoring";
WARNING_LOG(m_logger) << "Can not find participant with id " << childId << " - ignoring";
continue;
}
const ParticipantData &data = it.value();
@@ -682,7 +682,7 @@ void ParticipantSelectionModel::insertChildrenOf(int parentId,
childItem->participant = data;
childItem->bIsChecked = isChecked(checkedParticipants.contains(data.id()), cs);
DEBUG_LOG() << "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);
tryRenderSymbol(QString::fromStdString(data.symbol()), childItem);
@@ -913,7 +913,7 @@ void ParticipantSelectionModel::onParticipantChanged(const ParticipantManagement
CheckedTreeItem *childItem = static_cast<CheckedTreeItem *>(createItem(QVariant(), QIcon()));
childItem->participant = m_dtc->convertParticipantToParticipantData(data);
DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
<< ") to parent " << ctiParent << " at pos " << insertPos;
insertRow(insertPos, indexFromItem(ctiParent), childItem);
tryRenderSymbol(QString::fromStdString(data.symbol()), childItem);
@@ -95,6 +95,7 @@ public:
QString getHierarchyFromIndex(const QModelIndex &index) const;
protected:
NGL::INGLLogger &m_logger;
void gatherParticipants(QHash<int, ParticipantData> &tmap,
QHash<int, QSet<int>> &parentId2id) const;
@@ -140,6 +141,7 @@ signals:
void internalDataChanged();
protected:
NGL::INGLLogger &m_logger;
int m_partyId;
bool m_bRowsAreCheckable;
bool m_bUnitsSelectable;
@@ -167,6 +169,7 @@ public:
int partyId() const { return m_sourceModel ? m_sourceModel->partyId() : -1; }
protected:
NGL::INGLLogger &m_logger;
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
@@ -240,6 +243,7 @@ public:
SortData sortData() const { return m_sortData; }
protected:
NGL::INGLLogger &m_logger;
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override;
bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
@@ -46,6 +46,8 @@ private slots:
void onPrint();
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void onModifyTemplateDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void tableColumnOrganiserSetting() override;
@@ -33,6 +33,8 @@ Q_SIGNALS:
void selectedTemplate(int);
private:
NGL::INGLLogger &m_logger;
ParticipantTemplateChooserModel *m_model;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
LtsSession::LtsSession *m_session;
@@ -46,6 +46,8 @@ public:
Qt::DropActions supportedDragActions() const override { return Qt::CopyAction; }
protected:
NGL::INGLLogger &m_logger;
int getId(const TemplateParticipant &data) const override
{
return data.templateId();
@@ -402,7 +402,7 @@ void ParticipantTemplateEdit::onDoubleClicked(const QModelIndex &selIndex)
void ParticipantTemplateEdit::onSelectionChanged(const QItemSelection & ,
const QItemSelection & )
{
DEBUG_LOG() << "onSelectionChanged";
DEBUG_LOG(m_logger) << "onSelectionChanged";
enaDisa();
}
@@ -55,6 +55,7 @@ public Q_SLOTS:
bool apply() override final;
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
QModelIndex selectedIndexView() const;
bool isContainer(const QModelIndex &index);
@@ -84,6 +85,7 @@ protected slots:
private:
NGL::INGLLogger &m_logger;
int m_rootId;
bool m_asSupportService;
bool m_bNeedCommitModifedData;
@@ -29,6 +29,8 @@ public:
~TemplateUnitNamer();
private:
NGL::INGLLogger &m_logger;
void onSetUnitName();
void onTypeClassChanged();
void enaDisa();
@@ -48,17 +48,17 @@ bool OperatorPartyAssignment::init(LtsSession::LtsSession *session)
m_buttonBox->getButton(LtsWidgets::DialogButton::Ok)->setVisible(false);
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG()<<" -- Couldn't init ppmDtc";
ERROR_LOG(m_logger)<<" -- Couldn't init ppmDtc";
return false;
}
if (!m_session->getDtc<OperatorManagement::DataInterface>(m_opmDtc))
{
ERROR_LOG()<<" -- Couldn't init opmDtc";
ERROR_LOG(m_logger)<<" -- Couldn't init opmDtc";
return false;
}
if (!m_session->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
{
ERROR_LOG()<<" -- Couldn't init ppmFtc";
ERROR_LOG(m_logger)<<" -- Couldn't init ppmFtc";
return false;
}
@@ -98,7 +98,7 @@ QMap<int, bool> OperatorPartyAssignment::getPartyStatesForOpertator() const
DEBUG_LOG()<<" -- [getPartyStatesForOpertator] -> ";
DEBUG_LOG(m_logger)<<" -- [getPartyStatesForOpertator] -> ";
const auto &partys = m_ppmDtc->partys();
QMap<int,bool> mapPartyCheckStates;
for (auto p : partys)
@@ -41,11 +41,13 @@ private slots:
void onOperatorChanged(const OperatorManagement::User &data, DataModification modType);
void onSelectionOperatorChanged(const int index);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override;
void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
void enaDisa();
private:
NGL::INGLLogger &m_logger;
QString m_menuGroup;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ppmFtc;
@@ -35,6 +35,8 @@ public slots:
void updateView(const QMap<int, bool> partyCheckStates);
protected:
NGL::INGLLogger &m_logger;
QVariant data(const QModelIndex &, int) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override final;
Qt::ItemFlags flags(const QModelIndex &index) const override;
@@ -70,7 +70,7 @@ void PartyEdit::lock()
bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
{
DEBUG_LOG() << "PartyEdit::init()";
DEBUG_LOG(m_logger) << "PartyEdit::init()";
m_session = session;
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_dtc))
@@ -179,7 +179,7 @@ bool PartyEdit::apply()
reqOpm.rolePresetId(user.rolePresetId());
QString properties = QString::fromUtf8(QJsonDocument(opmProperties).toJson());
DEBUG_LOG() << "properties: " << properties;
DEBUG_LOG(m_logger) << "properties: " << properties;
reqOpm.properties(properties.toStdString());
m_requestHelper->addRequest([reqOpm, this]()
@@ -364,14 +364,14 @@ void PartyEdit::notificationCheck()
{
if (!m_dtcOpm->isAdlerAllowedParty(m_session->exerciseId(), m_partyId, LtsSessionData::LtsSessionData::getInstance()->getOperatorId()))
{
WARNING_LOG() << "Party " << m_partyId << " not allowed for this user";
WARNING_LOG(m_logger) << "Party " << m_partyId << " not allowed for this user";
m_ui->lblNotifications->hide();
m_ui->cbAdlerNotification->hide();
m_ui->cbCombatOrder->hide();
return;
}
DEBUG_LOG() << "Party allowed for ADLER notifications";
DEBUG_LOG(m_logger) << "Party allowed for ADLER notifications";
const std::string properties = m_dtcOpm->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()).properties();
QJsonObject opmProperties(QJsonDocument::fromJson(QByteArray::fromStdString(properties)).object());
@@ -407,7 +407,7 @@ void PartyEdit::notificationCheck()
void PartyEdit::modifyPartyProperties()
{
DEBUG_LOG() << Q_FUNC_INFO;
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
ParticipantManagement::Party requestParty;
requestParty = m_dtc->party(m_partyId);
@@ -422,11 +422,11 @@ void PartyEdit::modifyPartyProperties()
if (parserError.error != QJsonParseError::NoError)
{
ERROR_LOG() << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
ERROR_LOG(m_logger) << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
doc = QJsonDocument();
}
DEBUG_LOG() << "json to parse: " << doc.toJson();
DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson();
QJsonObject obj(doc.object());
obj[QStringLiteral("Adler")] = adlerPropertiesObj;
@@ -34,12 +34,12 @@ bool PartyModel::initModel(LtsSession::LtsSession *session)
m_session = session;
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG()<<" Couldn't load ppmDtc!!! ";
ERROR_LOG(m_logger)<<" Couldn't load ppmDtc!!! ";
return false;
}
if (!m_session->getDtc<OperatorManagement::DataInterface>(m_opmDtc))
{
ERROR_LOG()<<" Couldn't load opmDtc!!! ";
ERROR_LOG(m_logger)<<" Couldn't load opmDtc!!! ";
return false;
}
@@ -40,6 +40,8 @@ public:
QVariant data(const QModelIndex &, int) const override;
protected:
NGL::INGLLogger &m_logger;
bool isFiltered(const Party &data, DataModification modType) const override
{
@@ -196,7 +196,7 @@ void PartyView::onSyncParties()
SyncPartiesRequest req;
req.exerciseId(m_session->exerciseId());
DEBUG_LOG() << "Sync parties for exercise " << req.exerciseId();
DEBUG_LOG(m_logger) << "Sync parties for exercise " << req.exerciseId();
return m_ftc->syncPartiesRequest(req, this);
});
@@ -39,6 +39,11 @@ public:
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
void onRemovePartyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
@@ -42,6 +42,8 @@ public:
const std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> &ppmGuiCbxIfc);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override;
void tableColumnOrganiserSetting() override;
@@ -91,14 +91,14 @@ void ExportSaab::onStartExport()
if (!file.open(QIODevice::WriteOnly))
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. You do not have the permission to write the selected file."));
ERROR_LOG() << "Could not export exercise: \"" << strExportFile << "\" could not be opened for writing";
ERROR_LOG(m_logger) << "Could not export exercise: \"" << strExportFile << "\" could not be opened for writing";
return;
}
if (!isValidConfigFile())
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. Config file invalid."));
ERROR_LOG() << "Could not export exercise: \"" << strConfigFile << "\" invalid";
ERROR_LOG(m_logger) << "Could not export exercise: \"" << strConfigFile << "\" invalid";
return;
}
@@ -181,13 +181,13 @@ bool ExportSaab::isValidConfigFile()
{
if (!m_configFile)
{
ERROR_LOG() << "Not possible to read config: No file selected";
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
return false;
}
if (!m_configFile->open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Not possible to read config: Could not open file \""
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
<< m_configFile->fileName()
<< "\" for reading.";
return false;
@@ -217,11 +217,11 @@ bool ExportSaab::isValidConfigFile()
m_configFile->close();
if (!hasEchelons)
ERROR_LOG() << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
if (!hasSymbols)
ERROR_LOG() << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
if (!hasForces)
ERROR_LOG() << "Could not find " << SAAB_FORCES() << " in file \"" << m_configFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_FORCES() << " in file \"" << m_configFile->fileName() << '\"';
return hasEchelons && hasSymbols && hasForces;
}
@@ -243,13 +243,13 @@ void ExportSaab::importConfig()
if (!m_configFile)
{
ERROR_LOG() << "Not possible to read config: No file selected";
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
return;
}
if (!m_configFile->open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Not possible to read config: Could not open file \""
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
<< m_configFile->fileName()
<< "\" for reading.";
return;
@@ -456,13 +456,13 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
{
if (participant.isDeleted())
{
DEBUG_LOG() << "Participant with id " << participant.id() << " id deleted --> skipping";
DEBUG_LOG(m_logger) << "Participant with id " << participant.id() << " id deleted --> skipping";
return nullptr;
}
if (participant.externalId())
{
DEBUG_LOG() << "Particpant with id " << participant.id() << " has external ID set to " << participant.externalId() << " --> not being exported.";
DEBUG_LOG(m_logger) << "Particpant with id " << participant.id() << " has external ID set to " << participant.externalId() << " --> not being exported.";
return nullptr;
}
@@ -491,7 +491,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
{
result = new SaabUnit;
DEBUG_LOG() << "Reading unit with " << participant.inferiorIds().size() << " inferiors";
DEBUG_LOG(m_logger) << "Reading unit with " << participant.inferiorIds().size() << " inferiors";
for (int32_t id : participant.inferiorIds())
{
@@ -499,7 +499,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
if (player == nullptr)
{
DEBUG_LOG() << "Skipping inferior with id " << id;
DEBUG_LOG(m_logger) << "Skipping inferior with id " << id;
continue;
}
@@ -509,7 +509,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
if (!static_cast<SaabUnit *>(result)->inferiors.size())
{
DEBUG_LOG() << "Unit " << participant.id() << " has no inferiors.";
DEBUG_LOG(m_logger) << "Unit " << participant.id() << " has no inferiors.";
return nullptr;
}
@@ -519,7 +519,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
case ParticipantManagement::TypeClass::Aircraft:
case ParticipantManagement::TypeClass::Unknown:
default:
DEBUG_LOG() << "Type " << participant.typeId() << " is not supported.";
DEBUG_LOG(m_logger) << "Type " << participant.typeId() << " is not supported.";
return nullptr;
}
@@ -35,7 +35,7 @@ ImportSaab::ImportSaab(ParticipantManagement::ParticipantEditModel *pModel, cons
if (!pSession->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc) || !pSession->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
{
ERROR_LOG() << "Fetching m_ppmDtc or m_ppmFtc failed!";
ERROR_LOG(m_logger) << "Fetching m_ppmDtc or m_ppmFtc failed!";
setEnabled(false);
}
else
@@ -230,13 +230,13 @@ void ImportSaab::importOrbat()
{
if (!m_xmlFile)
{
ERROR_LOG() << "Not possible to import ORBAT: No file selected";
ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected";
return;
}
if (!m_xmlFile->open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Not possible to import ORBAT: Could not open file \""
ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \""
<< m_xmlFile->fileName()
<< "\" for reading.";
return;
@@ -267,7 +267,7 @@ void ImportSaab::importOrbat()
if (m_logger.isDebugEnabled())
{
for (SaabUnit *u : std::as_const(m_rootUnits))
DEBUG_LOG() << u->toString();
DEBUG_LOG(m_logger) << u->toString();
}
m_xmlFile->close();
@@ -290,13 +290,13 @@ void ImportSaab::importConfig()
if (!m_configFile)
{
ERROR_LOG() << "Not possible to read config: No file selected";
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
return;
}
if (!m_configFile->open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Not possible to read config: Could not open file \""
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
<< m_configFile->fileName()
<< "\" for reading.";
return;
@@ -374,7 +374,7 @@ QVector<SaabPlayer *> ImportSaab::inferiors(SaabPlayer *player) const
SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const
{
DEBUG_LOG() << "reading unit: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
DEBUG_LOG(m_logger) << "reading unit: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
SaabUnit *result = new SaabUnit;
@@ -433,7 +433,7 @@ SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const
int index = playerIndexByGuid(result->guid, result->inferiors);
if (index < 0)
WARNING_LOG() << SAAB_POSITION_BY_PLAYER_ID() << " set, but GUID " << result->positionByPlayerId << " could not be found.";
WARNING_LOG(m_logger) << SAAB_POSITION_BY_PLAYER_ID() << " set, but GUID " << result->positionByPlayerId << " could not be found.";
else
result->inferiors.prepend(result->inferiors.takeAt(index));
}
@@ -443,21 +443,21 @@ SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const
SaabPlayer *ImportSaab::readOcPlayer(QXmlStreamReader *reader) const
{
DEBUG_LOG() << "reading oc player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
DEBUG_LOG(m_logger) << "reading oc player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
return readPersonOcPlayer<SaabOcPlayer>(reader, XmlStrings::SAAB_OC_PLAYER());;
}
SaabPlayer *ImportSaab::readPersonPlayer(QXmlStreamReader *reader) const
{
DEBUG_LOG() << "reading person player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
DEBUG_LOG(m_logger) << "reading person player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
return readPersonOcPlayer<SaabPersonPlayer>(reader, XmlStrings::SAAB_PERSON_PLAYER());
}
SaabPlayer *ImportSaab::readVehiclePlayer(QXmlStreamReader *reader) const
{
DEBUG_LOG() << "reading vehicle player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
DEBUG_LOG(m_logger) << "reading vehicle player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
using namespace XmlStrings;
@@ -468,7 +468,7 @@ SaabPlayer *ImportSaab::readVehiclePlayer(QXmlStreamReader *reader) const
SaabVehicle vehicle = saabVehicleByGUID(reader->readElementText());
if (vehicle.guid.isEmpty())
WARNING_LOG() << SAAB_VEHICLE_REF_ID() << " set, but GUID " << result->refId << " could not be found.";
WARNING_LOG(m_logger) << SAAB_VEHICLE_REF_ID() << " set, but GUID " << result->refId << " could not be found.";
else
{
result->registrationNumber = vehicle.registrationNumber;
@@ -577,7 +577,7 @@ void ImportSaab::buildImportTreeView(const QVector<SaabPlayer *> &vecUnitsWithVa
if (vecUnitsWithValidDISTypes.contains(player->superior))
tmp.append(player);
else
WARNING_LOG() << "Parent missing: Could not import player " << player->designation;
WARNING_LOG(m_logger) << "Parent missing: Could not import player " << player->designation;
continue;
}
@@ -595,13 +595,13 @@ bool ImportSaab::isValidSaabOrbatFile() const
{
if (!m_xmlFile)
{
ERROR_LOG() << "Not possible to import ORBAT: No file selected";
ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected";
return false;
}
if (!m_xmlFile->open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Not possible to import ORBAT: Could not open file \""
ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \""
<< m_xmlFile->fileName()
<< "\" for reading.";
return false;
@@ -631,11 +631,11 @@ bool ImportSaab::isValidSaabOrbatFile() const
m_xmlFile->close();
if (!hasExerciseOrbatRoot)
ERROR_LOG() << "Could not find " << SAAB_EXERCISE_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
if (!hasExercise)
ERROR_LOG() << "Could not find " << SAAB_EXERCISE() << " in file \"" << m_xmlFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE() << " in file \"" << m_xmlFile->fileName() << '\"';
if (!hasOrbat)
ERROR_LOG() << "Could not find " << SAAB_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
return hasExerciseOrbatRoot && hasExercise && hasOrbat;
}
@@ -644,13 +644,13 @@ bool ImportSaab::isValidConfigFile() const
{
if (!m_configFile)
{
ERROR_LOG() << "Not possible to read config: No file selected";
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
return false;
}
if (!m_configFile->open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Not possible to read config: Could not open file \""
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
<< m_configFile->fileName()
<< "\" for reading.";
return false;
@@ -677,9 +677,9 @@ bool ImportSaab::isValidConfigFile() const
m_configFile->close();
if (!hasEchelons)
ERROR_LOG() << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
if (!hasSymbols)
ERROR_LOG() << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
return hasEchelons && hasSymbols;
}
@@ -66,11 +66,11 @@ bool TypeEdit::init(int typeId,
const std::shared_ptr<FileManagement::Interface::Dtc> &flmDtc,
const std::shared_ptr<FileManagement::Interface::Ftc> &flmFtc)
{
DEBUG_LOG() << "TypeEdit::init()";
DEBUG_LOG(m_logger) << "TypeEdit::init()";
if (!dtc || !ftc || !ppmGuiCbxIfc)
{
ERROR_LOG() << "TypeEdit::init() Invalid shared_ptr!";
ERROR_LOG(m_logger) << "TypeEdit::init() Invalid shared_ptr!";
return false;
}
@@ -82,9 +82,9 @@ bool TypeEdit::init(int typeId,
m_flmFtc = flmFtc;
if (m_flmDtc && !m_flmDtc->enableFileContent())
WARNING_LOG() << "Could not enable FLM DTC fileContent!";
WARNING_LOG(m_logger) << "Could not enable FLM DTC fileContent!";
if (m_flmFtc && !m_flmFtc->enableFileContentSetUsed())
WARNING_LOG() << "Could not enable FLM FTC fileContentSetUsed!";
WARNING_LOG(m_logger) << "Could not enable FLM FTC fileContentSetUsed!";
std::shared_ptr<ParticipantManagement::ForeignMSDLGuiInterface> msdlInterface;
m_session->getForeignGuiInterface<ParticipantManagement::ForeignMSDLGuiInterface>(msdlInterface);
@@ -157,13 +157,13 @@ bool TypeEdit::apply()
});
DEBUG_LOG() << "Old symbol: " << m_symbolSidcOld;
DEBUG_LOG() << "New symbol: " << m_symbolSidc;
DEBUG_LOG(m_logger) << "Old symbol: " << m_symbolSidcOld;
DEBUG_LOG(m_logger) << "New symbol: " << m_symbolSidc;
if (!m_symbolSidc.isEmpty())
{
int symbolId = AdvancedSymbology::SidcCodec::decodeCivilXml(m_symbolSidc);
DEBUG_LOG() << "Symbol Id = " << symbolId;
DEBUG_LOG(m_logger) << "Symbol Id = " << symbolId;
if (symbolId > 0)
{
FileManagement::FileContent data = m_flmDtc->fileContent(symbolId);
@@ -188,7 +188,7 @@ bool TypeEdit::apply()
if (!m_symbolSidcOld.isEmpty() && m_symbolSidcOld != m_symbolSidc)
{
int symbolId = AdvancedSymbology::SidcCodec::decodeCivilXml(m_symbolSidcOld);
DEBUG_LOG() << "Symbol Id = " << symbolId;
DEBUG_LOG(m_logger) << "Symbol Id = " << symbolId;
if (symbolId > 0)
{
FileManagement::FileContent data = m_flmDtc->fileContent(symbolId);
@@ -61,6 +61,8 @@ public slots:
void onChangeSymbolInternal(const QString &sidc, bool bInitial = false);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override;
void fillComboboxes();
@@ -49,6 +49,8 @@ protected slots:
void onDataChangedLocal(const Type &data, DataModification modType);
private:
NGL::INGLLogger &m_logger;
void updateFilterTypeClasses();
private:
QHash<int, EquipmentType> m_equipmentTypes;
@@ -37,6 +37,8 @@ public:
const std::shared_ptr<FileManagement::Interface::Ftc> &flmFtc);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void onRemoveTypeReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
@@ -48,6 +48,8 @@ public:
bool init();
private:
NGL::INGLLogger &m_logger;
void onRemoveUasReply(const Core::FunctionReplyObject &reply) override;
void retranslate() override;
void tableColumnOrganiserSetting() override;
@@ -57,7 +57,7 @@ bool UasListModel::initModel(LtsSession::LtsSession *session)
m_exmDtc->waitForHistoricalDataExercise(500);
DEBUG_LOG() << "UasListModel initialised for exercise " << m_exerciseId;
DEBUG_LOG(m_logger) << "UasListModel initialised for exercise " << m_exerciseId;
return true;
}
@@ -124,7 +124,7 @@ void UasListModel::onUasChanged(const UAS &data, const DataModification modType)
case DataModification::eModified:
case DataModification::eAdded:
{
DEBUG_LOG() << "DataModification::eModified and eAdded: ";
DEBUG_LOG(m_logger) << "DataModification::eModified and eAdded: ";
if (row < 0)
insertRow(data);
@@ -51,6 +51,7 @@ class UasListModel : public LtsWidgets::LtsAbstractTableModel<UAS>
void onUasChanged(const ParticipantManagement::UAS &data,
const DataModification modType);
private:
NGL::INGLLogger &m_logger;
int32_t m_exerciseId { 0 };
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;