/** * @RDE_HEADER@ * HMI Plugin for MeteoDataManagement - Weather Station Overview Dialog Model * $Id$ * $HeadURL$ * $Author$ * Created by Patric Karwat, SLSE, 2016-10.05 */ #pragma once #include #include #include #include #include namespace EffectShowClient { /** * @brief The OrderModel provides all effect show orders related to the vehicle. */ class OrderModel final : public LtsWidgets::LtsAbstractTableModel { Q_OBJECT public: enum Columns { Id, Type, Info, Status, StartTime, Duration, Distance, Position, Area, Rotation, Volley, ShotsInTotal }; explicit OrderModel(QObject *parent = nullptr); bool initModel(const std::shared_ptr &dtc, const std::shared_ptr &dtcTabOC, bool isEffectShow); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; /** * @brief Converts seconds of the day into a string like: hh::mm:ss. * @param seconds Seconds of the day * @return A string like: hh::mm:ss */ static QString timeOfDayString(int seconds); private slots: bool onDataChanged(const EffectShowClient::Order &data, DataModification modType) override; void onOwnPositionChanged(const TrainingAreaBaseOC::OwnPosition &data); private: std::shared_ptr m_dtc; std::shared_ptr m_dtcTabOC; TrainingAreaBaseOC::OwnPosition m_ownPosition; friend class OrderProxyModel; bool m_isEffectShow = true; LOGGER_T m_logger; }; class OrderProxyModel final : public LtsWidgets::LtsColumnFilterProxyModel { Q_OBJECT public: using LtsWidgets::LtsColumnFilterProxyModel::LtsColumnFilterProxyModel; void setSourceModel(QAbstractItemModel *sourceModel) override; protected: bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; private: OrderModel *m_sourceModel = nullptr; }; } //namespace EffectShowClient