- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
145 lines
3.8 KiB
C++
Executable File
145 lines
3.8 KiB
C++
Executable File
|
|
|
|
|
|
#include "evl_comments.h"
|
|
#include "ui_evl_comments.h"
|
|
#include "evl_comment_model.h"
|
|
|
|
#include <LtsSession/lts_session_data.h>
|
|
#include <PluginInterfaces/data_plugin_interface.h>
|
|
|
|
#include <QKeyEvent>
|
|
|
|
namespace Evaluations
|
|
{
|
|
EvlCommentsView::EvlCommentsView(const std::shared_ptr<Interface::Dtc> &evlDtc,
|
|
const std::shared_ptr<OperatorManagement::Interface::Dtc> &opmDtc,
|
|
QWidget *parent)
|
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly),
|
|
m_ui(new Ui::EvlCommentsDialog),
|
|
m_evlDtc(evlDtc),
|
|
m_opmDtc(opmDtc)
|
|
{
|
|
m_ui->setupUi(this);
|
|
|
|
setOnlineHelpFilename(QStringLiteral("Situation-Display_O-C_Evaluations"));
|
|
|
|
m_ui->m_tableComments->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
connect(m_ui->m_tableComments, &LtsDataView::LtsDataView::signalDoubleClicked, this, &EvlCommentsView::onLtsDataView_DoubleClicked);
|
|
|
|
m_model = new EvlCommentDataViewModel(this);
|
|
m_proxyModel = new EvlCommentDataViewProxyModel(this);
|
|
m_proxyModel->setSourceModel(m_model);
|
|
m_ui->m_tableComments->setModel(m_proxyModel);
|
|
|
|
m_ui->m_tableComments->installEventFilter(this);
|
|
|
|
m_buttonBox->getButton(LtsWidgets::DialogButton::Ok)->hide();
|
|
m_buttonBox->getButton(LtsWidgets::DialogButton::Apply)->hide();
|
|
|
|
|
|
auto cb = [this](const Evaluations::EvaluationComment & c)
|
|
{
|
|
insertComment(c);
|
|
};
|
|
m_evlDtc->evaluationComments(cb);
|
|
|
|
|
|
connect(m_evlDtc.get(), &Evaluations::Interface::Dtc::evaluationCommentChanged, this, &EvlCommentsView::onCommentChanged, Qt::UniqueConnection);
|
|
}
|
|
|
|
|
|
EvlCommentsView::~EvlCommentsView()
|
|
{
|
|
delete m_ui;
|
|
}
|
|
|
|
|
|
void EvlCommentsView::retranslate()
|
|
{
|
|
translate(m_ui, tr("Display O/C Evaluations"));
|
|
}
|
|
|
|
|
|
bool EvlCommentsView::eventFilter(QObject *object, QEvent *event)
|
|
{
|
|
if (object == m_ui->m_tableComments)
|
|
{
|
|
if (event->type() == QEvent::KeyPress)
|
|
{
|
|
QKeyEvent *pKeyEvent = static_cast<QKeyEvent *>(event);
|
|
|
|
if (pKeyEvent->key() == Qt::Key_Return || pKeyEvent->key() == Qt::Key_Enter)
|
|
onLtsDataView_DoubleClicked();
|
|
}
|
|
}
|
|
|
|
return LtsWidgets::LtsDialog::eventFilter(object, event);
|
|
}
|
|
|
|
void EvlCommentsView::tableColumnOrganiserSetting()
|
|
{
|
|
|
|
m_ui->m_tableComments->setColumnsOrganiserEnabled(identifier(), true);
|
|
}
|
|
|
|
|
|
void EvlCommentsView::onLtsDataView_DoubleClicked()
|
|
{
|
|
const QModelIndex idx = m_ui->m_tableComments->currentIndex();
|
|
|
|
if (idx.row() >= 0)
|
|
{
|
|
Evaluations::CommentTuple row = m_model->getRowData(idx.row());
|
|
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Comment:") + QStringLiteral("\n") + row.m_text);
|
|
}
|
|
}
|
|
|
|
|
|
void EvlCommentsView::onCommentChanged(const EvaluationComment &data, DataModification modType)
|
|
{
|
|
switch (modType)
|
|
{
|
|
case DataModification::eAdded:
|
|
insertComment(data);
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool EvlCommentsView::insertComment(const Evaluations::EvaluationComment &c)
|
|
{
|
|
QString strSenderOperatorName, strReceiverOperatorName;
|
|
|
|
OperatorManagement::User sender = m_opmDtc->user(c.senderOperatorId());
|
|
strSenderOperatorName = QString::fromStdString(sender.name());
|
|
|
|
if (c.receiverOperatorId().is_set())
|
|
{
|
|
|
|
OperatorManagement::User loggedInOperator = m_opmDtc->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
|
|
|
if (c.receiverOperatorId().get() != loggedInOperator.id())
|
|
return false;
|
|
|
|
OperatorManagement::User receiver = m_opmDtc->user(c.receiverOperatorId().get());
|
|
strReceiverOperatorName = QString::fromStdString(receiver.name());
|
|
}
|
|
|
|
CommentTuple t;
|
|
t.m_commentId = c.id();
|
|
t.m_timestamp = QDateTime::fromMSecsSinceEpoch(c.ts());
|
|
t.m_sender = strSenderOperatorName;
|
|
t.m_receiver = strReceiverOperatorName;
|
|
t.m_text = QString::fromStdString(c.text());
|
|
t.m_hierarchy = QString::fromStdString(c.hierarchy());
|
|
|
|
return m_model->insertRow(t);
|
|
}
|
|
}
|
|
|