X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fsignal.hpp;h=ca8eea2e4a85f3820de0c6b883bed9f8e69d6812;hp=7f88720f7943904142008b82d88f8103caefa464;hb=HEAD;hpb=2749b858a7bc0bb67d550438695f2ae9c613b6c7 diff --git a/pv/views/trace/signal.hpp b/pv/views/trace/signal.hpp index 7f88720f..e10e93ea 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" @@ -58,7 +62,7 @@ class Signal : public Trace, public ViewItemOwner Q_OBJECT protected: - Signal(pv::Session &session, shared_ptr channel); + Signal(pv::Session &session, shared_ptr signal); public: /** @@ -66,7 +70,14 @@ public: */ virtual void set_name(QString name); - 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. @@ -76,14 +87,16 @@ public: shared_ptr base() 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(); @@ -104,4 +117,4 @@ protected: } // namespace views } // namespace pv -#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP +#endif // PULSEVIEW_PV_VIEWS_TRACE_SIGNAL_HPP