#pragma once #include "tln_timeline_model.h" #include "tln_utils.h" #include "ui_tln_timeline_dialog.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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(ZoomFactor::SixtyMinutes)}; int minDurationSecs{static_cast(ZoomFactor::SixtyMinutes) / 1000LL}; qint64 maxDurationMSecs{static_cast(ZoomFactor::EightHours)}; int maxDurationSecs{static_cast(ZoomFactor::EightHours) / 1000LL}; }; explicit TimelineDialog( LtsSession::LtsSession *session, const QString &menuGroup, bool isMain, const std::shared_ptr &coreDtc, const std::shared_ptr &avmDtc, const std::shared_ptr &ismDtc, const std::shared_ptr &opmDtc, const std::shared_ptr &pdmDtc, const std::shared_ptr &ppmDtc, const std::shared_ptr &avmIfc, const std::shared_ptr &avmDataIfc, const std::shared_ptr &flmIfc, const std::shared_ptr &fltParticipantIfc, const std::shared_ptr &fltAesIfc, const std::shared_ptr &fltBuildingComponentIfc, const std::shared_ptr &mrkIfc, const std::shared_ptr &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 &itemIds); void openItemListDialog(EventItemPtrs &&items); void setZoomForDuration(const qint64 &durationInMSecs); void showItemListDialog(EventItemPtrs items); void showItemListDialogByFilter(const QVector &filters); void addItemToMap(int itemId, QMap &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 &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 &replayAppSession); private: LtsSession::LtsSession *m_session{nullptr}; QPointer m_replayAppSession{nullptr}; QPointer m_replayApp{nullptr}; QString m_menuGroup; std::shared_ptr m_coreDtc{nullptr}; std::shared_ptr m_avmDtc{nullptr}; std::shared_ptr m_ismDtc{nullptr}; std::shared_ptr m_opmDtc{nullptr}; std::shared_ptr m_pdmDtc{nullptr}; std::shared_ptr m_ppmDtc{nullptr}; std::shared_ptr m_mrkDtc{nullptr}; std::shared_ptr m_avmIfc; std::shared_ptr m_avmDataIfc; std::shared_ptr m_flmIfc; std::shared_ptr m_fltParticipantIfc; std::shared_ptr m_fltAesIfc; std::shared_ptr m_fltBuildingComponentIfc; std::shared_ptr m_mrkIfc; std::shared_ptr 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 m_liveTimer{nullptr}; qint64 m_exerciseStart{-1}; qint64 m_exerciseEnd{-1}; ZoomFactor m_zoomFactor = ZoomFactor::SixtyMinutes; TimelineRange m_range; std::unique_ptr m_ui{nullptr}; NGL::INGLLogger &m_logger; TimelineProgress* m_timeline_progress; }; } // namespace Timeline