20 #ifndef PULSEVIEW_PV_VIEWS_TRACE_VIEW_HPP 21 #define PULSEVIEW_PV_VIEWS_TRACE_VIEW_HPP 30 #include <QAbstractScrollArea> 48 using std::shared_ptr;
80 bool viewportEvent(QEvent *event);
89 TraceTreeItemHExtentsChanged = 1,
90 TraceTreeItemVExtentsChanged = 2
100 static const int ScaleUnits[3];
113 virtual void reset_view_state();
116 const Session& session()
const;
121 vector< shared_ptr<Signal> > signals()
const;
123 shared_ptr<Signal> get_signal_by_signalbase(shared_ptr<data::SignalBase> base)
const;
125 virtual void clear_signalbases();
126 virtual void add_signalbase(
const shared_ptr<data::SignalBase> signalbase);
127 virtual void remove_signalbase(
const shared_ptr<data::SignalBase> signalbase);
130 virtual void clear_decode_signals();
132 virtual void add_decode_signal(shared_ptr<data::DecodeSignal> signal);
134 virtual void remove_decode_signal(shared_ptr<data::DecodeSignal> signal);
137 void remove_trace(shared_ptr<Trace> trace);
139 shared_ptr<Signal> get_signal_under_mouse_cursor()
const;
144 virtual View* view();
149 virtual const View* view()
const;
156 const Ruler* ruler()
const;
158 virtual void save_settings(
QSettings &settings)
const;
159 virtual void restore_settings(
QSettings &settings);
164 vector< shared_ptr<TimeItem> > time_items()
const;
169 double scale()
const;
185 void reset_zero_position();
192 int owner_visual_v_offset()
const;
197 void set_v_offset(
int offset);
202 void set_h_offset(
int offset);
207 int get_h_scrollbar_maximum()
const;
217 unsigned int tick_precision()
const;
227 unsigned int minor_tick_count()
const;
237 unsigned int depth()
const;
242 uint32_t current_segment()
const;
248 bool segment_is_selectable()
const;
253 void zoom(
double steps);
254 void zoom(
double steps,
int offset);
256 void zoom_fit(
bool gui_state);
258 virtual void focus_on_range(uint64_t start_sample, uint64_t end_sample);
267 vector< shared_ptr<pv::data::SignalData> > get_visible_data()
const;
269 pair<pv::util::Timestamp, pv::util::Timestamp> get_time_extents()
const;
274 bool colored_bg()
const;
279 bool cursors_shown()
const;
284 void show_cursors(
bool show =
true);
296 void center_cursors();
301 shared_ptr<CursorPair> cursors()
const;
311 void remove_flag(shared_ptr<Flag> flag);
316 vector< shared_ptr<Flag> > flags()
const;
318 const QPoint& hover_point()
const;
319 const QWidget* hover_widget()
const;
328 int64_t get_nearest_level_change(
const QPoint &p);
330 void restack_all_trace_tree_items();
332 int header_width()
const;
334 void on_setting_changed(
const QString &key,
const QVariant &
value);
337 void hover_point_changed(
const QWidget* widget,
const QPoint &hp);
339 void selection_changed();
342 void offset_changed();
345 void scale_changed();
347 void sticky_scrolling_changed(
bool state);
349 void always_zoom_to_fit_changed(
bool state);
352 void tick_prefix_changed();
355 void tick_precision_changed();
358 void tick_period_changed();
361 void time_unit_changed();
364 void segment_changed(
int segment_id);
368 void segment_display_mode_changed(
int mode,
bool segment_selectable);
371 void cursor_state_changed(
bool show);
385 void set_zoom(
double scale,
int offset);
391 void calculate_tick_spacing();
393 void adjust_top_margin();
395 void update_scroll();
397 void set_scroll_default();
399 void determine_if_header_was_shrunk();
401 void resize_header_to_fit();
403 void update_layout();
406 const shared_ptr<sigrok::ChannelGroup> &group,
407 const map<shared_ptr<data::SignalBase>, shared_ptr<Signal> > &signal_map);
409 static vector< shared_ptr<Trace> >
410 extract_new_traces_for_channels(
411 const vector< shared_ptr<sigrok::Channel> > &channels,
412 const map<shared_ptr<data::SignalBase>, shared_ptr<Signal> > &signal_map,
413 set< shared_ptr<Trace> > &add_list);
415 void determine_time_unit();
417 bool eventFilter(
QObject *
object, QEvent *event);
419 virtual void contextMenuEvent(QContextMenuEvent *event);
421 void resizeEvent(QResizeEvent *event);
423 void update_view_range_metaobject()
const;
424 void update_hover_point();
427 void row_item_appearance_changed(
bool label,
bool content);
428 void time_item_appearance_changed(
bool label,
bool content);
430 void extents_changed(
bool horz,
bool vert);
433 void on_signal_name_changed();
434 void on_splitter_moved();
436 void on_zoom_in_shortcut_triggered();
437 void on_zoom_out_shortcut_triggered();
438 void on_scroll_to_start_shortcut_triggered();
439 void on_scroll_to_end_shortcut_triggered();
441 void h_scroll_value_changed(
int value);
442 void v_scroll_value_changed();
444 void on_grab_ruler(
int ruler_id);
446 void signals_changed();
447 void capture_state_updated(
int state);
449 void on_new_segment(
int new_segment_id);
450 void on_segment_completed(
int new_segment_id);
451 void on_segment_changed(
int segment);
453 void on_settingViewTriggerIsZeroTime_changed(
const QVariant new_value);
455 void on_create_marker_here();
457 virtual void perform_delayed_view_update();
459 void process_sticky_events();
471 void set_scale(
double scale);
483 void set_tick_precision(
unsigned tick_precision);
500 void set_current_segment(uint32_t segment_id);
519 vector< shared_ptr<DecodeTrace> > decode_traces_;
588 #endif // PULSEVIEW_PV_VIEWS_TRACE_VIEW_HPP
pv::util::Timestamp tick_period_
vector< shared_ptr< Signal > > signals_
vector< shared_ptr< TriggerMarker > > trigger_markers_
shared_ptr< Signal > signal_under_mouse_cursor_
double scale_
The view time scale in seconds per pixel.
bool segment_selectable_
Signals whether the user can change the currently shown segment.
T value(details::expression_node< T > *n)
QShortcut * home_shortcut_
QShortcut * zoom_in_shortcut_2_
QShortcut * grab_ruler_right_shortcut_
bool custom_zero_offset_set_
Shows whether the user set a custom zero offset that we should keep.
QTimer lazy_event_handler_
unsigned int sticky_events_
TimeMarker * grabbed_widget_
pv::util::Timestamp zero_offset_
The offset of the zero point in seconds.
list< shared_ptr< Flag > > flags_
static const int MaxScrollValue
QShortcut * zoom_out_shortcut_2_
CustomScrollArea * scrollarea_
static const int ViewScrollMargin
Trace::SegmentDisplayMode segment_display_mode_
pv::util::SIPrefix tick_prefix_
uint32_t context_menu_x_pos_
unsigned int minor_tick_count_
pv::util::Timestamp ruler_offset_
The ruler version of the time offset in seconds.
unsigned int tick_precision_
QShortcut * cancel_grab_shortcut_
manual txt set(MANUAL_OUT_HTML"${CMAKE_CURRENT_BINARY_DIR}/manual.html") set(MANUAL_OUT_PDF"$
pv::util::Timestamp offset_at_acq_start_
bool scroll_needs_defaults_
boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 24 >, boost::multiprecision::et_off > Timestamp
Timestamp type providing yoctosecond resolution.
static const pv::util::Timestamp MaxScale
pv::util::Timestamp offset_
The internal view version of the time offset in seconds.
util::TimeUnit time_unit_
shared_ptr< CursorPair > cursors_
double scale_at_acq_start_
static const pv::util::Timestamp MinScale