21#include <ui/qt/widgets/customplot.h>
27#include <QItemSelection>
127 void addPlot(
bool checked,
const QString &dfilter,
const QString &yfield);
172 virtual QString
getHintText(
unsigned num_items)
const;
195 void addPlot(
bool checked,
const QString& name,
const QString& dfilter,
207 void modelDataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
208 const QVector<int> &roles);
239 void modelRowsMoved(
const QModelIndex &sourceParent,
int sourceStart,
int sourceEnd,
240 const QModelIndex &destinationParent,
int destinationRow);
264 void setPosMarker(
const double xCoord,
const int selectMPos,
const int posMPos);
277 void createPlot(
int currentRow);
283 void syncPlotSettings(
int row);
289 int getLastPlotIdx();
296 bool graphIsEnabled(
int row)
const;
302 Plot *currentActiveGraph()
const;
311 void updateLegendPos();
321 void doZoom(
bool in,
bool y);
324 void zoomAxes(
bool in);
326 void zoomXAxis(
bool in);
328 void zoomYAxis(
bool in);
335 void panAxes(
int x_pixels,
int y_pixels);
338 void updateXAxisLabel();
346 QRectF getZoomRanges(QRect zoom_rect, QCPAxisRect **matchedAxisRect =
nullptr);
353 bool makeCsv(QTextStream &
stream)
const;
360 QCPAxisRect *getAxisRect(
int idx);
366 void removeExcessPlots();
369 void setTracerColor();
376 QCPAxisRect *axisRectFromPos(
const QPoint &pos);
381 void addMarkerDifference();
388 int visibleMarker(
const bool first =
true)
const;
396 Marker *addMarker(
const bool isPosMarker);
402 void drawMarker(
const Marker *marker);
408 void addDataPointsMarkers();
411 void updateFirstAxisRectHeight();
416 void recreateMultiValueAxes();
422 QList<QCPAxisRect *> axisRects()
const;
425 void autoScroll()
const;
428 QPushButton *copy_bt_;
435 QVector<Plot *> plots_;
438 QCPGraph *base_graph_;
439 QCPItemTracer *tracer_;
440 uint32_t packet_num_;
442 QRubberBand *rubber_band_;
446 QCPMarginGroup *margin_group_;
447 Qt::Alignment legend_alignment_;
453 double last_right_clicked_pos_;
459 static void applyChanges();
465 void updateStatistics();
474 void copyFromProfile(
const QString &filename);
477 void copyAsCsvClicked();
483 void showContextMenu(
const QPoint &pos);
493 void graphClicked(QMouseEvent *event);
499 void mouseMoved(QMouseEvent *event);
505 void mouseReleased(QMouseEvent *event);
511 void selectedFrameChanged(
const QList<int> &frames);
518 void plotUatSelectionChanged(
const QItemSelection &selected,
519 const QItemSelection &deselected);
525 void on_leftButtonBox_clicked(QAbstractButton *button);
531 void on_actionLegend_triggered(
bool checked);
537 void on_actionLogScale_triggered(
bool checked);
543 void on_actionCrosshairs_triggered(
bool checked);
549 void on_actionTopAxis_triggered(
bool checked);
555 void on_automaticUpdateCheckBox_toggled(
bool checked);
562 void on_plotUat_currentItemChanged(
const QModelIndex ¤t,
563 const QModelIndex &previous);
566 void on_actionGoToPacket_triggered();
569 void on_newToolButton_clicked();
571 void on_deleteToolButton_clicked();
573 void on_copyToolButton_clicked();
575 void on_clearToolButton_clicked();
577 void on_moveUpwardsToolButton_clicked();
579 void on_moveDownwardsToolButton_clicked();
582 void on_leftButtonBox_helpRequested();
585 void on_actionReset_triggered() { resetAxes(); }
587 void on_actionZoomIn_triggered() { zoomAxes(
true); }
589 void on_actionZoomInX_triggered() { zoomXAxis(
true); }
591 void on_actionZoomInY_triggered() { zoomYAxis(
true); }
593 void on_actionZoomOut_triggered() { zoomAxes(
false); }
595 void on_actionZoomOutX_triggered() { zoomXAxis(
false); }
597 void on_actionZoomOutY_triggered() { zoomYAxis(
false); }
599 void on_actionMoveUp10_triggered() { panAxes(0, 10); }
601 void on_actionMoveLeft10_triggered() { panAxes(-10, 0); }
603 void on_actionMoveRight10_triggered() { panAxes(10, 0); }
605 void on_actionMoveDown10_triggered() { panAxes(0, -10); }
607 void on_actionMoveUp1_triggered() { panAxes(0, 1); }
609 void on_actionMoveLeft1_triggered() { panAxes(-1, 0); }
611 void on_actionMoveRight1_triggered() { panAxes(1, 0); }
613 void on_actionMoveDown1_triggered() { panAxes(0, -1); }
615 void on_actionMoveUp100_triggered() { panAxes(0, 100); }
617 void on_actionMoveLeft100_triggered() { panAxes(-100, 0); }
619 void on_actionMoveRight100_triggered() { panAxes(100, 0); }
621 void on_actionMoveDown100_triggered() { panAxes(0, -100); }
626 void on_actionToggleTimeOrigin_triggered();
629 void on_rightButtonBox_accepted();
635 void on_actionAutoScroll_triggered(
bool checked);
641 void on_actionEnableMultiYAxes_triggered(
bool checked);
644 void on_actionAddMarker_triggered();
646 void on_actionMoveMarker_triggered();
648 void on_actionShowPosMarker_triggered();
650 void on_actionShowMarkersDifference_triggered();
652 void on_actionDeleteMarker_triggered();
654 void on_actionDeleteAllMarkers_triggered();
656 void on_actionShowDataPointMarker_triggered();
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
GraphDialog(QWidget &parent, CaptureFile &cf, int colorColumn)
Constructs the dialog and follows theme changes.
Definition graph_dialog.cpp:14
PlotStyles
Defines the available visual styles for plotting data.
Definition graph.h:37
@ psDot
Definition graph.h:45
@ psStepLine
Definition graph.h:40
@ psCircle
Definition graph.h:50
@ psLine
Definition graph.h:38
@ psImpulse
Definition graph.h:42
@ psDotLine
Definition graph.h:39
@ psPlus
Definition graph.h:49
@ psDotStepLine
Definition graph.h:41
@ psCross
Definition graph.h:48
@ psSquare
Definition graph.h:46
@ psDiamond
Definition graph.h:47
static constexpr double default_y_axis_factor_
Definition graph.h:29
A widget representing a marker on a graph or timeline.
Definition marker_dialog.h:21
void addPlot(bool checked, const QString &dfilter, const QString &yfield)
Add a plot with default name, style, colour, and Y-axis factor.
Definition plot_dialog.cpp:609
virtual void addDefaultPlot(bool enabled, bool filtered)
Add one of the two (or four) default plots.
Definition plot_dialog.cpp:628
void scheduleRecalc()
Request a medium-weight value recalculation then replot.
Definition plot_dialog.h:133
void initialize(QWidget &parent, uat_field_t *plot_fields, bool show_default=true)
Finish initialising the dialog after construction.
Definition plot_dialog.cpp:290
void captureFileClosing() override
Handle capture file closing.
Definition plot_dialog.cpp:636
PlotDialog(QWidget &parent, CaptureFile &cf)
Construct a PlotDialog.
Definition plot_dialog.cpp:105
void modelRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
Respond to rows being reordered within the UAT model.
Definition plot_dialog.cpp:766
void goToPacket(int packet, int hf_id)
Emitted when the packet list should navigate to a specific packet.
void modelRowsReset()
Respond to a full UAT model reset.
Definition plot_dialog.cpp:721
virtual QString getHintText(unsigned num_items) const
Return the status-bar hint text for normal operation.
Definition plot_dialog.cpp:910
void setPosMarker(const double xCoord, const int selectMPos, const int posMPos)
Emitted to set the position of a position or difference marker.
virtual QString getYAxisName() const
Return the default Y-axis label for this dialog type.
Definition plot_dialog.cpp:604
void scheduleRetap()
Request a full retap of the capture file.
Definition plot_dialog.h:135
void keyPressEvent(QKeyEvent *event) override
Handle key press events.
Definition plot_dialog.cpp:1486
virtual ~PlotDialog()
Destroy the dialog and its associated resources.
Definition plot_dialog.cpp:333
void reject() override
Handle dialog rejection (Close button / Escape).
Definition plot_dialog.cpp:439
void modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
Respond to data changes in the UAT model.
Definition plot_dialog.cpp:684
void modelRowsInserted(const QModelIndex &parent, int first, int last)
Respond to new rows being inserted into the UAT model.
Definition plot_dialog.cpp:742
void scheduleReplot()
Request a lightweight QCustomPlot replot of existing data.
Definition plot_dialog.h:131
void updateMarker(const int size, const double xCoord, const int)
Emitted to update the size and position of a measurement marker.
virtual QString getFilteredName() const
Return the display-filter-qualified window/tab title suffix.
Definition plot_dialog.cpp:599
void modelRowsRemoved(const QModelIndex &parent, int first, int last)
Respond to rows being removed from the UAT model.
Definition plot_dialog.cpp:752
A single tap-driven data series rendered on a QCustomPlot axis pair.
Definition plot.h:38
A delegate for rendering and editing fields in User Accessible Tables (UAT).
Definition uat_delegate.h:27
UatColumnsPlot
Column indices for the Plot UAT (User Accessible Table) configuration table.
Definition plot_dialog.h:45
@ plotColName
Definition plot_dialog.h:48
@ plotColIdx
Definition plot_dialog.h:47
@ plotColMaxNum
Definition plot_dialog.h:54
@ plotColColor
Definition plot_dialog.h:50
@ plotColDFilter
Definition plot_dialog.h:49
@ plotColEnabled
Definition plot_dialog.h:46
@ plotColYAxisFactor
Definition plot_dialog.h:53
@ plotColYField
Definition plot_dialog.h:52
@ plotColStyle
Definition plot_dialog.h:51
struct _plot_settings_t plot_settings_t
Persisted configuration for a single plot, corresponding to one UAT row.
Persisted configuration for a single plot, corresponding to one UAT row.
Definition plot_dialog.h:64
unsigned group
Definition plot_dialog.h:66
char * name
Definition plot_dialog.h:67
char * dfilter
Definition plot_dialog.h:68
double y_axis_factor
Definition plot_dialog.h:72
char * yfield
Definition plot_dialog.h:71
unsigned color
Definition plot_dialog.h:69
bool enabled
Definition plot_dialog.h:65
uint32_t style
Definition plot_dialog.h:70
struct _uat_field_t uat_field_t
Describes a single editable field within a UAT (User Accessible Table).
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.