X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=pv%2Fviews%2Ftabular_decoder%2Fview.hpp;h=891c227cd8e6a6446af7b32aab7f1279483383f4;hb=578d073553fa13c8f6939ad4bd7bd774950a33eb;hp=999501a2541b90626f0758e37e17a9cec40ad72d;hpb=86d4b8e3e52a422fe3a6956d6bbef27f1859717b;p=pulseview.git diff --git a/pv/views/tabular_decoder/view.hpp b/pv/views/tabular_decoder/view.hpp index 999501a2..891c227c 100644 --- a/pv/views/tabular_decoder/view.hpp +++ b/pv/views/tabular_decoder/view.hpp @@ -26,7 +26,7 @@ #include #include -#include "pv/globalsettings.hpp" +#include "pv/metadata_obj.hpp" #include "pv/views/viewbase.hpp" #include "pv/data/decodesignal.hpp" @@ -49,20 +49,21 @@ enum ViewModeType { ViewModeAll, ViewModeLatest, ViewModeVisible, - ViewModeCount // Indicates how many save types there are, must always be last + ViewModeCount // Indicates how many view mode types there are, must always be last }; extern const char* SaveTypeNames[SaveTypeCount]; extern const char* ViewModeNames[ViewModeCount]; -class AnnotationCollectionModel : public QAbstractTableModel, public GlobalSettingsInterface +class AnnotationCollectionModel : public QAbstractTableModel { Q_OBJECT public: AnnotationCollectionModel(QObject* parent = nullptr); + int get_hierarchy_level(const Annotation* ann) const; QVariant data_from_ann(const Annotation* ann, int index) const; QVariant data(const QModelIndex& index, int role) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; @@ -78,11 +79,15 @@ public: int columnCount(const QModelIndex& parent_idx = QModelIndex()) const override; void set_signal_and_segment(data::DecodeSignal* signal, uint32_t current_segment); + void set_sample_range(uint64_t start_sample, uint64_t end_sample); void set_hide_hidden(bool hide_hidden); void update_annotations_without_hidden(); + void update_highlighted_rows(QModelIndex first, QModelIndex last, + int64_t sample_num); - void on_setting_changed(const QString &key, const QVariant &value) override; +private Q_SLOTS: + void on_annotation_visibility_changed(); private: vector header_data_; @@ -92,8 +97,10 @@ private: data::DecodeSignal* signal_; uint32_t prev_segment_; uint64_t prev_last_row_; + uint64_t start_sample_, end_sample_, start_index_, end_index_; + int64_t highlight_sample_num_; + bool had_highlight_before_; bool hide_hidden_; - bool theme_is_dark_; }; @@ -107,12 +114,13 @@ public: }; -class View : public ViewBase +class View : public ViewBase, public MetadataObjObserverInterface { Q_OBJECT public: explicit View(Session &session, bool is_main_view=false, QMainWindow *parent = nullptr); + ~View(); virtual ViewType get_type() const; @@ -155,6 +163,9 @@ private Q_SLOTS: void on_table_header_requested(const QPoint& pos); void on_table_header_toggled(bool checked); + virtual void on_metadata_object_changed(MetadataObject* obj, + MetadataValueType value_type); + virtual void perform_delayed_view_update(); private: