![]() |
PulseView
unreleased development snapshot
A Qt-based sigrok GUI
|
#include <trace.hpp>
Public Types | |
enum | SegmentDisplayMode { ShowLastSegmentOnly = 1, ShowLastCompleteSegmentOnly, ShowSingleSegmentOnly, ShowAllSegments, ShowAccumulatedIntensity } |
Public Member Functions | |
shared_ptr< data::SignalBase > | base () const |
virtual bool | is_selectable (QPoint pos) const |
virtual bool | is_draggable (QPoint pos) const |
virtual void | set_segment_display_mode (SegmentDisplayMode mode) |
virtual void | on_setting_changed (const QString &key, const QVariant &value) |
virtual void | paint_label (QPainter &p, const QRect &rect, bool hover) |
virtual void | paint_error (QPainter &p, const ViewItemPaintParams &pp) |
virtual QMenu * | create_header_context_menu (QWidget *parent) |
virtual QMenu * | create_view_context_menu (QWidget *parent, QPoint &click_pos) |
pv::widgets::Popup * | create_popup (QWidget *parent) |
QRectF | label_rect (const QRectF &rect) const |
virtual QRectF | hit_box_rect (const ViewItemPaintParams &pp) const |
void | set_current_segment (const int segment) |
int | get_current_segment () const |
virtual void | hover_point_changed (const QPoint &hp) |
![]() | |
TraceTreeItem () | |
TraceTreeItemOwner * | owner () const |
void | select (bool select=true) |
int | layout_v_offset () const |
void | set_layout_v_offset (int v_offset) |
int | visual_v_offset () const |
void | set_visual_v_offset (int v_offset) |
void | force_to_v_offset (int v_offset) |
void | animate_to_layout_v_offset () |
virtual void | set_owner (TraceTreeItemOwner *owner) |
int | get_visual_y () const |
void | drag_by (const QPoint &delta) |
QPoint | drag_point (const QRect &rect) const |
virtual pair< int, int > | v_extents () const =0 |
![]() | |
ViewItem () | |
virtual bool | enabled () const =0 |
bool | selected () const |
bool | dragging () const |
void | drag () |
virtual void | drag_release () |
virtual void | paint_mid (QPainter &p, ViewItemPaintParams &pp) |
virtual void | paint_fore (QPainter &p, ViewItemPaintParams &pp) |
virtual void | delete_pressed () |
virtual void | mouse_left_press_event (const QMouseEvent *event) |
Protected Slots | |
virtual void | on_name_changed (const QString &text) |
virtual void | on_color_changed (const QColor &color) |
virtual void | on_error_message_changed (const QString &msg) |
void | on_popup_closed () |
Protected Member Functions | |
Trace (shared_ptr< data::SignalBase > signal) | |
~Trace () | |
virtual void | paint_back (QPainter &p, ViewItemPaintParams &pp) |
void | paint_axis (QPainter &p, ViewItemPaintParams &pp, int y) |
void | paint_hover_marker (QPainter &p) |
void | add_color_option (QWidget *parent, QFormLayout *form) |
void | create_popup_form () |
virtual void | populate_popup_form (QWidget *parent, QFormLayout *form) |
Protected Attributes | |
shared_ptr< data::SignalBase > | base_ |
QPen | axis_pen_ |
SegmentDisplayMode | segment_display_mode_ |
bool | show_hover_marker_ |
uint32_t | context_menu_x_pos_ |
int | current_segment_ |
The ID of the currently displayed segment. More... | |
![]() | |
TraceTreeItemOwner * | owner_ |
int | layout_v_offset_ |
int | visual_v_offset_ |
![]() | |
QWidget * | context_parent_ |
QPoint | drag_point_ |
Private Slots | |
void | on_nameedit_changed (const QString &name) |
void | on_coloredit_changed (const QColor &color) |
void | on_create_marker_here () const |
Private Attributes | |
pv::widgets::Popup * | popup_ |
QFormLayout * | popup_form_ |
Static Private Attributes | |
static const QPen | AxisPen |
static const int | LabelHitPadding = 2 |
static const QColor | BrightGrayBGColor = QColor(0, 0, 0, 10 * 255 / 100) |
static const QColor | DarkGrayBGColor = QColor(0, 0, 0, 15 * 255 / 100) |
static const QColor | ErrorBgColor = QColor(0xEF, 0x29, 0x29) |
Additional Inherited Members | |
![]() | |
static QColor | select_text_color (QColor background) |
![]() | |
static const QSizeF | LabelPadding |
static const int | HighlightRadius = 3 |
![]() | |
static QPen | highlight_pen () |
![]() | |
int | visual_v_offset |
The Trace class represents a TraceTreeItem which occupies some vertical space on the canvas and spans across its entire width, essentially showing a time series of values, events, objects or similar. While easily confused with Signal, the difference is that Trace may represent anything that can be drawn, not just numeric values. One example is a DecodeTrace.
For this reason, Trace is more generic and contains properties and helpers that benefit any kind of time series items.
Allowed values for the multi-segment display mode.
Note: Consider these locations when updating the list:
Enumerator | |
---|---|
ShowLastSegmentOnly | |
ShowLastCompleteSegmentOnly | |
ShowSingleSegmentOnly | |
ShowAllSegments | |
ShowAccumulatedIntensity |
|
protected |
|
protected |
|
protected |
shared_ptr< data::SignalBase > pv::views::trace::Trace::base | ( | ) | const |
|
virtual |
Reimplemented from pv::views::trace::ViewItem.
Reimplemented in pv::views::trace::DecodeTrace, and pv::views::trace::Signal.
Definition at line 201 of file trace.cpp.
|
virtual |
Reimplemented from pv::views::trace::ViewItem.
Definition at line 236 of file trace.cpp.
|
protected |
|
virtual |
Reimplemented from pv::views::trace::ViewItem.
Reimplemented in pv::views::trace::DecodeTrace.
Definition at line 208 of file trace.cpp.
int pv::views::trace::Trace::get_current_segment | ( | ) | const |
|
virtual |
Computes the outline rectangle of the viewport hit-box.
pp | The painting parameters object to paint with. |
Reimplemented from pv::views::trace::ViewItem.
Definition at line 267 of file trace.cpp.
|
virtual |
Reimplemented from pv::views::trace::ViewItem.
Reimplemented in pv::views::trace::DecodeTrace, and pv::views::trace::AnalogSignal.
Definition at line 291 of file trace.cpp.
|
virtual |
Returns true if the item may be dragged/moved.
Reimplemented from pv::views::trace::ViewItem.
Definition at line 95 of file trace.cpp.
|
virtual |
Returns true if the item may be selected.
Reimplemented from pv::views::trace::ViewItem.
Definition at line 86 of file trace.cpp.
|
virtual |
Computes the outline rectangle of a label.
rect | the rectangle of the header area. |
Reimplemented from pv::views::trace::ViewItem.
Definition at line 251 of file trace.cpp.
|
protectedvirtualslot |
|
privateslot |
|
privateslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
privateslot |
|
protectedslot |
|
virtual |
Implements pv::GlobalSettingsInterface.
Definition at line 114 of file trace.cpp.
|
protected |
|
protectedvirtual |
Paints the background layer of the signal with a QPainter.
p | The QPainter to paint into. |
pp | The painting parameters object to paint with. |
Reimplemented from pv::views::trace::ViewItem.
Reimplemented in pv::views::trace::DecodeTrace, pv::views::trace::Signal, and pv::views::trace::AnalogSignal.
Definition at line 299 of file trace.cpp.
|
virtual |
|
protected |
|
virtual |
Paints the signal label.
p | the QPainter to paint into. |
rect | the rectangle of the header area. |
hover | true if the label is being hovered over by the mouse. |
Reimplemented from pv::views::trace::ViewItem.
Definition at line 124 of file trace.cpp.
|
protectedvirtual |
Reimplemented in pv::views::trace::DecodeTrace, pv::views::trace::AnalogSignal, pv::views::trace::LogicSignal, pv::views::trace::Signal, and pv::views::trace::MathSignal.
Definition at line 397 of file trace.cpp.
void pv::views::trace::Trace::set_current_segment | ( | const int | segment | ) |
|
virtual |
|
protected |
|
staticprivate |
|
protected |
|
protected |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
protected |
|
protected |