#include <EnergyStorageCanvasVisualizer.h>
void inet::visualizer::EnergyStorageCanvasVisualizer::addEnergyStorageVisualization |
( |
const EnergyStorageVisualization * |
energyStorageVisualization | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::visualizer::EnergyStorageVisualizerBase.
69 auto energyStorageCanvasVisualization =
static_cast<const EnergyStorageCanvasVisualization *
>(energyStorageVisualization);
70 auto figure = energyStorageCanvasVisualization->figure;
Displacement displacementHint
Definition: EnergyStorageVisualizerBase.h:54
double displacementPriority
Definition: EnergyStorageVisualizerBase.h:55
virtual void addEnergyStorageVisualization(const EnergyStorageVisualization *energyStorageVisualization)
Definition: EnergyStorageVisualizerBase.cc:86
Implements inet::visualizer::EnergyStorageVisualizerBase.
51 auto module = check_and_cast<
const cModule *>(energyStorage);
52 auto figure =
new BarFigure(
"energyStorage");
53 figure->setTags((std::string(
"energyStorage ") +
tags).c_str());
54 figure->setTooltip(
"This figure represents an energy storage");
55 figure->setAssociatedObject(const_cast<cModule *>(module));
56 figure->setBounds(cFigure::Rectangle(0, 0,
width,
height));
58 figure->setColor(
color);
59 figure->setMinValue(0);
63 return new EnergyStorageCanvasVisualization(networkNodeVisualization, figure, energyStorage);
const char * tags
Definition: VisualizerBase.h:32
double height
Definition: EnergyStorageVisualizerBase.h:52
double width
Definition: EnergyStorageVisualizerBase.h:51
virtual NetworkNodeCanvasVisualization * getNetworkNodeVisualization(const cModule *networkNode) const
Definition: NetworkNodeCanvasVisualizer.cc:63
NetworkNodeCanvasVisualizer * networkNodeVisualizer
Definition: EnergyStorageCanvasVisualizer.h:45
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:65
cFigure::Color color
Definition: EnergyStorageVisualizerBase.h:50
virtual double getNominalCapacity(const IEnergyStorage *energyStorage) const
Definition: EnergyStorageVisualizerBase.cc:66
double spacing
Definition: EnergyStorageVisualizerBase.h:53
void inet::visualizer::EnergyStorageCanvasVisualizer::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::visualizer::EnergyStorageVisualizerBase.
42 if (!hasGUI())
return;
45 networkNodeVisualizer = getModuleFromPar<NetworkNodeCanvasVisualizer>(par(
"networkNodeVisualizerModule"),
this);
double zIndex
Definition: EnergyStorageCanvasVisualizer.h:44
Local initializations.
Definition: InitStages.h:35
NetworkNodeCanvasVisualizer * networkNodeVisualizer
Definition: EnergyStorageCanvasVisualizer.h:45
virtual void initialize(int stage) override
Definition: EnergyStorageVisualizerBase.cc:32
void inet::visualizer::EnergyStorageCanvasVisualizer::refreshEnergyStorageVisualization |
( |
const EnergyStorageVisualization * |
energyStorageVisualization | ) |
const |
|
overrideprotectedvirtual |
Implements inet::visualizer::EnergyStorageVisualizerBase.
84 auto energyStorageCanvasVisualization =
static_cast<const EnergyStorageCanvasVisualization *
>(energyStorageVisualization);
85 auto energyStorage = energyStorageVisualization->energyStorage;
86 auto figure = energyStorageCanvasVisualization->figure;
virtual double getResidualCapacity(const IEnergyStorage *energyStorage) const
Definition: EnergyStorageVisualizerBase.cc:76
void inet::visualizer::EnergyStorageCanvasVisualizer::removeEnergyStorageVisualization |
( |
const EnergyStorageVisualization * |
energyStorageVisualization | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::visualizer::EnergyStorageVisualizerBase.
77 auto energyStorageCanvasVisualization =
static_cast<const EnergyStorageCanvasVisualization *
>(energyStorageVisualization);
78 auto figure = energyStorageCanvasVisualization->figure;
79 energyStorageCanvasVisualization->networkNodeVisualization->removeAnnotation(figure);
virtual void removeEnergyStorageVisualization(const EnergyStorageVisualization *energyStorageVisualization)
Definition: EnergyStorageVisualizerBase.cc:91
double inet::visualizer::EnergyStorageCanvasVisualizer::zIndex = NaN |
|
protected |
The documentation for this class was generated from the following files: