Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1 parent
eb1d949edc
commit
815e16368e
1718 files changed
+126739
-18495
No files matched your search
+18
-17
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_topic_editor_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <Evaluations/evl_translation.h>
|
||||
#include <QtCore/QDateTime>
|
||||
@@ -11,9 +12,9 @@ namespace Evaluations
|
||||
{
|
||||
|
||||
TopicEditorEvaluationModel::TopicEditorEvaluationModel(QObject* parent)
|
||||
: NGLTreeModel(parent, new NGLTreeItem(QVariant()), ,
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()){tr("Id"), tr("Name"), tr("Weight"), tr("Start Time"),
|
||||
tr("Situation"), tr("Video"), tr("Audio")})
|
||||
: NGLTreeModel(parent, new NGLTreeItem(QVariant()), {tr("Id"), tr("Name"), tr("Weight"), tr("Start Time"),
|
||||
tr("Situation"), tr("Video"), tr("Audio")})
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -57,15 +58,15 @@ QVariant TopicEditorEvaluationModel::data(const QModelIndex& index, int role) co
|
||||
switch (index.column())
|
||||
{
|
||||
case NAME:
|
||||
return QString::fromStdString(crt.name());
|
||||
return QString::fromStdString(crt.name);
|
||||
case ID:
|
||||
return crt.id();
|
||||
return crt.id;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (role == Qt::UserRole)
|
||||
return crt.id();
|
||||
return crt.id;
|
||||
}
|
||||
else if (item->data().canConvert<Evaluations::EvaluationElement>())
|
||||
{
|
||||
@@ -77,23 +78,23 @@ QVariant TopicEditorEvaluationModel::data(const QModelIndex& index, int role) co
|
||||
switch (index.column())
|
||||
{
|
||||
case ID:
|
||||
return elem.id();
|
||||
return elem.id;
|
||||
case NAME:
|
||||
return QString::fromStdString(elem.note());
|
||||
return QString::fromStdString(elem.note);
|
||||
case WEIGHT:
|
||||
return elem.rating();
|
||||
return elem.rating;
|
||||
case SITUATION:
|
||||
return elem.situation() ? tr("Yes") : tr("No");
|
||||
return elem.situation ? tr("Yes") : tr("No");
|
||||
case AUDIO:
|
||||
return elem.audio() ? tr("Yes") : tr("No");
|
||||
return elem.audio ? tr("Yes") : tr("No");
|
||||
case VIDEO:
|
||||
return elem.video() ? tr("Yes") : tr("No");
|
||||
return elem.video ? tr("Yes") : tr("No");
|
||||
case START_TIME:
|
||||
return QDateTime::fromMSecsSinceEpoch(elem.timestamp());
|
||||
return QDateTime::fromMSecsSinceEpoch(elem.timestamp);
|
||||
}
|
||||
}
|
||||
else if (role == Qt::UserRole)
|
||||
return elem.id();
|
||||
return elem.id;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
@@ -132,7 +133,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr<Interface::Dtc>
|
||||
int parentId = 0;
|
||||
EvaluationCriterium crit = iter.value();
|
||||
|
||||
if (crit.operatorId() != operatorId)
|
||||
if (crit.operatorId != operatorId)
|
||||
continue;
|
||||
|
||||
if (!parentItemIndexCache.contains(parentId))
|
||||
@@ -157,7 +158,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr<Interface::Dtc>
|
||||
iter2 != elemMap.constEnd(); ++iter2)
|
||||
{
|
||||
Evaluations::EvaluationElement elem = iter2.value();
|
||||
if (elem.criteriumId() != criteriumId)
|
||||
if (elem.criteriumId != criteriumId)
|
||||
continue;
|
||||
|
||||
parentId = criteriumId + 10000;
|
||||
@@ -175,7 +176,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr<Interface::Dtc>
|
||||
QVariant data;
|
||||
data.setValue(elem);
|
||||
onInsertRow(rowPos, pIndex, data);
|
||||
int elementId = elem.id();
|
||||
int elementId = elem.id;
|
||||
parentItemIndexCache.insert(elementId, index(rowPos, 0, pIndex));
|
||||
DEBUG_LOG(m_logger) << "Added to tree (element id, parent id) : (" << elementId << ", " << parentId
|
||||
<< ")";
|
||||
|
||||
+33
-31
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "topic_editor.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_topic_editor.h"
|
||||
|
||||
@@ -19,6 +20,7 @@ namespace Evaluations
|
||||
|
||||
EvaluationTopicEditor::EvaluationTopicEditor(LtsSession::LtsSession* session, QWidget* parent)
|
||||
: TopicEditorBase::TopicEditor(parent), m_session(session), m_ui(new Ui::EvaluationTopicEditor)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
init(m_ui->widget);
|
||||
@@ -81,12 +83,12 @@ void EvaluationTopicEditor::updateInternalData()
|
||||
m_ui->cbxOperator->setCurrentIndex(m_ui->cbxOperator->findData(m_operatorId));
|
||||
m_model->initModel(m_evlDtc, m_operatorId);
|
||||
|
||||
m_evlElement.id(getTopicDataValue(QStringLiteral("elementId")).toDouble());
|
||||
DEBUG_LOG(m_logger) << "element id = " << m_evlElement.id();
|
||||
m_evlElement.timestamp(getTopicDataValue(QStringLiteral("start")).toDouble());
|
||||
m_evlElement.situation(getTopicDataValue(QStringLiteral("situation")).toBool());
|
||||
m_evlElement.audio(getTopicDataValue(QStringLiteral("audio")).toBool());
|
||||
m_evlElement.video(getTopicDataValue(QStringLiteral("video")).toBool());
|
||||
m_evlElement.id = getTopicDataValue(QStringLiteral("elementId")).toDouble();
|
||||
DEBUG_LOG(m_logger) << "element id = " << m_evlElement.id;
|
||||
m_evlElement.timestamp = getTopicDataValue(QStringLiteral("start")).toDouble();
|
||||
m_evlElement.situation = getTopicDataValue(QStringLiteral("situation")).toBool();
|
||||
m_evlElement.audio = getTopicDataValue(QStringLiteral("audio")).toBool();
|
||||
m_evlElement.video = getTopicDataValue(QStringLiteral("video")).toBool();
|
||||
|
||||
selectElement();
|
||||
}
|
||||
@@ -100,8 +102,8 @@ void EvaluationTopicEditor::selectElement()
|
||||
{
|
||||
QModelIndex idx;
|
||||
QItemSelectionModel* selectionModel = m_ui->trvEvaluations->selectionModel();
|
||||
if (m_evlElement.id() > 0)
|
||||
idx = m_model->getIndex(m_evlElement.id());
|
||||
if (m_evlElement.id > 0)
|
||||
idx = m_model->getIndex(m_evlElement.id);
|
||||
if (idx.isValid())
|
||||
selectionModel->setCurrentIndex(idx, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
else
|
||||
@@ -123,7 +125,7 @@ void EvaluationTopicEditor::initOperatorComboBox()
|
||||
|
||||
auto it =
|
||||
std::find_if(evaluationCriteria.constBegin(), evaluationCriteria.constEnd(),
|
||||
[this, operatorId](const EvaluationCriterium& ec) { return ec.operatorId() == operatorId; });
|
||||
[this, operatorId](const EvaluationCriterium& ec) { return ec.operatorId == operatorId; });
|
||||
if (it == evaluationCriteria.constEnd())
|
||||
m_ui->cbxOperator->removeItem(index);
|
||||
}
|
||||
@@ -133,27 +135,27 @@ void EvaluationTopicEditor::initOperatorComboBox()
|
||||
bool EvaluationTopicEditor::apply2()
|
||||
{
|
||||
setTopicDataProperty(QStringLiteral("operatorId"), m_operatorId);
|
||||
setTopicDataProperty(QStringLiteral("elementId"), m_evlElement.id());
|
||||
setTopicDataProperty(QStringLiteral("start"), m_evlElement.timestamp());
|
||||
setTopicDataProperty(QStringLiteral("situation"), m_evlElement.situation());
|
||||
setTopicDataProperty(QStringLiteral("audio"), m_evlElement.audio());
|
||||
setTopicDataProperty(QStringLiteral("video"), m_evlElement.video());
|
||||
setTopicDataProperty(QStringLiteral("elementId"), m_evlElement.id);
|
||||
setTopicDataProperty(QStringLiteral("start"), static_cast<qint64>(m_evlElement.timestamp));
|
||||
setTopicDataProperty(QStringLiteral("situation"), m_evlElement.situation);
|
||||
setTopicDataProperty(QStringLiteral("audio"), m_evlElement.audio);
|
||||
setTopicDataProperty(QStringLiteral("video"), m_evlElement.video);
|
||||
|
||||
DEBUG_LOG(m_logger) << "operator id = " << m_operatorId << ", element id = " << m_evlElement.id();
|
||||
DEBUG_LOG(m_logger) << "timestamp: " << m_evlElement.timestamp();
|
||||
DEBUG_LOG(m_logger) << "operator id = " << m_operatorId << ", element id = " << m_evlElement.id;
|
||||
DEBUG_LOG(m_logger) << "timestamp: " << m_evlElement.timestamp;
|
||||
|
||||
if (m_evlElement.situation())
|
||||
if (m_evlElement.situation)
|
||||
{
|
||||
TopicEditorBase::TopicData data;
|
||||
data.topicType = TopicEditorBase::TopicType::Situation;
|
||||
setTopicDataProperty(QStringLiteral("end"), m_evlElement.timestamp() + m_evlElement.duration() * 1000);
|
||||
setTopicDataProperty(QStringLiteral("end"), static_cast<qint64>(m_evlElement.timestamp + m_evlElement.duration * 1000));
|
||||
setTopicDataProperty(QStringLiteral("speed"), 1.0);
|
||||
|
||||
if (m_evlElement.situationContent())
|
||||
if (m_evlElement.situationContent)
|
||||
{
|
||||
QJsonParseError error;
|
||||
QJsonDocument doc(QJsonDocument::fromJson(
|
||||
QString::fromStdString(m_evlElement.situationContent().get()).toUtf8(), &error));
|
||||
QString::fromStdString(m_evlElement.situationContent.get()).toUtf8(), &error));
|
||||
|
||||
if (error.error == QJsonParseError::NoError)
|
||||
{
|
||||
@@ -166,7 +168,7 @@ bool EvaluationTopicEditor::apply2()
|
||||
tr("The selected marker has invalid filter and/or map settings."));
|
||||
}
|
||||
|
||||
data.duration = m_evlElement.duration();
|
||||
data.duration = m_evlElement.duration;
|
||||
data.properties = m_topicData.properties;
|
||||
|
||||
DEBUG_LOG(m_logger) << "topicData - properties: "
|
||||
@@ -175,26 +177,26 @@ bool EvaluationTopicEditor::apply2()
|
||||
emit topicEditorRequested(data);
|
||||
}
|
||||
|
||||
if (m_evlElement.audio())
|
||||
if (m_evlElement.audio)
|
||||
{
|
||||
TopicEditorBase::TopicData data;
|
||||
data.topicType = TopicEditorBase::TopicType::Audio;
|
||||
setTopicDataProperty(QStringLiteral("end"), m_evlElement.timestamp() + m_evlElement.duration() * 1000);
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(m_evlElement.audioContent().get());
|
||||
setTopicDataProperty(QStringLiteral("end"), static_cast<qint64>(m_evlElement.timestamp + m_evlElement.duration * 1000));
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(m_evlElement.audioContent.get());
|
||||
setTopicDataProperty(QStringLiteral("stream"), jsonObj.value<QString>("actualStream"));
|
||||
data.duration = m_evlElement.duration();
|
||||
data.duration = m_evlElement.duration;
|
||||
data.properties = m_topicData.properties;
|
||||
emit topicEditorRequested(data);
|
||||
}
|
||||
|
||||
if (m_evlElement.video())
|
||||
if (m_evlElement.video)
|
||||
{
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(m_evlElement.videoContent().get());
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(m_evlElement.videoContent.get());
|
||||
TopicEditorBase::TopicData data;
|
||||
data.topicType = TopicEditorBase::TopicType::Video;
|
||||
setTopicDataProperty(QStringLiteral("end"), m_evlElement.timestamp() + m_evlElement.duration() * 1000);
|
||||
setTopicDataProperty(QStringLiteral("end"), static_cast<qint64>(m_evlElement.timestamp + m_evlElement.duration * 1000));
|
||||
setTopicDataProperty(QStringLiteral("stream"), jsonObj.value<QString>("actualStream"));
|
||||
data.duration = m_evlElement.duration();
|
||||
data.duration = m_evlElement.duration;
|
||||
data.properties = m_topicData.properties;
|
||||
emit topicEditorRequested(data);
|
||||
}
|
||||
@@ -220,9 +222,9 @@ void EvaluationTopicEditor::onSelectionChanged(const QItemSelection& selected, c
|
||||
|
||||
QModelIndex index = m_ui->trvEvaluations->currentIndex();
|
||||
m_evlElement = m_model->getEvaluationElement(index);
|
||||
DEBUG_LOG(m_logger) << "element id = " << m_evlElement.id();
|
||||
DEBUG_LOG(m_logger) << "element id = " << m_evlElement.id;
|
||||
|
||||
m_topicData.description = QString::number(m_evlElement.id());
|
||||
m_topicData.description = QString::number(m_evlElement.id);
|
||||
slotChangesMade();
|
||||
}
|
||||
|
||||
|
||||
+9
-7
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "evl_edit_dialog.h"
|
||||
#include "evl_element_dialog.h"
|
||||
@@ -20,6 +21,7 @@ CriteriumDialog::CriteriumDialog(const QString& menuGroup, LtsSession::LtsSessio
|
||||
m_proxyModel(new CriteriumFilterModel(this)), m_session(session), m_ui(new Ui::CriteriumDialog),
|
||||
m_menuGroup(menuGroup), m_ownEvaluationElements(ownEvlElements),
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "CriteriumDialog ctor";
|
||||
m_ui->setupUi(this);
|
||||
@@ -51,7 +53,7 @@ void CriteriumDialog::enaDisa()
|
||||
int selected = m_ui->widget->selectedRows().size();
|
||||
|
||||
const QModelIndex srcIdx = m_ui->widget->currentIndex();
|
||||
int operatorId = m_model->getRowData(srcIdx.row()).operatorId();
|
||||
int operatorId = m_model->getRowData(srcIdx.row()).operatorId;
|
||||
|
||||
if (m_currentOperatorId == operatorId)
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, true && selected == 1);
|
||||
@@ -92,7 +94,7 @@ void CriteriumDialog::slotEdit()
|
||||
DEBUG_LOG(m_logger) << "CriteriumDialog::slotEdit";
|
||||
|
||||
const QModelIndex srcIdx = m_ui->widget->currentIndex();
|
||||
editCriterium(m_model->getRowData(srcIdx.row()).id());
|
||||
editCriterium(m_model->getRowData(srcIdx.row()).id);
|
||||
}
|
||||
|
||||
void CriteriumDialog::slotRemove()
|
||||
@@ -102,8 +104,8 @@ void CriteriumDialog::slotRemove()
|
||||
if (!selIndex.isValid())
|
||||
return;
|
||||
|
||||
Core::RemoveElementRequest req(m_model->getRowData(selIndex.row()).id());
|
||||
DEBUG_LOG(m_logger) << "Removing criterium id = " << req.id();
|
||||
Core::RemoveElementRequest req(m_model->getRowData(selIndex.row()).id);
|
||||
DEBUG_LOG(m_logger) << "Removing criterium id = " << req.id;
|
||||
m_requestHelper->startSingleRequest([req, this]() { return m_ftc->evlCriteriumRemoveRequest(req, this); });
|
||||
|
||||
if (m_requestHelper->failed())
|
||||
@@ -116,7 +118,7 @@ void CriteriumDialog::slotEditElements()
|
||||
if (!selIndex.isValid())
|
||||
return;
|
||||
|
||||
int criteriumId = m_model->getRowData(selIndex.row()).id();
|
||||
int criteriumId = m_model->getRowData(selIndex.row()).id;
|
||||
addDialog(LtsWidgets::initDialog(new ElementDialog(), criteriumId, m_exerciseId, m_menuGroup, m_dtc, m_ftc,
|
||||
m_exmDtc, m_avmDataIfc, m_fltParticipantIfc, m_fltAesIfc,
|
||||
m_fltBuildingComponentIfc, m_session),
|
||||
@@ -165,8 +167,8 @@ bool CriteriumDialog::init(
|
||||
for (auto i = criteria.constBegin(); i != criteria.constEnd(); ++i)
|
||||
{
|
||||
const EvaluationCriterium& p = (*i);
|
||||
DEBUG_LOG(m_logger) << "Criterium: id = " << p.id() << ", name = " << p.name().c_str()
|
||||
<< ", desc = " << p.description().c_str();
|
||||
DEBUG_LOG(m_logger) << "Criterium: id = " << p.id << ", name = " << p.name.c_str()
|
||||
<< ", desc = " << p.description.c_str();
|
||||
}
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged, this, &CriteriumDialog::enaDisa,
|
||||
|
||||
+9
-7
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_edit_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_evl_edit_dialog.h"
|
||||
|
||||
@@ -17,6 +18,7 @@ namespace Evaluations
|
||||
CriteriumEditDialog::CriteriumEditDialog(QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkCancel),
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::CriteriumEditDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "CriteriumEditDialog ctor";
|
||||
|
||||
@@ -50,10 +52,10 @@ bool CriteriumEditDialog::init(int criteriumId, LtsSession::LtsSession* session,
|
||||
if (m_criteriumId > 0)
|
||||
{
|
||||
Evaluations::EvaluationCriterium eval = m_dtc->evaluationCriterium(m_criteriumId);
|
||||
m_ui->leName->setText(QString::fromStdString(eval.name()));
|
||||
m_ui->teDesc->setText(QString::fromStdString(eval.description()));
|
||||
m_ui->leName->setText(QString::fromStdString(eval.name));
|
||||
m_ui->teDesc->setText(QString::fromStdString(eval.description));
|
||||
|
||||
m_ui->cbxOperators->setCurrentIndex(m_ui->cbxOperators->findData(eval.operatorId()));
|
||||
m_ui->cbxOperators->setCurrentIndex(m_ui->cbxOperators->findData(eval.operatorId));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -76,10 +78,10 @@ bool CriteriumEditDialog::apply()
|
||||
{
|
||||
|
||||
EvlCriteriumModifyRequest req;
|
||||
req.id(m_criteriumId);
|
||||
req.name(m_ui->leName->text().toStdString());
|
||||
req.description(m_ui->teDesc->toPlainText().toStdString());
|
||||
req.operatorId(m_ui->cbxOperators->currentData().toInt());
|
||||
req.id = m_criteriumId;
|
||||
req.name = m_ui->leName->text().toStdString();
|
||||
req.description = m_ui->teDesc->toPlainText().toStdString();
|
||||
req.operatorId = m_ui->cbxOperators->currentData().toInt();
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, req]() { return m_ftc->evlCriteriumModifyRequest(req, this); });
|
||||
}
|
||||
|
||||
+22
-20
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_edit_element_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_evl_edit_element_dialog.h"
|
||||
|
||||
@@ -26,6 +27,7 @@ namespace Evaluations
|
||||
ElementEditDialog::ElementEditDialog(QWidget*)
|
||||
: LtsWidgets::LtsDialog(nullptr, LtsWidgets::ButtonCombination::OkCancel),
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::ElementEditDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ElementEditDialog ctor";
|
||||
|
||||
@@ -88,17 +90,17 @@ bool ElementEditDialog::init(
|
||||
if (m_elementId > 0)
|
||||
{
|
||||
Evaluations::EvaluationElement eval = m_dtc->evaluationElement(m_elementId);
|
||||
m_ui->cbxRating->setCurrentIndex(m_ui->cbxRating->findData(eval.rating()));
|
||||
m_ui->teDesc->setText(QString::fromStdString(eval.note()));
|
||||
m_ui->lblStartTime->setText(DTG::toStringMSec(eval.timestamp()));
|
||||
m_ui->cbxRating->setCurrentIndex(m_ui->cbxRating->findData(eval.rating));
|
||||
m_ui->teDesc->setText(QString::fromStdString(eval.note));
|
||||
m_ui->lblStartTime->setText(DTG::toStringMSec(eval.timestamp));
|
||||
ERROR_LOG(m_logger) << "set start time label to " << m_ui->lblStartTime->text();
|
||||
m_startTime = eval.timestamp();
|
||||
m_startTime = eval.timestamp;
|
||||
|
||||
m_ui->cbSituation->setChecked(eval.situation());
|
||||
m_ui->cbVideo->setChecked(eval.video());
|
||||
m_ui->cbAudio->setChecked(eval.audio());
|
||||
m_ui->cbSituation->setChecked(eval.situation);
|
||||
m_ui->cbVideo->setChecked(eval.video);
|
||||
m_ui->cbAudio->setChecked(eval.audio);
|
||||
|
||||
m_ui->cbxPhase->setCurrentIndex(m_ui->cbxPhase->findData(eval.phaseId()));
|
||||
m_ui->cbxPhase->setCurrentIndex(m_ui->cbxPhase->findData(eval.phaseId));
|
||||
}
|
||||
|
||||
if (m_avmDataIfc && m_avmDataIfc->hasAvsSession())
|
||||
@@ -139,13 +141,13 @@ bool ElementEditDialog::apply()
|
||||
{
|
||||
|
||||
EvlElementModifyRequest req;
|
||||
req.id(m_elementId);
|
||||
req.criteriumId(m_criteriumId);
|
||||
req.rating(m_ui->cbxRating->currentData().toInt());
|
||||
req.note(m_ui->teDesc->toPlainText().toStdString());
|
||||
req.timestamp(m_startTime);
|
||||
req.duration((QDateTime::currentMSecsSinceEpoch() - m_startTime) / 1000);
|
||||
req.phaseId(m_ui->cbxPhase->currentData().toInt());
|
||||
req.id = m_elementId;
|
||||
req.criteriumId = m_criteriumId;
|
||||
req.rating = m_ui->cbxRating->currentData().toInt();
|
||||
req.note = m_ui->teDesc->toPlainText().toStdString();
|
||||
req.timestamp = m_startTime;
|
||||
req.duration = (QDateTime::currentMSecsSinceEpoch() - m_startTime) / 1000;
|
||||
req.phaseId = m_ui->cbxPhase->currentData().toInt();
|
||||
|
||||
QJsonObject obj;
|
||||
if (m_ui->cbSituation->isChecked())
|
||||
@@ -160,21 +162,21 @@ bool ElementEditDialog::apply()
|
||||
|
||||
root[QStringLiteral("filters")] = getFilterSettings();
|
||||
|
||||
req.situationContent().set(QJsonDocument(root).toJson().constData());
|
||||
req.situationContent.set(QJsonDocument(root).toJson().constData());
|
||||
}
|
||||
|
||||
if (m_ui->cbVideo->isChecked() && m_ui->cbxVideoChannel->currentData().isValid())
|
||||
{
|
||||
obj[QStringLiteral("actualStream")] = QJsonValue(m_ui->cbxVideoChannel->currentData().toString());
|
||||
obj[QStringLiteral("allStreams")] = QJsonValue(QString(m_videoStreams.join(QStringLiteral(", "))));
|
||||
req.videoContent().set(QJsonDocument(obj).toJson().constData());
|
||||
req.videoContent.set(QJsonDocument(obj).toJson().constData());
|
||||
}
|
||||
|
||||
if (m_ui->cbAudio->isChecked() && !m_ui->cbxRadioCircuit->currentText().isNull())
|
||||
{
|
||||
obj[QStringLiteral("actualStream")] = QJsonValue(m_ui->cbxRadioCircuit->currentText());
|
||||
obj[QStringLiteral("allStreams")] = QJsonValue(QString(m_audioStreams.join(QStringLiteral(", "))));
|
||||
req.audioContent().set(QJsonDocument(obj).toJson().constData());
|
||||
req.audioContent.set(QJsonDocument(obj).toJson().constData());
|
||||
}
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, req]() { return m_ftc->evlElementModifyRequest(req, this); });
|
||||
@@ -188,8 +190,8 @@ void ElementEditDialog::fillPhasesComboBox()
|
||||
m_ui->cbxPhase->addItem(tr("<not set>"), 0);
|
||||
|
||||
auto cb = [this](const ExerciseManagement::ExercisePhase& ph) {
|
||||
if (ph.exerciseId() == m_exerciseId)
|
||||
m_ui->cbxPhase->addItem(QString::fromStdString(ph.name()), ph.id());
|
||||
if (ph.exerciseId == m_exerciseId)
|
||||
m_ui->cbxPhase->addItem(QString::fromStdString(ph.name), ph.id);
|
||||
};
|
||||
m_exmDtc->exercisePhases(cb);
|
||||
|
||||
|
||||
+6
-4
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_element_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "evl_edit_element_dialog.h"
|
||||
#include "evl_element_model.h"
|
||||
@@ -14,6 +15,7 @@ namespace Evaluations
|
||||
ElementDialog::ElementDialog(QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_model(new ElementDialogModel(this)),
|
||||
m_ui(new Ui::ElementDialog), m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ElementDialog ctor";
|
||||
m_ui->setupUi(this);
|
||||
@@ -51,7 +53,7 @@ void ElementDialog::slotEdit()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ElementDialog::slotEdit";
|
||||
|
||||
addElementEditDialog(m_model->getRowData(m_ui->widget->currentIndex().row()).id());
|
||||
addElementEditDialog(m_model->getRowData(m_ui->widget->currentIndex().row()).id);
|
||||
}
|
||||
|
||||
void ElementDialog::addElementEditDialog(int elementId)
|
||||
@@ -76,9 +78,9 @@ void ElementDialog::slotRemove()
|
||||
return;
|
||||
|
||||
m_requestHelper->startSingleRequest([this]() {
|
||||
DEBUG_LOG(m_logger) << "Removing element id = " << m_model->getRowData(m_ui->widget->currentIndex().row()).id();
|
||||
DEBUG_LOG(m_logger) << "Removing element id = " << m_model->getRowData(m_ui->widget->currentIndex().row()).id;
|
||||
return m_ftc->evlElementRemoveRequest(
|
||||
EvlElementRemoveRequest(m_model->getRowData(m_ui->widget->currentIndex().row()).id(), m_criteriumId), this);
|
||||
EvlElementRemoveRequest(m_model->getRowData(m_ui->widget->currentIndex().row()).id, m_criteriumId), this);
|
||||
});
|
||||
|
||||
if (m_requestHelper->failed())
|
||||
@@ -126,7 +128,7 @@ bool ElementDialog::init(
|
||||
#endif
|
||||
|
||||
auto cb = [this](const Evaluations::EvaluationElement& e) {
|
||||
DEBUG_LOG(m_logger) << "Element: id = " << e.id() << ", medium = " << e.rating();
|
||||
DEBUG_LOG(m_logger) << "Element: id = " << e.id << ", medium = " << e.rating;
|
||||
};
|
||||
m_dtc->evaluationElements(cb);
|
||||
|
||||
|
||||
+18
-16
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_element_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <AudioVideoManagement/stream_name_mapping.h>
|
||||
#include <LtsUtilsCore/json_object.h>
|
||||
@@ -15,6 +16,7 @@ ElementDialogModel::ElementDialogModel(QObject* parent)
|
||||
{tr("Id"), tr("Situation"), tr("Video"), tr("Audio"), tr("Start Time"), tr("Duration"), tr("Rating"),
|
||||
tr("Radio Circuit"), tr("Video Channel"), tr("Note"), tr("Phase")},
|
||||
parent)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,7 +31,7 @@ bool ElementDialogModel::initModel(const std::shared_ptr<Interface::Dtc>& dtc,
|
||||
connect(dtc.get(), &Interface::Dtc::evaluationElementChanged, this, &ElementDialogModel::onDataChanged);
|
||||
|
||||
auto cb = [this, criteriumId](const EvaluationElement& e) {
|
||||
if (e.criteriumId() == criteriumId)
|
||||
if (e.criteriumId == criteriumId)
|
||||
insertRow(e);
|
||||
};
|
||||
dtc->evaluationElements(cb);
|
||||
@@ -49,31 +51,31 @@ QVariant ElementDialogModel::data(const QModelIndex& index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
return eval.id();
|
||||
return eval.id;
|
||||
case Situation:
|
||||
return eval.situation() ? tr("Yes") : tr("No");
|
||||
return eval.situation ? tr("Yes") : tr("No");
|
||||
case Video:
|
||||
return eval.video() ? tr("Yes") : tr("No");
|
||||
return eval.video ? tr("Yes") : tr("No");
|
||||
case Audio:
|
||||
return eval.audio() ? tr("Yes") : tr("No");
|
||||
return eval.audio ? tr("Yes") : tr("No");
|
||||
case Timestamp:
|
||||
return QDateTime::fromMSecsSinceEpoch(eval.timestamp());
|
||||
return QDateTime::fromMSecsSinceEpoch(eval.timestamp);
|
||||
case Duration:
|
||||
return eval.duration();
|
||||
return eval.duration;
|
||||
case Rating:
|
||||
return eval.rating();
|
||||
return eval.rating;
|
||||
case RadioCircuit:
|
||||
if (eval.audioContent().is_set())
|
||||
if (eval.audioContent.has_value())
|
||||
{
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(eval.audioContent().get());
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(eval.audioContent.get());
|
||||
return jsonObj.value<QString>("actualStream");
|
||||
}
|
||||
else
|
||||
return QString();
|
||||
case VideoChannel:
|
||||
if (eval.videoContent().is_set())
|
||||
if (eval.videoContent.has_value())
|
||||
{
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(eval.videoContent().get());
|
||||
LtsUtils::JsonObject jsonObj = LtsUtils::JsonObject::fromJson(eval.videoContent.get());
|
||||
QString streamName = jsonObj.value<QString>("actualStream");
|
||||
QString displayName = m_avmDataIfc->streamNameMapping()->displayName(streamName);
|
||||
return displayName;
|
||||
@@ -81,9 +83,9 @@ QVariant ElementDialogModel::data(const QModelIndex& index, int role) const
|
||||
else
|
||||
return QString();
|
||||
case Note:
|
||||
return QString::fromStdString(eval.note());
|
||||
return QString::fromStdString(eval.note);
|
||||
case Phase:
|
||||
return QString::fromStdString(m_exmDtc->exercisePhase(eval.phaseId()).name());
|
||||
return QString::fromStdString(m_exmDtc->exercisePhase(eval.phaseId).name);
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
@@ -105,7 +107,7 @@ bool ElementDialogProxyModel::lessThan(const QModelIndex& source_left, const QMo
|
||||
switch (source_left.column())
|
||||
{
|
||||
case ElementDialogModel::Timestamp:
|
||||
return dataLeft.timestamp() < dataRight.timestamp();
|
||||
return dataLeft.timestamp < dataRight.timestamp;
|
||||
case ElementDialogModel::Id:
|
||||
case ElementDialogModel::Situation:
|
||||
case ElementDialogModel::Video:
|
||||
@@ -138,7 +140,7 @@ bool ElementDialogProxyModel::filterAcceptsRow(int source_row, const QModelIndex
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::filterAcceptsRow(source_row, source_parent);
|
||||
|
||||
const auto& data = m_sourceModel->m_vecData.at(source_row);
|
||||
if (data.criteriumId() != m_criteriumId)
|
||||
if (data.criteriumId != m_criteriumId)
|
||||
return false;
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::filterAcceptsRow(source_row, source_parent);
|
||||
}
|
||||
|
||||
+7
-5
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <Evaluations/evl_translation.h>
|
||||
|
||||
@@ -10,6 +11,7 @@ namespace Evaluations
|
||||
CriteriumDialogModel::CriteriumDialogModel(QObject* parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<EvaluationCriterium>({tr("Id"), tr("Name"), tr("Description"), tr("Operator")},
|
||||
parent)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,13 +36,13 @@ QVariant CriteriumDialogModel::data(const QModelIndex& index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
return eval.id();
|
||||
return eval.id;
|
||||
case Name:
|
||||
return QString::fromStdString(eval.name());
|
||||
return QString::fromStdString(eval.name);
|
||||
case Description:
|
||||
return QString::fromStdString(eval.description());
|
||||
return QString::fromStdString(eval.description);
|
||||
case Operator:
|
||||
return QString::fromStdString(m_opmDtc->user(eval.operatorId()).name());
|
||||
return QString::fromStdString(m_opmDtc->user(eval.operatorId).name);
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
@@ -68,7 +70,7 @@ bool CriteriumFilterModel::filterAcceptsRow(int source_row, const QModelIndex& s
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::filterAcceptsRow(source_row, source_parent);
|
||||
|
||||
const auto& data = m_sourceModel->m_vecData.at(source_row);
|
||||
if (data.operatorId() != m_operatorId)
|
||||
if (data.operatorId != m_operatorId)
|
||||
return false;
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::filterAcceptsRow(source_row, source_parent);
|
||||
}
|
||||
|
||||
+7
-5
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "san_nine_liner_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "san_nine_liner_dialog_model.h"
|
||||
#include "san_nine_liner_edit_dialog.h"
|
||||
@@ -16,6 +17,7 @@ namespace Evaluations
|
||||
SanNineLinerDialog::SanNineLinerDialog(const QString& menuGroup, QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_ui(new Ui::SanNineLinerDialog),
|
||||
m_menuGroup(menuGroup), m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-SanNineLiner"));
|
||||
@@ -90,7 +92,7 @@ void SanNineLinerDialog::onRemoveSanNineLiner()
|
||||
const QModelIndex curIdx = m_ui->widget->currentIndex();
|
||||
if (!curIdx.isValid())
|
||||
return;
|
||||
const int sanNineLinerId = m_model->getRowData(curIdx.row()).id();
|
||||
const int sanNineLinerId = m_model->getRowData(curIdx.row()).id;
|
||||
|
||||
Core::RemoveElementRequest req(sanNineLinerId);
|
||||
m_requestHelper->startSingleRequest([req, this]() { return m_ftc->sanNineLinerRemoveRequest(req, this); });
|
||||
@@ -101,14 +103,14 @@ void SanNineLinerDialog::onEditSanNineLiner()
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
const Evaluations::SanNineLiner san = m_model->getRowData(idx.row());
|
||||
|
||||
if (san.id() <= 0)
|
||||
if (san.id <= 0)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "current SanNineLinerId: " << san.id();
|
||||
DEBUG_LOG(m_logger) << "current SanNineLinerId: " << san.id;
|
||||
|
||||
SanNineLinerEditDialog* dialog = new SanNineLinerEditDialog(this);
|
||||
|
||||
dialog->init(m_session, m_menuGroup, san.id());
|
||||
const QString identifier = QStringLiteral("EditSanNineLiner%1").arg(san.id());
|
||||
dialog->init(m_session, m_menuGroup, san.id);
|
||||
const QString identifier = QStringLiteral("EditSanNineLiner%1").arg(san.id);
|
||||
|
||||
addDialog(dialog, m_menuGroup, identifier);
|
||||
}
|
||||
|
||||
+7
-5
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "san_nine_liner_dialog_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <Evaluations/evl_translation.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -13,6 +14,7 @@ namespace Evaluations
|
||||
SanNineLinerDialogModel::SanNineLinerDialogModel(QObject* parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<Evaluations::SanNineLiner>(
|
||||
{tr("Id"), tr("Created"), tr("Position"), tr("Radio frequency / Call Sign / Suffix")}, parent)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,16 +41,16 @@ QVariant SanNineLinerDialogModel::data(const QModelIndex& index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case SanNineLinerDialogModel::Columns::Id:
|
||||
return san.id();
|
||||
return san.id;
|
||||
case SanNineLinerDialogModel::Columns::Created:
|
||||
return QDateTime::fromMSecsSinceEpoch(san.lastModified());
|
||||
return QDateTime::fromMSecsSinceEpoch(san.lastModified);
|
||||
case SanNineLinerDialogModel::Columns::Position: {
|
||||
if (std::isnan(san.line1_position().lat()) || std::isnan(san.line1_position().lon()))
|
||||
if (std::isnan(san.line1_position.lat) || std::isnan(san.line1_position.lon))
|
||||
return tr("---");
|
||||
return LtsCoordTrans::mgrsFromGeographic(san.line1_position().lon(), san.line1_position().lat());
|
||||
return LtsCoordTrans::mgrsFromGeographic(san.line1_position.lon, san.line1_position.lat);
|
||||
}
|
||||
case SanNineLinerDialogModel::Columns::RadioFrequencyCallSignSuffix:
|
||||
return QString::fromStdString(san.line2_RadioFrequencyCallSignSuffix());
|
||||
return QString::fromStdString(san.line2_RadioFrequencyCallSignSuffix);
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
-1
@@ -37,7 +37,6 @@ class SanNineLinerProxyModel final : public LtsWidgets::LtsColumnFilterProxyMode
|
||||
void setSourceModel(QAbstractItemModel* sourceModel) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
SanNineLinerDialogModel* m_sourceModel{nullptr};
|
||||
};
|
||||
} // namespace Evaluations
|
||||
+14
-12
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "san_nine_liner_edit_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_san_nine_liner_edit_dialog.h"
|
||||
|
||||
@@ -24,6 +25,7 @@ namespace Evaluations
|
||||
SanNineLinerEditDialog::SanNineLinerEditDialog(QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel), m_ui(new Ui::SanNineLinerEditDialog),
|
||||
m_validator(new QIntValidator(this)), m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -82,16 +84,16 @@ bool SanNineLinerEditDialog::init(LtsSession::LtsSessionDataDds* session, const
|
||||
|
||||
Evaluations::SanNineLiner data = m_dtc->sanNineLiner(sanNineLinerId);
|
||||
|
||||
if (data.id() > 0)
|
||||
if (data.id > 0)
|
||||
{
|
||||
m_ui->dtTime->setMsecsSinceEpoch(data.lastModified());
|
||||
m_ui->dtTime->setMsecsSinceEpoch(data.lastModified);
|
||||
m_ui->leRadioFrequencyCallSignSuffix->setText(
|
||||
QString::fromStdString(data.line2_RadioFrequencyCallSignSuffix()));
|
||||
QPointF position(data.line1_position().lon(), data.line1_position().lat());
|
||||
QString::fromStdString(data.line2_RadioFrequencyCallSignSuffix));
|
||||
QPointF position(data.line1_position.lon, data.line1_position.lat);
|
||||
if (!position.isNull())
|
||||
m_ui->positionEdit->setCoordinate(position);
|
||||
|
||||
QVector<Database::SanCategoryLine> linesCategory = SanCategoryLine::fromJson(data.lines(), data.id());
|
||||
QVector<Database::SanCategoryLine> linesCategory = SanCategoryLine::fromJson(data.lines, data.id);
|
||||
|
||||
INFO_LOG(m_logger) << "linesCategory size: " << linesCategory.size();
|
||||
|
||||
@@ -165,13 +167,13 @@ bool SanNineLinerEditDialog::apply()
|
||||
{
|
||||
|
||||
SanNineLinerModifyRequest request;
|
||||
request.id(m_sanNineLinerId);
|
||||
request.id = m_sanNineLinerId;
|
||||
|
||||
request.id(m_sanNineLinerId);
|
||||
request.lastModified(m_ui->dtTime->msecsSinceEpoch());
|
||||
request.id = m_sanNineLinerId;
|
||||
request.lastModified = m_ui->dtTime->msecsSinceEpoch();
|
||||
const Core::GeoPosition2D pos(m_ui->positionEdit->coordinate().x(), m_ui->positionEdit->coordinate().y());
|
||||
request.line1_position(pos);
|
||||
request.line2_radioFrequencyCallSignSuffix(m_ui->leRadioFrequencyCallSignSuffix->text().toStdString());
|
||||
request.line1_position = pos;
|
||||
request.line2_radioFrequencyCallSignSuffix = m_ui->leRadioFrequencyCallSignSuffix->text().toStdString();
|
||||
|
||||
m_vecCategoryLine.clear();
|
||||
|
||||
@@ -218,13 +220,13 @@ bool SanNineLinerEditDialog::apply()
|
||||
setCategoryLine(line, QStringLiteral("None"), m_ui->cbx9None);
|
||||
|
||||
QJsonDocument doc = SanCategoryLine::toJson(m_vecCategoryLine);
|
||||
request.lines(doc.toJson().toStdString());
|
||||
request.lines = doc.toJson().toStdString();
|
||||
|
||||
if (!m_requestHelper->startSingleRequest(
|
||||
[this, request]() { return m_ftc->sanNineLinerModifyRequest(request, this); }))
|
||||
return false;
|
||||
|
||||
if (request.id() <= 0)
|
||||
if (request.id <= 0)
|
||||
{
|
||||
m_sanNineLinerId = m_requestHelper->getRepliedId();
|
||||
ERROR_LOG(m_logger) << "Created new san nine liner with id " << m_sanNineLinerId;
|
||||
|
||||
+12
-10
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "evl_comments.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_evl_comments.h"
|
||||
#include "evl_comment_model.h"
|
||||
|
||||
@@ -19,6 +20,7 @@ EvlCommentsView::EvlCommentsView(const std::shared_ptr<Interface::Dtc> &evlDtc,
|
||||
m_ui(new Ui::EvlCommentsDialog),
|
||||
m_evlDtc(evlDtc),
|
||||
m_opmDtc(opmDtc)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -115,28 +117,28 @@ bool EvlCommentsView::insertComment(const Evaluations::EvaluationComment &c)
|
||||
{
|
||||
QString strSenderOperatorName, strReceiverOperatorName;
|
||||
|
||||
OperatorManagement::User sender = m_opmDtc->user(c.senderOperatorId());
|
||||
strSenderOperatorName = QString::fromStdString(sender.name());
|
||||
OperatorManagement::User sender = m_opmDtc->user(c.senderOperatorId);
|
||||
strSenderOperatorName = QString::fromStdString(sender.name);
|
||||
|
||||
if (c.receiverOperatorId().is_set())
|
||||
if (c.receiverOperatorId.has_value())
|
||||
{
|
||||
|
||||
OperatorManagement::User loggedInOperator = m_opmDtc->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
|
||||
if (c.receiverOperatorId().get() != loggedInOperator.id())
|
||||
if (c.receiverOperatorId.get() != loggedInOperator.id)
|
||||
return false;
|
||||
|
||||
OperatorManagement::User receiver = m_opmDtc->user(c.receiverOperatorId().get());
|
||||
strReceiverOperatorName = QString::fromStdString(receiver.name());
|
||||
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_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());
|
||||
t.m_text = QString::fromStdString(c.text);
|
||||
t.m_hierarchy = QString::fromStdString(c.hierarchy);
|
||||
|
||||
return m_model->insertRow(t);
|
||||
}
|
||||
|
||||
+37
-35
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_edit_schema.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "evl_new_comment_dialog.h"
|
||||
#include "ui_evl_edit_schema.h"
|
||||
@@ -62,6 +63,7 @@ EditSchemaDialog::EditSchemaDialog(bool ocMode, bool runningOnTablet, LtsSession
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel), m_ocMode(ocMode),
|
||||
m_runningOnTablet(runningOnTablet), m_session(session), m_requestHelper(new LtsUtils::RequestHelper(this)),
|
||||
m_ui(new Ui::EditSchemaDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -202,9 +204,9 @@ void EditSchemaDialog::loadLatestSchema()
|
||||
{
|
||||
--itE;
|
||||
|
||||
if ((*itE).sendToTa())
|
||||
if ((*itE).sendToTa)
|
||||
{
|
||||
loadSchema((*itE).id());
|
||||
loadSchema((*itE).id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -213,22 +215,22 @@ void EditSchemaDialog::loadLatestSchema()
|
||||
|
||||
for (const Evaluations::EvaluationComment& c : mapComments)
|
||||
{
|
||||
if (c.schemaId() != m_loadedSchemaId)
|
||||
if (c.schemaId != m_loadedSchemaId)
|
||||
continue;
|
||||
|
||||
if (c.senderOperatorId() != LtsSessionData::LtsSessionData::getInstance()->getOperatorId())
|
||||
if (c.senderOperatorId != LtsSessionData::LtsSessionData::getInstance()->getOperatorId())
|
||||
continue;
|
||||
|
||||
ItemComment comment(QString::fromStdString(c.text()), c.senderOperatorId(),
|
||||
c.receiverOperatorId().is_set() ? c.receiverOperatorId().get() : 0, c.elementId(),
|
||||
QDateTime::fromMSecsSinceEpoch(c.ts()));
|
||||
ItemComment comment(QString::fromStdString(c.text), c.senderOperatorId,
|
||||
c.receiverOperatorId.has_value() ? c.receiverOperatorId.get() : 0, c.elementId,
|
||||
QDateTime::fromMSecsSinceEpoch(c.ts));
|
||||
m_pModel->insertComment(comment);
|
||||
}
|
||||
|
||||
updateCommentLabel();
|
||||
}
|
||||
else
|
||||
loadSchema(m_mapSchemata.last().id());
|
||||
loadSchema(m_mapSchemata.last().id);
|
||||
}
|
||||
|
||||
void EditSchemaDialog::handleUnsentComments()
|
||||
@@ -268,25 +270,25 @@ void EditSchemaDialog::onRequestSchema()
|
||||
|
||||
void EditSchemaDialog::onNotifyAboutSchema(const Evaluations::EvaluationSchema& data, DataModification modType)
|
||||
{
|
||||
if (m_ocMode && !data.sendToTa())
|
||||
if (m_ocMode && !data.sendToTa)
|
||||
return;
|
||||
|
||||
QJsonParseError jError;
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(data.schemadata().c_str(), &jError));
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(data.schemadata.c_str(), &jError));
|
||||
|
||||
if (jError.error != QJsonParseError::NoError)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse schema with database id " << data.id();
|
||||
WARNING_LOG(m_logger) << "Could not parse schema with database id " << data.id;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_loadedSchemaId == data.id())
|
||||
if (m_loadedSchemaId == data.id)
|
||||
return;
|
||||
|
||||
if (doc == m_pModel->toJsonDocument())
|
||||
{
|
||||
|
||||
m_loadedSchemaId = data.id();
|
||||
m_loadedSchemaId = data.id;
|
||||
retranslate();
|
||||
return;
|
||||
}
|
||||
@@ -301,7 +303,7 @@ void EditSchemaDialog::onNotifyAboutSchema(const Evaluations::EvaluationSchema&
|
||||
{
|
||||
handleUnsentComments();
|
||||
|
||||
m_loadedSchemaId = data.id();
|
||||
m_loadedSchemaId = data.id;
|
||||
m_pModel->fromQJsonDocument(doc);
|
||||
expandNodeChildren(m_ui->m_treeViewSchema, QModelIndex(), true);
|
||||
updateCommentLabel();
|
||||
@@ -314,11 +316,11 @@ void EditSchemaDialog::loadSchema(qint32 schemaId)
|
||||
if (m_mapSchemata.size())
|
||||
{
|
||||
QJsonParseError jError;
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(m_mapSchemata[schemaId].schemadata().c_str(), &jError));
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(m_mapSchemata[schemaId].schemadata.c_str(), &jError));
|
||||
|
||||
if (jError.error != QJsonParseError::NoError)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not load schema with database id " << m_mapSchemata.last().id();
|
||||
WARNING_LOG(m_logger) << "Could not load schema with database id " << m_mapSchemata.last().id;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -338,8 +340,8 @@ void EditSchemaDialog::DebugonLoadSchema()
|
||||
|
||||
m_mapSchemata = m_evlDtc->evaluationSchemas();
|
||||
qint32 id = QInputDialog::getInt(this, QStringLiteral("Insert database id of desired schema"),
|
||||
QStringLiteral("Database id"), m_mapSchemata.last().id(),
|
||||
m_mapSchemata.first().id(), m_mapSchemata.last().id());
|
||||
QStringLiteral("Database id"), m_mapSchemata.last().id,
|
||||
m_mapSchemata.first().id, m_mapSchemata.last().id);
|
||||
loadSchema(id);
|
||||
}
|
||||
|
||||
@@ -454,11 +456,11 @@ void EditSchemaDialog::saveSchema(bool sendToTa)
|
||||
EvlSchemaModifyRequest req;
|
||||
|
||||
bool schemaChanged = hasUnsavedChanges();
|
||||
req.id(schemaChanged ? 0 : m_loadedSchemaId);
|
||||
req.sendToTa(sendToTa);
|
||||
req.id = schemaChanged ? 0 : m_loadedSchemaId;
|
||||
req.sendToTa = sendToTa;
|
||||
|
||||
QJsonDocument doc = m_pModel->toJsonDocument();
|
||||
req.schemadata(doc.toJson().constData());
|
||||
req.schemadata = doc.toJson().constData();
|
||||
|
||||
m_requestHelper->addRequest([this, req, schemaChanged]() {
|
||||
bool success = m_evlFtc->evlSchemaModifyRequest(req, this);
|
||||
@@ -535,34 +537,34 @@ void EditSchemaDialog::onSendComment()
|
||||
EvlCommentModifyRequest EditSchemaDialog::createEvlCommentModifyRequest(const ItemComment& c) const
|
||||
{
|
||||
EvlCommentModifyRequest req;
|
||||
req.id(0);
|
||||
req.ts(c.getTimeStamp().toMSecsSinceEpoch());
|
||||
req.senderOperatorId(c.senderId());
|
||||
req.id = 0;
|
||||
req.ts = c.getTimeStamp().toMSecsSinceEpoch();
|
||||
req.senderOperatorId = c.senderId();
|
||||
|
||||
if (c.hasReceiverId())
|
||||
req.receiverOperatorId(c.receiverId());
|
||||
req.receiverOperatorId = c.receiverId();
|
||||
|
||||
req.text(c.getText().toStdString());
|
||||
req.text = c.getText().toStdString();
|
||||
|
||||
req.hierarchy(c.getHierarchy().toStdString());
|
||||
req.schemaId(m_loadedSchemaId);
|
||||
req.elementId(c.elementId());
|
||||
req.hierarchy = c.getHierarchy().toStdString();
|
||||
req.schemaId = m_loadedSchemaId;
|
||||
req.elementId = c.elementId();
|
||||
return req;
|
||||
}
|
||||
|
||||
OcSituationClient::SendEvaluationRequest EditSchemaDialog::createSendEvaluationRequest(const ItemComment& c) const
|
||||
{
|
||||
OcSituationClient::SendEvaluationRequest req;
|
||||
req.timeStamp(c.getTimeStamp().toMSecsSinceEpoch());
|
||||
req.senderOperatorId(c.senderId());
|
||||
req.timeStamp = c.getTimeStamp().toMSecsSinceEpoch();
|
||||
req.senderOperatorId = c.senderId();
|
||||
|
||||
if (c.hasReceiverId())
|
||||
req.receiverOperatorId(c.receiverId());
|
||||
req.receiverOperatorId = c.receiverId();
|
||||
|
||||
req.text(c.getText().toStdString());
|
||||
req.text = c.getText().toStdString();
|
||||
|
||||
req.hierarchy(c.getHierarchy().toStdString());
|
||||
req.schemaId(m_loadedSchemaId);
|
||||
req.hierarchy = c.getHierarchy().toStdString();
|
||||
req.schemaId = m_loadedSchemaId;
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <OcSituationClient/osc_ftc.h>
|
||||
#include <FileManagement/flm_data_plugin.h>
|
||||
#include <Plugins/FileManagement/Data/flm_data_plugin.h>
|
||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||
#include <OperatorManagement/opm_data_plugin_interface.h>
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ namespace Evaluations
|
||||
{
|
||||
TreeModelSchema::TreeModelSchema(QObject* parent, NGL::INGLLogger& logger) : TreeModelGeneral(parent, logger)
|
||||
{
|
||||
qRegisterMetaTypeStreamOperators<Evaluations::ElementData>();
|
||||
qRegisterMetaType<Evaluations::ElementData>();
|
||||
}
|
||||
|
||||
void TreeModelSchema::resetModel()
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "evl_new_comment_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_evl_new_comment_dialog.h"
|
||||
|
||||
@@ -18,7 +19,7 @@ EvlNewCommentDialog::EvlNewCommentDialog(const std::shared_ptr<OperatorManagemen
|
||||
m_ui->m_ltsComboBox_ReceiverOperator->addItem(tr("All (Default)"), 0);
|
||||
|
||||
auto cbUser = [this](const OperatorManagement::User& user) {
|
||||
m_ui->m_ltsComboBox_ReceiverOperator->addItem(QString::fromStdString(user.name()), user.id());
|
||||
m_ui->m_ltsComboBox_ReceiverOperator->addItem(QString::fromStdString(user.name), user.id);
|
||||
};
|
||||
opmDtc->users(cbUser);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <FilterManagement/flt_participant_plugin_interface.h>
|
||||
#include <FilterManagement/flt_aes_plugin_interface.h>
|
||||
#include <FilterManagement/flt_building_cmpnt_plugin_interface.h>
|
||||
#include <flm_data_plugin_interface.h>
|
||||
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||
#include <AudioVideoManagement/avm_data_plugin_interface.h>
|
||||
|
||||
|
||||
Reference in new issue
Block a user