PulseView  unreleased development snapshot
A Qt-based sigrok GUI
pv::views::trace::Signal Class Referenceabstract

#include <signal.hpp>

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

Public Member Functions

virtual void set_name (QString name)
 
virtual vector< data::LogicSegment::EdgePairget_nearest_level_changes (uint64_t sample_pos)=0
 
bool enabled () const
 
shared_ptr< data::SignalBasebase () const
 
virtual void save_settings (QSettings &settings) const
 
virtual std::map< QString, QVariant > save_settings () const
 
virtual void restore_settings (QSettings &settings)
 
virtual void restore_settings (std::map< QString, QVariant > settings)
 
void paint_back (QPainter &p, ViewItemPaintParams &pp)
 
virtual void populate_popup_form (QWidget *parent, QFormLayout *form)
 
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
 
virtual pair< int, int > v_extents () const =0
 
- Public Member Functions inherited from pv::views::trace::ViewItem
 ViewItem ()
 
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 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 ()
 

Protected Slots

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

 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 ()
 

Protected Attributes

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_
 

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)
 
- Static Public Attributes inherited from pv::views::trace::ViewItem
static const QSizeF LabelPadding
 
static const int HighlightRadius = 3
 
- Static Protected Member Functions inherited from pv::views::trace::ViewItem
static QPen highlight_pen ()
 
- Properties inherited from pv::views::trace::TraceTreeItem
int visual_v_offset
 

Detailed Description

The Signal class represents a series of numeric values that can be drawn. This is the main difference to the more generic 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.

Definition at line 60 of file signal.hpp.

Constructor & Destructor Documentation

pv::views::trace::Signal::Signal ( pv::Session session,
shared_ptr< data::SignalBase signal 
)
protected

Definition at line 66 of file signal.cpp.

Here is the call graph for this function:

Member Function Documentation

shared_ptr< data::SignalBase > pv::views::trace::Signal::base ( ) const

Definition at line 91 of file signal.cpp.

QMenu * pv::views::trace::Signal::create_header_context_menu ( QWidget *  parent)
virtual

Reimplemented from pv::views::trace::Trace.

Definition at line 158 of file signal.cpp.

Here is the call graph for this function:

void pv::views::trace::Signal::delete_pressed ( )
virtual

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

Definition at line 179 of file signal.cpp.

Here is the call graph for this function:

bool pv::views::trace::Signal::enabled ( ) const
virtual

Returns true if the trace is visible and enabled.

Implements pv::views::trace::ViewItem.

Definition at line 86 of file signal.cpp.

Here is the caller graph for this function:

virtual vector<data::LogicSegment::EdgePair> pv::views::trace::Signal::get_nearest_level_changes ( uint64_t  sample_pos)
pure 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

Implemented in pv::views::trace::AnalogSignal, and pv::views::trace::LogicSignal.

void pv::views::trace::Signal::on_disable ( )
protectedslot

Definition at line 197 of file signal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::Signal::on_enabled_changed ( bool  enabled)
protectedslot

Definition at line 206 of file signal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::Signal::on_name_changed ( const QString &  text)
protectedvirtualslot

Definition at line 184 of file signal.cpp.

Here is the call graph for this function:

void pv::views::trace::Signal::paint_back ( QPainter &  p,
ViewItemPaintParams pp 
)
virtual

Paints the background 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::Trace.

Definition at line 126 of file signal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::Signal::populate_popup_form ( QWidget *  parent,
QFormLayout *  form 
)
virtual

Reimplemented from pv::views::trace::Trace.

Reimplemented in pv::views::trace::AnalogSignal, pv::views::trace::LogicSignal, and pv::views::trace::MathSignal.

Definition at line 132 of file signal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::Signal::restore_settings ( QSettings settings)
virtual

Definition at line 109 of file signal.cpp.

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

Reimplemented in pv::views::trace::AnalogSignal, and pv::views::trace::LogicSignal.

Definition at line 120 of file signal.cpp.

void pv::views::trace::Signal::save_settings ( QSettings settings) const
virtual

Definition at line 96 of file signal.cpp.

Here is the call graph for this function:

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

Reimplemented in pv::views::trace::AnalogSignal, and pv::views::trace::LogicSignal.

Definition at line 104 of file signal.cpp.

Here is the caller graph for this function:

void pv::views::trace::Signal::set_name ( QString  name)
virtual

Sets the name of the signal.

Definition at line 78 of file signal.cpp.

Member Data Documentation

QComboBox* pv::views::trace::Signal::name_widget_
protected

Definition at line 113 of file signal.hpp.

pv::Session& pv::views::trace::Signal::session_
protected

Definition at line 111 of file signal.hpp.


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