10#ifndef IO_GRAPH_DIALOG_H
11#define IO_GRAPH_DIALOG_H
32#include <QItemSelection>
44class QCPAxisTickerDateTime;
153 QString displayFilter = QString(),
155 QString yfield = QString(),
156 bool is_sibling_dialog =
false,
157 const QVector<QString> convFilters = QVector<QString>(),
158 const QVector<QString> convNames = QVector<QString>());
177 void addGraph(
bool checked,
bool asAOT, QString name, QString dfilter,
180 int moving_average,
double yaxisfactor);
194 void addGraph(
bool checked,
bool asAOT, QString dfilter,
202 void addGraph(
bool copy_from_current =
false);
360 virtual QString
getHintText(
unsigned num_items)
const;
375 void modelDataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
376 const QVector<int> &roles);
422 void modelRowsMoved(
const QModelIndex &sourceParent,
int sourceStart,
int sourceEnd,
423 const QModelIndex &destinationParent,
int destinationRow);
458 Ui::IOGraphDialog *ui;
465 QVector<IOGraph *> ioGraphs_;
468 QCPGraph *base_graph_;
469 QCPItemTracer *tracer_;
470 uint32_t packet_num_;
473 QRubberBand *rubber_band_;
482 const char *type_unit_name_;
484 QSharedPointer<QCPAxisTicker> number_ticker_;
485 QSharedPointer<QCPAxisTickerDateTime> datetime_ticker_;
489 void zoomAxes(
bool in);
491 void zoomXAxis(
bool in);
493 void zoomYAxis(
bool in);
499 void panAxes(
int x_pixels,
int y_pixels);
504 void toggleTracerStyle(
bool force_default =
false);
516 QRectF getZoomRanges(QRect zoom_rect);
521 void createIOGraph(
int currentRow);
526 void loadProfileGraphs(
uat_field_t *io_graph_fields);
531 void makeCsv(QTextStream &
stream)
const;
537 bool saveCsv(
const QString &file_name)
const;
542 IOGraph *currentActiveGraph()
const;
548 bool graphIsEnabled(
int row)
const;
554 bool graphAsAOT(
int row)
const;
564 static void applyChanges();
570 void copyFromProfile(QString filename);
579 void showContextMenu(
const QPoint &pos);
589 void graphClicked(QMouseEvent *event);
599 void mouseMoved(QMouseEvent *event);
608 void mouseReleased(QMouseEvent *event);
617 void selectedFrameChanged(QList<int> frames);
629 void updateStatistics(
void);
632 void copyAsCsvClicked();
643 void graphUatSelectionChanged(
const QItemSelection &selected,
644 const QItemSelection &deselected);
653 void on_intervalComboBox_currentIndexChanged(
int index);
664 void on_graphUat_currentItemChanged(
const QModelIndex ¤t,
665 const QModelIndex &previous);
671 void on_automaticUpdateCheckBox_toggled(
bool checked);
674 void on_newToolButton_clicked();
676 void on_deleteToolButton_clicked();
678 void on_copyToolButton_clicked();
680 void on_clearToolButton_clicked();
682 void on_moveUpwardsToolButton_clicked();
684 void on_moveDownwardsToolButton_clicked();
690 void on_dragRadioButton_toggled(
bool checked);
696 void on_zoomRadioButton_toggled(
bool checked);
699 void on_actionReset_triggered();
701 void on_actionZoomIn_triggered();
703 void on_actionZoomInX_triggered();
705 void on_actionZoomInY_triggered();
707 void on_actionZoomOut_triggered();
709 void on_actionZoomOutX_triggered();
711 void on_actionZoomOutY_triggered();
713 void on_actionMoveUp10_triggered();
715 void on_actionMoveLeft10_triggered();
717 void on_actionMoveRight10_triggered();
719 void on_actionMoveDown10_triggered();
721 void on_actionMoveUp1_triggered();
723 void on_actionMoveLeft1_triggered();
725 void on_actionMoveRight1_triggered();
727 void on_actionMoveDown1_triggered();
729 void on_actionMoveUp100_triggered();
731 void on_actionMoveLeft100_triggered();
733 void on_actionMoveRight100_triggered();
735 void on_actionMoveDown100_triggered();
740 void on_actionGoToPacket_triggered();
743 void on_actionDragZoom_triggered();
748 void on_actionToggleTimeOrigin_triggered();
751 void on_actionCrosshairs_triggered();
754 void on_buttonBox_helpRequested();
757 void on_buttonBox_accepted();
763 void buttonBoxClicked(QAbstractButton *button);
769 void actionLegendTriggered(
bool checked);
775 void actionTimeOfDayTriggered(
bool checked);
781 void actionLogScaleTriggered(
bool checked);
787 void actionMATriggered(
bool checked);
struct _capture_file capture_file
Represents a capture file and its associated metadata.
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
@ psStackedBar
Definition graph.h:44
@ psCircle
Definition graph.h:50
@ psBar
Definition graph.h:43
@ 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
virtual QString getFilteredName() const
Return the display-filter-qualified window/tab title suffix.
Definition io_graph_dialog.cpp:498
void goToPacket(int packet_num)
Emitted when the plot should navigate to a specific packet.
void syncGraphSettings(int row)
Synchronise the QCustomPlot graph object for row with its UAT model row data.
Definition io_graph_dialog.cpp:640
virtual void insertGraph(bool enabled)
Add a graph to this dialog type.
Definition io_graph_dialog.cpp:608
void intervalChanged(int interval)
Emitted when the time interval selection changes.
void scheduleRetap(bool now=false)
Request a heavy-weight retap of all packet data.
Definition io_graph_dialog.cpp:711
void scheduleRecalc(bool now=false)
Request a medium-weight value recalculation followed by replot.
Definition io_graph_dialog.cpp:705
static const int DEFAULT_Y_AXIS_FACTOR
Definition io_graph_dialog.h:454
virtual const char * getYAxisName(io_graph_item_unit_t value_units) const
Return the Y-axis label for a given unit.
Definition io_graph_dialog.cpp:508
virtual QString getXAxisName() const
Return the X-axis label for this graph type.
Definition io_graph_dialog.cpp:503
void initialize(QWidget &parent, uat_field_t *io_graph_fields, QString displayFilter=QString(), io_graph_item_unit_t value_units=IOG_ITEM_UNIT_PACKETS, QString yfield=QString(), bool is_sibling_dialog=false, const QVector< QString > convFilters=QVector< QString >(), const QVector< QString > convNames=QVector< QString >())
Finish initialising the dialog after construction.
Definition io_graph_dialog.cpp:369
void modelRowsRemoved(const QModelIndex &parent, int first, int last)
Respond to rows being removed from the UAT model.
Definition io_graph_dialog.cpp:1571
virtual int getYAxisValue(const QString &data)
Parse a Y-axis value string from the UAT and return its int value.
Definition io_graph_dialog.cpp:624
void scheduleReplot(bool now=false)
Request a lightweight replot of already-computed graph data.
Definition io_graph_dialog.cpp:699
void keyPressEvent(QKeyEvent *event) override
Handle key press events.
Definition io_graph_dialog.cpp:743
void captureFileClosing() override
Handle capture file closing.
Definition io_graph_dialog.cpp:722
void modelRowsInserted(const QModelIndex &parent, int first, int last)
Respond to new rows being inserted into the UAT model.
Definition io_graph_dialog.cpp:1563
virtual ~IOGraphDialog()
Destroy the dialog.
Definition io_graph_dialog.cpp:464
void modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
Respond to data changes in the UAT model.
Definition io_graph_dialog.cpp:1642
virtual QString getYFieldName(io_graph_item_unit_t value_units, const QString &yfield) const
Return the effective Y-axis field expression to use.
Definition io_graph_dialog.cpp:513
void recalcGraphData(capture_file *cap_file)
Emitted to trigger a full recalculation of all graph data.
virtual QString getNoDataHint() const
Return the hint text shown when no data is available.
Definition io_graph_dialog.cpp:1017
void reloadFields()
Reload the list of available Y-axis field names.
Definition io_graph_dialog.cpp:717
void addGraph(bool checked, bool asAOT, QString name, QString dfilter, IOGraph::PlotStyles style, io_graph_item_unit_t value_units, QString yfield, int moving_average, double yaxisfactor)
Add a fully-specified graph to the dialog.
Definition io_graph_dialog.cpp:518
qsizetype graphCount() const
Return the number of graphs currently in the dialog.
Definition io_graph_dialog.cpp:689
void reject() override
Handle dialog rejection (Close button / Escape).
Definition io_graph_dialog.cpp:829
void modelRowsReset()
Respond to a full UAT model reset.
Definition io_graph_dialog.cpp:1548
static const int DEFAULT_MOVING_AVERAGE
Definition io_graph_dialog.h:453
void modelRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
Respond to rows being moved within the UAT model.
Definition io_graph_dialog.cpp:1580
virtual QString getHintText(unsigned num_items) const
Return the status-bar hint text shown during normal operation.
Definition io_graph_dialog.cpp:1022
void reloadValueUnitFields()
Emitted to request that Y-axis field combo boxes reload their available field lists.
IOGraphDialog(QWidget &parent, CaptureFile &cf, const char *type_unit_name)
Construct an IOGraphDialog.
Definition io_graph_dialog.cpp:219
Represents an individual input/output graph, handling tapping, packet processing, and data scaling.
Definition io_graph.h:66
A delegate for rendering and editing fields in User Accessible Tables (UAT).
Definition uat_delegate.h:27
virtual void updateWidgets()
Updates the state and contents of the dialog's widgets.
Definition wireshark_dialog.cpp:92
struct _io_graph_settings_t io_graph_settings_t
Persisted configuration for a single I/O Graph plot, corresponding to one UAT row.
UatColumnsIOG
Column indices for the I/O Graph UAT (User Accessible Table) configuration table.
Definition io_graph_dialog.h:68
@ colYAxis
Definition io_graph_dialog.h:74
@ colYField
Definition io_graph_dialog.h:75
@ colColor
Definition io_graph_dialog.h:72
@ colAOT
Definition io_graph_dialog.h:78
@ colStyle
Definition io_graph_dialog.h:73
@ colName
Definition io_graph_dialog.h:70
@ colMaxNum
Definition io_graph_dialog.h:79
@ colDFilter
Definition io_graph_dialog.h:71
@ colYAxisFactor
Definition io_graph_dialog.h:77
@ colSMAPeriod
Definition io_graph_dialog.h:76
@ colEnabled
Definition io_graph_dialog.h:69
io_graph_item_unit_t
Selects the Y-axis value unit or aggregate calculation mode for an I/O graph plot.
Definition io_graph_item.h:29
@ IOG_ITEM_UNIT_PACKETS
Definition io_graph_item.h:31
Persisted configuration for a single I/O Graph plot, corresponding to one UAT row.
Definition io_graph_dialog.h:49
uint32_t style
Definition io_graph_dialog.h:55
char * name
Definition io_graph_dialog.h:52
char * dfilter
Definition io_graph_dialog.h:53
char * yfield
Definition io_graph_dialog.h:57
unsigned color
Definition io_graph_dialog.h:54
bool asAOT
Definition io_graph_dialog.h:51
bool enabled
Definition io_graph_dialog.h:50
uint32_t sma_period
Definition io_graph_dialog.h:58
double y_axis_factor
Definition io_graph_dialog.h:59
uint32_t yaxis
Definition io_graph_dialog.h:56
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.