#include <cstdint>
+#include <pv/data/logicsegment.hpp>
+
#include "trace.hpp"
#include "viewitemowner.hpp"
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
virtual shared_ptr<pv::data::SignalData> 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<data::LogicSegment::EdgePair> get_nearest_level_changes(uint64_t sample_pos) = 0;
+
/**
* Returns true if the trace is visible and enabled.
*/
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();