X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Fviewbase.hpp;h=d3111dc79cdfbc5929f260d8f0181a2238f592a9;hb=ec4f16ff84c688f2572c6e3d2e2184aee95f46f7;hp=09c5716ae1cb82443cd13a243a2f714c73c76198;hpb=8ba6f8b7541409dd33fd4ddd1b51494f555773c9;p=pulseview.git diff --git a/pv/views/viewbase.hpp b/pv/views/viewbase.hpp index 09c5716a..d3111dc7 100644 --- a/pv/views/viewbase.hpp +++ b/pv/views/viewbase.hpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -50,21 +51,29 @@ class Signal; namespace views { +// When adding an entry here, don't forget to update ViewTypeNames as well enum ViewType { ViewTypeTrace, +#ifdef ENABLE_DECODE ViewTypeDecoderOutput, - ViewTypeTabularDecode +#endif + ViewTypeCount // Indicates how many view types there are, must always be last }; +extern const char* ViewTypeNames[ViewTypeCount]; + class ViewBase : public QWidget { Q_OBJECT -private: +public: static const int MaxViewAutoUpdateRate; public: - explicit ViewBase(Session &session, bool is_main_view = false, QWidget *parent = nullptr); + explicit ViewBase(Session &session, bool is_main_view = false, QMainWindow *parent = nullptr); + + virtual ViewType get_type() const = 0; + bool is_main_view() const; /** * Resets the view to its default state after construction. It does however @@ -120,6 +129,9 @@ protected: util::TimeUnit time_unit_; unordered_set< shared_ptr > signalbases_; +#ifdef ENABLE_DECODE + unordered_set< shared_ptr > decode_signals_; +#endif /// The ID of the currently displayed segment uint32_t current_segment_;