#include <unordered_set>
#include <vector>
+#include <QMainWindow>
#include <QTimer>
#include <QWidget>
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
-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
+ * not reset the signal bases or any other connections with the session.
+ */
+ virtual void reset_view_state();
Session& session();
const Session& session() const;
const bool is_main_view_;
- util::Timestamp ruler_shift_;
util::TimeUnit time_unit_;
unordered_set< shared_ptr<data::SignalBase> > signalbases_;
+#ifdef ENABLE_DECODE
+ unordered_set< shared_ptr<data::DecodeSignal> > decode_signals_;
+#endif
/// The ID of the currently displayed segment
uint32_t current_segment_;