PulseView  0.3.0
A Qt-based sigrok GUI
pv::view::LogicSignal Class Reference

#include <logicsignal.hpp>

Inheritance diagram for pv::view::LogicSignal:
Collaboration diagram for pv::view::LogicSignal:

Public Member Functions

 LogicSignal (pv::Session &session, std::shared_ptr< devices::Device > device, std::shared_ptr< sigrok::Channel > channel, std::shared_ptr< pv::data::Logic > data)
 
virtual ~LogicSignal ()
 
std::shared_ptr< pv::data::SignalDatadata () const
 
std::shared_ptr< pv::data::Logiclogic_data () const
 
void set_logic_data (std::shared_ptr< pv::data::Logic > data)
 
std::pair< int, int > v_extents () const
 
int scale_handle_offset () const
 
void scale_handle_dragged (int offset)
 
void paint_mid (QPainter &p, const ViewItemPaintParams &pp)
 
virtual void paint_fore (QPainter &p, const ViewItemPaintParams &pp)
 
- Public Member Functions inherited from pv::view::Signal
void set_name (QString name)
 
bool enabled () const
 
void enable (bool enable=true)
 
std::shared_ptr< sigrok::Channel > channel () const
 
const item_listchild_items () const
 
void paint_back (QPainter &p, const ViewItemPaintParams &pp)
 
QMenu * create_context_menu (QWidget *parent)
 
void delete_pressed ()
 
virtual void scale_handle_released ()
 
- Public Member Functions inherited from pv::view::Trace
QString name () const
 
QColor colour () const
 
void set_colour (QColor colour)
 
void set_coloured_bg (bool state)
 
virtual void paint_label (QPainter &p, const QRect &rect, bool hover)
 
pv::widgets::Popupcreate_popup (QWidget *parent)
 
QRectF label_rect (const QRectF &rect) const
 
- Public Member Functions inherited from pv::view::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 ()
 
void set_owner (pv::view::TraceTreeItemOwner *owner)
 
int get_visual_y () const
 
void drag_by (const QPoint &delta)
 
QPoint point (const QRect &rect) const
 
void set_bgcolour_state (bool state)
 
- Public Member Functions inherited from pv::view::RowItem
virtual void hover_point_changed ()
 
- Public Member Functions inherited from pv::view::ViewItem
 ViewItem ()
 
bool selected () const
 
virtual bool is_draggable () const
 
bool dragging () const
 
void drag ()
 
virtual void drag_release ()
 
virtual QRectF hit_box_rect (const ViewItemPaintParams &pp) const
 
- Public Member Functions inherited from pv::view::ViewItemOwner
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
template<class T >
std::vector< std::shared_ptr< T > > list_by_type ()
 

Private Slots

void on_trigger ()
 

Private Member Functions

void paint_caps (QPainter &p, QLineF *const lines, std::vector< std::pair< int64_t, bool > > &edges, bool level, double samples_per_pixel, double pixels_offset, float x_offset, float y_offset)
 
void init_trigger_actions (QWidget *parent)
 
const std::vector< int32_t > get_trigger_types () const
 
QAction * action_from_trigger_type (const sigrok::TriggerMatchType *match)
 
const sigrok::TriggerMatchType * trigger_type_from_action (QAction *action)
 
void populate_popup_form (QWidget *parent, QFormLayout *form)
 
void modify_trigger ()
 

Static Private Member Functions

static const QIcon * get_icon (const char *path)
 
static const QPixmap * get_pixmap (const char *path)
 

Private Attributes

int signal_height_
 
std::shared_ptr< pv::devices::Devicedevice_
 
std::shared_ptr< pv::data::Logicdata_
 
const sigrok::TriggerMatchType * trigger_match_
 
QToolBartrigger_bar_
 
QAction * trigger_none_
 
QAction * trigger_rising_
 
QAction * trigger_high_
 
QAction * trigger_falling_
 
QAction * trigger_low_
 
QAction * trigger_change_
 

Static Private Attributes

static const float Oversampling = 2.0f
 
static const QColor EdgeColour
 
static const QColor HighColour
 
static const QColor LowColour
 
static const QColor SignalColours [10]
 
static QColor TriggerMarkerBackgroundColour = QColor(0xED, 0xD4, 0x00)
 
static const int TriggerMarkerPadding = 2
 
static const char * TriggerMarkerIcons [8]
 
static QCache< QString, const QIcon > icon_cache_
 
static QCache< QString, const QPixmap > pixmap_cache_
 

Additional Inherited Members

- Public Types inherited from pv::view::ViewItemOwner
typedef std::vector< std::shared_ptr< ViewItem > > item_list
 
typedef ViewItemIterator< ViewItemOwner, ViewItemiterator
 
typedef ViewItemIterator< const ViewItemOwner, ViewItemconst_iterator
 
- Static Public Member Functions inherited from pv::view::ViewItem
static QColor select_text_colour (QColor background)
 
- Static Public Attributes inherited from pv::view::ViewItem
static const QSizeF LabelPadding
 
static const int HighlightRadius = 3
 
- Protected Member Functions inherited from pv::view::Signal
 Signal (pv::Session &session, std::shared_ptr< sigrok::Channel > channel)
 
- Protected Member Functions inherited from pv::view::Trace
 Trace (QString name)
 
void paint_axis (QPainter &p, const ViewItemPaintParams &pp, int y)
 
void add_colour_option (QWidget *parent, QFormLayout *form)
 
void create_popup_form ()
 
- Static Protected Member Functions inherited from pv::view::ViewItem
static QPen highlight_pen ()
 
- Protected Attributes inherited from pv::view::Signal
pv::Sessionsession_
 
std::shared_ptr< sigrok::Channel > channel_
 
const std::shared_ptr< SignalScaleHandlescale_handle_
 
const item_list items_
 
QComboBox * name_widget_
 
- Protected Attributes inherited from pv::view::Trace
QString name_
 
QColor colour_
 
QColor bgcolour_
 
bool coloured_bg_
 
bool coloured_bg_state_
 
- Protected Attributes inherited from pv::view::TraceTreeItem
TraceTreeItemOwnerowner_
 
int layout_v_offset_
 
int visual_v_offset_
 
bool bgcolour_state_
 
- Protected Attributes inherited from pv::view::ViewItem
QWidget * context_parent_
 
QPoint drag_point_
 
- Protected Attributes inherited from pv::view::ViewItemOwner
item_list items_
 
- Properties inherited from pv::view::TraceTreeItem
int visual_v_offset
 

Detailed Description

Definition at line 49 of file logicsignal.hpp.

Constructor & Destructor Documentation

pv::view::LogicSignal::LogicSignal ( pv::Session session,
std::shared_ptr< devices::Device device,
std::shared_ptr< sigrok::Channel >  channel,
std::shared_ptr< pv::data::Logic data 
)

Definition at line 99 of file logicsignal.cpp.

Here is the call graph for this function:

pv::view::LogicSignal::~LogicSignal ( )
virtual

Definition at line 129 of file logicsignal.cpp.

Member Function Documentation

QAction * pv::view::LogicSignal::action_from_trigger_type ( const sigrok::TriggerMatchType *  match)
private

Definition at line 346 of file logicsignal.cpp.

Here is the caller graph for this function:

shared_ptr< pv::data::SignalData > pv::view::LogicSignal::data ( ) const
virtual

Implements pv::view::Signal.

Definition at line 133 of file logicsignal.cpp.

Here is the caller graph for this function:

const QIcon * pv::view::LogicSignal::get_icon ( const char *  path)
staticprivate

Definition at line 454 of file logicsignal.cpp.

Here is the caller graph for this function:

const QPixmap * pv::view::LogicSignal::get_pixmap ( const char *  path)
staticprivate

Definition at line 465 of file logicsignal.cpp.

Here is the caller graph for this function:

const vector< int32_t > pv::view::LogicSignal::get_trigger_types ( ) const
private

Definition at line 333 of file logicsignal.cpp.

Here is the caller graph for this function:

void pv::view::LogicSignal::init_trigger_actions ( QWidget *  parent)
private

Definition at line 300 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

shared_ptr< pv::data::Logic > pv::view::LogicSignal::logic_data ( ) const

Definition at line 138 of file logicsignal.cpp.

void pv::view::LogicSignal::modify_trigger ( )
private

Definition at line 415 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::LogicSignal::on_trigger ( )
privateslot

Definition at line 476 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 281 of file logicsignal.cpp.

Here is the caller graph for this function:

void pv::view::LogicSignal::paint_fore ( QPainter &  p,
const 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::view::ViewItem.

Definition at line 244 of file logicsignal.cpp.

Here is the call graph for this function:

void pv::view::LogicSignal::paint_mid ( QPainter &  p,
const 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::view::ViewItem.

Definition at line 167 of file logicsignal.cpp.

Here is the call graph for this function:

void pv::view::LogicSignal::populate_popup_form ( QWidget *  parent,
QFormLayout *  form 
)
privatevirtual

Reimplemented from pv::view::Signal.

Definition at line 392 of file logicsignal.cpp.

Here is the call graph for this function:

void pv::view::LogicSignal::scale_handle_dragged ( int  offset)
virtual

Handles the scale handle being dragged to an offset.

Parameters
offsetthe offset the scale handle was dragged to.

Implements pv::view::Signal.

Definition at line 160 of file logicsignal.cpp.

int pv::view::LogicSignal::scale_handle_offset ( ) const
virtual

Returns the offset to show the drag handle.

Implements pv::view::Signal.

Definition at line 155 of file logicsignal.cpp.

void pv::view::LogicSignal::set_logic_data ( std::shared_ptr< pv::data::Logic data)

Definition at line 143 of file logicsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const TriggerMatchType * pv::view::LogicSignal::trigger_type_from_action ( QAction *  action)
private

Definition at line 376 of file logicsignal.cpp.

Here is the caller graph for this function:

std::pair< int, int > pv::view::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::view::TraceTreeItem.

Definition at line 148 of file logicsignal.cpp.

Member Data Documentation

std::shared_ptr<pv::data::Logic> pv::view::LogicSignal::data_
private

Definition at line 137 of file logicsignal.hpp.

std::shared_ptr<pv::devices::Device> pv::view::LogicSignal::device_
private

Definition at line 136 of file logicsignal.hpp.

const QColor pv::view::LogicSignal::EdgeColour
staticprivate

Definition at line 56 of file logicsignal.hpp.

const QColor pv::view::LogicSignal::HighColour
staticprivate

Definition at line 57 of file logicsignal.hpp.

QCache< QString, const QIcon > pv::view::LogicSignal::icon_cache_
staticprivate

Definition at line 148 of file logicsignal.hpp.

const QColor pv::view::LogicSignal::LowColour
staticprivate

Definition at line 58 of file logicsignal.hpp.

const float pv::view::LogicSignal::Oversampling = 2.0f
staticprivate

Definition at line 54 of file logicsignal.hpp.

QCache< QString, const QPixmap > pv::view::LogicSignal::pixmap_cache_
staticprivate

Definition at line 149 of file logicsignal.hpp.

int pv::view::LogicSignal::signal_height_
private

Definition at line 134 of file logicsignal.hpp.

const QColor pv::view::LogicSignal::SignalColours
staticprivate
Initial value:
= {
QColor(0x16, 0x19, 0x1A),
QColor(0x8F, 0x52, 0x02),
QColor(0xCC, 0x00, 0x00),
QColor(0xF5, 0x79, 0x00),
QColor(0xED, 0xD4, 0x00),
QColor(0x73, 0xD2, 0x16),
QColor(0x34, 0x65, 0xA4),
QColor(0x75, 0x50, 0x7B),
QColor(0x88, 0x8A, 0x85),
QColor(0xEE, 0xEE, 0xEC),
}

Definition at line 60 of file logicsignal.hpp.

QToolBar* pv::view::LogicSignal::trigger_bar_
private

Definition at line 140 of file logicsignal.hpp.

QAction* pv::view::LogicSignal::trigger_change_
private

Definition at line 146 of file logicsignal.hpp.

QAction* pv::view::LogicSignal::trigger_falling_
private

Definition at line 144 of file logicsignal.hpp.

QAction* pv::view::LogicSignal::trigger_high_
private

Definition at line 143 of file logicsignal.hpp.

QAction* pv::view::LogicSignal::trigger_low_
private

Definition at line 145 of file logicsignal.hpp.

const sigrok::TriggerMatchType* pv::view::LogicSignal::trigger_match_
private

Definition at line 139 of file logicsignal.hpp.

QAction* pv::view::LogicSignal::trigger_none_
private

Definition at line 141 of file logicsignal.hpp.

QAction* pv::view::LogicSignal::trigger_rising_
private

Definition at line 142 of file logicsignal.hpp.

QColor pv::view::LogicSignal::TriggerMarkerBackgroundColour = QColor(0xED, 0xD4, 0x00)
staticprivate

Definition at line 62 of file logicsignal.hpp.

const char * pv::view::LogicSignal::TriggerMarkerIcons
staticprivate
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 64 of file logicsignal.hpp.

const int pv::view::LogicSignal::TriggerMarkerPadding = 2
staticprivate

Definition at line 63 of file logicsignal.hpp.


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