![]() |
PulseView
unreleased development snapshot
A Qt-based sigrok GUI
|
#include <view.hpp>
Public Slots | |
void | trigger_event (int segment_id, util::Timestamp location) |
![]() | |
virtual void | trigger_event (int segment_id, util::Timestamp location) |
virtual void | signals_changed () |
virtual void | capture_state_updated (int state) |
virtual void | on_new_segment (int new_segment_id) |
virtual void | on_segment_completed (int new_segment_id) |
virtual void | perform_delayed_view_update () |
Signals | |
void | hover_point_changed (const QWidget *widget, const QPoint &hp) |
void | selection_changed () |
void | offset_changed () |
Emitted when the offset changed. More... | |
void | scale_changed () |
Emitted when the scale changed. More... | |
void | sticky_scrolling_changed (bool state) |
void | always_zoom_to_fit_changed (bool state) |
void | tick_prefix_changed () |
Emitted when the tick_prefix changed. More... | |
void | tick_precision_changed () |
Emitted when the tick_precision changed. More... | |
void | tick_period_changed () |
Emitted when the tick_period changed. More... | |
void | time_unit_changed () |
Emitted when the time_unit changed. More... | |
void | segment_changed (int segment_id) |
Emitted when the currently selected segment changed. More... | |
void | segment_display_mode_changed (int mode, bool segment_selectable) |
void | cursor_state_changed (bool show) |
Emitted when the cursors are shown/hidden. More... | |
Public Member Functions | |
View (Session &session, bool is_main_view=false, QMainWindow *parent=nullptr) | |
~View () | |
virtual ViewType | get_type () const |
virtual void | reset_view_state () |
Session & | session () |
const Session & | session () const |
vector< shared_ptr< Signal > > | signals () const |
shared_ptr< Signal > | get_signal_by_signalbase (shared_ptr< data::SignalBase > base) const |
virtual void | clear_signalbases () |
virtual void | add_signalbase (const shared_ptr< data::SignalBase > signalbase) |
virtual void | remove_signalbase (const shared_ptr< data::SignalBase > signalbase) |
void | remove_trace (shared_ptr< Trace > trace) |
shared_ptr< Signal > | get_signal_under_mouse_cursor () const |
virtual View * | view () |
virtual const View * | view () const |
Viewport * | viewport () |
const Viewport * | viewport () const |
QAbstractScrollArea * | scrollarea () const |
const Ruler * | ruler () const |
virtual void | save_settings (QSettings &settings) const |
virtual void | restore_settings (QSettings &settings) |
vector< shared_ptr< TimeItem > > | time_items () const |
double | scale () const |
const pv::util::Timestamp & | offset () const |
const pv::util::Timestamp & | ruler_offset () const |
void | set_zero_position (const pv::util::Timestamp &position) |
void | reset_zero_position () |
pv::util::Timestamp | zero_offset () const |
int | owner_visual_v_offset () const |
void | set_v_offset (int offset) |
void | set_h_offset (int offset) |
int | get_h_scrollbar_maximum () const |
pv::util::SIPrefix | tick_prefix () const |
unsigned int | tick_precision () const |
const pv::util::Timestamp & | tick_period () const |
unsigned int | minor_tick_count () const |
util::TimeUnit | time_unit () const |
unsigned int | depth () const |
uint32_t | current_segment () const |
bool | segment_is_selectable () const |
Trace::SegmentDisplayMode | segment_display_mode () const |
void | set_segment_display_mode (Trace::SegmentDisplayMode mode) |
void | zoom (double steps) |
void | zoom (double steps, int offset) |
void | zoom_fit (bool gui_state) |
virtual void | focus_on_range (uint64_t start_sample, uint64_t end_sample) |
void | set_scale_offset (double scale, const pv::util::Timestamp &offset) |
vector< shared_ptr< pv::data::SignalData > > | get_visible_data () const |
pair< pv::util::Timestamp, pv::util::Timestamp > | get_time_extents () const |
bool | colored_bg () const |
bool | cursors_shown () const |
void | show_cursors (bool show=true) |
void | set_cursors (pv::util::Timestamp &first, pv::util::Timestamp &second) |
void | center_cursors () |
shared_ptr< CursorPair > | cursors () const |
shared_ptr< Flag > | add_flag (const pv::util::Timestamp &time) |
void | remove_flag (shared_ptr< Flag > flag) |
vector< shared_ptr< Flag > > | flags () const |
const QPoint & | hover_point () const |
const QWidget * | hover_widget () const |
int64_t | get_nearest_level_change (const QPoint &p) |
void | restack_all_trace_tree_items () |
int | header_width () const |
void | on_setting_changed (const QString &key, const QVariant &value) |
void | row_item_appearance_changed (bool label, bool content) |
void | time_item_appearance_changed (bool label, bool content) |
void | extents_changed (bool horz, bool vert) |
![]() | |
ViewBase (Session &session, bool is_main_view=false, QMainWindow *parent=nullptr) | |
bool | is_main_view () const |
Session & | session () |
const Session & | session () const |
vector< shared_ptr< data::SignalBase > > | signalbases () const |
![]() | |
virtual const item_list & | child_items () const |
vector< shared_ptr< TraceTreeItem > > | trace_tree_child_items () const |
void | clear_child_items () |
void | add_child_item (shared_ptr< TraceTreeItem > item) |
void | remove_child_item (shared_ptr< TraceTreeItem > item) |
virtual void | restack_items () |
pair< int, int > | v_extents () const |
![]() | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
template<class T > | |
vector< shared_ptr< T > > | list_by_type () |
Private Types | |
enum | StickyEvents { TraceTreeItemHExtentsChanged = 1, TraceTreeItemVExtentsChanged = 2 } |
Private Member Functions | |
void | get_scroll_layout (double &length, pv::util::Timestamp &offset) const |
void | set_zoom (double scale, int offset) |
void | calculate_tick_spacing () |
void | adjust_top_margin () |
void | update_scroll () |
void | reset_scroll () |
void | set_scroll_default () |
void | determine_if_header_was_shrunk () |
void | resize_header_to_fit () |
void | update_layout () |
TraceTreeItemOwner * | find_prevalent_trace_group (const shared_ptr< sigrok::ChannelGroup > &group, const map< shared_ptr< data::SignalBase >, shared_ptr< Signal > > &signal_map) |
void | determine_time_unit () |
bool | eventFilter (QObject *object, QEvent *event) |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
void | resizeEvent (QResizeEvent *event) |
void | update_view_range_metaobject () const |
void | update_hover_point () |
Static Private Member Functions | |
static vector< shared_ptr< Trace > > | extract_new_traces_for_channels (const vector< shared_ptr< sigrok::Channel > > &channels, const map< shared_ptr< data::SignalBase >, shared_ptr< Signal > > &signal_map, set< shared_ptr< Trace > > &add_list) |
Static Private Attributes | |
static const pv::util::Timestamp | MaxScale |
static const pv::util::Timestamp | MinScale |
static const int | MaxScrollValue = INT_MAX / 2 |
static const int | ViewScrollMargin = 50 |
static const int | ScaleUnits [3] = {1, 2, 5} |
Additional Inherited Members | |
![]() | |
typedef vector< shared_ptr< ViewItem > > | item_list |
typedef ViewItemIterator< ViewItemOwner, ViewItem > | iterator |
typedef ViewItemIterator< const ViewItemOwner, ViewItem > | const_iterator |
![]() | |
static const int | MaxViewAutoUpdateRate = 25 |
![]() | |
Session & | session_ |
const bool | is_main_view_ |
util::TimeUnit | time_unit_ |
vector< shared_ptr< data::SignalBase > > | signalbases_ |
uint32_t | current_segment_ |
The ID of the currently displayed segment. More... | |
QTimer | delayed_view_updater_ |
![]() | |
item_list | items_ |
|
private |
|
explicit |
pv::views::trace::View::~View | ( | ) |
shared_ptr< Flag > pv::views::trace::View::add_flag | ( | const pv::util::Timestamp & | time | ) |
|
virtual |
Reimplemented from pv::views::ViewBase.
Definition at line 354 of file view.cpp.
|
private |
|
signal |
|
private |
|
privateslot |
void pv::views::trace::View::center_cursors | ( | ) |
Moves the cursors to a convenient position in the view. You still have to call show_cursors() separately.
Definition at line 995 of file view.cpp.
|
virtual |
Reimplemented from pv::views::ViewBase.
Definition at line 348 of file view.cpp.
bool pv::views::trace::View::colored_bg | ( | ) | const |
|
privatevirtual |
uint32_t pv::views::trace::View::current_segment | ( | ) | const |
|
signal |
Emitted when the cursors are shown/hidden.
Definition at line 583 of file moc_view.cpp.
shared_ptr< CursorPair > pv::views::trace::View::cursors | ( | ) | const |
bool pv::views::trace::View::cursors_shown | ( | ) | const |
|
virtual |
Returns the number of nested parents that this row item owner has.
Implements pv::views::trace::TraceTreeItemOwner.
|
private |
|
private |
|
private |
|
virtual |
Implements pv::views::trace::TraceTreeItemOwner.
|
staticprivate |
|
private |
vector< shared_ptr< Flag > > pv::views::trace::View::flags | ( | ) | const |
|
virtual |
Reimplemented from pv::views::ViewBase.
Definition at line 859 of file view.cpp.
int pv::views::trace::View::get_h_scrollbar_maximum | ( | ) | const |
int64_t pv::views::trace::View::get_nearest_level_change | ( | const QPoint & | p | ) |
Determines the closest level change (i.e. edge) to a given point, which is useful for e.g. the "snap to edge" functionality.
p | The current position of the mouse cursor |
Definition at line 1052 of file view.cpp.
|
private |
shared_ptr< Signal > pv::views::trace::View::get_signal_by_signalbase | ( | shared_ptr< data::SignalBase > | base | ) | const |
shared_ptr< Signal > pv::views::trace::View::get_signal_under_mouse_cursor | ( | ) | const |
pair< Timestamp, Timestamp > pv::views::trace::View::get_time_extents | ( | ) | const |
|
virtual |
Implements pv::views::ViewBase.
vector< shared_ptr< SignalData > > pv::views::trace::View::get_visible_data | ( | ) | const |
|
privateslot |
int pv::views::trace::View::header_width | ( | ) | const |
const QPoint & pv::views::trace::View::hover_point | ( | ) | const |
|
signal |
const QWidget * pv::views::trace::View::hover_widget | ( | ) | const |
unsigned int pv::views::trace::View::minor_tick_count | ( | ) | const |
const Timestamp & pv::views::trace::View::offset | ( | ) | const |
|
signal |
Emitted when the offset changed.
Definition at line 519 of file moc_view.cpp.
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
virtual |
Implements pv::GlobalSettingsInterface.
Definition at line 1180 of file view.cpp.
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
virtual |
Returns the vertical scroll offset.
Implements pv::views::trace::TraceTreeItemOwner.
Definition at line 652 of file view.cpp.
|
privatevirtualslot |
|
privateslot |
void pv::views::trace::View::remove_flag | ( | shared_ptr< Flag > | flag | ) |
|
virtual |
Reimplemented from pv::views::ViewBase.
Definition at line 396 of file view.cpp.
void pv::views::trace::View::remove_trace | ( | shared_ptr< Trace > | trace | ) |
|
private |
|
virtual |
Resets the view to its default state after construction. It does however not reset the signal bases or any other connections with the session.
Reimplemented from pv::views::ViewBase.
Definition at line 278 of file view.cpp.
void pv::views::trace::View::reset_zero_position | ( | ) |
|
private |
|
private |
void pv::views::trace::View::restack_all_trace_tree_items | ( | ) |
|
virtual |
Reimplemented from pv::views::ViewBase.
Definition at line 519 of file view.cpp.
|
virtual |
Implements pv::views::trace::TraceTreeItemOwner.
const Ruler * pv::views::trace::View::ruler | ( | ) | const |
const Timestamp & pv::views::trace::View::ruler_offset | ( | ) | const |
|
virtual |
Reimplemented from pv::views::ViewBase.
Definition at line 496 of file view.cpp.
double pv::views::trace::View::scale | ( | ) | const |
|
signal |
Emitted when the scale changed.
Definition at line 525 of file moc_view.cpp.
QAbstractScrollArea * pv::views::trace::View::scrollarea | ( | ) | const |
|
signal |
Emitted when the currently selected segment changed.
Definition at line 569 of file moc_view.cpp.
Trace::SegmentDisplayMode pv::views::trace::View::segment_display_mode | ( | ) | const |
|
signal |
Emitted when the multi-segment display mode changed
mode | is a value of Trace::SegmentDisplayMode |
Definition at line 576 of file moc_view.cpp.
bool pv::views::trace::View::segment_is_selectable | ( | ) | const |
|
signal |
|
virtual |
Returns the session of the owner.
Implements pv::views::trace::TraceTreeItemOwner.
Definition at line 320 of file view.cpp.
|
virtual |
Returns the session of the owner.
Implements pv::views::trace::TraceTreeItemOwner.
|
privateslot |
void pv::views::trace::View::set_cursors | ( | pv::util::Timestamp & | first, |
pv::util::Timestamp & | second | ||
) |
Sets the cursors to the given offsets. You still have to call show_cursors() separately.
Definition at line 984 of file view.cpp.
void pv::views::trace::View::set_h_offset | ( | int | offset | ) |
|
privateslot |
|
privateslot |
void pv::views::trace::View::set_scale_offset | ( | double | scale, |
const pv::util::Timestamp & | offset | ||
) |
|
private |
void pv::views::trace::View::set_segment_display_mode | ( | Trace::SegmentDisplayMode | mode | ) |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
void pv::views::trace::View::set_v_offset | ( | int | offset | ) |
void pv::views::trace::View::set_zero_position | ( | const pv::util::Timestamp & | position | ) |
|
private |
Simultaneously sets the zoom and offset.
scale | The scale to set the view to in seconds per pixel. This value is clamped between MinScale and MaxScale. |
offset | The offset of the left edge of the view in seconds. |
Definition at line 1219 of file view.cpp.
void pv::views::trace::View::show_cursors | ( | bool | show = true | ) |
vector< shared_ptr< Signal > > pv::views::trace::View::signals | ( | ) | const |
|
privateslot |
|
signal |
const pv::util::Timestamp & pv::views::trace::View::tick_period | ( | ) | const |
|
signal |
Emitted when the tick_period changed.
Definition at line 557 of file moc_view.cpp.
unsigned int pv::views::trace::View::tick_precision | ( | ) | const |
|
signal |
Emitted when the tick_precision changed.
Definition at line 551 of file moc_view.cpp.
pv::util::SIPrefix pv::views::trace::View::tick_prefix | ( | ) | const |
|
signal |
Emitted when the tick_prefix changed.
Definition at line 545 of file moc_view.cpp.
void pv::views::trace::View::time_item_appearance_changed | ( | bool | label, |
bool | content | ||
) |
vector< shared_ptr< TimeItem > > pv::views::trace::View::time_items | ( | ) | const |
TimeUnit pv::views::trace::View::time_unit | ( | ) | const |
|
signal |
Emitted when the time_unit changed.
Definition at line 563 of file moc_view.cpp.
|
slot |
|
private |
|
private |
|
private |
|
private |
|
privateslot |
|
virtual |
Returns the view of the owner.
Implements pv::views::trace::TraceTreeItemOwner.
|
virtual |
Returns the view of the owner.
Implements pv::views::trace::TraceTreeItemOwner.
Viewport * pv::views::trace::View::viewport | ( | ) |
const Viewport * pv::views::trace::View::viewport | ( | ) | const |
pv::util::Timestamp pv::views::trace::View::zero_offset | ( | ) | const |
void pv::views::trace::View::zoom | ( | double | steps | ) |
void pv::views::trace::View::zoom | ( | double | steps, |
int | offset | ||
) |
void pv::views::trace::View::zoom_fit | ( | bool | gui_state | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |