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;
193 void addPlot(
bool checked,
const QString& name,
const QString& dfilter, QColor color_idx,
205 void modelDataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
206 const QVector<int> &roles);
237 void modelRowsMoved(
const QModelIndex &sourceParent,
int sourceStart,
int sourceEnd,
238 const QModelIndex &destinationParent,
int destinationRow);
262 void setPosMarker(
const double xCoord,
const int selectMPos,
const int posMPos);
275 void createPlot(
int currentRow);
281 void syncPlotSettings(
int row);
287 int getLastPlotIdx();
294 bool graphIsEnabled(
int row)
const;
300 Plot *currentActiveGraph()
const;
309 void updateLegendPos();
319 void doZoom(
bool in,
bool y);
322 void zoomAxes(
bool in);
324 void zoomXAxis(
bool in);
326 void zoomYAxis(
bool in);
333 void panAxes(
int x_pixels,
int y_pixels);
336 void updateXAxisLabel();
344 QRectF getZoomRanges(QRect zoom_rect, QCPAxisRect **matchedAxisRect =
nullptr);
351 bool makeCsv(QTextStream &
stream)
const;
358 QCPAxisRect *getAxisRect(
int idx);
364 void removeExcessPlots();
367 void setTracerColor();
374 QCPAxisRect *axisRectFromPos(
const QPoint &pos);
379 void addMarkerDifference();
386 int visibleMarker(
const bool first =
true)
const;
394 Marker *addMarker(
const bool isPosMarker);
400 void drawMarker(
const Marker *marker);
406 void addDataPointsMarkers();
409 void updateFirstAxisRectHeight();
414 void recreateMultiValueAxes();
420 QList<QCPAxisRect *> axisRects()
const;
423 void autoScroll()
const;
426 QPushButton *copy_bt_;
430 QPointer<UatModel> uat_model_;
434 QVector<Plot *> plots_;
437 QCPGraph *base_graph_;
438 QCPItemTracer *tracer_;
439 uint32_t packet_num_;
441 QRubberBand *rubber_band_;
445 QCPMarginGroup *margin_group_;
446 Qt::Alignment legend_alignment_;
452 double last_right_clicked_pos_;
463 QHash<int, QColor> themeDefaultColors_;
474 void onThemeChanged();
479 static void applyChanges();
485 void updateStatistics();
494 void copyFromProfile(
const QString &filename);
497 void copyAsCsvClicked();
503 void showContextMenu(
const QPoint &pos);
513 void graphClicked(QMouseEvent *event);
519 void mouseMoved(QMouseEvent *event);
525 void mouseReleased(QMouseEvent *event);
531 void selectedFrameChanged(
const QList<int> &frames);
538 void plotUatSelectionChanged(
const QItemSelection &selected,
539 const QItemSelection &deselected);
545 void on_leftButtonBox_clicked(QAbstractButton *button);
551 void on_actionLegend_triggered(
bool checked);
557 void on_actionLogScale_triggered(
bool checked);
563 void on_actionCrosshairs_triggered(
bool checked);
569 void on_actionTopAxis_triggered(
bool checked);
575 void on_automaticUpdateCheckBox_toggled(
bool checked);
582 void on_plotUat_currentItemChanged(
const QModelIndex ¤t,
583 const QModelIndex &previous);
586 void on_actionGoToPacket_triggered();
589 void on_newToolButton_clicked();
591 void on_deleteToolButton_clicked();
593 void on_copyToolButton_clicked();
595 void on_clearToolButton_clicked();
597 void on_moveUpwardsToolButton_clicked();
599 void on_moveDownwardsToolButton_clicked();
602 void on_rightButtonBox_helpRequested();
605 void on_actionReset_triggered() { resetAxes(); }
607 void on_actionZoomIn_triggered() { zoomAxes(
true); }
609 void on_actionZoomInX_triggered() { zoomXAxis(
true); }
611 void on_actionZoomInY_triggered() { zoomYAxis(
true); }
613 void on_actionZoomOut_triggered() { zoomAxes(
false); }
615 void on_actionZoomOutX_triggered() { zoomXAxis(
false); }
617 void on_actionZoomOutY_triggered() { zoomYAxis(
false); }
619 void on_actionMoveUp10_triggered() { panAxes(0, 10); }
621 void on_actionMoveLeft10_triggered() { panAxes(-10, 0); }
623 void on_actionMoveRight10_triggered() { panAxes(10, 0); }
625 void on_actionMoveDown10_triggered() { panAxes(0, -10); }
627 void on_actionMoveUp1_triggered() { panAxes(0, 1); }
629 void on_actionMoveLeft1_triggered() { panAxes(-1, 0); }
631 void on_actionMoveRight1_triggered() { panAxes(1, 0); }
633 void on_actionMoveDown1_triggered() { panAxes(0, -1); }
635 void on_actionMoveUp100_triggered() { panAxes(0, 100); }
637 void on_actionMoveLeft100_triggered() { panAxes(-100, 0); }
639 void on_actionMoveRight100_triggered() { panAxes(100, 0); }
641 void on_actionMoveDown100_triggered() { panAxes(0, -100); }
646 void on_actionToggleTimeOrigin_triggered();
649 void on_rightButtonBox_accepted();
655 void on_actionAutoScroll_triggered(
bool checked);
661 void on_actionEnableMultiYAxes_triggered(
bool checked);
664 void on_actionAddMarker_triggered();
666 void on_actionMoveMarker_triggered();
668 void on_actionShowPosMarker_triggered();
670 void on_actionShowMarkersDifference_triggered();
672 void on_actionDeleteMarker_triggered();
674 void on_actionDeleteAllMarkers_triggered();
676 void on_actionShowDataPointMarker_triggered();
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
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
Dialog for configuring and displaying packet field value plots.
Definition plot_dialog.h:96
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:632
virtual void addDefaultPlot(bool enabled, bool filtered)
Add one of the two (or four) default plots.
Definition plot_dialog.cpp:652
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:281
void captureFileClosing() override
Handle capture file closing.
Definition plot_dialog.cpp:661
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:791
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:746
virtual QString getHintText(unsigned num_items) const
Return the status-bar hint text for normal operation.
Definition plot_dialog.cpp:949
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:627
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:1538
virtual ~PlotDialog()
Destroy the dialog and its associated resources.
Definition plot_dialog.cpp:324
void reject() override
Handle dialog rejection (Close button / Escape).
Definition plot_dialog.cpp:429
void modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
Respond to data changes in the UAT model.
Definition plot_dialog.cpp:709
void modelRowsInserted(const QModelIndex &parent, int first, int last)
Respond to new rows being inserted into the UAT model.
Definition plot_dialog.cpp:767
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:622
void modelRowsRemoved(const QModelIndex &parent, int first, int last)
Respond to rows being removed from the UAT model.
Definition plot_dialog.cpp:777
A single tap-driven data series rendered on a QCustomPlot axis pair.
Definition plot.h:35
A delegate for rendering and editing fields in User Accessible Tables (UAT).
Definition uat_delegate.h:27
Base class for Wireshark specific dialogs that require interaction with a CaptureFile.
Definition wireshark_dialog.h:38
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
Describes a single editable field within a UAT (User Accessible Table).
Definition uat.h:234
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33