10#ifndef IO_GRAPH_DIALOG_H
11#define IO_GRAPH_DIALOG_H
32#include <QItemSelection>
44class QCPAxisTickerDateTime;
151 QString displayFilter = QString(),
153 QString yfield = QString(),
154 bool is_sibling_dialog =
false,
155 const QVector<QString> convFilters = QVector<QString>());
172 void addGraph(
bool checked,
bool asAOT, QString name, QString dfilter,
175 int moving_average,
double yaxisfactor);
189 void addGraph(
bool checked,
bool asAOT, QString dfilter,
197 void addGraph(
bool copy_from_current =
false);
354 virtual QString
getHintText(
unsigned num_items)
const;
369 void modelDataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
370 const QVector<int> &roles);
416 void modelRowsMoved(
const QModelIndex &sourceParent,
int sourceStart,
int sourceEnd,
417 const QModelIndex &destinationParent,
int destinationRow);
452 Ui::IOGraphDialog *ui;
456 QPointer<UatModel> uat_model_;
460 QVector<IOGraph *> ioGraphs_;
463 QCPGraph *base_graph_;
464 QCPItemTracer *tracer_;
465 uint32_t packet_num_;
468 QRubberBand *rubber_band_;
477 const char *type_unit_name_;
479 QSharedPointer<QCPAxisTicker> number_ticker_;
480 QSharedPointer<QCPAxisTickerDateTime> datetime_ticker_;
491 QHash<int, QColor> themeDefaultColors_;
495 void zoomAxes(
bool in);
497 void zoomXAxis(
bool in);
499 void zoomYAxis(
bool in);
505 void panAxes(
int x_pixels,
int y_pixels);
510 void toggleTracerStyle(
bool force_default =
false);
522 QRectF getZoomRanges(QRect zoom_rect);
527 void createIOGraph(
int currentRow);
532 void loadProfileGraphs(
uat_field_t *io_graph_fields);
537 void makeCsv(QTextStream &
stream)
const;
543 bool saveCsv(
const QString &file_name)
const;
548 IOGraph *currentActiveGraph()
const;
554 bool graphIsEnabled(
int row)
const;
560 bool graphAsAOT(
int row)
const;
573 void onThemeChanged();
581 static void applyChanges();
587 void copyFromProfile(QString filename);
590 void updateWidgets();
596 void showContextMenu(
const QPoint &pos);
606 void graphClicked(QMouseEvent *event);
616 void mouseMoved(QMouseEvent *event);
625 void mouseReleased(QMouseEvent *event);
634 void selectedFrameChanged(QList<int> frames);
646 void updateStatistics(
void);
649 void copyAsCsvClicked();
660 void graphUatSelectionChanged(
const QItemSelection &selected,
661 const QItemSelection &deselected);
670 void on_intervalComboBox_currentIndexChanged(
int index);
681 void on_graphUat_currentItemChanged(
const QModelIndex ¤t,
682 const QModelIndex &previous);
688 void on_automaticUpdateCheckBox_toggled(
bool checked);
691 void on_newToolButton_clicked();
693 void on_deleteToolButton_clicked();
695 void on_copyToolButton_clicked();
697 void on_clearToolButton_clicked();
699 void on_moveUpwardsToolButton_clicked();
701 void on_moveDownwardsToolButton_clicked();
707 void on_dragRadioButton_toggled(
bool checked);
713 void on_zoomRadioButton_toggled(
bool checked);
716 void on_actionReset_triggered();
718 void on_actionZoomIn_triggered();
720 void on_actionZoomInX_triggered();
722 void on_actionZoomInY_triggered();
724 void on_actionZoomOut_triggered();
726 void on_actionZoomOutX_triggered();
728 void on_actionZoomOutY_triggered();
730 void on_actionMoveUp10_triggered();
732 void on_actionMoveLeft10_triggered();
734 void on_actionMoveRight10_triggered();
736 void on_actionMoveDown10_triggered();
738 void on_actionMoveUp1_triggered();
740 void on_actionMoveLeft1_triggered();
742 void on_actionMoveRight1_triggered();
744 void on_actionMoveDown1_triggered();
746 void on_actionMoveUp100_triggered();
748 void on_actionMoveLeft100_triggered();
750 void on_actionMoveRight100_triggered();
752 void on_actionMoveDown100_triggered();
757 void on_actionGoToPacket_triggered();
760 void on_actionDragZoom_triggered();
765 void on_actionToggleTimeOrigin_triggered();
768 void on_actionCrosshairs_triggered();
771 void on_buttonBox_helpRequested();
774 void on_buttonBox_accepted();
780 void buttonBoxClicked(QAbstractButton *button);
786 void actionLegendTriggered(
bool checked);
792 void actionTimeOfDayTriggered(
bool checked);
798 void actionLogScaleTriggered(
bool checked);
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
@ 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
Dialog for configuring and displaying I/O throughput graphs.
Definition io_graph_dialog.h:116
virtual QString getFilteredName() const
Return the display-filter-qualified window/tab title suffix.
Definition io_graph_dialog.cpp:495
void goToPacket(int packet_num)
Emitted when the plot should navigate to a specific packet.
void keyPressEvent(QKeyEvent *event)
Handle key press events.
Definition io_graph_dialog.cpp:767
void syncGraphSettings(int row)
Synchronise the QCustomPlot graph object for row with its UAT model row data.
Definition io_graph_dialog.cpp:632
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:703
void scheduleRecalc(bool now=false)
Request a medium-weight value recalculation followed by replot.
Definition io_graph_dialog.cpp:697
static const int DEFAULT_Y_AXIS_FACTOR
Definition io_graph_dialog.h:448
void reject()
Handle dialog rejection (Close button / Escape).
Definition io_graph_dialog.cpp:853
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:505
virtual QString getXAxisName() const
Return the X-axis label for this graph type.
Definition io_graph_dialog.cpp:500
void modelRowsRemoved(const QModelIndex &parent, int first, int last)
Respond to rows being removed from the UAT model.
Definition io_graph_dialog.cpp:1607
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:616
void scheduleReplot(bool now=false)
Request a lightweight replot of already-computed graph data.
Definition io_graph_dialog.cpp:691
void captureFileClosing()
Handle capture file closing.
Definition io_graph_dialog.cpp:746
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 >())
Finish initialising the dialog after construction.
Definition io_graph_dialog.cpp:371
void modelRowsInserted(const QModelIndex &parent, int first, int last)
Respond to new rows being inserted into the UAT model.
Definition io_graph_dialog.cpp:1599
virtual ~IOGraphDialog()
Destroy the dialog.
Definition io_graph_dialog.cpp:461
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:1691
void addGraph(bool checked, bool asAOT, QString name, QString dfilter, QColor color_idx, 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:515
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:510
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:1041
void reloadFields()
Reload the list of available Y-axis field names.
Definition io_graph_dialog.cpp:741
qsizetype graphCount() const
Return the number of graphs currently in the dialog.
Definition io_graph_dialog.cpp:681
void modelRowsReset()
Respond to a full UAT model reset.
Definition io_graph_dialog.cpp:1584
static const int DEFAULT_MOVING_AVERAGE
Definition io_graph_dialog.h:447
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:1616
virtual QString getHintText(unsigned num_items) const
Return the status-bar hint text shown during normal operation.
Definition io_graph_dialog.cpp:1046
void reloadValueUnitFields()
Emitted to request that Y-axis field combo boxes reload their available field lists.
virtual void addDefaultGraph(bool enabled, int idx=0)
Add the default graph(s) for this dialog type.
Definition io_graph_dialog.cpp:608
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
Base class for Wireshark specific dialogs that require interaction with a CaptureFile.
Definition wireshark_dialog.h:38
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
Represents a capture file and its associated metadata.
Definition cfile.h:84
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
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