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
+4
-11
@@ -22,18 +22,12 @@ IF(BUILD_RTI)
|
||||
SET(mrk_common_gui_SRCS
|
||||
mrk_dialog_model.cpp
|
||||
mrk_dialog_model.h
|
||||
mrk_apply_filter.cpp
|
||||
mrk_apply_filter.h
|
||||
CustomViews/mrk_marker.cpp
|
||||
CustomViews/mrk_marker.h
|
||||
)
|
||||
|
||||
# FilterManagement-Plugins temporär ausgeschlossen für BUILD_RTI=OFF
|
||||
# if(BUILD_RTI)
|
||||
# list(APPEND mrk_common_gui_SRCS
|
||||
# mrk_apply_filter.cpp
|
||||
# mrk_apply_filter.h
|
||||
# )
|
||||
# endif()
|
||||
|
||||
NGL_WRAP_UI(mrk_common_gui_SRCS
|
||||
CustomViews/mrk_marker.ui
|
||||
)
|
||||
@@ -50,11 +44,10 @@ if(QT6_GUI_AVAILABLE)
|
||||
LtsSession
|
||||
LtsSessionData
|
||||
LtsUtilsGuiDds
|
||||
# OpmDataPluginInterface # External dependency
|
||||
svcOpmCommon # OperatorManagement::Interface::Dtc (legacy: OpmDataPluginInterface)
|
||||
ngltools
|
||||
# svcMrkCommon # External dependency
|
||||
PUBLIC
|
||||
# MrkDataPluginInterface # External dependency - check if available
|
||||
svcMrkCommon # MarkerManagement::Interface::Dtc (legacy: MrkDataPluginInterface)
|
||||
${Qt6_Widgets}
|
||||
LtsWidgets
|
||||
LtsDataView
|
||||
|
||||
+16
-15
@@ -20,6 +20,7 @@ MarkerManagementApplyFilter::MarkerManagementApplyFilter(LtsSession::LtsSession
|
||||
, m_fltParticipantIfc(fltParticipantIfc)
|
||||
, m_fltAesIfc(fltAesIfc)
|
||||
, m_fltBuildingComponentIfc(fltBuildingComponenIfc)
|
||||
, m_logger(getLogger("MarkerManagementApplyFilter"))
|
||||
{
|
||||
std::shared_ptr<SituationMap::ForeignGuiInterface> spSitMapGuiIfc;
|
||||
m_session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(spSitMapGuiIfc);
|
||||
@@ -112,7 +113,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent)
|
||||
if (innerObj.isEmpty())
|
||||
ERROR_LOG(m_logger) << "inner content AesFilterJson is empty";
|
||||
else
|
||||
aesFilter.content(QJsonDocument(innerObj).toJson().constData());
|
||||
aesFilter.content = QJsonDocument(innerObj).toJson().constData();
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +126,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent)
|
||||
if (innerObj.isEmpty())
|
||||
ERROR_LOG(m_logger) << "inner content SymbolAppearanceJson is empty";
|
||||
else
|
||||
symbolAppearance.content(QJsonDocument(innerObj).toJson().constData());
|
||||
symbolAppearance.content = QJsonDocument(innerObj).toJson().constData();
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +139,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent)
|
||||
if (innerObj.isEmpty())
|
||||
ERROR_LOG(m_logger) << "inner content BuildingComponentSettingsJson is empty";
|
||||
else
|
||||
buildingComponentFilter.content(QJsonDocument(innerObj).toJson().constData());
|
||||
buildingComponentFilter.content = QJsonDocument(innerObj).toJson().constData();
|
||||
}
|
||||
|
||||
|
||||
@@ -164,10 +165,10 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent)
|
||||
|
||||
|
||||
|
||||
aesFilter.id(0);
|
||||
aesFilter.operatorId(operatorId);
|
||||
aesFilter.sampleTime(0);
|
||||
aesFilter.ctx(wsId_context.toStdString());
|
||||
aesFilter.id = 0;
|
||||
aesFilter.operatorId = operatorId;
|
||||
aesFilter.sampleTime = 0;
|
||||
aesFilter.ctx = wsId_context.toStdString();
|
||||
|
||||
std::shared_ptr<FilterManagement::AesDisplayFilter> aesDisplayFilter
|
||||
= fltIfcPtr->aesFilterForOperator(LtsSessionData::LtsSessionData::getInstance()->getOperatorId(), wsId_context);
|
||||
@@ -176,10 +177,10 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent)
|
||||
|
||||
|
||||
|
||||
symbolAppearance.id(0);
|
||||
symbolAppearance.operatorId(operatorId);
|
||||
symbolAppearance.sampleTime(0);
|
||||
symbolAppearance.ctx(wsId_context.toStdString());
|
||||
symbolAppearance.id = 0;
|
||||
symbolAppearance.operatorId = operatorId;
|
||||
symbolAppearance.sampleTime = 0;
|
||||
symbolAppearance.ctx = wsId_context.toStdString();
|
||||
|
||||
std::shared_ptr<FilterManagement::SymbolAppearanceSettings> appearanceSettings
|
||||
= fltParticipantIfc->symbolAppearanceForOperator(LtsSessionData::LtsSessionData::getInstance()->getOperatorId(), wsId_context);
|
||||
@@ -195,10 +196,10 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent)
|
||||
{
|
||||
|
||||
|
||||
buildingComponentFilter.id(0);
|
||||
buildingComponentFilter.operatorId(operatorId);
|
||||
buildingComponentFilter.sampleTime(0);
|
||||
buildingComponentFilter.ctx(wsId_context.toStdString());
|
||||
buildingComponentFilter.id = 0;
|
||||
buildingComponentFilter.operatorId = operatorId;
|
||||
buildingComponentFilter.sampleTime = 0;
|
||||
buildingComponentFilter.ctx = wsId_context.toStdString();
|
||||
|
||||
std::shared_ptr<FilterManagement::BuildingComponentSettings> buildingComponentSettings
|
||||
= fltBldgCmpntIfc->buildingComponentSettingsForOperator(LtsSessionData::LtsSessionData::getInstance()->getOperatorId(), wsId_context);
|
||||
|
||||
+24
-24
@@ -9,11 +9,11 @@
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <MarkerManagement/mrk_dtc.h>
|
||||
#include <MarkerManagement/mrk_translation.h>
|
||||
#endif
|
||||
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <LtsProjectionWorkstation/lts_projection_workstation.h>
|
||||
#include <QtCore/QBuffer>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QTimer>
|
||||
@@ -33,7 +33,7 @@ MarkerManagementDialogModel::MarkerManagementDialogModel(QObject *parent)
|
||||
tr("File Id"),
|
||||
tr("Image")},
|
||||
parent)
|
||||
, m_logger(LtsProjectionWorkstation::getLogger("MarkerManagementDialogModel"))
|
||||
, m_logger(getLogger("MarkerManagementDialogModel"))
|
||||
{}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ bool MarkerManagementDialogModel::initModel(const std::shared_ptr<MarkerManageme
|
||||
{
|
||||
auto cbUser = [this](const OperatorManagement::User &user)
|
||||
{
|
||||
m_operatorNames.insert(user.id(), QString::fromStdString(user.name()));
|
||||
m_operatorNames.insert(user.id, QString::fromStdString(user.name));
|
||||
};
|
||||
connect(opmDtc.get(), &OperatorManagement::Interface::Dtc::userChanged, this, cbUser);
|
||||
opmDtc->users(cbUser);
|
||||
@@ -149,13 +149,13 @@ QVariant MarkerManagementDialogModel::data(const QModelIndex &index, int role) c
|
||||
if (role == LtsWidgets::LtsColumnFilterProxyModel::ComboboxFilterRole)
|
||||
{
|
||||
if (index.column() == ColOperator)
|
||||
return marker.operatorId();
|
||||
return marker.operatorId;
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if (role == Qt::ToolTipRole)
|
||||
{
|
||||
const int fileContentId = marker.fileContentId();
|
||||
const int fileContentId = marker.fileContentId;
|
||||
if (fileContentId > 0)
|
||||
{
|
||||
auto it = m_previews.find(fileContentId);
|
||||
@@ -175,31 +175,31 @@ QVariant MarkerManagementDialogModel::data(const QModelIndex &index, int role) c
|
||||
switch (index.column())
|
||||
{
|
||||
case ColNote:
|
||||
return QString::fromStdString(marker.note());
|
||||
return QString::fromStdString(marker.note);
|
||||
case ColOperator:
|
||||
if (marker.operatorId() <= 0)
|
||||
if (marker.operatorId <= 0)
|
||||
return tr("Global");
|
||||
return m_operatorNames.value(marker.operatorId());
|
||||
return m_operatorNames.value(marker.operatorId);
|
||||
case ColType:
|
||||
{
|
||||
QStringList slTypes;
|
||||
slTypes.reserve(marker.descriptions().size());
|
||||
for (const MarkerManagement::MarkerDescription &desc : marker.descriptions())
|
||||
slTypes.append(MarkerManagement::toString(desc.markerType()));
|
||||
slTypes.reserve(marker.descriptions.size());
|
||||
for (const MarkerManagement::MarkerDescription &desc : marker.descriptions)
|
||||
slTypes.append(MarkerManagement::toString(desc.markerType));
|
||||
|
||||
return slTypes.join(QStringLiteral(", "));
|
||||
}
|
||||
case ColStreams:
|
||||
{
|
||||
QString ret;
|
||||
for (const MarkerManagement::MarkerDescription &desc : marker.descriptions())
|
||||
for (const MarkerManagement::MarkerDescription &desc : marker.descriptions)
|
||||
{
|
||||
if (desc.markerType() != MarkerManagement::MarkerType::Audio &&
|
||||
desc.markerType() != MarkerManagement::MarkerType::Video)
|
||||
if (desc.markerType != MarkerManagement::MarkerType::Audio &&
|
||||
desc.markerType != MarkerManagement::MarkerType::Video)
|
||||
continue;
|
||||
if (!ret.isEmpty())
|
||||
ret += QLatin1Char(',');
|
||||
ret += QString::fromStdString(desc.content());
|
||||
ret += QString::fromStdString(desc.content);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -209,16 +209,16 @@ QVariant MarkerManagementDialogModel::data(const QModelIndex &index, int role) c
|
||||
|
||||
|
||||
|
||||
return QDateTime::fromMSecsSinceEpoch(marker.timeStamp() + (m_timezoneHoursOffset * 3600 * 1000)).toString(QStringLiteral("dd.MM.yy HH:mm:ss"));
|
||||
return QDateTime::fromMSecsSinceEpoch(marker.timeStamp + (m_timezoneHoursOffset * 3600 * 1000)).toString(QStringLiteral("dd.MM.yy HH:mm:ss"));
|
||||
}
|
||||
else
|
||||
return QDateTime::fromMSecsSinceEpoch(marker.timeStamp() - marker.timeStampOffset());
|
||||
return QDateTime::fromMSecsSinceEpoch(marker.timeStamp - marker.timeStampOffset);
|
||||
case ColOffset:
|
||||
return QVariant::fromValue<qlonglong>(marker.timeStampOffset() / 1000);
|
||||
return QVariant::fromValue<qlonglong>(marker.timeStampOffset / 1000);
|
||||
case ColFileId:
|
||||
return marker.fileContentId();
|
||||
return QVariant::fromValue<qlonglong>(marker.fileContentId);
|
||||
case ColImage:
|
||||
return m_previews.value(marker.fileContentId());
|
||||
return m_previews.value(marker.fileContentId);
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
@@ -228,7 +228,7 @@ void MarkerManagementDialogModel::updateOperatorNames()
|
||||
{
|
||||
QSet<int> operatorIds;
|
||||
for (const auto &op : std::as_const(m_vecData))
|
||||
operatorIds.insert(op.operatorId());
|
||||
operatorIds.insert(op.operatorId);
|
||||
|
||||
LtsWidgets::ComboboxFilterContent cfc;
|
||||
LtsWidgets::ComboboxFilterData cfd;
|
||||
@@ -270,8 +270,8 @@ bool MarkerSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIn
|
||||
|
||||
if (!m_showOtherUsersMarkers)
|
||||
{
|
||||
bool bAccepted = marker.operatorId() == 0 ||
|
||||
marker.operatorId() == m_operatorId;
|
||||
bool bAccepted = marker.operatorId == 0 ||
|
||||
marker.operatorId == m_operatorId;
|
||||
if (!bAccepted)
|
||||
return false;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ bool MarkerSortFilterProxyModel::lessThan(const QModelIndex &source_left, const
|
||||
switch (source_left.column())
|
||||
{
|
||||
case MarkerManagementDialogModel::ColTime:
|
||||
return left.timeStamp() < right.timeStamp();
|
||||
return left.timeStamp < right.timeStamp;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
-1
@@ -6,7 +6,6 @@
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
|
||||
#include <MarkerManagement/mrk_dtc.h>
|
||||
#include <MarkerManagement/mrk_marker.h>
|
||||
#include <MarkerManagement/logger.h>
|
||||
#include <mrkcommon_export.h>
|
||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||
|
||||
+18
-16
@@ -2,11 +2,12 @@
|
||||
|
||||
|
||||
#include "topic_editor.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_topic_editor.h"
|
||||
|
||||
#include <LtsScriptTimeline/track_entry.h>
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <MarkerManagement/MarkerEdit/snapshot_dialog_model.h>
|
||||
#include <Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog_model.h>
|
||||
#include <MarkerManagement/mrk.hpp>
|
||||
#include <TopicEditorBase/topic_previewer.h>
|
||||
|
||||
@@ -24,6 +25,7 @@ SnapshotTopicEditor::SnapshotTopicEditor(SnapshotDialogModel *snapshotModel, QSo
|
||||
, m_proxyModel(proxyModel)
|
||||
, m_snapshotId(0)
|
||||
, m_ui(new Ui::SnapshotTopicEditor)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
init(m_ui->widget);
|
||||
@@ -76,9 +78,9 @@ void SnapshotTopicEditor::updateInternalData()
|
||||
{
|
||||
m_ui->snapshotsDataView->selectRow(m_proxyModel->mapFromSource(idx));
|
||||
const MarkerManagement::Snapshot snapshot = m_snapshotModel->getRowData(idx.row());
|
||||
DEBUG_LOG(m_logger) << "SnapShot Selected " << snapshot.id() ;
|
||||
m_snapshotId = snapshot.id();
|
||||
m_ui->lblName->setText(QString::fromStdString(snapshot.name()));
|
||||
DEBUG_LOG(m_logger) << "SnapShot Selected " << snapshot.id ;
|
||||
m_snapshotId = snapshot.id;
|
||||
m_ui->lblName->setText(QString::fromStdString(snapshot.name));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -110,12 +112,12 @@ void SnapshotTopicEditor::onSnapshotSelected()
|
||||
{
|
||||
const QModelIndex idx =m_ui->snapshotsDataView->currentIndex();
|
||||
const MarkerManagement::Snapshot snapshot = m_snapshotModel->getRowData(idx.row());
|
||||
if (snapshot.id() <= 0)
|
||||
if (snapshot.id <= 0)
|
||||
return;
|
||||
|
||||
m_snapshotId = snapshot.id();
|
||||
m_snapshotId = snapshot.id;
|
||||
DEBUG_LOG(m_logger) << "new snapshot id = " << m_snapshotId;
|
||||
m_ui->lblName->setText(QString::fromStdString(snapshot.name()));
|
||||
m_ui->lblName->setText(QString::fromStdString(snapshot.name));
|
||||
slotChangesMade();
|
||||
}
|
||||
|
||||
@@ -131,22 +133,22 @@ bool SnapshotTopicEditor::apply2()
|
||||
}
|
||||
|
||||
const MarkerManagement::Snapshot snapshot = m_snapshotModel->getRowData(m_ui->snapshotsDataView->currentIndex().row());
|
||||
if (snapshot.id() <= 0)
|
||||
if (snapshot.id <= 0)
|
||||
{
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Invalid or no snapshot selected"));
|
||||
return false;
|
||||
}
|
||||
|
||||
setTopicDataProperty(QStringLiteral("snapshotName"), QString::fromStdString(snapshot.name()));
|
||||
setTopicDataProperty(QStringLiteral("snapshotName"), QString::fromStdString(snapshot.name));
|
||||
setTopicDataProperty(QStringLiteral("snapshotId"), m_snapshotId);
|
||||
setTopicDataProperty(QStringLiteral("planOverlay"), QString::fromStdString(snapshot.planOverlay()));
|
||||
setTopicDataProperty(QStringLiteral("snapshotFilter"), QString::fromStdString(snapshot.filter()));
|
||||
setTopicDataProperty(QStringLiteral("timeStamp"), double(snapshot.timeStamp()));
|
||||
setTopicDataProperty(QStringLiteral("mapSettings"), QString::fromStdString(snapshot.mapSettings()));
|
||||
setTopicDataProperty(QStringLiteral("fileContentId"), snapshot.fileContentId());
|
||||
setDescription(m_ui->widget->description().isEmpty() ? QString::fromStdString(snapshot.name()) : m_ui->widget->description());
|
||||
setTopicDataProperty(QStringLiteral("planOverlay"), QString::fromStdString(snapshot.planOverlay));
|
||||
setTopicDataProperty(QStringLiteral("snapshotFilter"), QString::fromStdString(snapshot.filter));
|
||||
setTopicDataProperty(QStringLiteral("timeStamp"), double(snapshot.timeStamp));
|
||||
setTopicDataProperty(QStringLiteral("mapSettings"), QString::fromStdString(snapshot.mapSettings));
|
||||
setTopicDataProperty(QStringLiteral("fileContentId"), static_cast<qint64>(snapshot.fileContentId));
|
||||
setDescription(m_ui->widget->description().isEmpty() ? QString::fromStdString(snapshot.name) : m_ui->widget->description());
|
||||
if (topicPreviewWidget()->description().isEmpty())
|
||||
topicPreviewWidget()->setDescription(QString::fromStdString(snapshot.name()));
|
||||
topicPreviewWidget()->setDescription(QString::fromStdString(snapshot.name));
|
||||
m_ui->widget->previewer()->setTopicData(m_topicData);
|
||||
return true;
|
||||
}
|
||||
|
||||
+40
-38
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "mrk_create_snapshot.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_mrk_create_snapshot.h"
|
||||
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
@@ -14,7 +15,7 @@
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtGui/QImage>
|
||||
@@ -29,6 +30,7 @@ SnapshotCreateDialog::SnapshotCreateDialog(QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_ui(new Ui::SnapshotCreateDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -64,7 +66,7 @@ bool SnapshotCreateDialog::init(const std::shared_ptr<MarkerManagement::Interfac
|
||||
return false;
|
||||
|
||||
m_editData = data;
|
||||
m_fileId = data.fileContentId();
|
||||
m_fileId = data.fileContentId;
|
||||
|
||||
m_mrkFtc = mrk_ftc;
|
||||
m_flmDtc = flm_dtc;
|
||||
@@ -81,11 +83,11 @@ bool SnapshotCreateDialog::init(const std::shared_ptr<MarkerManagement::Interfac
|
||||
m_ui->cbSavePreview->setEnabled(false);
|
||||
m_ui->cbSavePreview->setChecked(true);
|
||||
|
||||
if (m_editData.id() > 0)
|
||||
if (m_editData.id > 0)
|
||||
{
|
||||
m_ui->leName->setText(QString::fromStdString(m_editData.name()));
|
||||
m_ui->leDesc->setText(QString::fromStdString(m_editData.description()));
|
||||
m_fileId = m_editData.fileContentId();
|
||||
m_ui->leName->setText(QString::fromStdString(m_editData.name));
|
||||
m_ui->leDesc->setText(QString::fromStdString(m_editData.description));
|
||||
m_fileId = m_editData.fileContentId;
|
||||
if (m_fileId > 0)
|
||||
m_ui->cbSavePreview->setChecked(false);
|
||||
}
|
||||
@@ -103,30 +105,30 @@ void SnapshotCreateDialog::sendSnapshotRequest()
|
||||
const QByteArray &movementTracks = spSitMapGuiIfc->movementTrackManagerSettingsJson();
|
||||
|
||||
Snapshot req;
|
||||
req.id(m_editData.id());
|
||||
req.name(m_ui->leName->text().toStdString());
|
||||
req.description(m_ui->leDesc->toPlainText().toStdString());
|
||||
req.id = m_editData.id;
|
||||
req.name = m_ui->leName->text().toStdString();
|
||||
req.description = m_ui->leDesc->toPlainText().toStdString();
|
||||
|
||||
if (m_editData.id() > 0)
|
||||
if (m_editData.id > 0)
|
||||
{
|
||||
req.mapSettings(m_editData.mapSettings());
|
||||
req.movementTracks(m_editData.movementTracks());
|
||||
req.filter(m_editData.filter());
|
||||
req.planOverlay(m_editData.planOverlay());
|
||||
req.mapSettings = m_editData.mapSettings;
|
||||
req.movementTracks = m_editData.movementTracks;
|
||||
req.filter = m_editData.filter;
|
||||
req.planOverlay = m_editData.planOverlay;
|
||||
}
|
||||
else
|
||||
{
|
||||
req.mapSettings(mapSettings.constData());
|
||||
req.movementTracks(movementTracks.constData());
|
||||
req.filter(getFilterParams().constData());
|
||||
req.planOverlay(std::string());
|
||||
req.mapSettings = mapSettings.constData();
|
||||
req.movementTracks = movementTracks.constData();
|
||||
req.filter = getFilterParams().constData();
|
||||
req.planOverlay = std::string();
|
||||
}
|
||||
|
||||
req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.timeStamp(partitionTime);
|
||||
req.fileContentId(m_fileId);
|
||||
req.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
req.timeStamp = partitionTime;
|
||||
req.fileContentId = m_fileId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Edit/Create snapshot id = " << m_editData.id();
|
||||
DEBUG_LOG(m_logger) << "Edit/Create snapshot id = " << m_editData.id;
|
||||
DEBUG_LOG(m_logger) << "File id = " << m_fileId;
|
||||
|
||||
if (m_requestHelper->startSingleRequest([req, this]()
|
||||
@@ -134,7 +136,7 @@ void SnapshotCreateDialog::sendSnapshotRequest()
|
||||
return m_mrkFtc->snapshotModifyRequest(req, this);
|
||||
}))
|
||||
{
|
||||
m_editData.id(m_requestHelper->getRepliedId());
|
||||
m_editData.id = m_requestHelper->getRepliedId();
|
||||
DEBUG_LOG(m_logger) << "Saved snapshot with id = " << m_requestHelper->getRepliedId();
|
||||
__unchange__();
|
||||
closeRequest();
|
||||
@@ -229,22 +231,22 @@ void SnapshotCreateDialog::saveSnapshotPreviewInLibrary()
|
||||
const int folderId = snapshotFolderId > 0 ? snapshotFolderId : initialFolderId;
|
||||
|
||||
FileManagement::FileContentModifyRequest request;
|
||||
request.id(m_editData.fileContentId());
|
||||
request.name(title.toStdString());
|
||||
request.isTemplate(false);
|
||||
request.folderId(folderId);
|
||||
request.fileCategory(FileManagement::FileCategory::Exercise);
|
||||
request.fileStatus(FileManagement::FileStatus::Valid);
|
||||
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
request.id = m_editData.fileContentId;
|
||||
request.name = title.toStdString();
|
||||
request.isTemplate = false;
|
||||
request.folderId = folderId;
|
||||
request.fileCategory = FileManagement::FileCategory::Exercise;
|
||||
request.fileStatus = FileManagement::FileStatus::Valid;
|
||||
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
bool bIsPng;
|
||||
request.content() = LtsUtils::fromImage(image, &bIsPng);
|
||||
request.fileType(bIsPng ? FileManagement::FileType::Png : FileManagement::FileType::Jpg);
|
||||
request.isUsedBy(true);
|
||||
request.usedBy(1);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.content = LtsUtils::fromImage(image, &bIsPng);
|
||||
request.fileType = bIsPng ? FileManagement::FileType::Png : FileManagement::FileType::Jpg;
|
||||
request.isUsedBy = true;
|
||||
request.usedBy = 1;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
if (m_session->exerciseId() > 0)
|
||||
request.exerciseId(m_session->exerciseId());
|
||||
request.exerciseId = m_session->exerciseId();
|
||||
|
||||
if (m_requestHelper->startSingleRequest([this, request]()
|
||||
{
|
||||
@@ -256,10 +258,10 @@ void SnapshotCreateDialog::saveSnapshotPreviewInLibrary()
|
||||
|
||||
sendSnapshotRequest();
|
||||
|
||||
if (m_editData.fileContentId() != m_fileId)
|
||||
if (m_editData.fileContentId != m_fileId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "One more request needed!";
|
||||
m_editData.fileContentId(m_fileId);
|
||||
m_editData.fileContentId = m_fileId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-8
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "mrk_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_mrk_dialog.h"
|
||||
#include "mrk_edit_dialog.h"
|
||||
|
||||
@@ -28,6 +29,7 @@ MarkerManagementDialog::MarkerManagementDialog(const QString &menuGroup, LtsSess
|
||||
, m_flmFtc(nullptr)
|
||||
, m_avmInterface(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -117,16 +119,16 @@ void MarkerManagementDialog::onEditMarker()
|
||||
if (!idx.isValid())
|
||||
return;
|
||||
const MarkerManagement::Marker marker = m_model->getRowData(idx.row());
|
||||
if (marker.id() <= 0)
|
||||
if (marker.id <= 0)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "current MarkerId: " << marker.id();
|
||||
DEBUG_LOG(m_logger) << "current MarkerId: " << marker.id;
|
||||
|
||||
AudioVideoManagement::StreamNameMapping *streamNameMapping = nullptr;
|
||||
if (m_avmInterface)
|
||||
streamNameMapping = m_avmInterface->streamNameMapping();
|
||||
MarkerEditDialog *dialog = new MarkerEditDialog(marker.id(), m_dtc, m_ftc, streamNameMapping);
|
||||
addDialog(dialog, m_menuGroup, QStringLiteral("EditMarker%1").arg(marker.id()));
|
||||
MarkerEditDialog *dialog = new MarkerEditDialog(marker.id, m_dtc, m_ftc, streamNameMapping);
|
||||
addDialog(dialog, m_menuGroup, QStringLiteral("EditMarker%1").arg(marker.id));
|
||||
}
|
||||
|
||||
void MarkerManagementDialog::onRemoveMarker()
|
||||
@@ -135,16 +137,16 @@ void MarkerManagementDialog::onRemoveMarker()
|
||||
if (!idx.isValid())
|
||||
return;
|
||||
const MarkerManagement::Marker marker = m_model->getRowData(idx.row());
|
||||
if (marker.id() <= 0)
|
||||
if (marker.id <= 0)
|
||||
return;
|
||||
Core::RemoveElementRequest req(marker.id());
|
||||
Core::RemoveElementRequest req(marker.id);
|
||||
m_requestHelper->addRequest([req, this]()
|
||||
{
|
||||
return m_ftc->markerRemoveRequest(req, this);
|
||||
});
|
||||
if (marker.fileContentId() > 0)
|
||||
if (marker.fileContentId > 0)
|
||||
{
|
||||
Core::RemoveElementRequest req1(marker.fileContentId());
|
||||
Core::RemoveElementRequest req1(marker.fileContentId);
|
||||
m_requestHelper->addRequest([req1, this]()
|
||||
{
|
||||
return m_flmFtc->fileContentRemoveRequest(req1, this);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#include <MarkerManagement/mrk_dtc.h>
|
||||
#include <MarkerManagement/logger.h>
|
||||
#include <AudioVideoManagement/avm_data_plugin_interface.h>
|
||||
#include <flm_data_plugin_interface.h>
|
||||
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
#include <Lts/Services/FileManagement/flm_ftc.h>
|
||||
|
||||
+19
-17
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "mrk_edit_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_mrk_edit_dialog.h"
|
||||
#include <AudioVideoManagement/stream_name_mapping.h>
|
||||
#include <QtCore/QDateTime>
|
||||
@@ -24,6 +25,7 @@ MarkerEditDialog::MarkerEditDialog(int markerId,
|
||||
, m_streamNameMapping(streamNameMapping)
|
||||
, m_ui(new Ui::MarkerEditDialog)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -40,9 +42,9 @@ MarkerEditDialog::MarkerEditDialog(int markerId,
|
||||
|
||||
if (m_markerId > 0)
|
||||
{
|
||||
m_ui->teNote->setText(QString::fromStdString(data.note()));
|
||||
m_ui->spOffset->setValue(data.timeStampOffset()/1000);
|
||||
m_ui->lblTimeStamp->setText(QDateTime::fromMSecsSinceEpoch(data.timeStamp()).toString(Qt::TextDate));
|
||||
m_ui->teNote->setText(QString::fromStdString(data.note));
|
||||
m_ui->spOffset->setValue(data.timeStampOffset/1000);
|
||||
m_ui->lblTimeStamp->setText(QDateTime::fromMSecsSinceEpoch(data.timeStamp).toString(Qt::TextDate));
|
||||
createDescriptions(data);
|
||||
}
|
||||
|
||||
@@ -56,8 +58,8 @@ MarkerEditDialog::MarkerEditDialog(int markerId,
|
||||
m_ui->pteDebugMap->show();
|
||||
m_ui->pteDebugFilter->show();
|
||||
|
||||
m_ui->pteDebugMap->setPlainText(QString::fromStdString(data.mapSettings()));
|
||||
m_ui->pteDebugFilter->setPlainText(QString::fromStdString(data.filter()));
|
||||
m_ui->pteDebugMap->setPlainText(QString::fromStdString(data.mapSettings));
|
||||
m_ui->pteDebugFilter->setPlainText(QString::fromStdString(data.filter));
|
||||
}
|
||||
setNoTopicLock();
|
||||
}
|
||||
@@ -79,20 +81,20 @@ void MarkerEditDialog::createDescriptions(const MarkerManagement::Marker &marker
|
||||
{
|
||||
QIcon icon;
|
||||
|
||||
for (const auto &desc : marker.descriptions())
|
||||
for (const auto &desc : marker.descriptions)
|
||||
{
|
||||
if (desc.markerType() == MarkerManagement::MarkerType::Situation)
|
||||
if (desc.markerType == MarkerManagement::MarkerType::Situation)
|
||||
icon = QIcon(QLatin1String("icon:set_marker_situation.svg"));
|
||||
if (desc.markerType() == MarkerManagement::MarkerType::Audio)
|
||||
if (desc.markerType == MarkerManagement::MarkerType::Audio)
|
||||
icon = QIcon(QLatin1String("icon:set_markers_audio.svg"));
|
||||
if (desc.markerType() == MarkerManagement::MarkerType::Video)
|
||||
if (desc.markerType == MarkerManagement::MarkerType::Video)
|
||||
icon = QIcon(QLatin1String("icon:set_marker_video.svg"));
|
||||
|
||||
QString description;
|
||||
if (desc.markerType() == MarkerManagement::MarkerType::Video)
|
||||
description = toDisplayNames(QString::fromStdString(desc.content()));
|
||||
if (desc.markerType == MarkerManagement::MarkerType::Video)
|
||||
description = toDisplayNames(QString::fromStdString(desc.content));
|
||||
else
|
||||
description = QString::fromStdString(desc.content());
|
||||
description = QString::fromStdString(desc.content);
|
||||
|
||||
m_ui->lwDescriptions->addItem(new QListWidgetItem(icon, description));
|
||||
}
|
||||
@@ -132,15 +134,15 @@ QString MarkerEditDialog::toDisplayNames(const QString &videoStreams)
|
||||
bool MarkerEditDialog::apply()
|
||||
{
|
||||
MarkerManagement::Marker request = m_dtc->marker(m_markerId);
|
||||
if (request.note() == m_ui->teNote->toPlainText().toStdString() &&
|
||||
request.timeStampOffset() == m_ui->spOffset->value())
|
||||
if (request.note == m_ui->teNote->toPlainText().toStdString() &&
|
||||
request.timeStampOffset == m_ui->spOffset->value())
|
||||
return false;
|
||||
|
||||
request.note(m_ui->teNote->toPlainText().toStdString());
|
||||
request.timeStampOffset(m_ui->spOffset->value() * 1000);
|
||||
request.note = m_ui->teNote->toPlainText().toStdString();
|
||||
request.timeStampOffset = m_ui->spOffset->value() * 1000;
|
||||
|
||||
|
||||
int fileId = request.fileContentId();
|
||||
int fileId = request.fileContentId;
|
||||
if (fileId > 0)
|
||||
{
|
||||
|
||||
|
||||
+34
-34
@@ -17,7 +17,7 @@
|
||||
#include <MarkerManagement/Gui/Common/mrk_dialog_model.h>
|
||||
#include <OperatorManagement/opm_data_plugin_interface.h>
|
||||
#include <LtsAppManager/lts_app_manager.h>
|
||||
#include <flm_data_plugin_interface.h>
|
||||
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QJsonParseError>
|
||||
@@ -355,7 +355,7 @@ void InterfaceImpl::startSnapshot()
|
||||
int tries = t->property("tries").toInt();
|
||||
Core::ReplayPartition replay = m_coreDtc->replayPartition(m_replayPartitionId);
|
||||
|
||||
if (replay.id() == m_replayPartitionId)
|
||||
if (replay.id == m_replayPartitionId)
|
||||
{
|
||||
t->stop();
|
||||
|
||||
@@ -409,7 +409,7 @@ void InterfaceImpl::onReplayPartitionChanged(const Core::ReplayPartition &data,
|
||||
return;
|
||||
if (m_replayPartitionId < 0)
|
||||
return;
|
||||
if (data.id() == m_replayPartitionId)
|
||||
if (data.id == m_replayPartitionId)
|
||||
{
|
||||
m_replayPartitionId = -1;
|
||||
startSnapshotApp(data);
|
||||
@@ -435,10 +435,10 @@ TopicEditorBase::TopicEditor *InterfaceImpl::createTopicEditor(const TopicEditor
|
||||
|
||||
bool InterfaceImpl::applyFilter(const Snapshot &snapshot, NGL::INGLLogger &logger)
|
||||
{
|
||||
const QByteArray filterContent(QByteArray::fromRawData(snapshot.filter().c_str(), snapshot.filter().size()));
|
||||
const QByteArray filterContent(QByteArray::fromRawData(snapshot.filter.c_str(), snapshot.filter.size()));
|
||||
if (filterContent.isEmpty())
|
||||
{
|
||||
WARNING_LOG(logger) << "filterContent is empty, snapshot.id(): " << snapshot.id();
|
||||
WARNING_LOG(logger) << "filterContent is empty, snapshot.id(): " << snapshot.id;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ bool InterfaceImpl::snapshotAdjustSitMap(const Snapshot &snapshot, bool bApplyFi
|
||||
|
||||
if (sitMapGuiIfc != nullptr)
|
||||
{
|
||||
const QByteArray ba(QByteArray::fromRawData(snapshot.mapSettings().c_str(), snapshot.mapSettings().size()));
|
||||
const QByteArray ba(QByteArray::fromRawData(snapshot.mapSettings.c_str(), snapshot.mapSettings.size()));
|
||||
|
||||
originalMapSettings = sitMapGuiIfc->operatorMapSettingsJson();
|
||||
|
||||
@@ -500,7 +500,7 @@ bool InterfaceImpl::snapshotAdjustSitMap(const Snapshot &snapshot, bool bApplyFi
|
||||
{
|
||||
sitMapGuiIfc->planOverlayRemove(snapShotOverlayId);
|
||||
}
|
||||
const QByteArray &planOverlay = QByteArray(snapshot.planOverlay().c_str(), snapshot.planOverlay().size());
|
||||
const QByteArray &planOverlay = QByteArray(snapshot.planOverlay.c_str(), snapshot.planOverlay.size());
|
||||
if (!planOverlay.isEmpty())
|
||||
{
|
||||
const bool bIsMapReady = sitMapGuiIfc->isMapReady();
|
||||
@@ -646,17 +646,17 @@ bool TopicReplayInterface::playbackInit(const QJsonObject &attributes)
|
||||
m_snapshot = m_mrkDtc->snapshot(attributes[QStringLiteral("snapshotId")].toInt(0 ));
|
||||
|
||||
|
||||
if (m_snapshot.id() <= 0 || m_snapshot.timeStamp() < 1)
|
||||
if (m_snapshot.id <= 0 || m_snapshot.timeStamp < 1)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "cannot fetch live snapshot data (maybe snapshot with id '"<<attributes[QStringLiteral("snapshotId")].toInt(0 )<<"' was deleted), using saved data - timestamp: " << m_snapshot.timeStamp();
|
||||
WARNING_LOG(m_logger) << "cannot fetch live snapshot data (maybe snapshot with id '"<<attributes[QStringLiteral("snapshotId")].toInt(0 )<<"' was deleted), using saved data - timestamp: " << m_snapshot.timeStamp;
|
||||
|
||||
m_snapshot.planOverlay(attributes[QStringLiteral("planOverlay")].toString().toUtf8().data());
|
||||
m_snapshot.filter(attributes[QStringLiteral("snapshotFilter")].toString().toUtf8().data());
|
||||
m_snapshot.timeStamp(qRound64(attributes[QStringLiteral("timeStamp")].toDouble()));
|
||||
m_snapshot.mapSettings(attributes[QStringLiteral("mapSettings")].toString().toUtf8().data());
|
||||
m_snapshot.planOverlay = attributes[QStringLiteral("planOverlay")].toString().toUtf8().data();
|
||||
m_snapshot.filter = attributes[QStringLiteral("snapshotFilter")].toString().toUtf8().data();
|
||||
m_snapshot.timeStamp = qRound64(attributes[QStringLiteral("timeStamp")].toDouble());
|
||||
m_snapshot.mapSettings = attributes[QStringLiteral("mapSettings")].toString().toUtf8().data();
|
||||
}
|
||||
|
||||
if (m_snapshot.timeStamp() < 1)
|
||||
if (m_snapshot.timeStamp < 1)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "invalid snapshot timestamp for playback: " << QString::fromUtf8(QJsonDocument(attributes).toJson());
|
||||
return false;
|
||||
@@ -682,7 +682,7 @@ bool TopicReplayInterface::playbackInit(const QJsonObject &attributes)
|
||||
|
||||
bool TopicReplayInterface::playbackStart(int )
|
||||
{
|
||||
return m_srpIfc->startReplay(m_snapshot.timeStamp(), m_snapshot.timeStamp(), 0 );
|
||||
return m_srpIfc->startReplay(m_snapshot.timeStamp, m_snapshot.timeStamp, 0 );
|
||||
}
|
||||
|
||||
bool TopicReplayInterface::playbackPause()
|
||||
@@ -732,10 +732,10 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
|
||||
MarkerManagement::Marker req;
|
||||
|
||||
auto &descriptions = req.descriptions();
|
||||
auto &descriptions = req.descriptions;
|
||||
|
||||
MarkerManagement::MarkerDescription ma;
|
||||
ma.markerType() = MarkerManagement::MarkerType::Situation;
|
||||
ma.markerType = MarkerManagement::MarkerType::Situation;
|
||||
descriptions.push_back(ma);
|
||||
|
||||
|
||||
@@ -743,16 +743,16 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
return false;
|
||||
|
||||
const QByteArray mapSettings = m_sitMapGuiIfc->operatorMapSettingsJson();
|
||||
req.mapSettings(mapSettings.constData());
|
||||
req.mapSettings = mapSettings.constData();
|
||||
|
||||
|
||||
|
||||
if (ev->getDescription().size() > 0)
|
||||
req.note(ev->getDescription().toStdString());
|
||||
req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.timeStamp(QDateTime::currentMSecsSinceEpoch());
|
||||
req.timeStampOffset(10000);
|
||||
req.fileContentId(0);
|
||||
req.note = ev->getDescription().toStdString();
|
||||
req.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
req.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
req.timeStampOffset = 10000;
|
||||
req.fileContentId = 0;
|
||||
|
||||
if (!m_requestHelper)
|
||||
m_requestHelper = new LtsUtils::RequestHelper(this);
|
||||
@@ -762,7 +762,7 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
return m_ftc->markerModifyRequest(req, this);
|
||||
}))
|
||||
{
|
||||
req.id(m_requestHelper->getRepliedId());
|
||||
req.id = m_requestHelper->getRepliedId();
|
||||
DEBUG_LOG(m_logger) << "Saved Marker with id = " << m_requestHelper->getRepliedId();
|
||||
}
|
||||
|
||||
@@ -831,19 +831,19 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
const QByteArray &movementTracks = m_sitMapGuiIfc->movementTrackManagerSettingsJson();
|
||||
|
||||
MarkerManagement::Snapshot req;
|
||||
req.id(0);
|
||||
req.name(ev->getDescription().toStdString());
|
||||
req.description(ev->getDescription().toStdString());
|
||||
req.id = 0;
|
||||
req.name = ev->getDescription().toStdString();
|
||||
req.description = ev->getDescription().toStdString();
|
||||
|
||||
req.mapSettings(mapSettings.constData());
|
||||
req.movementTracks(movementTracks.constData());
|
||||
req.mapSettings = mapSettings.constData();
|
||||
req.movementTracks = movementTracks.constData();
|
||||
|
||||
|
||||
req.planOverlay(std::string());
|
||||
req.planOverlay = std::string();
|
||||
|
||||
req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.timeStamp(partitionTime);
|
||||
req.fileContentId(0);
|
||||
req.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
req.timeStamp = partitionTime;
|
||||
req.fileContentId = 0;
|
||||
|
||||
if (!m_requestHelper)
|
||||
m_requestHelper = new LtsUtils::RequestHelper(this);
|
||||
@@ -853,7 +853,7 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
return m_ftc->snapshotModifyRequest(req, this);
|
||||
}))
|
||||
{
|
||||
req.id(m_requestHelper->getRepliedId());
|
||||
req.id = m_requestHelper->getRepliedId();
|
||||
DEBUG_LOG(m_logger) << "Saved Snapshot with id = " << m_requestHelper->getRepliedId();
|
||||
}
|
||||
}
|
||||
|
||||
+34
-33
@@ -1,10 +1,11 @@
|
||||
#include "mrk_set_markers.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_mrk_set_markers.h"
|
||||
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtils/LtsUtilsCore/await.h>
|
||||
#include <LtsWidgets/lts_global_wait_dialog.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
@@ -61,8 +62,7 @@ bool containsStream(QComboBox *cb, const QString &internalStreamName)
|
||||
|
||||
namespace MarkerManagement
|
||||
{
|
||||
FinishedSignal::FinishedSignal() : QObject(),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
FinishedSignal::FinishedSignal() : QObject() {}
|
||||
|
||||
|
||||
SetMarkers::SetMarkers(LtsSession::LtsSession *session, QWidget *parent)
|
||||
@@ -70,6 +70,7 @@ SetMarkers::SetMarkers(LtsSession::LtsSession *session, QWidget *parent)
|
||||
, m_session(session)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_ui(new Ui::SetMarkers)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->dteMarkerTime->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); });
|
||||
@@ -119,7 +120,7 @@ bool SetMarkers::init(const std::shared_ptr<MarkerManagement::Interface::Dtc> &m
|
||||
return false;
|
||||
|
||||
m_editData = data;
|
||||
m_fileId = data.fileContentId();
|
||||
m_fileId = data.fileContentId;
|
||||
|
||||
m_dtc = mrk_dtc;
|
||||
m_ftc = mrk_ftc;
|
||||
@@ -268,14 +269,14 @@ QByteArray SetMarkers::getFilterParams() const
|
||||
void SetMarkers::sendMarkerRequest() noexcept(false)
|
||||
{
|
||||
Marker req;
|
||||
auto &descriptions = req.descriptions();
|
||||
auto &descriptions = req.descriptions;
|
||||
MarkerManagement::MarkerDescription ma;
|
||||
const QLatin1Char selectionIndicator = QLatin1Char('*');
|
||||
|
||||
|
||||
if (m_ui->cbSit->isChecked())
|
||||
{
|
||||
ma.markerType() = MarkerManagement::MarkerType::Situation;
|
||||
ma.markerType = MarkerManagement::MarkerType::Situation;
|
||||
descriptions.push_back(ma);
|
||||
|
||||
|
||||
@@ -284,14 +285,14 @@ void SetMarkers::sendMarkerRequest() noexcept(false)
|
||||
return;
|
||||
|
||||
const QByteArray mapSettings = spSitMapGuiIfc->operatorMapSettingsJson();
|
||||
req.mapSettings(mapSettings.constData());
|
||||
req.filter(getFilterParams().constData());
|
||||
req.mapSettings = mapSettings.constData();
|
||||
req.filter = getFilterParams().constData();
|
||||
}
|
||||
|
||||
|
||||
if (m_ui->cbAudio->isChecked())
|
||||
{
|
||||
ma.markerType() = MarkerManagement::MarkerType::Audio;
|
||||
ma.markerType = MarkerManagement::MarkerType::Audio;
|
||||
|
||||
QStringList slStreamlist;
|
||||
slStreamlist.reserve(m_ui->cbxAudioStreams->count());
|
||||
@@ -304,14 +305,14 @@ void SetMarkers::sendMarkerRequest() noexcept(false)
|
||||
if (allAudioStreamsSelected || m_ui->cbxAudioStreams->currentIndex() == i)
|
||||
slStreamlist.last().append(selectionIndicator);
|
||||
}
|
||||
ma.content() = slStreamlist.join(QStringLiteral(", ")).toStdString();
|
||||
ma.content = slStreamlist.join(QStringLiteral(", ")).toStdString();
|
||||
descriptions.push_back(ma);
|
||||
}
|
||||
|
||||
|
||||
if (m_ui->cbVideo->isChecked())
|
||||
{
|
||||
ma.markerType() = MarkerManagement::MarkerType::Video;
|
||||
ma.markerType = MarkerManagement::MarkerType::Video;
|
||||
|
||||
QStringList slStreamlist;
|
||||
slStreamlist.reserve(m_ui->cbxVideoStreams->count());
|
||||
@@ -324,21 +325,21 @@ void SetMarkers::sendMarkerRequest() noexcept(false)
|
||||
if (allVideoStreamsSelected || m_ui->cbxVideoStreams->currentIndex() == i)
|
||||
slStreamlist.last().append(selectionIndicator);
|
||||
}
|
||||
ma.content() = slStreamlist.join(QStringLiteral(", ")).toStdString();
|
||||
ma.content = slStreamlist.join(QStringLiteral(", ")).toStdString();
|
||||
descriptions.push_back(ma);
|
||||
}
|
||||
|
||||
req.note(m_ui->teNote->toPlainText().toStdString());
|
||||
req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.timeStamp(m_ui->dteMarkerTime->msecsSinceEpoch());
|
||||
req.timeStampOffset(m_ui->cbxOffset->currentText().toInt() * 1000);
|
||||
req.fileContentId(m_fileId);
|
||||
req.note = m_ui->teNote->toPlainText().toStdString();
|
||||
req.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
req.timeStamp = m_ui->dteMarkerTime->msecsSinceEpoch();
|
||||
req.timeStampOffset = m_ui->cbxOffset->currentText().toInt() * 1000;
|
||||
req.fileContentId = m_fileId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Start Marker request with file content Id = " << m_fileId;
|
||||
|
||||
auto id = m_ftc->markerModifyRequest(req);
|
||||
|
||||
m_editData.id(id);
|
||||
m_editData.id = id;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Saved marker with id = " << m_requestHelper->getRepliedId();
|
||||
}
|
||||
@@ -396,22 +397,22 @@ void SetMarkers::saveMarkerInLibrary() noexcept(false)
|
||||
}
|
||||
|
||||
FileManagement::FileContentModifyRequest request;
|
||||
request.id(m_fileId);
|
||||
request.name(title.toStdString());
|
||||
request.isTemplate(false);
|
||||
request.folderId(folderId);
|
||||
request.fileCategory(FileManagement::FileCategory::Exercise);
|
||||
request.fileStatus(FileManagement::FileStatus::Valid);
|
||||
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
request.id = m_fileId;
|
||||
request.name = title.toStdString();
|
||||
request.isTemplate = false;
|
||||
request.folderId = folderId;
|
||||
request.fileCategory = FileManagement::FileCategory::Exercise;
|
||||
request.fileStatus = FileManagement::FileStatus::Valid;
|
||||
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
bool bIsPng;
|
||||
request.content() = LtsUtils::fromImage(img, &bIsPng);
|
||||
request.fileType(bIsPng ? FileManagement::FileType::Png : FileManagement::FileType::Jpg);
|
||||
request.isUsedBy(true);
|
||||
request.usedBy(1);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.content = LtsUtils::fromImage(img, &bIsPng);
|
||||
request.fileType = bIsPng ? FileManagement::FileType::Png : FileManagement::FileType::Jpg;
|
||||
request.isUsedBy = true;
|
||||
request.usedBy = 1;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
if (m_session->exerciseId() > 0)
|
||||
request.exerciseId(m_session->exerciseId());
|
||||
request.exerciseId = m_session->exerciseId();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -427,10 +428,10 @@ void SetMarkers::saveMarkerInLibrary() noexcept(false)
|
||||
|
||||
sendMarkerRequest();
|
||||
|
||||
if (m_editData.fileContentId() != m_fileId)
|
||||
if (m_editData.fileContentId != m_fileId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "One more request needed!";
|
||||
m_editData.fileContentId(m_fileId);
|
||||
m_editData.fileContentId = m_fileId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+85
-83
@@ -3,20 +3,21 @@
|
||||
|
||||
|
||||
#include "snapshot_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_snapshot_dialog.h"
|
||||
|
||||
#include "snapshot_dialog_model.h"
|
||||
#include "mrk_create_snapshot.h"
|
||||
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <LtsAppManager/lts_app_manager.h>
|
||||
#include <LtsPrinting/printing.h>
|
||||
|
||||
#include <PlanEditor/PlanEditorPlugin/plan_editor_gui_plugin_interface.h>
|
||||
#include <MarkerManagement/Common/mrk_apply_filter.h>
|
||||
#include <Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.h>
|
||||
|
||||
|
||||
#include <PlanOverlays/plan_overlays_plugin_interface.h>
|
||||
@@ -50,6 +51,7 @@ SnapshotDialog::SnapshotDialog(const QString &menuGroup, LtsSession::LtsSession
|
||||
, m_planEditorHasUpdatedThePlan(false)
|
||||
, m_planEditorApp(nullptr)
|
||||
, m_fileId(-1)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_ui->setupUi(this);
|
||||
@@ -109,7 +111,7 @@ void SnapshotDialog::onShow()
|
||||
const QModelIndex &idx = m_ui->widget->currentIndex();
|
||||
const MarkerManagement::Snapshot &snapshot = m_model->getRowData(idx.row());
|
||||
|
||||
if (snapshot.id() <= 0)
|
||||
if (snapshot.id <= 0)
|
||||
return;
|
||||
|
||||
m_currentSnapshot = snapshot;
|
||||
@@ -120,10 +122,10 @@ void SnapshotDialog::onShow()
|
||||
|
||||
void SnapshotDialog::onRefreshCurrent(const Snapshot &snapshot)
|
||||
{
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << snapshot.id();
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << snapshot.id;
|
||||
|
||||
|
||||
if (snapshot.id() != m_currentSnapshot.id())
|
||||
if (snapshot.id != m_currentSnapshot.id)
|
||||
return;
|
||||
|
||||
m_currentSnapshot = snapshot;
|
||||
@@ -133,7 +135,7 @@ void SnapshotDialog::onRefreshCurrent(const Snapshot &snapshot)
|
||||
|
||||
void SnapshotDialog::showSnapshot()
|
||||
{
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id();
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id;
|
||||
showSnapshotInternal(m_currentSnapshot, true);
|
||||
|
||||
enaDisa();
|
||||
@@ -142,11 +144,11 @@ void SnapshotDialog::showSnapshot()
|
||||
|
||||
bool SnapshotDialog::applyFilter(const Snapshot &snapshot)
|
||||
{
|
||||
const QByteArray filterContent(QByteArray::fromRawData(snapshot.filter().c_str(), snapshot.filter().size()));
|
||||
const QByteArray filterContent(QByteArray::fromRawData(snapshot.filter.c_str(), snapshot.filter.size()));
|
||||
|
||||
if (filterContent.isEmpty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "filterContent is empty, snapshot.id()="<< snapshot.id();
|
||||
ERROR_LOG(m_logger) << "filterContent is empty, snapshot.id()="<< snapshot.id;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -161,7 +163,7 @@ bool SnapshotDialog::applyFilter(const Snapshot &snapshot)
|
||||
|
||||
|
||||
|
||||
if (m_planEditorApp && (m_currentSnapshot.id() == snapshot.id()))
|
||||
if (m_planEditorApp && (m_currentSnapshot.id == snapshot.id))
|
||||
{
|
||||
const int partitionId = m_session->partitionId();
|
||||
auto pe_session = m_planEditorApp->getSession(IDL::PartitionType::Replay, partitionId);
|
||||
@@ -209,12 +211,12 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF
|
||||
<< ", applyFilter=" << bApplyFilter;
|
||||
|
||||
SituationReplay::ChangeReplayStateRequest req;
|
||||
req.id(0);
|
||||
req.replayPartitionId(partitionId);
|
||||
req.state(SituationReplay::SrpState::Started);
|
||||
req.beginTime(snapshot.timeStamp());
|
||||
req.endTime(snapshot.timeStamp());
|
||||
req.pace(0);
|
||||
req.id = 0;
|
||||
req.replayPartitionId = partitionId;
|
||||
req.state = SituationReplay::SrpState::Started;
|
||||
req.beginTime = snapshot.timeStamp;
|
||||
req.endTime = snapshot.timeStamp;
|
||||
req.pace = 0;
|
||||
|
||||
if (!m_requestHelper->startSingleRequest([req, this]() { return m_srpFtc->changeReplayStateRequest(req, this); }))
|
||||
{
|
||||
@@ -245,10 +247,10 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF
|
||||
|
||||
|
||||
{
|
||||
const QByteArray ba(QByteArray::fromRawData(snapshot.mapSettings().c_str(), snapshot.mapSettings().size()));
|
||||
const QByteArray ba(QByteArray::fromRawData(snapshot.mapSettings.c_str(), snapshot.mapSettings.size()));
|
||||
spSitMapGuiIfc->setOperatorMapSettingsJson(ba);
|
||||
|
||||
const QByteArray planOverlay(snapshot.planOverlay().c_str(), snapshot.planOverlay().size());
|
||||
const QByteArray planOverlay(snapshot.planOverlay.c_str(), snapshot.planOverlay.size());
|
||||
if (!planOverlay.isEmpty())
|
||||
{
|
||||
|
||||
@@ -260,7 +262,7 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF
|
||||
{
|
||||
if (!spSitMapGuiIfc->planOverlaySetContent(snapShotOverlayId, tr("Snapshot-PlanOverlay"), planOverlay, true))
|
||||
{
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error add planOverlay to snapshot, SnapshotId: " << snapshot.id()
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error add planOverlay to snapshot, SnapshotId: " << snapshot.id
|
||||
<< " planOverlay.size()=" << planOverlay.size()
|
||||
<< " planOverlay=" << planOverlay;
|
||||
success = false;
|
||||
@@ -296,7 +298,7 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF
|
||||
|
||||
|
||||
|
||||
const int snapshotId = snapshot.id();
|
||||
const int snapshotId = snapshot.id;
|
||||
auto onMapIsReadyFn = [this, spSitMapGuiIfc, planOverlay, snapshotId]() {
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " try again: do planOverlaySetContent...";
|
||||
if (!spSitMapGuiIfc->planOverlaySetContent(snapShotOverlayId, tr("Snapshot-PlanOverlay"), planOverlay, true))
|
||||
@@ -317,16 +319,16 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF
|
||||
|
||||
|
||||
{
|
||||
const QByteArray ba(QByteArray::fromRawData(snapshot.movementTracks().c_str(), snapshot.movementTracks().size()));
|
||||
const QByteArray ba(QByteArray::fromRawData(snapshot.movementTracks.c_str(), snapshot.movementTracks.size()));
|
||||
if (!spSitMapGuiIfc->setMovementTrackManagerSettingsJSon(ba))
|
||||
{
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error setMovementTrackManagerSettingsJSon, SnapshotId: " << snapshot.id();
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error setMovementTrackManagerSettingsJSon, SnapshotId: " << snapshot.id;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString name = tr("Snapshot '%1'").arg(QString::fromStdString(m_currentSnapshot.name()));
|
||||
QString name = tr("Snapshot '%1'").arg(QString::fromStdString(m_currentSnapshot.name));
|
||||
m_session->baseLayout()->setCustomText(name);
|
||||
spSitMapGuiIfc->showExerciseTimeString(true);
|
||||
return success;
|
||||
@@ -342,10 +344,10 @@ void SnapshotDialog::onEditPlan()
|
||||
|
||||
|
||||
|
||||
if (snapshot.id() != m_currentSnapshot.id())
|
||||
if (snapshot.id != m_currentSnapshot.id)
|
||||
onShow();
|
||||
|
||||
if (m_currentSnapshot.id() <= 0)
|
||||
if (m_currentSnapshot.id <= 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -403,7 +405,7 @@ void SnapshotDialog::onPlaneditorFinished()
|
||||
|
||||
if (m_planEditorHasUpdatedThePlan)
|
||||
{
|
||||
const QString &title = QString::fromStdString(m_currentSnapshot.name());
|
||||
const QString &title = QString::fromStdString(m_currentSnapshot.name);
|
||||
saveSnapshotPreviewInLibrary(title);
|
||||
}
|
||||
|
||||
@@ -446,16 +448,16 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted()
|
||||
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id()
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id
|
||||
<< ", PlanEditor - partitionId = " << partitionId;
|
||||
|
||||
SituationReplay::ChangeReplayStateRequest req;
|
||||
req.id(0);
|
||||
req.replayPartitionId(partitionId);
|
||||
req.state(SituationReplay::SrpState::Started);
|
||||
req.beginTime(m_currentSnapshot.timeStamp());
|
||||
req.endTime(m_currentSnapshot.timeStamp());
|
||||
req.pace(0);
|
||||
req.id = 0;
|
||||
req.replayPartitionId = partitionId;
|
||||
req.state = SituationReplay::SrpState::Started;
|
||||
req.beginTime = m_currentSnapshot.timeStamp;
|
||||
req.endTime = m_currentSnapshot.timeStamp;
|
||||
req.pace = 0;
|
||||
|
||||
if (!m_requestHelper->startSingleRequest([req, this]() { return m_srpFtc->changeReplayStateRequest(req, this); }))
|
||||
{
|
||||
@@ -468,7 +470,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted()
|
||||
#define PlanEditorForSnapshot3D
|
||||
#ifdef PlanEditorForSnapshot3D
|
||||
{
|
||||
const QByteArray ba(QByteArray::fromRawData(m_currentSnapshot.mapSettings().c_str(), m_currentSnapshot.mapSettings().size()));
|
||||
const QByteArray ba(QByteArray::fromRawData(m_currentSnapshot.mapSettings.c_str(), m_currentSnapshot.mapSettings.size()));
|
||||
|
||||
QJsonParseError parserError;
|
||||
const QJsonDocument jDoc(QJsonDocument::fromJson(ba, &parserError));
|
||||
@@ -498,7 +500,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted()
|
||||
|
||||
applyFilter(m_currentSnapshot);
|
||||
|
||||
planEditorIfc->setPlanToEdit( QByteArray::fromStdString(m_currentSnapshot.planOverlay()) );
|
||||
planEditorIfc->setPlanToEdit( QByteArray::fromStdString(m_currentSnapshot.planOverlay) );
|
||||
|
||||
planEditorIfc->addSaveSnapshotAction(QIcon(), tr("Save Plan to Snapshot"), [this](const QByteArray & planXMLContent) -> bool
|
||||
{
|
||||
@@ -534,9 +536,9 @@ void SnapshotDialog::prepareIndex(const QModelIndex &idx)
|
||||
{
|
||||
const MarkerManagement::Snapshot &snapshot = m_model->getRowData(idx.row());
|
||||
|
||||
DEBUG_LOG(m_logger) << "Prepare index for snapshot with id = " << snapshot.id();
|
||||
DEBUG_LOG(m_logger) << "Prepare index for snapshot with id = " << snapshot.id;
|
||||
|
||||
const int fileId = snapshot.fileContentId();
|
||||
const int fileId = snapshot.fileContentId;
|
||||
if (fileId > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Loading file content with id = " << fileId;
|
||||
@@ -544,10 +546,10 @@ void SnapshotDialog::prepareIndex(const QModelIndex &idx)
|
||||
QByteArray content;
|
||||
if (m_flmGui->loadContent(fileId, content) && content.size() > 0)
|
||||
{
|
||||
QString timeStr = DTG::toStringMSec(snapshot.timeStamp());
|
||||
QString timeStr = DTG::toStringMSec(snapshot.timeStamp);
|
||||
|
||||
QString name = QString::fromStdString(snapshot.name());
|
||||
m_descriptions.append( QString::fromStdString(snapshot.description()));
|
||||
QString name = QString::fromStdString(snapshot.name);
|
||||
m_descriptions.append( QString::fromStdString(snapshot.description));
|
||||
m_imageTitles.append( name + QStringLiteral(" (")+ timeStr + QStringLiteral(")"));
|
||||
m_images.append(QImage::fromData(content));
|
||||
|
||||
@@ -561,7 +563,7 @@ void SnapshotDialog::prepareIndex(const QModelIndex &idx)
|
||||
}
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << "Not found: file id = 0 for snapshot id = " << snapshot.id();
|
||||
WARNING_LOG(m_logger) << "Not found: file id = 0 for snapshot id = " << snapshot.id;
|
||||
}
|
||||
|
||||
|
||||
@@ -588,7 +590,7 @@ bool SnapshotDialog::saveSnapshotPlan(const QByteArray &planXMLContent)
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " save snapshot";
|
||||
|
||||
|
||||
m_currentSnapshot.planOverlay(planXMLContent.constData());
|
||||
m_currentSnapshot.planOverlay = planXMLContent.constData();
|
||||
|
||||
bool ok = m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
@@ -707,7 +709,7 @@ void SnapshotDialog::enaDisa()
|
||||
{
|
||||
const QModelIndex &idx = m_ui->widget->currentIndex();
|
||||
const MarkerManagement::Snapshot &userSelSnapshot = m_model->getRowData(idx.row());
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, (m_currentSnapshot.id() > 0) && (userSelSnapshot.id() == m_currentSnapshot.id()));
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, (m_currentSnapshot.id > 0) && (userSelSnapshot.id == m_currentSnapshot.id));
|
||||
}
|
||||
|
||||
|
||||
@@ -722,8 +724,8 @@ void SnapshotDialog::enaDisa()
|
||||
const MarkerManagement::Snapshot &snapshot = m_model->getRowData(idx.row());
|
||||
|
||||
QJsonParseError error;
|
||||
QJsonDocument doc(QJsonDocument::fromJson(QByteArray::fromRawData(snapshot.mapSettings().c_str(),
|
||||
snapshot.mapSettings().size()), &error));
|
||||
QJsonDocument doc(QJsonDocument::fromJson(QByteArray::fromRawData(snapshot.mapSettings.c_str(),
|
||||
snapshot.mapSettings.size()), &error));
|
||||
|
||||
if (error.error == QJsonParseError::NoError)
|
||||
{
|
||||
@@ -751,7 +753,7 @@ void SnapshotDialog::enaDisa()
|
||||
|
||||
bool bSelectedSnapshotActuallyInEditor = true;
|
||||
if (m_planEditorApp)
|
||||
bSelectedSnapshotActuallyInEditor = snapshot.id() == m_currentSnapshot.id();
|
||||
bSelectedSnapshotActuallyInEditor = snapshot.id == m_currentSnapshot.id;
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, (cntSelectedRows == 1) && mapReady && bSelectedSnapshotActuallyInEditor);
|
||||
|
||||
|
||||
@@ -766,7 +768,7 @@ void SnapshotDialog::enaDisa()
|
||||
if (selectedSnapIds.isEmpty())
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, false);
|
||||
else
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, !selectedSnapIds.contains(m_currentSnapshot.id()));
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, !selectedSnapIds.contains(m_currentSnapshot.id));
|
||||
}
|
||||
|
||||
|
||||
@@ -775,16 +777,16 @@ void SnapshotDialog::onEditMetaData()
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
const MarkerManagement::Snapshot snapshot = m_model->getRowData(idx.row());
|
||||
|
||||
if (snapshot.id() <= 0)
|
||||
if (snapshot.id <= 0)
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "current SnapshotId: " << snapshot.id();
|
||||
INFO_LOG(m_logger) << "current SnapshotId: " << snapshot.id;
|
||||
|
||||
if (snapshot.operatorId() == LtsSessionData::LtsSessionData::getInstance()->getOperatorId())
|
||||
if (snapshot.operatorId == LtsSessionData::LtsSessionData::getInstance()->getOperatorId())
|
||||
{
|
||||
addDialog(LtsWidgets::initDialog(new SnapshotCreateDialog(this),
|
||||
m_mrkFtc, m_flmDtc, m_flmFtc, m_sitMapGuiIfc, m_fltParticipantIfc, m_fltAesIfc, m_fltBuildingComponentIfc, m_session, snapshot),
|
||||
m_menuGroup, QStringLiteral("EditSnapshot%1").arg(snapshot.id()));
|
||||
m_menuGroup, QStringLiteral("EditSnapshot%1").arg(snapshot.id));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -802,10 +804,10 @@ void SnapshotDialog::onEditMetaData()
|
||||
|
||||
{
|
||||
Snapshot req(snapshot);
|
||||
req.id(0);
|
||||
req.name((tr("Copy - %1").arg(QString::fromStdString(snapshot.name()))).toStdString());
|
||||
req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.fileContentId(0);
|
||||
req.id = 0;
|
||||
req.name = tr("Copy - %1").arg(QString::fromStdString(snapshot.name)).toStdString();
|
||||
req.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
req.fileContentId = 0;
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_mrkFtc->snapshotModifyRequest(req, this);
|
||||
@@ -832,9 +834,9 @@ QVector<int> SnapshotDialog::selectedSnapshotIds() const
|
||||
if (!idx.isValid())
|
||||
continue;
|
||||
const MarkerManagement::Snapshot snapshot = m_model->getRowData(idx.row());
|
||||
if (snapshot.id() <= 0)
|
||||
if (snapshot.id <= 0)
|
||||
continue;
|
||||
selectedSnapshotIds.push_back(snapshot.id());
|
||||
selectedSnapshotIds.push_back(snapshot.id);
|
||||
}
|
||||
return selectedSnapshotIds;
|
||||
}
|
||||
@@ -848,16 +850,16 @@ void SnapshotDialog::onRemoveSnapshots()
|
||||
if (!idx.isValid())
|
||||
continue;
|
||||
const MarkerManagement::Snapshot &snapshot = m_model->getRowData(idx.row());
|
||||
if (snapshot.id() <= 0)
|
||||
if (snapshot.id <= 0)
|
||||
continue;
|
||||
Core::RemoveElementRequest req(snapshot.id());
|
||||
Core::RemoveElementRequest req(snapshot.id);
|
||||
m_requestHelper->addRequest([req, this]()
|
||||
{
|
||||
return m_mrkFtc->snapshotRemoveRequest(req, this);
|
||||
});
|
||||
if (snapshot.fileContentId() > 0)
|
||||
if (snapshot.fileContentId > 0)
|
||||
{
|
||||
Core::RemoveElementRequest req1(snapshot.fileContentId());
|
||||
Core::RemoveElementRequest req1(snapshot.fileContentId);
|
||||
m_requestHelper->addRequest([req1, this]()
|
||||
{
|
||||
return m_flmFtc->fileContentRemoveRequest(req1, this);
|
||||
@@ -883,20 +885,20 @@ void SnapshotDialog::saveSnapshotFilter()
|
||||
|
||||
const QByteArray mapSettings = spSitMapGuiIfc->operatorMapSettingsJson();
|
||||
Snapshot req(m_currentSnapshot);
|
||||
req.mapSettings(mapSettings.data());
|
||||
req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.mapSettings = mapSettings.data();
|
||||
req.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
|
||||
DEBUG_LOG(m_logger) << "File content id (of preview image) = " << m_currentSnapshot.fileContentId();
|
||||
req.fileContentId(m_fileId);
|
||||
DEBUG_LOG(m_logger) << "File content id (of preview image) = " << m_currentSnapshot.fileContentId;
|
||||
req.fileContentId = m_fileId;
|
||||
|
||||
|
||||
MarkerManagementApplyFilter appFilter(m_session, m_fltParticipantIfc, m_fltAesIfc, m_fltBuildingComponentIfc);
|
||||
const QByteArray &filterParams = appFilter.getFilterParams();
|
||||
req.filter(filterParams.constData());
|
||||
req.filter = filterParams.constData();
|
||||
|
||||
|
||||
const QByteArray &movementTracks = spSitMapGuiIfc->movementTrackManagerSettingsJson();
|
||||
req.movementTracks(movementTracks.constData());
|
||||
req.movementTracks = movementTracks.constData();
|
||||
|
||||
|
||||
|
||||
@@ -918,8 +920,8 @@ void SnapshotDialog::onSaveSettings()
|
||||
|
||||
|
||||
const MarkerManagement::Snapshot &snapshot = m_currentSnapshot;
|
||||
const QString title = QString::fromStdString(snapshot.name());
|
||||
m_fileId = snapshot.fileContentId();
|
||||
const QString title = QString::fromStdString(snapshot.name);
|
||||
m_fileId = snapshot.fileContentId;
|
||||
|
||||
saveSnapshotPreviewInLibrary(title);
|
||||
}
|
||||
@@ -972,22 +974,22 @@ void SnapshotDialog::saveSnapshotPreviewInLibrary(const QString &snapshotTitle)
|
||||
const int folderId = snapshotFolderId > 0 ? snapshotFolderId : initialFolderId;
|
||||
|
||||
FileManagement::FileContentModifyRequest request;
|
||||
request.id(m_currentSnapshot.fileContentId());
|
||||
request.name(title.toStdString());
|
||||
request.isTemplate(false);
|
||||
request.folderId(folderId);
|
||||
request.fileCategory(FileManagement::FileCategory::Exercise);
|
||||
request.fileStatus(FileManagement::FileStatus::Valid);
|
||||
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
request.id = m_currentSnapshot.fileContentId;
|
||||
request.name = title.toStdString();
|
||||
request.isTemplate = false;
|
||||
request.folderId = folderId;
|
||||
request.fileCategory = FileManagement::FileCategory::Exercise;
|
||||
request.fileStatus = FileManagement::FileStatus::Valid;
|
||||
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
bool bIsPng;
|
||||
request.content() = LtsUtils::fromImage(image, &bIsPng);
|
||||
request.fileType(bIsPng ? FileManagement::FileType::Png : FileManagement::FileType::Jpg);
|
||||
request.isUsedBy(true);
|
||||
request.usedBy(1);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.content = LtsUtils::fromImage(image, &bIsPng);
|
||||
request.fileType = bIsPng ? FileManagement::FileType::Png : FileManagement::FileType::Jpg;
|
||||
request.isUsedBy = true;
|
||||
request.usedBy = 1;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
if (m_session->exerciseId() > 0)
|
||||
request.exerciseId(m_session->exerciseId());
|
||||
request.exerciseId = m_session->exerciseId();
|
||||
|
||||
if (m_requestHelper->startSingleRequest([this, request]()
|
||||
{
|
||||
@@ -999,10 +1001,10 @@ void SnapshotDialog::saveSnapshotPreviewInLibrary(const QString &snapshotTitle)
|
||||
|
||||
saveSnapshotFilter();
|
||||
|
||||
if (m_currentSnapshot.fileContentId() != m_fileId)
|
||||
if (m_currentSnapshot.fileContentId != m_fileId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " One more request needed!";
|
||||
m_currentSnapshot.fileContentId(m_fileId);
|
||||
m_currentSnapshot.fileContentId = m_fileId;
|
||||
}
|
||||
} else {
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Saved file in library with id = " << m_fileId << " failed";
|
||||
|
||||
+15
-13
@@ -3,9 +3,10 @@
|
||||
|
||||
|
||||
#include "snapshot_dialog_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <utility>
|
||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QJsonDocument>
|
||||
@@ -28,6 +29,7 @@ SnapshotDialogModel::SnapshotDialogModel(QObject *parent)
|
||||
tr("File Id"),
|
||||
tr("Image")},
|
||||
parent)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
|
||||
bool SnapshotDialogModel::initModel(const std::shared_ptr<MarkerManagement::Interface::Dtc> &dtc,
|
||||
@@ -40,7 +42,7 @@ bool SnapshotDialogModel::initModel(const std::shared_ptr<MarkerManagement::Inte
|
||||
|
||||
auto cbUser = [this](const OperatorManagement::User &user)
|
||||
{
|
||||
m_operatorNames[user.id()] = QString::fromStdString(user.name());
|
||||
m_operatorNames[user.id] = QString::fromStdString(user.name);
|
||||
};
|
||||
connect(opmDtc.get(), &OperatorManagement::Interface::Dtc::userChanged, this, cbUser);
|
||||
opmDtc->users(cbUser);
|
||||
@@ -79,13 +81,13 @@ QVariant SnapshotDialogModel::data(const QModelIndex &index, int role) const
|
||||
if (role == LtsWidgets::LtsColumnFilterProxyModel::ComboboxFilterRole)
|
||||
{
|
||||
if (index.column() == ColOperator)
|
||||
return snapshot.operatorId();
|
||||
return snapshot.operatorId;
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if (role == Qt::ToolTipRole)
|
||||
{
|
||||
const int fileContentId = snapshot.fileContentId();
|
||||
const int fileContentId = snapshot.fileContentId;
|
||||
if (fileContentId > 0)
|
||||
{
|
||||
auto it = m_previews.find(fileContentId);
|
||||
@@ -104,17 +106,17 @@ QVariant SnapshotDialogModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case ColName:
|
||||
return QString::fromStdString(snapshot.name());
|
||||
return QString::fromStdString(snapshot.name);
|
||||
case ColDescription:
|
||||
return QString::fromStdString(snapshot.description());
|
||||
return QString::fromStdString(snapshot.description);
|
||||
case ColTime:
|
||||
return QDateTime::fromMSecsSinceEpoch(snapshot.timeStamp());
|
||||
return QDateTime::fromMSecsSinceEpoch(snapshot.timeStamp);
|
||||
case ColOperator:
|
||||
return m_operatorNames.value(snapshot.operatorId());
|
||||
return m_operatorNames.value(snapshot.operatorId);
|
||||
case ColFileId:
|
||||
return snapshot.fileContentId();
|
||||
return static_cast<qint64>(snapshot.fileContentId);
|
||||
case ColImage:
|
||||
return m_previews.value(snapshot.fileContentId());
|
||||
return m_previews.value(snapshot.fileContentId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +139,7 @@ void SnapshotDialogModel::onFileContentChanged(const FileManagement::FileContent
|
||||
|
||||
if (modType == DataModification::eModified)
|
||||
{
|
||||
const int fileContentId = fileContent.id();
|
||||
const int fileContentId = fileContent.id;
|
||||
|
||||
if (m_previews.contains(fileContentId))
|
||||
m_previews.remove(fileContentId);
|
||||
@@ -148,7 +150,7 @@ void SnapshotDialogModel::updateOperatorNames()
|
||||
{
|
||||
QSet<int> operatorIds;
|
||||
for (const auto &op : std::as_const(m_vecData))
|
||||
operatorIds.insert(op.operatorId());
|
||||
operatorIds.insert(op.operatorId);
|
||||
|
||||
LtsWidgets::ComboboxFilterContent cfc;
|
||||
LtsWidgets::ComboboxFilterData cfd;
|
||||
@@ -243,7 +245,7 @@ bool SnapshotDialogFilterProxyModel::lessThan(const QModelIndex &source_left, co
|
||||
switch (source_left.column())
|
||||
{
|
||||
case SnapshotDialogModel::ColTime:
|
||||
return left.timeStamp() < right.timeStamp();
|
||||
return left.timeStamp < right.timeStamp;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user