PulseView  unreleased development snapshot
A Qt-based sigrok GUI
pv::views::trace::LogicSignal Class Reference

#include <logicsignal.hpp>

Inheritance diagram for pv::views::trace::LogicSignal:
Collaboration diagram for pv::views::trace::LogicSignal:

Public Member Functions

 LogicSignal (pv::Session &session, shared_ptr< data::SignalBase > base)
 
virtual ~LogicSignal ()=default
 
virtual std::map< QString, QVariant > save_settings () const
 
virtual void restore_settings (std::map< QString, QVariant > settings)
 
virtual pair< int, int > v_extents () const
 
virtual void paint_mid (QPainter &p, ViewItemPaintParams &pp)
 
virtual void paint_fore (QPainter &p, ViewItemPaintParams &pp)
 
virtual vector< data::LogicSegment::EdgePairget_nearest_level_changes (uint64_t sample_pos)
 
- Public Member Functions inherited from pv::views::trace::Signal
virtual void set_name (QString name)
 
bool enabled () const
 
shared_ptr< data::SignalBasebase () const
 
virtual void save_settings (QSettings &settings) const
 
virtual void restore_settings (QSettings &settings)
 
void paint_back (QPainter &p, ViewItemPaintParams &pp)
 
QMenu * create_header_context_menu (QWidget *parent)
 
void delete_pressed ()
 
- Public Member Functions inherited from pv::views::trace::Trace
shared_ptr< data::SignalBasebase () 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_view_context_menu (QWidget *parent, QPoint &click_pos)
 
pv::widgets::Popupcreate_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)
 
- Public Member Functions inherited from pv::views::trace::TraceTreeItem
 TraceTreeItem ()
 
TraceTreeItemOwnerowner () 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
 
- Public Member Functions inherited from pv::views::trace::ViewItem
 ViewItem ()
 
bool selected () const
 
bool dragging () const
 
void drag ()
 
virtual void drag_release ()
 
virtual void mouse_left_press_event (const QMouseEvent *event)
 
- Public Member Functions inherited from pv::views::trace::ViewItemOwner
virtual const item_listchild_items () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
template<class T >
vector< shared_ptr< T > > list_by_type ()
 

Static Public Attributes

static const float Oversampling = 2.0f
 
static const QColor EdgeColor
 
static const QColor HighColor
 
static const QColor LowColor
 
static const QColor SamplingPointColor
 
static QColor TriggerMarkerBackgroundColor = QColor(0xED, 0xD4, 0x00)
 
static const int TriggerMarkerPadding = 2
 
static const char * TriggerMarkerIcons [8]
 
- Static Public Attributes inherited from pv::views::trace::ViewItem
static const QSizeF LabelPadding
 
static const int HighlightRadius = 3
 

Protected Slots

void on_setting_changed (const QString &key, const QVariant &value)
 
void on_trigger ()
 
void on_signal_height_changed (int height)
 
- Protected Slots inherited from pv::views::trace::Signal
virtual void on_name_changed (const QString &text)
 
void on_disable ()
 
void on_enabled_changed (bool enabled)
 
- Protected Slots inherited from pv::views::trace::Trace
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

void paint_caps (QPainter &p, QLineF *const lines, vector< pair< int64_t, bool > > &edges, bool level, double samples_per_pixel, double pixels_offset, float x_offset, float y_offset)
 
shared_ptr< pv::data::LogicSegmentget_logic_segment_to_paint () const
 
void init_trigger_actions (QWidget *parent)
 
const vector< int32_t > get_trigger_types () const
 
QAction * action_from_trigger_type (const sigrok::TriggerMatchType *type)
 
const sigrok::TriggerMatchType * trigger_type_from_action (QAction *action)
 
void populate_popup_form (QWidget *parent, QFormLayout *form)
 
void modify_trigger ()
 
virtual void update_logic_level_offsets ()
 
- Protected Member Functions inherited from pv::views::trace::Signal
 Signal (pv::Session &session, shared_ptr< data::SignalBase > signal)
 
- Protected Member Functions inherited from pv::views::trace::Trace
 Trace (shared_ptr< data::SignalBase > signal)
 
 ~Trace ()
 
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 ()
 

Static Protected Member Functions

static const QIcon * get_icon (const char *path)
 
static const QPixmap * get_pixmap (const char *path)
 
- Static Protected Member Functions inherited from pv::views::trace::ViewItem
static QPen highlight_pen ()
 

Protected Attributes

QColor high_fill_color_
 
bool show_sampling_points_
 
bool fill_high_areas_
 
float high_level_offset_
 
float low_level_offset_
 
QSpinBox * signal_height_sb_
 
const sigrok::TriggerMatchType * trigger_match_
 
const vector< int32_t > trigger_types_
 
QToolBartrigger_bar_
 
QAction * trigger_none_
 
QAction * trigger_rising_
 
QAction * trigger_high_
 
QAction * trigger_falling_
 
QAction * trigger_low_
 
QAction * trigger_change_
 
int signal_height_
 
- Protected Attributes inherited from pv::views::trace::Signal
pv::Sessionsession_
 
QComboBox * name_widget_
 
- Protected Attributes inherited from pv::views::trace::Trace
shared_ptr< data::SignalBasebase_
 
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...
 
- Protected Attributes inherited from pv::views::trace::TraceTreeItem
TraceTreeItemOwnerowner_
 
int layout_v_offset_
 
int visual_v_offset_
 
- Protected Attributes inherited from pv::views::trace::ViewItem
QWidget * context_parent_
 
QPoint drag_point_
 
- Protected Attributes inherited from pv::views::trace::ViewItemOwner
item_list items_
 

Static Protected Attributes

static QCache< QString, const QIcon > icon_cache_
 
static QCache< QString, const QPixmap > pixmap_cache_
 

Additional Inherited Members

- Public Types inherited from pv::views::trace::Trace
enum  SegmentDisplayMode {
  ShowLastSegmentOnly = 1, ShowLastCompleteSegmentOnly, ShowSingleSegmentOnly, ShowAllSegments,
  ShowAccumulatedIntensity
}
 
- Public Types inherited from pv::views::trace::ViewItemOwner
typedef vector< shared_ptr< ViewItem > > item_list
 
typedef ViewItemIterator< ViewItemOwner, ViewItemiterator
 
typedef ViewItemIterator< const ViewItemOwner, ViewItemconst_iterator
 
- Static Public Member Functions inherited from pv::views::trace::ViewItem
static QColor select_text_color (QColor background)
 
- Properties inherited from pv::views::trace::TraceTreeItem
int visual_v_offset
 

Detailed Description

Definition at line 56 of file logicsignal.hpp.

Constructor & Destructor Documentation

pv::views::trace::LogicSignal::LogicSignal ( pv::Session session,
shared_ptr< data::SignalBase base 
)

Definition at line 89 of file logicsignal.cpp.

Here is the call graph for this function:

virtual pv::views::trace::LogicSignal::~LogicSignal ( )
virtualdefault

Member Function Documentation

QAction * pv::views::trace::LogicSignal::action_from_trigger_type ( const sigrok::TriggerMatchType *  type)
protected

Definition at line 482 of file logicsignal.cpp.

Here is the caller graph for this function:

const QIcon * pv::views::trace::LogicSignal::get_icon ( const char *  path)
staticprotected

Definition at line 607 of file logicsignal.cpp.

Here is the caller graph for this function:

shared_ptr< pv::data::LogicSegment > pv::views::trace::LogicSignal::get_logic_segment_to_paint ( ) const
protected

Definition at line 396 of file logicsignal.cpp.

Here is the caller graph for this function:

vector< LogicSegment::EdgePair > pv::views::trace::LogicSignal::get_nearest_level_changes ( uint64_t  sample_pos)
virtual

Determines the closest level change (i.e. edge) to a given sample, which is useful for e.g. the "snap to edge" functionality.

Parameters
sample_posSample to use
Returns
The changes left and right of the given position

Implements pv::views::trace::Signal.

Reimplemented in pv::views::trace::AnalogSignal.

Definition at line 350 of file logicsignal.cpp.

Here is the call graph for this function:

const QPixmap * pv::views::trace::LogicSignal::get_pixmap ( const char *  path)
staticprotected

Definition at line 617 of file logicsignal.cpp.

Here is the caller graph for this function:

const vector< int32_t > pv::views::trace::LogicSignal::get_trigger_types ( ) const
protected

Definition at line 453 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::init_trigger_actions ( QWidget *  parent)
protected

Definition at line 420 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::modify_trigger ( )
protected

Definition at line 567 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::on_setting_changed ( const QString &  key,
const QVariant &  value 
)
protectedslot

Definition at line 633 of file logicsignal.cpp.

Here is the call graph for this function:

void pv::views::trace::LogicSignal::on_signal_height_changed ( int  height)
protectedslot

Definition at line 660 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::on_trigger ( )
protectedslot

Definition at line 647 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::paint_caps ( QPainter &  p,
QLineF *const  lines,
vector< pair< int64_t, bool > > &  edges,
bool  level,
double  samples_per_pixel,
double  pixels_offset,
float  x_offset,
float  y_offset 
)
protected

Definition at line 377 of file logicsignal.cpp.

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::paint_fore ( QPainter &  p,
ViewItemPaintParams pp 
)
virtual

Paints the foreground layer of the signal with a QPainter

Parameters
pthe QPainter to paint into.
ppthe painting parameters object to paint with.

Reimplemented from pv::views::trace::ViewItem.

Reimplemented in pv::views::trace::AnalogSignal.

Definition at line 309 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::paint_mid ( QPainter &  p,
ViewItemPaintParams pp 
)
virtual

Paints the mid-layer of the signal with a QPainter

Parameters
pthe QPainter to paint into.
ppthe painting parameters object to paint with..

Reimplemented from pv::views::trace::ViewItem.

Reimplemented in pv::views::trace::AnalogSignal.

Definition at line 153 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::populate_popup_form ( QWidget *  parent,
QFormLayout *  form 
)
protectedvirtual

Reimplemented from pv::views::trace::Signal.

Reimplemented in pv::views::trace::MathSignal.

Definition at line 528 of file logicsignal.cpp.

Here is the call graph for this function:

void pv::views::trace::LogicSignal::restore_settings ( std::map< QString, QVariant >  settings)
virtual

Reimplemented from pv::views::trace::Signal.

Reimplemented in pv::views::trace::AnalogSignal.

Definition at line 129 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::map< QString, QVariant > pv::views::trace::LogicSignal::save_settings ( ) const
virtual

Reimplemented from pv::views::trace::Signal.

Reimplemented in pv::views::trace::AnalogSignal.

Definition at line 120 of file logicsignal.cpp.

Here is the caller graph for this function:

const TriggerMatchType * pv::views::trace::LogicSignal::trigger_type_from_action ( QAction *  action)
protected

Definition at line 512 of file logicsignal.cpp.

Here is the caller graph for this function:

void pv::views::trace::LogicSignal::update_logic_level_offsets ( )
protectedvirtual

Reimplemented in pv::views::trace::AnalogSignal.

Definition at line 627 of file logicsignal.cpp.

Here is the caller graph for this function:

pair< int, int > pv::views::trace::LogicSignal::v_extents ( ) const
virtual

Computes the vertical extents of the contents of this row item.

Returns
A pair containing the minimum and maximum y-values.

Implements pv::views::trace::TraceTreeItem.

Reimplemented in pv::views::trace::AnalogSignal.

