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

#include <decodetrace.hpp>

Inheritance diagram for pv::view::DecodeTrace:
Collaboration diagram for pv::view::DecodeTrace:

Classes

struct  ChannelSelector
 

Public Member Functions

 DecodeTrace (pv::Session &session, std::shared_ptr< pv::data::DecoderStack > decoder_stack, int index)
 
bool enabled () const
 
const std::shared_ptr< pv::data::DecoderStack > & decoder () const
 
std::pair< int, int > v_extents () const
 
void paint_back (QPainter &p, const ViewItemPaintParams &pp)
 
void paint_mid (QPainter &p, const ViewItemPaintParams &pp)
 
void paint_fore (QPainter &p, const ViewItemPaintParams &pp)
 
void populate_popup_form (QWidget *parent, QFormLayout *form)
 
QMenu * create_context_menu (QWidget *parent)
 
void delete_pressed ()
 
void hover_point_changed ()
 
- Public Member Functions inherited from pv::view::Trace
QString name () const
 
virtual void set_name (QString name)
 
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::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
 

Private Slots

void on_new_decode_data ()
 
void on_delete ()
 
void on_channel_selected (int)
 
void on_stack_decoder (srd_decoder *decoder)
 
void on_delete_decoder (int index)
 
void on_show_hide_decoder (int index)
 

Private Member Functions

void draw_annotations (std::vector< pv::data::decode::Annotation > annotations, QPainter &p, int h, const ViewItemPaintParams &pp, int y, size_t base_colour)
 
void draw_annotation (const pv::data::decode::Annotation &a, QPainter &p, int text_height, const ViewItemPaintParams &pp, int y, size_t base_colour) const
 
void draw_annotation_block (std::vector< pv::data::decode::Annotation > a, QPainter &p, int h, int y, size_t base_colour) const
 
void draw_instant (const pv::data::decode::Annotation &a, QPainter &p, QColor fill, QColor outline, int h, double x, int y) const
 
void draw_range (const pv::data::decode::Annotation &a, QPainter &p, QColor fill, QColor outline, int h, double start, double end, int y) const
 
void draw_error (QPainter &p, const QString &message, const ViewItemPaintParams &pp)
 
void draw_unresolved_period (QPainter &p, int h, int left, int right) const
 
std::pair< double, double > get_pixels_offset_samples_per_pixel () const
 
std::pair< uint64_t, uint64_t > get_sample_range (int x_start, int x_end) const
 
int get_row_at_point (const QPoint &point)
 
const QString get_annotation_at_point (const QPoint &point)
 
void create_decoder_form (int index, std::shared_ptr< pv::data::decode::Decoder > &dec, QWidget *parent, QFormLayout *form)
 
QComboBox * create_channel_selector (QWidget *parent, const std::shared_ptr< pv::data::decode::Decoder > &dec, const srd_channel *const pdch)
 
void commit_decoder_channels (std::shared_ptr< data::decode::Decoder > &dec)
 
void commit_channels ()
 

Private Attributes

pv::Sessionsession_
 
std::shared_ptr< pv::data::DecoderStackdecoder_stack_
 
uint64_t decode_start_
 
uint64_t decode_end_
 
std::list< std::shared_ptr< pv::binding::Decoder > > bindings_
 
std::list< ChannelSelectorchannel_selectors_
 
std::vector< pv::widgets::DecoderGroupBox * > decoder_forms_
 
std::vector< data::decode::Rowvisible_rows_
 
int row_height_
 
int max_visible_rows_
 
QSignalMapper delete_mapper_
 
QSignalMapper show_hide_mapper_
 

Static Private Attributes

static const QColor DecodeColours [4]
 
static const QColor ErrorBgColour = QColor(0xEF, 0x29, 0x29)
 
static const QColor NoDecodeColour = QColor(0x88, 0x8A, 0x85)
 
static const int ArrowSize = 4
 
static const double EndCapWidth = 5
 
static const int DrawPadding = 100
 
static const QColor Colours [16]
 
static const QColor OutlineColours [16]
 

Additional Inherited Members

- 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::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::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_
 
- Properties inherited from pv::view::TraceTreeItem
int visual_v_offset
 

Detailed Description

Definition at line 61 of file decodetrace.hpp.


Class Documentation

struct pv::view::DecodeTrace::ChannelSelector

Definition at line 66 of file decodetrace.hpp.

Collaboration diagram for pv::view::DecodeTrace::ChannelSelector:
Class Members
const QComboBox * combo_
const shared_ptr< Decoder > decoder_
const srd_channel * pdch_

Constructor & Destructor Documentation

pv::view::DecodeTrace::DecodeTrace ( pv::Session session,
std::shared_ptr< pv::data::DecoderStack decoder_stack,
int  index 
)

Definition at line 129 of file decodetrace.cpp.

Here is the call graph for this function:

Member Function Documentation

void pv::view::DecodeTrace::commit_channels ( )
private

Definition at line 845 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::commit_decoder_channels ( std::shared_ptr< data::decode::Decoder > &  dec)
private

Definition at line 818 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QComboBox * pv::view::DecodeTrace::create_channel_selector ( QWidget *  parent,
const std::shared_ptr< pv::data::decode::Decoder > &  dec,
const srd_channel *const  pdch 
)
private

Definition at line 779 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QMenu * pv::view::DecodeTrace::create_context_menu ( QWidget *  parent)
virtual

Reimplemented from pv::view::Trace.

Definition at line 319 of file decodetrace.cpp.

Here is the call graph for this function:

void pv::view::DecodeTrace::create_decoder_form ( int  index,
std::shared_ptr< pv::data::decode::Decoder > &  dec,
QWidget *  parent,
QFormLayout *  form 
)
private

Definition at line 709 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const std::shared_ptr< pv::data::DecoderStack > & pv::view::DecodeTrace::decoder ( ) const

Definition at line 157 of file decodetrace.cpp.

Here is the caller graph for this function:

void pv::view::DecodeTrace::delete_pressed ( )
virtual

Reimplemented from pv::view::ViewItem.

Definition at line 860 of file decodetrace.cpp.

Here is the call graph for this function:

void pv::view::DecodeTrace::draw_annotation ( const pv::data::decode::Annotation a,
QPainter &  p,
int  text_height,
const ViewItemPaintParams pp,
int  y,
size_t  base_colour 
) const
private

Definition at line 375 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::draw_annotation_block ( std::vector< pv::data::decode::Annotation a,
QPainter &  p,
int  h,
int  y,
size_t  base_colour 
) const
private

Definition at line 401 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::draw_annotations ( std::vector< pv::data::decode::Annotation annotations,
QPainter &  p,
int  h,
const ViewItemPaintParams pp,
int  y,
size_t  base_colour 
)
private

Definition at line 333 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::draw_error ( QPainter &  p,
const QString &  message,
const ViewItemPaintParams pp 
)
private

Definition at line 511 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::draw_instant ( const pv::data::decode::Annotation a,
QPainter &  p,
QColor  fill,
QColor  outline,
int  h,
double  x,
int  y 
) const
private

Definition at line 436 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::draw_range ( const pv::data::decode::Annotation a,
QPainter &  p,
QColor  fill,
QColor  outline,
int  h,
double  start,
double  end,
int  y 
) const
private

Definition at line 453 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::draw_unresolved_period ( QPainter &  p,
int  h,
int  left,
int  right 
) const
private

Definition at line 532 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool pv::view::DecodeTrace::enabled ( ) const
virtual

Returns true if the item is visible and enabled.

Implements pv::view::ViewItem.

Definition at line 152 of file decodetrace.cpp.

Here is the caller graph for this function:

const QString pv::view::DecodeTrace::get_annotation_at_point ( const QPoint &  point)
private

Definition at line 647 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pair< double, double > pv::view::DecodeTrace::get_pixels_offset_samples_per_pixel ( ) const
private

Definition at line 590 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int pv::view::DecodeTrace::get_row_at_point ( const QPoint &  point)
private

Definition at line 628 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pair< uint64_t, uint64_t > pv::view::DecodeTrace::get_sample_range ( int  x_start,
int  x_end 
) const
private

Determines the start and end sample for a given pixel range.

Parameters
x_startthe X coordinate of the start sample in the view
x_endthe X coordinate of the end sample in the view
Returns
Returns a pair containing the start sample and the end sample that correspond to the start and end coordinates.

Definition at line 613 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::hover_point_changed ( )
virtual

Reimplemented from pv::view::RowItem.

Definition at line 670 of file decodetrace.cpp.

Here is the call graph for this function:

void pv::view::DecodeTrace::on_channel_selected ( int  )
privateslot

Definition at line 870 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::on_delete ( )
privateslot

Definition at line 865 of file decodetrace.cpp.

Here is the caller graph for this function:

void pv::view::DecodeTrace::on_delete_decoder ( int  index)
privateslot

Definition at line 886 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::on_new_decode_data ( )
privateslot

Definition at line 854 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::on_show_hide_decoder ( int  index)
privateslot

Definition at line 896 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::on_stack_decoder ( srd_decoder *  decoder)
privateslot

Definition at line 875 of file decodetrace.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::DecodeTrace::paint_back ( QPainter &  p,
const ViewItemPaintParams pp 
)
virtual

Paints the background layer of the trace with a QPainter

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

Reimplemented from pv::view::Trace.

Definition at line 169 of file decodetrace.cpp.

Here is the call graph for this function:

void pv::view::DecodeTrace::paint_fore ( QPainter &  p,
const ViewItemPaintParams pp 
)
virtual

Paints the foreground layer of the trace with a QPainter

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

Reimplemented from pv::view::ViewItem.

Definition at line 230 of file decodetrace.cpp.

Here is the call graph for this function:

void pv::view::DecodeTrace::paint_mid ( QPainter &  p,
const ViewItemPaintParams pp 
)
virtual

Paints the mid-layer of the trace with a QPainter

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

Reimplemented from pv::view::ViewItem.

Definition at line 175 of file decodetrace.cpp.

Here is the call graph for this function:

