X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fsignal.hpp;h=0674209ec06eb6a96fa1af648d97ce4f582d6b4b;hb=20c99cfc69d3c7430817abd9a1f810698deb4a18;hp=2cc49a77d1962499c8bece819c5a0824485bf543;hpb=526c8c00a61aa5f6ac7e3ee56991db957b45828d;p=pulseview.git diff --git a/pv/views/trace/signal.hpp b/pv/views/trace/signal.hpp index 2cc49a77..0674209e 100644 --- a/pv/views/trace/signal.hpp +++ b/pv/views/trace/signal.hpp @@ -17,16 +17,20 @@ * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP -#define PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP +#ifndef PULSEVIEW_PV_VIEWS_TRACE_SIGNAL_HPP +#define PULSEVIEW_PV_VIEWS_TRACE_SIGNAL_HPP #include #include +#include +#include #include #include +#include + #include "trace.hpp" #include "viewitemowner.hpp" @@ -68,6 +72,15 @@ public: virtual shared_ptr data() const = 0; + /** + * Determines the closest level change (i.e. edge) to a given sample, which + * is useful for e.g. the "snap to edge" functionality. + * + * @param sample_pos Sample to use + * @return The changes left and right of the given position + */ + virtual vector get_nearest_level_changes(uint64_t sample_pos) = 0; + /** * Returns true if the trace is visible and enabled. */ @@ -75,19 +88,17 @@ public: shared_ptr base() const; - void set_current_segment(const int segment); - - int get_current_segment() const; - virtual void save_settings(QSettings &settings) const; + virtual std::map save_settings() const; virtual void restore_settings(QSettings &settings); + virtual void restore_settings(std::map settings); void paint_back(QPainter &p, ViewItemPaintParams &pp); virtual void populate_popup_form(QWidget *parent, QFormLayout *form); - QMenu* create_context_menu(QWidget *parent); + QMenu* create_header_context_menu(QWidget *parent); void delete_pressed(); @@ -102,13 +113,10 @@ protected: pv::Session &session_; QComboBox *name_widget_; - - /// The ID of the currently displayed segment - int current_segment_; }; } // namespace trace } // namespace views } // namespace pv -#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP +#endif // PULSEVIEW_PV_VIEWS_TRACE_SIGNAL_HPP