#include <EnergyStorageVisualizerBase.h>
void inet::visualizer::EnergyStorageVisualizerBase::addEnergyStorageVisualization |
( |
const EnergyStorageVisualization * |
energyStorageVisualization | ) |
|
|
protectedvirtual |
void inet::visualizer::EnergyStorageVisualizerBase::addEnergyStorageVisualizations |
( |
| ) |
|
|
protectedvirtual |
Referenced by handleParameterChange(), and initialize().
98 auto simulation = getSimulation();
99 for (
int id = 0;
id < simulation->getLastComponentId();
id++) {
100 auto component = simulation->getComponent(
id);
101 auto module =
dynamic_cast<cModule *
>(component);
102 auto energyStorage =
dynamic_cast<IEnergyStorage *
>(module);
virtual EnergyStorageVisualization * createEnergyStorageVisualization(const IEnergyStorage *energyStorage) const =0
bool matches(const cModule *module) const
Definition: ModuleFilter.cc:29
virtual void addEnergyStorageVisualization(const EnergyStorageVisualization *energyStorageVisualization)
Definition: EnergyStorageVisualizerBase.cc:86
ModuleFilter energyStorageFilter
Definition: EnergyStorageVisualizerBase.h:49
double inet::visualizer::EnergyStorageVisualizerBase::getNominalCapacity |
( |
const IEnergyStorage * |
energyStorage | ) |
const |
|
protectedvirtual |
Referenced by inet::visualizer::EnergyStorageCanvasVisualizer::createEnergyStorageVisualization().
68 if (
auto epEnergyStorage = dynamic_cast<const IEpEnergyStorage *>(energyStorage))
69 return epEnergyStorage->getNominalEnergyCapacity().get();
70 else if (
auto ccEnergyStorage = dynamic_cast<const ICcEnergyStorage *>(energyStorage))
71 return ccEnergyStorage->getNominalChargeCapacity().get();
73 throw cRuntimeError(
"Unknown energy storage");
double inet::visualizer::EnergyStorageVisualizerBase::getResidualCapacity |
( |
const IEnergyStorage * |
energyStorage | ) |
const |
|
protectedvirtual |
Referenced by inet::visualizer::EnergyStorageCanvasVisualizer::refreshEnergyStorageVisualization().
78 if (
auto epEnergyStorage = dynamic_cast<const IEpEnergyStorage *>(energyStorage))
79 return epEnergyStorage->getResidualEnergyCapacity().get();
80 else if (
auto ccEnergyStorage = dynamic_cast<const ICcEnergyStorage *>(energyStorage))
81 return ccEnergyStorage->getResidualChargeCapacity().get();
83 throw cRuntimeError(
"Unknown energy storage");
void inet::visualizer::EnergyStorageVisualizerBase::handleParameterChange |
( |
const char * |
name | ) |
|
|
overrideprotectedvirtual |
54 if (name !=
nullptr) {
virtual void removeAllEnergyStorageVisualizations()
Definition: EnergyStorageVisualizerBase.cc:108
virtual void addEnergyStorageVisualizations()
Definition: EnergyStorageVisualizerBase.cc:96
void inet::visualizer::EnergyStorageVisualizerBase::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::visualizer::VisualizerBase.
Reimplemented in inet::visualizer::EnergyStorageOsgVisualizer, and inet::visualizer::EnergyStorageCanvasVisualizer.
Referenced by inet::visualizer::EnergyStorageCanvasVisualizer::initialize().
35 if (!hasGUI())
return;
39 color = cFigure::parseColor(par(
"color"));
void setPattern(const char *pattern)
Definition: ModuleFilter.cc:24
double height
Definition: EnergyStorageVisualizerBase.h:52
double width
Definition: EnergyStorageVisualizerBase.h:51
bool displayEnergyStorages
Definition: EnergyStorageVisualizerBase.h:48
Operations that no other initializations can depend on, e.g.
Definition: InitStages.h:111
virtual void initialize(int stage) override
Definition: VisualizerBase.cc:29
Displacement displacementHint
Definition: EnergyStorageVisualizerBase.h:54
Displacement parseDisplacement(const char *s)
Definition: Displacement.cc:24
double displacementPriority
Definition: EnergyStorageVisualizerBase.h:55
Local initializations.
Definition: InitStages.h:35
cFigure::Color color
Definition: EnergyStorageVisualizerBase.h:50
ModuleFilter energyStorageFilter
Definition: EnergyStorageVisualizerBase.h:49
virtual void addEnergyStorageVisualizations()
Definition: EnergyStorageVisualizerBase.cc:96
double spacing
Definition: EnergyStorageVisualizerBase.h:53
void inet::visualizer::EnergyStorageVisualizerBase::refreshDisplay |
( |
| ) |
const |
|
overrideprotectedvirtual |
virtual void refreshEnergyStorageVisualization(const EnergyStorageVisualization *energyStorageVisualization) const =0
std::vector< const EnergyStorageVisualization * > energyStorageVisualizations
Definition: EnergyStorageVisualizerBase.h:58
virtual void inet::visualizer::EnergyStorageVisualizerBase::refreshEnergyStorageVisualization |
( |
const EnergyStorageVisualization * |
energyStorageVisualization | ) |
const |
|
protectedpure virtual |
void inet::visualizer::EnergyStorageVisualizerBase::removeAllEnergyStorageVisualizations |
( |
| ) |
|
|
protectedvirtual |
Referenced by handleParameterChange().
112 delete energyStorageVisualization;
virtual void removeEnergyStorageVisualization(const EnergyStorageVisualization *energyStorageVisualization)
Definition: EnergyStorageVisualizerBase.cc:91
std::vector< const EnergyStorageVisualization * > energyStorageVisualizations
Definition: EnergyStorageVisualizerBase.h:58
void inet::visualizer::EnergyStorageVisualizerBase::removeEnergyStorageVisualization |
( |
const EnergyStorageVisualization * |
energyStorageVisualization | ) |
|
|
protectedvirtual |
cFigure::Color inet::visualizer::EnergyStorageVisualizerBase::color |
|
protected |
Displacement inet::visualizer::EnergyStorageVisualizerBase::displacementHint |
|
protected |
double inet::visualizer::EnergyStorageVisualizerBase::displacementPriority |
|
protected |
bool inet::visualizer::EnergyStorageVisualizerBase::displayEnergyStorages = false |
|
protected |
ModuleFilter inet::visualizer::EnergyStorageVisualizerBase::energyStorageFilter |
|
protected |
double inet::visualizer::EnergyStorageVisualizerBase::height |
|
protected |
double inet::visualizer::EnergyStorageVisualizerBase::spacing |
|
protected |
double inet::visualizer::EnergyStorageVisualizerBase::width |
|
protected |
The documentation for this class was generated from the following files: