171 lines
6.7 KiB
C++
Executable File
171 lines
6.7 KiB
C++
Executable File
#pragma once
|
|
|
|
#include "tln_timeline_model.h"
|
|
#include "tln_utils.h"
|
|
#include "ui_tln_timeline_dialog.h"
|
|
|
|
#include <LtsTimeline/timeline_utils.h>
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <Plugins/AudioVideoManagement/avm_data_plugin_interface.h>
|
|
#include <Plugins/AudioVideoManagement/avm_menu_edit_gui_plugin_interface.h>
|
|
#include <Plugins/FilterManagement/flt_participant_plugin_interface.h>
|
|
#include <Plugins/FilterManagement/flt_building_cmpnt_plugin_interface.h>
|
|
#include <Plugins/AudioVideoManagement/Shared/stream_list_result.h>
|
|
#include <Plugins/FileManagement/flm_explorer_gui_plugin_interface.h>
|
|
#include <Plugins/FilterManagement/flt_aes_plugin_interface.h>
|
|
#include <Plugins/InfrastructureManagement/ism_data_plugin_interface.h>
|
|
#include <Plugins/MarkerManagement/mrk_gui_plugin_interface.h>
|
|
#include <Plugins/OperatorManagement/opm_data_plugin_interface.h>
|
|
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
|
|
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
|
|
#include <Plugins/SituationReplay/srp_data_plugin_interface.h>
|
|
#include <Plugins/SituationReplayManagement/srm_data_plugin_interface.h>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
namespace NGL { class INGLLogger; }
|
|
namespace LtsPluginManager { class LtsPluginManager; }
|
|
namespace LtsSession { class LtsSession; }
|
|
namespace Ui { class TimelineDialog; }
|
|
|
|
class QLabel;
|
|
|
|
|
|
namespace Timeline
|
|
{
|
|
|
|
class AbstractEventItem;
|
|
class TimelineModel;
|
|
class TimelineProgress;
|
|
class TimelineProxyModel;
|
|
|
|
|
|
class TimelineDialog
|
|
: public LtsWidgets::LtsDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
struct TimelineRange
|
|
{
|
|
qint64 minStartMSecs{0};
|
|
int minStartSecs{0};
|
|
qint64 maxEndMSecs{0};
|
|
int maxEndSecs{0};
|
|
qint64 minDurationMSecs{static_cast<qint64>(ZoomFactor::SixtyMinutes)};
|
|
int minDurationSecs{static_cast<qint64>(ZoomFactor::SixtyMinutes) / 1000LL};
|
|
qint64 maxDurationMSecs{static_cast<qint64>(ZoomFactor::EightHours)};
|
|
int maxDurationSecs{static_cast<qint64>(ZoomFactor::EightHours) / 1000LL};
|
|
};
|
|
|
|
explicit TimelineDialog(
|
|
LtsSession::LtsSession *session, const QString &menuGroup, bool isMain,
|
|
const std::shared_ptr<Core::Interface::Dtc> &coreDtc, const std::shared_ptr<AudioVideoManagement::Interface::Dtc> &avmDtc,
|
|
const std::shared_ptr<InfrastructureManagement::Interface::Dtc> &ismDtc,
|
|
const std::shared_ptr<OperatorManagement::Interface::Dtc> &opmDtc,
|
|
const std::shared_ptr<ProjectDataManagement::Interface::Dtc> &pdmDtc,
|
|
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
|
|
const std::shared_ptr<AudioVideoManagement::ForeignMenuEditGuiInterface> &avmIfc,
|
|
const std::shared_ptr<AudioVideoManagement::ForeignDataInterface> &avmDataIfc,
|
|
const std::shared_ptr<FileManagement::ForeignGuiInterface> &flmIfc,
|
|
const std::shared_ptr<FilterManagement::ForeignFltParticipantGuiInterface> &fltParticipantIfc,
|
|
const std::shared_ptr<FilterManagement::ForeignAesGuiInterface> &fltAesIfc,
|
|
const std::shared_ptr<FilterManagement::ForeignFltBuildingComponentGuiInterface> &fltBuildingComponentIfc,
|
|
const std::shared_ptr<MarkerManagement::ForeignGuiInterface> &mrkIfc,
|
|
const std::shared_ptr<SituationReplayManagement::ForeignDataInterface> &srmIfc
|
|
) noexcept(false);
|
|
|
|
bool isLive() const { return m_isLive; }
|
|
void setLive(bool live);
|
|
|
|
LtsTimeline::TimelineView *view();
|
|
|
|
private:
|
|
void retranslate() override;
|
|
void aboutToClose() override;
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
void openItemInfoDialog(AbstractEventItem &item, bool scrollToPosition = false);
|
|
|
|
void openItemListDialog(const QVector<int> &itemIds);
|
|
void openItemListDialog(EventItemPtrs &&items);
|
|
void setZoomForDuration(const qint64 &durationInMSecs);
|
|
void showItemListDialog(EventItemPtrs items);
|
|
void showItemListDialogByFilter(const QVector<AbstractEventFilter *> &filters);
|
|
void addItemToMap(int itemId, QMap<QString /* hash */, int /* item id */> &map) noexcept(false);
|
|
|
|
private slots:
|
|
void onDebugCreateFakeEvent();
|
|
void onStartReplay();
|
|
void onShowLegend();
|
|
|
|
void onContextMenu(QPoint pos);
|
|
void onFilter();
|
|
void onEditFilter(EventType eventType);
|
|
void onShowItemsForAllFilters();
|
|
void onShowItemsForEventWithUnsavedFilters(EventType eventType);
|
|
void onShowItemsForEvents(EventTypes eventTypes);
|
|
void onOpenItemInfoDialog(int itemId);
|
|
void onTrackActivated(int trackId);
|
|
void onItemsSelected(const QVector<int> &itemIds);
|
|
|
|
void onLive();
|
|
void onLiveTimeout();
|
|
|
|
void onRangeEdited(int rangeStart, int rangeEnd);
|
|
void onRangeStartEdited(int rangeStart);
|
|
void onRangeEndEdited(int rangeEnd);
|
|
void onStartEdited();
|
|
void onEndEdited();
|
|
|
|
void showProgress();
|
|
void hideProgress();
|
|
void modelUpdateStatusChanged(bool running);
|
|
void resizeTimelineProgress();
|
|
|
|
signals:
|
|
void situtionReplayAppStarted(const QPointer<LtsSession::LtsSession> &replayAppSession);
|
|
|
|
private:
|
|
LtsSession::LtsSession *m_session{nullptr};
|
|
QPointer<LtsSession::LtsSession> m_replayAppSession{nullptr};
|
|
QPointer<LtsPluginManager::LtsPluginManager> m_replayApp{nullptr};
|
|
QString m_menuGroup;
|
|
|
|
std::shared_ptr<Core::Interface::Dtc> m_coreDtc{nullptr};
|
|
std::shared_ptr<AudioVideoManagement::Interface::Dtc> m_avmDtc{nullptr};
|
|
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_ismDtc{nullptr};
|
|
std::shared_ptr<OperatorManagement::Interface::Dtc> m_opmDtc{nullptr};
|
|
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc{nullptr};
|
|
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc{nullptr};
|
|
std::shared_ptr<MarkerManagement::Interface::Dtc> m_mrkDtc{nullptr};
|
|
|
|
std::shared_ptr<AudioVideoManagement::ForeignMenuEditGuiInterface> m_avmIfc;
|
|
std::shared_ptr<AudioVideoManagement::ForeignDataInterface> m_avmDataIfc;
|
|
std::shared_ptr<FileManagement::ForeignGuiInterface> m_flmIfc;
|
|
std::shared_ptr<FilterManagement::ForeignFltParticipantGuiInterface> m_fltParticipantIfc;
|
|
std::shared_ptr<FilterManagement::ForeignAesGuiInterface> m_fltAesIfc;
|
|
std::shared_ptr<FilterManagement::ForeignFltBuildingComponentGuiInterface> m_fltBuildingComponentIfc;
|
|
std::shared_ptr<MarkerManagement::ForeignGuiInterface> m_mrkIfc;
|
|
std::shared_ptr<SituationReplayManagement::ForeignDataInterface> m_srmIfc;
|
|
|
|
|
|
TimelineModel *m_model{nullptr}; // parented
|
|
TimelineProxyModel *m_pModel{nullptr};
|
|
bool m_isLive{true}; // NOTE: true initially in order to enable setLive(false) in ctor
|
|
std::unique_ptr<QTimer> m_liveTimer{nullptr};
|
|
qint64 m_exerciseStart{-1};
|
|
qint64 m_exerciseEnd{-1};
|
|
ZoomFactor m_zoomFactor = ZoomFactor::SixtyMinutes;
|
|
TimelineRange m_range;
|
|
|
|
std::unique_ptr<Ui::TimelineDialog> m_ui{nullptr};
|
|
NGL::INGLLogger &m_logger;
|
|
TimelineProgress* m_timeline_progress;
|
|
|
|
};
|
|
|
|
} // namespace Timeline
|