X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fsignal.hpp;h=1b9f254330a79fd150f6f73165f5cb910a76b5be;hp=d763609d972abc322dc796e9aca32a2add66269f;hb=f6b6c9bf50999dc99f9517318ffd3114cae4960f;hpb=2d458a761b9fb184cd1c903485293f86fd552637 diff --git a/pv/views/trace/signal.hpp b/pv/views/trace/signal.hpp index d763609d..1b9f2543 100644 --- a/pv/views/trace/signal.hpp +++ b/pv/views/trace/signal.hpp @@ -27,6 +27,8 @@ #include +#include + #include "trace.hpp" #include "viewitemowner.hpp" @@ -44,6 +46,15 @@ class SignalData; namespace views { namespace trace { +/** + * The Signal class represents a series of numeric values that can be drawn. + * This is the main difference to the more generic @ref Trace class. + * + * It is generally accepted that Signal instances consider themselves to be + * individual channels on e.g. an oscilloscope, though it should be kept in + * mind that virtual signals (e.g. math) will also be served by the Signal + * class. + */ class Signal : public Trace, public ViewItemOwner { Q_OBJECT @@ -59,6 +70,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. */ @@ -74,7 +94,7 @@ public: 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();