Definition at line 146 of file logicsignal.cpp.

Member Data Documentation

const QColor pv::views::trace::LogicSignal::EdgeColor
static

Definition at line 63 of file logicsignal.hpp.

bool pv::views::trace::LogicSignal::fill_high_areas_
protected

Definition at line 139 of file logicsignal.hpp.

QColor pv::views::trace::LogicSignal::high_fill_color_
protected

Definition at line 138 of file logicsignal.hpp.

float pv::views::trace::LogicSignal::high_level_offset_
protected

Definition at line 140 of file logicsignal.hpp.

const QColor pv::views::trace::LogicSignal::HighColor
static

Definition at line 64 of file logicsignal.hpp.

QCache< QString, const QIcon > pv::views::trace::LogicSignal::icon_cache_
staticprotected

Definition at line 154 of file logicsignal.hpp.

float pv::views::trace::LogicSignal::low_level_offset_
protected

Definition at line 140 of file logicsignal.hpp.

const QColor pv::views::trace::LogicSignal::LowColor
static

Definition at line 65 of file logicsignal.hpp.

const float pv::views::trace::LogicSignal::Oversampling = 2.0f
static

Definition at line 61 of file logicsignal.hpp.

QCache< QString, const QPixmap > pv::views::trace::LogicSignal::pixmap_cache_
staticprotected

Definition at line 155 of file logicsignal.hpp.

const QColor pv::views::trace::LogicSignal::SamplingPointColor
static

Definition at line 66 of file logicsignal.hpp.

bool pv::views::trace::LogicSignal::show_sampling_points_
protected

Definition at line 139 of file logicsignal.hpp.

int pv::views::trace::LogicSignal::signal_height_
protected

Definition at line 160 of file logicsignal.hpp.

QSpinBox* pv::views::trace::LogicSignal::signal_height_sb_
protected

Definition at line 142 of file logicsignal.hpp.

QToolBar* pv::views::trace::LogicSignal::trigger_bar_
protected

Definition at line 146 of file logicsignal.hpp.

QAction* pv::views::trace::LogicSignal::trigger_change_
protected

Definition at line 152 of file logicsignal.hpp.

QAction* pv::views::trace::LogicSignal::trigger_falling_
protected

Definition at line 150 of file logicsignal.hpp.

QAction* pv::views::trace::LogicSignal::trigger_high_
protected

Definition at line 149 of file logicsignal.hpp.

QAction* pv::views::trace::LogicSignal::trigger_low_
protected

Definition at line 151 of file logicsignal.hpp.

const sigrok::TriggerMatchType* pv::views::trace::LogicSignal::trigger_match_
protected

Definition at line 144 of file logicsignal.hpp.

QAction* pv::views::trace::LogicSignal::trigger_none_
protected

Definition at line 147 of file logicsignal.hpp.

QAction* pv::views::trace::LogicSignal::trigger_rising_
protected

Definition at line 148 of file logicsignal.hpp.

const vector<int32_t> pv::views::trace::LogicSignal::trigger_types_
protected

Definition at line 145 of file logicsignal.hpp.

QColor pv::views::trace::LogicSignal::TriggerMarkerBackgroundColor = QColor(0xED, 0xD4, 0x00)
static

Definition at line 68 of file logicsignal.hpp.

const char * pv::views::trace::LogicSignal::TriggerMarkerIcons
static
Initial value:
= {
nullptr,
":/icons/trigger-marker-low.svg",
":/icons/trigger-marker-high.svg",
":/icons/trigger-marker-rising.svg",
":/icons/trigger-marker-falling.svg",
":/icons/trigger-marker-change.svg",
nullptr,
nullptr
}

Definition at line 70 of file logicsignal.hpp.

const int pv::views::trace::LogicSignal::TriggerMarkerPadding = 2
static

Definition at line 69 of file logicsignal.hpp.


The documentation for this class was generated from the following files: