X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Fviewbase.hpp;h=0c7b0463661d3019943859883bff3b14987962e4;hp=fdf12a8693d20505d417346b74587dc6d2e43995;hb=baf867eddd4efbc465f5a3490b1ea21dfe7ba597;hpb=4e86ec7042631d4b54876cba89c01a73abaf7213 diff --git a/pv/views/viewbase.hpp b/pv/views/viewbase.hpp index fdf12a86..0c7b0463 100644 --- a/pv/views/viewbase.hpp +++ b/pv/views/viewbase.hpp @@ -50,11 +50,17 @@ class Signal; namespace views { +// When adding an entry here, don't forget to update ViewTypeNames as well enum ViewType { ViewTypeTrace, - ViewTypeTabularDecode +#ifdef ENABLE_DECODE + ViewTypeDecoderOutput, +#endif + ViewTypeCount // Indicates how many view types there are, must always be last }; +extern const char* ViewTypeNames[ViewTypeCount]; + class ViewBase : public QWidget { Q_OBJECT @@ -65,6 +71,12 @@ private: public: explicit ViewBase(Session &session, bool is_main_view = false, QWidget *parent = nullptr); + /** + * Resets the view to its default state after construction. It does however + * not reset the signal bases or any other connections with the session. + */ + virtual void reset_view_state(); + Session& session(); const Session& session() const; @@ -92,13 +104,17 @@ public: virtual void restore_settings(QSettings &settings); public Q_SLOTS: - virtual void trigger_event(util::Timestamp location); + virtual void trigger_event(int segment_id, util::Timestamp location); virtual void signals_changed(); virtual void capture_state_updated(int state); virtual void on_new_segment(int new_segment_id); + virtual void on_segment_completed(int new_segment_id); virtual void perform_delayed_view_update(); private Q_SLOTS: + void on_samples_added(uint64_t segment_id, uint64_t start_sample, + uint64_t end_sample); + void on_data_updated(); protected: @@ -110,6 +126,9 @@ protected: unordered_set< shared_ptr > signalbases_; + /// The ID of the currently displayed segment + uint32_t current_segment_; + QTimer delayed_view_updater_; };