10 #ifndef IO_GRAPH_DIALOG_H 11 #define IO_GRAPH_DIALOG_H 17 #include "epan/epan_dissect.h" 19 #include "ui/io_graph_item.h" 21 #include "wireshark_dialog.h" 23 #include <ui/qt/models/uat_model.h> 24 #include <ui/qt/models/uat_delegate.h> 28 #include <QTextStream> 39 const int max_io_items_ = 250000;
46 enum PlotStyles { psLine, psImpulse, psBar, psStackedBar, psDot, psSquare, psDiamond };
50 const QString configError() {
return config_err_; }
51 const QString name() {
return name_; }
52 void setName(
const QString &name);
53 const QString filter() {
return filter_; }
54 void setFilter(
const QString &filter);
55 void applyCurrentColor();
56 bool visible() {
return visible_; }
57 void setVisible(
bool visible);
59 void setColor(
const QRgb color);
60 void setPlotStyle(
int style);
61 const QString valueUnitLabel();
62 void setValueUnits(
int val_units);
63 const QString valueUnitField() {
return vu_field_; }
64 void setValueUnitField(
const QString &vu_field);
65 unsigned int movingAveragePeriod() {
return moving_avg_period_; }
66 void setInterval(
int interval);
68 bool removeFromLegend();
70 QCPBars *bars() {
return bars_; }
72 int packetFromTime(
double ts);
73 double getItemValue(
int idx,
const capture_file *cap_file)
const;
74 int maxInterval ()
const {
return cur_idx_; }
75 QString scaledValueUnit()
const {
return scaled_value_unit_; }
79 unsigned int moving_avg_period_;
82 void recalcGraphData(
capture_file *cap_file,
bool enable_scaling);
84 void reloadValueUnitField();
93 static void tapReset(
void *iog_ptr);
95 static void tapDraw(
void *iog_ptr);
97 void calculateScaledValueUnit();
98 template<
class DataMap>
double maxValueFromGraphData(
const DataMap &map);
99 template<
class DataMap>
void scaleGraphData(DataMap &map,
int scalar);
109 io_graph_item_unit_t val_units_;
114 QString scaled_value_unit_;
134 enum UatColumns { colEnabled = 0, colName, colDFilter, colColor, colStyle, colYAxis, colYField, colSMAPeriod, colMaxNum};
136 void addGraph(
bool checked, QString name, QString dfilter,
int color_idx, IOGraph::PlotStyles style,
137 io_graph_item_unit_t value_units, QString yfield,
int moving_average);
138 void addGraph(
bool copy_from_current =
false);
139 void addDefaultGraph(
bool enabled,
int idx = 0);
140 void syncGraphSettings(
int row);
143 void scheduleReplot(
bool now =
false);
144 void scheduleRecalc(
bool now =
false);
145 void scheduleRetap(
bool now =
false);
149 void keyPressEvent(QKeyEvent *event);
153 void goToPacket(
int packet_num);
154 void recalcGraphData(
capture_file *cap_file,
bool enable_scaling);
155 void intervalChanged(
int interval);
156 void reloadValueUnitFields();
167 QVector<IOGraph*> ioGraphs_;
175 QRubberBand *rubber_band_;
186 void zoomAxes(
bool in);
187 void zoomXAxis(
bool in);
188 void zoomYAxis(
bool in);
189 void panAxes(
int x_pixels,
int y_pixels);
190 void toggleTracerStyle(
bool force_default =
false);
193 QRectF getZoomRanges(QRect zoom_rect);
194 void createIOGraph(
int currentRow);
195 void loadProfileGraphs();
196 void makeCsv(QTextStream &
stream)
const;
197 bool saveCsv(
const QString &file_name)
const;
198 IOGraph *currentActiveGraph()
const;
199 bool graphIsEnabled(
int row)
const;
202 void updateWidgets();
203 void graphClicked(QMouseEvent *event);
204 void mouseMoved(QMouseEvent *event);
205 void mouseReleased(QMouseEvent *event);
208 void updateStatistics(
void);
209 void copyAsCsvClicked();
211 void on_intervalComboBox_currentIndexChanged(
int index);
212 void on_todCheckBox_toggled(
bool checked);
213 void modelDataChanged(
const QModelIndex &index);
214 void on_graphUat_currentItemChanged(
const QModelIndex ¤t,
const QModelIndex &previous);
216 void on_resetButton_clicked();
217 void on_logCheckBox_toggled(
bool checked);
218 void on_newToolButton_clicked();
219 void on_deleteToolButton_clicked();
220 void on_copyToolButton_clicked();
221 void on_dragRadioButton_toggled(
bool checked);
222 void on_zoomRadioButton_toggled(
bool checked);
223 void on_actionReset_triggered();
224 void on_actionZoomIn_triggered();
225 void on_actionZoomInX_triggered();
226 void on_actionZoomInY_triggered();
227 void on_actionZoomOut_triggered();
228 void on_actionZoomOutX_triggered();
229 void on_actionZoomOutY_triggered();
230 void on_actionMoveUp10_triggered();
231 void on_actionMoveLeft10_triggered();
232 void on_actionMoveRight10_triggered();
233 void on_actionMoveDown10_triggered();
234 void on_actionMoveUp1_triggered();
235 void on_actionMoveLeft1_triggered();
236 void on_actionMoveRight1_triggered();
237 void on_actionMoveDown1_triggered();
238 void on_actionGoToPacket_triggered();
239 void on_actionDragZoom_triggered();
240 void on_actionToggleTimeOrigin_triggered();
241 void on_actionCrosshairs_triggered();
242 void on_buttonBox_helpRequested();
243 void on_buttonBox_accepted();
246 #endif // IO_GRAPH_DIALOG_H Definition: io_graph_item.h:36
Definition: packet_info.h:44
Definition: ui_about_dialog.h:291
A plottable representing a bar chart in a plot.
Definition: qcustomplot.h:2825
Definition: uat_model.h:24
Definition: io_graph_dialog.h:42
A plottable representing a graph in a plot.
Definition: qcustomplot.h:2492
Item that sticks to QCPGraph data points.
Definition: qcustomplot.h:3635
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:1682
Definition: capture_event.h:19
Definition: uat_delegate.h:23
Definition: io_graph_dialog.h:126
Definition: ui_io_graph_dialog.h:416
Definition: epan_dissect.h:28
Definition: wireshark_dialog.h:32
Definition: capture_file.h:22