10 #ifndef IO_GRAPH_DIALOG_H
11 #define IO_GRAPH_DIALOG_H
30 #include <QTextStream>
36 class QAbstractButton;
43 class QCPAxisTickerDateTime;
54 const int max_io_items_ = 1 << 25;
61 enum PlotStyles { psLine, psDotLine, psStepLine, psDotStepLine, psImpulse, psBar, psStackedBar, psDot, psSquare, psDiamond, psCross, psPlus, psCircle };
63 explicit IOGraph(QCustomPlot *parent);
65 QString configError()
const {
return config_err_; }
66 QString name()
const {
return name_; }
67 void setName(
const QString &name);
68 QString filter()
const {
return filter_; }
69 bool setFilter(
const QString &filter);
70 void applyCurrentColor();
71 bool visible()
const {
return visible_; }
72 void setVisible(
bool visible);
73 bool needRetap()
const {
return need_retap_; }
74 void setNeedRetap(
bool retap);
76 void setColor(
const QRgb color);
77 void setPlotStyle(
int style);
78 QString valueUnitLabel()
const;
80 void setValueUnits(
int val_units);
81 QString valueUnitField()
const {
return vu_field_; }
82 void setValueUnitField(
const QString &vu_field);
83 unsigned int movingAveragePeriod()
const {
return moving_avg_period_; }
84 void setInterval(
int interval);
86 bool removeFromLegend();
87 QCPGraph *graph()
const {
return graph_; }
88 QCPBars *bars()
const {
return bars_; }
89 double startOffset()
const;
91 int packetFromTime(
double ts)
const;
92 bool hasItemToShow(
int idx,
double value)
const;
93 double getItemValue(
int idx,
const capture_file *cap_file)
const;
94 int maxInterval ()
const {
return cur_idx_; }
98 unsigned int moving_avg_period_;
99 unsigned int y_axis_factor_;
104 void reloadValueUnitField();
107 void requestReplot();
108 void requestRecalc();
113 static void tapReset(
void *iog_ptr);
115 static void tapDraw(
void *iog_ptr);
117 void removeTapListener();
119 bool showsZero()
const;
121 template<
class DataMap>
double maxValueFromGraphData(
const DataMap &map);
122 template<
class DataMap>
void scaleGraphData(DataMap &map,
int scalar);
124 QCustomPlot *parent_;
127 bool tap_registered_;
133 QString full_filter_;
135 io_graph_item_unit_t val_units_;
143 std::vector<io_graph_item_t> items_;
159 enum UatColumns { colEnabled = 0, colName, colDFilter, colColor, colStyle, colYAxis, colYField, colSMAPeriod, colYAxisFactor, colMaxNum};
161 void addGraph(
bool checked, QString name, QString dfilter, QRgb color_idx, IOGraph::PlotStyles style,
162 io_graph_item_unit_t value_units, QString yfield,
int moving_average,
int yaxisfactor);
163 void addGraph(
bool copy_from_current =
false);
164 void addDefaultGraph(
bool enabled,
int idx = 0);
165 void syncGraphSettings(
int row);
168 void scheduleReplot(
bool now =
false);
169 void scheduleRecalc(
bool now =
false);
170 void scheduleRetap(
bool now =
false);
171 void modelRowsReset();
175 void keyPressEvent(QKeyEvent *event);
179 void goToPacket(
int packet_num);
181 void intervalChanged(
int interval);
182 void reloadValueUnitFields();
185 Ui::IOGraphDialog *ui;
193 QVector<IOGraph*> ioGraphs_;
196 QCPGraph *base_graph_;
197 QCPItemTracer *tracer_;
198 uint32_t packet_num_;
201 QRubberBand *rubber_band_;
211 QSharedPointer<QCPAxisTicker> number_ticker_;
212 QSharedPointer<QCPAxisTickerDateTime> datetime_ticker_;
216 void zoomAxes(
bool in);
217 void zoomXAxis(
bool in);
218 void zoomYAxis(
bool in);
219 void panAxes(
int x_pixels,
int y_pixels);
220 void toggleTracerStyle(
bool force_default =
false);
224 QRectF getZoomRanges(QRect zoom_rect);
225 void createIOGraph(
int currentRow);
226 void loadProfileGraphs();
227 void makeCsv(QTextStream &
stream)
const;
228 bool saveCsv(
const QString &file_name)
const;
229 IOGraph *currentActiveGraph()
const;
230 bool graphIsEnabled(
int row)
const;
233 void copyFromProfile(QString filename);
234 void updateWidgets();
235 void graphClicked(QMouseEvent *event);
236 void mouseMoved(QMouseEvent *event);
237 void mouseReleased(QMouseEvent *event);
238 void selectedFrameChanged(QList<int> frames);
241 void updateStatistics(
void);
242 void copyAsCsvClicked();
244 void on_intervalComboBox_currentIndexChanged(
int index);
245 void on_todCheckBox_toggled(
bool checked);
246 void modelDataChanged(
const QModelIndex &index);
247 void on_graphUat_currentItemChanged(
const QModelIndex ¤t,
const QModelIndex &previous);
249 void on_logCheckBox_toggled(
bool checked);
250 void on_automaticUpdateCheckBox_toggled(
bool checked);
251 void on_enableLegendCheckBox_toggled(
bool checked);
252 void on_newToolButton_clicked();
253 void on_deleteToolButton_clicked();
254 void on_copyToolButton_clicked();
255 void on_clearToolButton_clicked();
256 void on_moveUpwardsToolButton_clicked();
257 void on_moveDownwardsToolButton_clicked();
258 void on_dragRadioButton_toggled(
bool checked);
259 void on_zoomRadioButton_toggled(
bool checked);
260 void on_actionReset_triggered();
261 void on_actionZoomIn_triggered();
262 void on_actionZoomInX_triggered();
263 void on_actionZoomInY_triggered();
264 void on_actionZoomOut_triggered();
265 void on_actionZoomOutX_triggered();
266 void on_actionZoomOutY_triggered();
267 void on_actionMoveUp10_triggered();
268 void on_actionMoveLeft10_triggered();
269 void on_actionMoveRight10_triggered();
270 void on_actionMoveDown10_triggered();
271 void on_actionMoveUp1_triggered();
272 void on_actionMoveLeft1_triggered();
273 void on_actionMoveRight1_triggered();
274 void on_actionMoveDown1_triggered();
275 void on_actionGoToPacket_triggered();
276 void on_actionDragZoom_triggered();
277 void on_actionToggleTimeOrigin_triggered();
278 void on_actionCrosshairs_triggered();
279 void on_buttonBox_helpRequested();
280 void on_buttonBox_accepted();
281 void buttonBoxClicked(QAbstractButton *button);
Definition: capture_event.h:21
Definition: capture_file.h:21
Definition: io_graph_dialog.h:152
Definition: io_graph_dialog.h:57
Definition: uat_delegate.h:24
Definition: uat_model.h:25
Definition: wireshark_dialog.h:35
format_size_units_e
Definition: str_util.h:231
Definition: packet_info.h:44
Definition: epan_dissect.h:28
tap_packet_status
Definition: tap.h:25