20 #ifndef PULSEVIEW_PV_VIEWS_TRACE_DECODETRACE_HPP 21 #define PULSEVIEW_PV_VIEWS_TRACE_DECODETRACE_HPP 34 #include <QElapsedTimer> 36 #include <QPushButton> 37 #include <QSignalMapper> 46 #define DECODETRACE_SHOW_RENDER_TIME 0 53 using std::shared_ptr;
79 class DecoderGroupBox;
85 class ContainerWidget;
92 unsigned int height, expanded_height,
title_width, animation_step;
94 bool expand_marker_highlighted,
expanding, expanded, collapsing;
112 virtual void resizeEvent(QResizeEvent* event);
115 void widgetResized(QWidget* sender);
144 bool enabled()
const;
146 shared_ptr<SignalBase> base()
const;
158 pair<int, int> v_extents()
const;
181 void populate_popup_form(QWidget *parent, QFormLayout *form);
183 QMenu* create_header_context_menu(QWidget *parent);
185 virtual QMenu* create_view_context_menu(QWidget *parent, QPoint &click_pos);
187 virtual void delete_pressed();
189 virtual void hover_point_changed(
const QPoint &hp);
191 virtual void mouse_left_press_event(
const QMouseEvent* event);
194 void draw_annotations(deque<const Annotation*>& annotations, QPainter &p,
197 void draw_annotation(
const Annotation* a, QPainter &p,
200 void draw_annotation_block(qreal start, qreal end, uint32_t ann_class,
201 bool use_ann_format, QPainter &p,
int y,
const DecodeTraceRow& row)
const;
203 void draw_instant(
const Annotation* a, QPainter &p, qreal
x,
int y)
const;
205 void draw_range(
const Annotation* a, QPainter &p, qreal start, qreal end,
210 void draw_unresolved_period(QPainter &p,
int left,
int right)
const;
212 pair<double, double> get_pixels_offset_samples_per_pixel()
const;
221 pair<uint64_t, uint64_t> get_view_sample_range(
int x_start,
int x_end)
const;
227 const QString get_annotation_at_point(
const QPoint &point);
229 void update_stack_button();
231 void create_decoder_form(
int index, shared_ptr<Decoder> &dec,
232 QWidget *parent, QFormLayout *form);
234 QComboBox* create_channel_selector(QWidget *parent,
236 QComboBox* create_channel_selector_init_state(QWidget *parent,
239 void export_annotations(deque<const Annotation*>& annotations)
const;
241 void initialize_row_widgets(
DecodeTraceRow* r,
unsigned int row_id);
254 void update_expanded_rows();
257 void on_setting_changed(
const QString &key,
const QVariant &
value);
259 void on_color_changed(
const QColor &color);
261 void on_new_annotations();
262 void on_delayed_trace_update();
263 void on_decode_reset();
264 void on_decode_finished();
265 void on_pause_decode();
269 void on_channel_selected(
int);
271 void on_channels_updated();
273 void on_init_state_changed(
int);
275 void on_stack_decoder(srd_decoder *decoder);
277 void on_delete_decoder(
int index);
279 void on_show_hide_decoder(
int index);
280 void on_show_hide_row(
int row_id);
281 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 282 void on_show_hide_class(
QObject* sender);
284 void on_show_hide_class(QWidget* sender);
286 void on_show_all_classes();
287 void on_hide_all_classes();
288 void on_row_container_resized(QWidget* sender);
290 void on_copy_annotation_to_clipboard();
292 void on_export_row();
293 void on_export_all_rows();
294 void on_export_row_with_cursor();
295 void on_export_all_rows_with_cursor();
296 void on_export_row_from_here();
297 void on_export_all_rows_from_here();
299 void on_animation_timer();
300 void on_hide_hidden_rows();
332 #if DECODETRACE_SHOW_RENDER_TIME 333 QElapsedTimer render_time_;
341 #endif // PULSEVIEW_PV_VIEWS_TRACE_DECODETRACE_HPP
static const int RowTitleMargin
static const int ArrowSize
static const int MaxTraceUpdateRate
pair< uint64_t, uint64_t > selected_sample_range_
static const int HiddenRowHideDelay
static const double EndCapWidth
list< shared_ptr< pv::binding::Decoder > > bindings_
QSignalMapper row_show_hide_mapper_
static const QColor NoDecodeColor
shared_ptr< data::DecodeSignal > decode_signal_
static const QColor ExpandMarkerHiddenColor
T value(details::expression_node< T > *n)
vector< pv::widgets::DecoderGroupBox * > decoder_forms_
unsigned int default_row_height_
QCheckBox * row_visibility_checkbox
QTimer delayed_trace_updater_
int min_useful_label_width_
map< QComboBox *, uint16_t > init_state_map_
QPushButton * stack_button_
static const QColor ExpandMarkerWarnColor
QPolygon default_marker_shape_
map< QComboBox *, uint16_t > channel_id_map_
static const uint8_t ExpansionAreaHeaderAlpha
static const int DrawPadding
static const uint8_t ExpansionAreaAlpha
unsigned int visible_rows_
QSignalMapper show_hide_mapper_
static const int AnimationDurationInTicks
const Row * selected_row_
vector< QCheckBox * > selectors
ContainerWidget * container
QPolygon expand_marker_shape
QWidget * header_container
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)
deque< DecodeTraceRow > rows_
mutex row_modification_mutex_
QWidget * selector_container