void pv::view::DecodeTrace::populate_popup_form ( QWidget *  parent,
QFormLayout *  form 
)
virtual

Reimplemented from pv::view::Trace.

Definition at line 270 of file decodetrace.cpp.

Here is the call graph for this function:

pair< int, int > pv::view::DecodeTrace::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 162 of file decodetrace.cpp.

Here is the call graph for this function:

Member Data Documentation

const int pv::view::DecodeTrace::ArrowSize = 4
staticprivate

Definition at line 78 of file decodetrace.hpp.

std::list< std::shared_ptr<pv::binding::Decoder> > pv::view::DecodeTrace::bindings_
private

Definition at line 203 of file decodetrace.hpp.

std::list<ChannelSelector> pv::view::DecodeTrace::channel_selectors_
private

Definition at line 205 of file decodetrace.hpp.

const QColor pv::view::DecodeTrace::Colours
staticprivate
Initial value:
= {
QColor(0xEF, 0x29, 0x29),
QColor(0xF6, 0x6A, 0x32),
QColor(0xFC, 0xAE, 0x3E),
QColor(0xFB, 0xCA, 0x47),
QColor(0xFC, 0xE9, 0x4F),
QColor(0xCD, 0xF0, 0x40),
QColor(0x8A, 0xE2, 0x34),
QColor(0x4E, 0xDC, 0x44),
QColor(0x55, 0xD7, 0x95),
QColor(0x64, 0xD1, 0xD2),
QColor(0x72, 0x9F, 0xCF),
QColor(0xD4, 0x76, 0xC4),
QColor(0x9D, 0x79, 0xB9),
QColor(0xAD, 0x7F, 0xA8),
QColor(0xC2, 0x62, 0x9B),
QColor(0xD7, 0x47, 0x6F)
}

Definition at line 82 of file decodetrace.hpp.

uint64_t pv::view::DecodeTrace::decode_end_
private

Definition at line 200 of file decodetrace.hpp.

uint64_t pv::view::DecodeTrace::decode_start_
private

Definition at line 200 of file decodetrace.hpp.

const QColor pv::view::DecodeTrace::DecodeColours
staticprivate
Initial value:
= {
QColor(0xEF, 0x29, 0x29),
QColor(0xFC, 0xE9, 0x4F),
QColor(0x8A, 0xE2, 0x34),
QColor(0x72, 0x9F, 0xCF)
}

Definition at line 74 of file decodetrace.hpp.

std::vector<pv::widgets::DecoderGroupBox*> pv::view::DecodeTrace::decoder_forms_
private

Definition at line 206 of file decodetrace.hpp.

std::shared_ptr<pv::data::DecoderStack> pv::view::DecodeTrace::decoder_stack_
private

Definition at line 198 of file decodetrace.hpp.

QSignalMapper pv::view::DecodeTrace::delete_mapper_
private

Definition at line 211 of file decodetrace.hpp.

const int pv::view::DecodeTrace::DrawPadding = 100
staticprivate

Definition at line 80 of file decodetrace.hpp.

const double pv::view::DecodeTrace::EndCapWidth = 5
staticprivate

Definition at line 79 of file decodetrace.hpp.

const QColor pv::view::DecodeTrace::ErrorBgColour = QColor(0xEF, 0x29, 0x29)
staticprivate

Definition at line 75 of file decodetrace.hpp.

int pv::view::DecodeTrace::max_visible_rows_
private

Definition at line 209 of file decodetrace.hpp.

const QColor pv::view::DecodeTrace::NoDecodeColour = QColor(0x88, 0x8A, 0x85)
staticprivate

Definition at line 76 of file decodetrace.hpp.

const QColor pv::view::DecodeTrace::OutlineColours
staticprivate
Initial value:
= {
QColor(0x77, 0x14, 0x14),
QColor(0x7B, 0x35, 0x19),
QColor(0x7E, 0x57, 0x1F),
QColor(0x7D, 0x65, 0x23),
QColor(0x7E, 0x74, 0x27),
QColor(0x66, 0x78, 0x20),
QColor(0x45, 0x71, 0x1A),
QColor(0x27, 0x6E, 0x22),
QColor(0x2A, 0x6B, 0x4A),
QColor(0x32, 0x68, 0x69),
QColor(0x39, 0x4F, 0x67),
QColor(0x6A, 0x3B, 0x62),
QColor(0x4E, 0x3C, 0x5C),
QColor(0x56, 0x3F, 0x54),
QColor(0x61, 0x31, 0x4D),
QColor(0x6B, 0x23, 0x37)
}

Definition at line 83 of file decodetrace.hpp.

int pv::view::DecodeTrace::row_height_
private

Definition at line 209 of file decodetrace.hpp.

pv::Session& pv::view::DecodeTrace::session_
private

Definition at line 197 of file decodetrace.hpp.

QSignalMapper pv::view::DecodeTrace::show_hide_mapper_
private

Definition at line 211 of file decodetrace.hpp.

std::vector<data::decode::Row> pv::view::DecodeTrace::visible_rows_
private

Definition at line 208 of file decodetrace.hpp.


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