Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
io_graph_dialog.h
Go to the documentation of this file.
1
10#ifndef IO_GRAPH_DIALOG_H
11#define IO_GRAPH_DIALOG_H
12
13#include <config.h>
14#include "io_graph.h"
15
16#include <epan/epan_dissect.h>
17#include <epan/prefs.h>
18
19#include <wsutil/str_util.h>
20
21#include <ui/preference_utils.h>
22#include <ui/io_graph_item.h>
25
26#include "wireshark_dialog.h"
27
28#include <QPointer>
29#include <QMenu>
30#include <QTextStream>
31#include <QItemSelection>
32
33#include <vector>
34
35class QRubberBand;
36class QTimer;
37class QAbstractButton;
39
40class QCPGraph;
41class QCPItemTracer;
42class QCPAxisTicker;
43class QCPAxisTickerDateTime;
44
45/* define I/O Graph specific UAT columns */
46enum UatColumnsIOG {colEnabled = 0, colName, colDFilter, colColor, colStyle, colYAxis, colYField, colSMAPeriod, colYAxisFactor, colAOT, colMaxNum};
47
48namespace Ui {
49class IOGraphDialog;
50}
51
53{
54 Q_OBJECT
55
56public:
57 explicit IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFilter = QString(),
58 io_graph_item_unit_t value_units = IOG_ITEM_UNIT_PACKETS,
59 QString yfield = QString(),
60 bool is_sibling_dialog = false,
61 const QVector<QString> convFilters = QVector<QString>() );
63
64 void addGraph(bool checked, bool asAOT, QString name, QString dfilter, QRgb color_idx, IOGraph::PlotStyles style,
65 io_graph_item_unit_t value_units, QString yfield, int moving_average, int yaxisfactor);
66 void addGraph(bool checked, bool asAOT, QString dfilter, io_graph_item_unit_t value_units, QString yfield);
67 void addGraph(bool copy_from_current = false);
68 void addDefaultGraph(bool enabled, int idx = 0);
69 void syncGraphSettings(int row);
70 qsizetype graphCount() const;
71
72public slots:
73 void scheduleReplot(bool now = false);
74 void scheduleRecalc(bool now = false);
75 void scheduleRetap(bool now = false);
76 void reloadFields();
77
78protected:
79 void captureFileClosing();
80 void keyPressEvent(QKeyEvent *event);
81 void reject();
82
83protected slots:
84 void modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
85 void modelRowsReset();
86 void modelRowsInserted(const QModelIndex &parent, int first, int last);
87 void modelRowsRemoved(const QModelIndex &parent, int first, int last);
88 void modelRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow);
89
90signals:
91 void goToPacket(int packet_num);
92 void recalcGraphData(capture_file *cap_file);
93 void intervalChanged(int interval);
94 void reloadValueUnitFields();
95
96private:
97 Ui::IOGraphDialog *ui;
98 CopyFromProfileButton *copy_profile_bt_;
99
100 //Model and delegate were chosen over UatFrame because add/remove/copy
101 //buttons would need realignment (UatFrame has its own)
102 QPointer<UatModel> uat_model_;
103 UatDelegate *uat_delegate_;
104
105 // XXX - This needs to stay synced with UAT index
106 QVector<IOGraph*> ioGraphs_;
107
108 QString hint_err_;
109 QCPGraph *base_graph_;
110 QCPItemTracer *tracer_;
111 uint32_t packet_num_;
112 nstime_t start_time_;
113 bool mouse_drags_;
114 QRubberBand *rubber_band_;
115 QPoint rb_origin_;
116 QMenu ctx_menu_;
117 QTimer *stat_timer_;
118 bool need_replot_; // Light weight: tell QCP to replot existing data
119 bool need_recalc_; // Medium weight: recalculate values, then replot
120 bool need_retap_; // Heavy weight: re-read packet data
121 bool auto_axes_;
122 int precision_;
123
124 QSharedPointer<QCPAxisTicker> number_ticker_;
125 QSharedPointer<QCPAxisTickerDateTime> datetime_ticker_;
126
127
128// void fillGraph();
129 void zoomAxes(bool in);
130 void zoomXAxis(bool in);
131 void zoomYAxis(bool in);
132 void panAxes(int x_pixels, int y_pixels);
133 void toggleTracerStyle(bool force_default = false);
134 void getGraphInfo();
135 void updateHint();
136 void updateLegend();
137 QRectF getZoomRanges(QRect zoom_rect);
138 void createIOGraph(int currentRow);
139 void loadProfileGraphs();
140 void makeCsv(QTextStream &stream) const;
141 bool saveCsv(const QString &file_name) const;
142 IOGraph *currentActiveGraph() const;
143 bool graphIsEnabled(int row) const;
144 bool graphAsAOT(int row) const;
145
146private slots:
147 static void applyChanges();
148
149 void copyFromProfile(QString filename);
150 void updateWidgets();
151 void showContextMenu(const QPoint &pos);
152 void graphClicked(QMouseEvent *event);
153 void mouseMoved(QMouseEvent *event);
154 void mouseReleased(QMouseEvent *event);
155 void selectedFrameChanged(QList<int> frames);
156 void moveLegend();
157
158 void resetAxes();
159 void updateStatistics(void);
160 void copyAsCsvClicked();
161
162 void graphUatSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
163 void on_intervalComboBox_currentIndexChanged(int index);
164 void on_graphUat_currentItemChanged(const QModelIndex &current, const QModelIndex &previous);
165
166 void on_automaticUpdateCheckBox_toggled(bool checked);
167 void on_newToolButton_clicked();
168 void on_deleteToolButton_clicked();
169 void on_copyToolButton_clicked();
170 void on_clearToolButton_clicked();
171 void on_moveUpwardsToolButton_clicked();
172 void on_moveDownwardsToolButton_clicked();
173 void on_dragRadioButton_toggled(bool checked);
174 void on_zoomRadioButton_toggled(bool checked);
175 void on_actionReset_triggered();
176 void on_actionZoomIn_triggered();
177 void on_actionZoomInX_triggered();
178 void on_actionZoomInY_triggered();
179 void on_actionZoomOut_triggered();
180 void on_actionZoomOutX_triggered();
181 void on_actionZoomOutY_triggered();
182 void on_actionMoveUp10_triggered();
183 void on_actionMoveLeft10_triggered();
184 void on_actionMoveRight10_triggered();
185 void on_actionMoveDown10_triggered();
186 void on_actionMoveUp1_triggered();
187 void on_actionMoveLeft1_triggered();
188 void on_actionMoveRight1_triggered();
189 void on_actionMoveDown1_triggered();
190 void on_actionGoToPacket_triggered();
191 void on_actionDragZoom_triggered();
192 void on_actionToggleTimeOrigin_triggered();
193 void on_actionCrosshairs_triggered();
194 void on_buttonBox_helpRequested();
195 void on_buttonBox_accepted();
196 void buttonBoxClicked(QAbstractButton *button);
197 void actionLegendTriggered(bool checked);
198 void actionTimeOfDayTriggered(bool checked);
199 void actionLogScaleTriggered(bool checked);
200};
201
202#endif // IO_GRAPH_DIALOG_H
Definition capture_file.h:21
Definition copy_from_profile_button.h:21
Definition io_graph_dialog.h:53
void captureFileClosing()
Called when the capture file is about to close. This can be used to disconnect taps and similar actio...
Definition io_graph_dialog.cpp:817
Definition io_graph.h:63
Definition uat_delegate.h:24
Definition wireshark_dialog.h:35
Definition cfile.h:67
Definition nstime.h:26
Definition stream.c:41