INET Framework for OMNeT++/OMNEST
inet::FigureRecorder Class Reference

#include <FigureRecorder.h>

Inheritance diagram for inet::FigureRecorder:

Protected Member Functions

virtual void init (cComponent *component, const char *statisticName, const char *recordingMode, cProperty *attrsProperty, opp_string_map *manualAttrs=nullptr) override
 
virtual void collect (simtime_t_cref t, double value, cObject *details) override
 

Protected Attributes

IIndicatorFigureindicatorFigure = nullptr
 
int series = 0
 

Member Function Documentation

void inet::FigureRecorder::collect ( simtime_t_cref  t,
double  value,
cObject *  details 
)
overrideprotectedvirtual
51 {
52  indicatorFigure->setValue(series, t, value);
53 }
int series
Definition: FigureRecorder.h:29
IIndicatorFigure * indicatorFigure
Definition: FigureRecorder.h:28
virtual void setValue(int series, simtime_t timestamp, double value)=0
void inet::FigureRecorder::init ( cComponent *  component,
const char *  statisticName,
const char *  recordingMode,
cProperty *  attrsProperty,
opp_string_map *  manualAttrs = nullptr 
)
overrideprotectedvirtual
25 {
26  cNumericResultRecorder::init(component, statisticName, recordingMode, attrsProperty, manualAttrs);
27 
28  cModule *module = check_and_cast<cModule *>(getComponent());
29  const char *figureSpec = attrsProperty->getValue("targetFigure");
30  if (!figureSpec)
31  figureSpec = statisticName;
32  std::string figureName;
33  int series;
34  if (const char *lastColon = strrchr(figureSpec, ':')) {
35  figureName = std::string(figureSpec, lastColon - figureSpec).c_str();
36  series = utils::atoul(lastColon + 1);
37  }
38  else {
39  figureName = figureSpec;
40  series = 0;
41  }
42  cFigure *figure = module->getCanvas()->getFigureByPath(figureName.c_str());
43  if (!figure)
44  throw cRuntimeError("Figure '%s' in module '%s' not found", figureName.c_str(), module->getFullPath().c_str());
45  indicatorFigure = check_and_cast<IIndicatorFigure *>(figure);
46  if (series > indicatorFigure->getNumSeries())
47  throw cRuntimeError("series :%d is out of bounds, figure '%s' supports %d series", series, figureName.c_str(), indicatorFigure->getNumSeries());
48 }
int series
Definition: FigureRecorder.h:29
unsigned long atoul(const char *s)
Converts string to unsigned long.
Definition: INETUtils.cc:47
IIndicatorFigure * indicatorFigure
Definition: FigureRecorder.h:28

Member Data Documentation

IIndicatorFigure* inet::FigureRecorder::indicatorFigure = nullptr
protected

Referenced by collect(), and init().

int inet::FigureRecorder::series = 0
protected

Referenced by collect(), and init().


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