Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Public Attributes | List of all members
IOGraph Class Reference

Represents an individual input/output graph, handling tapping, packet processing, and data scaling. More...

#include <io_graph.h>

Inheritance diagram for IOGraph:
Graph

Public Slots

void recalcGraphData (capture_file *cap_file)
 Recalculates the graph plotting data based on cached tap data.
 
void captureEvent (const CaptureEvent &e)
 Handles system capture events.
 
void reloadValueUnitField ()
 Reloads and re-evaluates the value unit field setting.
 

Signals

void requestReplot ()
 Signal emitted to request a UI redraw of the parent plot.
 
void requestRecalc ()
 Signal emitted to request a recalculation of the graph data.
 
void requestRetap ()
 Signal emitted to request a full retap of the packet data.
 

Public Member Functions

 IOGraph (QCustomPlot *parent, const char *type_unit_name)
 Constructs a new IOGraph.
 
 ~IOGraph ()
 Destroys the IOGraph.
 
QString configError () const
 Retrieves the current configuration error string, if any.
 
void setAOT (bool asAOT)
 Sets whether the graph displays values as an Average Over Time (AOT).
 
bool getAOT () const
 Checks if the graph displays values as an Average Over Time (AOT).
 
QString filter () const
 Retrieves the active filter string for this graph.
 
bool setFilter (const QString &filter)
 Sets the filter string for this graph.
 
void setVisible (bool visible)
 Sets the visibility of the graph.
 
bool needRetap () const
 Checks if changing the graph configuration requires a packet retap.
 
void setNeedRetap (bool retap)
 Manually flags whether a retap is required.
 
void setPlotStyle (PlotStyles style)
 Sets the visual plotting style for this specific IO graph.
 
QString valueUnitLabel () const
 Generates the label for the value (Y-axis) units.
 
format_size_units_e formatUnits () const
 Retrieves the size formatting enumerator for the Y-axis units.
 
io_graph_item_unit_t valueUnits () const
 Retrieves the core IO graph item unit type.
 
void setValueUnits (int val_units)
 Sets the core IO graph item unit type.
 
QString valueUnitField () const
 Retrieves the field used to calculate the value units (e.g., specific protocol field).
 
void setValueUnitField (const QString &vu_field)
 Sets the field used to calculate the value units.
 
nstime_t startTime () const
 Retrieves the starting time of the graph data.
 
unsigned int movingAveragePeriod () const
 Retrieves the period used for moving average calculations.
 
void setInterval (int interval)
 Sets the time interval for data bucketing.
 
int packetFromTime (double ts) const
 Determines the packet number closest to a specific timestamp.
 
bool hasItemToShow (int idx, double value) const
 Checks if a specific data item index has a valid value to display.
 
double getItemValue (int idx, const capture_file *cap_file) const
 Calculates or retrieves the formatted value for a specific data item index.
 
int maxInterval () const
 Retrieves the maximum populated interval index.
 
void clearAllData ()
 Clears all cached plotting and tap data.
 
- Public Member Functions inherited from Graph
 Graph (QCustomPlot *parent, QCPAxis *keyAxis=nullptr, QCPAxis *valueAxis=nullptr)
 Constructs a new Graph.
 
 ~Graph ()
 Destroys the Graph.
 
QString name () const
 Retrieves the name of the graph.
 
void setName (const QString &name)
 Sets the name of the graph.
 
QRgb color () const
 Retrieves the color of the graph.
 
void setColor (const QRgb color)
 Sets the color of the graph.
 
bool visible () const
 Checks if the graph is currently visible.
 
void setVisible (bool visible)
 Sets the visibility of the graph.
 
double yAxisFactor () const
 Retrieves the scaling factor for the Y-axis.
 
void setYAxisFactor (double y_axis_factor)
 Sets the scaling factor for the Y-axis.
 
QCPGraph * graph () const
 Retrieves the underlying QCPGraph object.
 
QCPBars * bars () const
 Retrieves the underlying QCPBars object.
 
bool addToLegend ()
 Adds the graph to the parent plot's legend.
 
bool setPlotStyle (PlotStyles style)
 Sets the visual style of the plot.
 

Public Attributes

unsigned int moving_avg_period_
 
- Public Attributes inherited from Graph
const qreal graph_line_width_ = 1.0
 

Additional Inherited Members

- Public Types inherited from Graph
enum  PlotStyles {
  psLine , psDotLine , psStepLine , psDotStepLine ,
  psImpulse , psBar , psStackedBar , psDot ,
  psSquare , psDiamond , psCross , psPlus ,
  psCircle
}
 Defines the available visual styles for plotting data. More...
 
- Static Public Attributes inherited from Graph
static constexpr double default_y_axis_factor_ = 1
 
- Protected Member Functions inherited from Graph
void applyCurrentColor ()
 Applies the currently set color to the underlying graphical elements.
 
bool removeFromLegend ()
 Removes the graph from the parent plot's legend.
 
void clearAllData ()
 Clears all data points currently loaded into the graph.
 
- Protected Attributes inherited from Graph
QCustomPlot * parent_
 
QCPGraph * graph_
 
QCPBars * bars_
 
QString name_
 
QBrush color_
 
bool visible_
 
double y_axis_factor_
 

Detailed Description

Represents an individual input/output graph, handling tapping, packet processing, and data scaling.

Constructor & Destructor Documentation

◆ IOGraph()

IOGraph::IOGraph ( QCustomPlot *  parent,
const char *  type_unit_name 
)
explicit

Constructs a new IOGraph.

Parameters
parentThe parent QCustomPlot widget.
type_unit_nameThe name string representing the graph's unit type.

Member Function Documentation

◆ captureEvent

void IOGraph::captureEvent ( const CaptureEvent e)
slot

Handles system capture events.

Parameters
eThe capture event.

◆ configError()

QString IOGraph::configError ( ) const
inline

Retrieves the current configuration error string, if any.

Returns
The configuration error string.

◆ filter()

QString IOGraph::filter ( ) const
inline

Retrieves the active filter string for this graph.

Returns
The filter string.

◆ formatUnits()

format_size_units_e IOGraph::formatUnits ( ) const

Retrieves the size formatting enumerator for the Y-axis units.

Returns
The format_size_units_e value.

◆ getAOT()

bool IOGraph::getAOT ( ) const
inline

Checks if the graph displays values as an Average Over Time (AOT).

Returns
True if AOT is enabled, false otherwise.

◆ getItemValue()

double IOGraph::getItemValue ( int  idx,
const capture_file cap_file 
) const

Calculates or retrieves the formatted value for a specific data item index.

Parameters
idxThe item index.
cap_fileThe capture file context.
Returns
The calculated double value.

◆ hasItemToShow()

bool IOGraph::hasItemToShow ( int  idx,
double  value 
) const

Checks if a specific data item index has a valid value to display.

Parameters
idxThe item index.
valueThe value associated with the index.
Returns
True if it should be shown, false otherwise.

◆ maxInterval()

int IOGraph::maxInterval ( ) const
inline

Retrieves the maximum populated interval index.

Returns
The maximum interval index.

◆ movingAveragePeriod()

unsigned int IOGraph::movingAveragePeriod ( ) const
inline

Retrieves the period used for moving average calculations.

Returns
The moving average period integer.

◆ needRetap()

bool IOGraph::needRetap ( ) const
inline

Checks if changing the graph configuration requires a packet retap.

Returns
True if a retap is needed, false otherwise.

◆ packetFromTime()

int IOGraph::packetFromTime ( double  ts) const

Determines the packet number closest to a specific timestamp.

Parameters
tsThe timestamp to search for.
Returns
The closest packet number.

◆ recalcGraphData

void IOGraph::recalcGraphData ( capture_file cap_file)
slot

Recalculates the graph plotting data based on cached tap data.

Parameters
cap_fileThe capture file context.

◆ setAOT()

void IOGraph::setAOT ( bool  asAOT)

Sets whether the graph displays values as an Average Over Time (AOT).

Parameters
asAOTTrue to enable AOT interpretation.

◆ setFilter()

bool IOGraph::setFilter ( const QString &  filter)

Sets the filter string for this graph.

Parameters
filterThe new filter string.
Returns
True if the filter was successfully applied.

◆ setInterval()

void IOGraph::setInterval ( int  interval)

Sets the time interval for data bucketing.

Parameters
intervalThe interval in milliseconds.

◆ setNeedRetap()

void IOGraph::setNeedRetap ( bool  retap)

Manually flags whether a retap is required.

Parameters
retapTrue to flag for a retap.

◆ setPlotStyle()

void IOGraph::setPlotStyle ( PlotStyles  style)

Sets the visual plotting style for this specific IO graph.

Parameters
styleThe desired PlotStyles value.

◆ setValueUnitField()

void IOGraph::setValueUnitField ( const QString &  vu_field)

Sets the field used to calculate the value units.

Parameters
vu_fieldThe new value unit field string.

◆ setValueUnits()

void IOGraph::setValueUnits ( int  val_units)

Sets the core IO graph item unit type.

Parameters
val_unitsThe new io_graph_item_unit_t integer value.

◆ setVisible()

void IOGraph::setVisible ( bool  visible)

Sets the visibility of the graph.

Parameters
visibleTrue to show the graph, false to hide it.

◆ startTime()

nstime_t IOGraph::startTime ( ) const

Retrieves the starting time of the graph data.

Returns
The nstime_t structure representing the start time.

◆ valueUnitField()

QString IOGraph::valueUnitField ( ) const
inline

Retrieves the field used to calculate the value units (e.g., specific protocol field).

Returns
The value unit field string.

◆ valueUnitLabel()

QString IOGraph::valueUnitLabel ( ) const

Generates the label for the value (Y-axis) units.

Returns
The unit label string.

◆ valueUnits()

io_graph_item_unit_t IOGraph::valueUnits ( ) const
inline

Retrieves the core IO graph item unit type.

Returns
The io_graph_item_unit_t value.

Member Data Documentation

◆ moving_avg_period_

unsigned int IOGraph::moving_avg_period_

The active moving average period.


The documentation for this class was generated from the following files: