326 Enter_Method_Silent();
327 auto module = check_and_cast<
const cModule *>(radio);
330 if (
displayInterferenceRanges || (module->hasPar(
"displayInterferenceRange") && module->par(
"displayInterferenceRange"))) {
332 auto interferenceRangeFigure =
new cOvalFigure(
"interferenceRange");
333 m maxInterferenceRange = check_and_cast<
const IRadioMedium *>(radio->getMedium())->getMediumLimitCache()->getMaxInterferenceRange(radio);
334 interferenceRangeFigure->setTags((std::string(
"interference_range ") +
tags).c_str());
335 interferenceRangeFigure->setTooltip(
"This circle represents the interference range of a wireless interface");
336 interferenceRangeFigure->setBounds(cFigure::Rectangle(-maxInterferenceRange.get(), -maxInterferenceRange.get(), 2 * maxInterferenceRange.get(), 2 * maxInterferenceRange.get()));
340 networkNodeVisualization->addFigure(interferenceRangeFigure);
342 if (
displayCommunicationRanges || (module->hasPar(
"displayCommunicationRange") && module->par(
"displayCommunicationRange"))) {
344 auto communicationRangeFigure =
new cOvalFigure(
"communicationRange");
345 m maxCommunicationRange = check_and_cast<
const IRadioMedium *>(radio->getMedium())->getMediumLimitCache()->getMaxCommunicationRange(radio);
346 communicationRangeFigure->setTags((std::string(
"communication_range ") +
tags).c_str());
347 communicationRangeFigure->setTooltip(
"This circle represents the communication range of a wireless interface");
348 communicationRangeFigure->setBounds(cFigure::Rectangle(-maxCommunicationRange.get(), -maxCommunicationRange.get(), 2 * maxCommunicationRange.get(), 2 * maxCommunicationRange.get()));
352 networkNodeVisualization->addFigure(communicationRangeFigure);
357 std::string imageName = par(
"transmissionImage");
358 auto transmissionFigure =
new LabeledIconFigure(
"transmission");
359 transmissionFigure->setTags((std::string(
"transmission ") +
tags).c_str());
360 transmissionFigure->setTooltip(
"This icon represents an ongoing transmission in a wireless interface");
361 transmissionFigure->setVisible(
false);
362 auto iconFigure = transmissionFigure->getIconFigure();
363 iconFigure->setImageName(imageName.substr(0, imageName.find_first_of(
".")).c_str());
364 iconFigure->setAnchor(cFigure::ANCHOR_NW);
365 auto labelFigure = transmissionFigure->getLabelFigure();
366 labelFigure->setPosition(iconFigure->getBounds().getSize() / 2);
371 std::string imageName = par(
"receptionImage");
372 auto receptionFigure =
new LabeledIconFigure(
"reception");
373 receptionFigure->setTags((std::string(
"reception ") +
tags).c_str());
374 receptionFigure->setTooltip(
"This icon represents an ongoing reception in a wireless interface");
375 receptionFigure->setVisible(
false);
376 auto iconFigure = receptionFigure->getIconFigure();
377 iconFigure->setImageName(imageName.substr(0, imageName.find_first_of(
".")).c_str());
378 iconFigure->setAnchor(cFigure::ANCHOR_NW);
379 auto labelFigure = receptionFigure->getLabelFigure();
380 labelFigure->setPosition(iconFigure->getBounds().getSize() / 2);
bool displayTransmissions
Definition: MediumVisualizerBase.h:60
virtual void setTransmissionFigure(const IRadio *radio, cFigure *figure)
Definition: MediumCanvasVisualizer.cc:174
bool displayReceptions
Definition: MediumVisualizerBase.h:61
bool matches(const cModule *module) const
Definition: NetworkNodeFilter.cc:29
double interferenceRangeLineWidth
Definition: MediumVisualizerBase.h:69
const char * tags
Definition: VisualizerBase.h:32
NetworkNodeCanvasVisualizer * networkNodeVisualizer
Definition: MediumCanvasVisualizer.h:65
bool displayInterferenceRanges
Definition: MediumVisualizerBase.h:66
double transmissionDisplacementPriority
Definition: MediumVisualizerBase.h:64
Displacement receptionDisplacementHint
Definition: MediumVisualizerBase.h:63
cFigure::Color interferenceRangeLineColor
Definition: MediumVisualizerBase.h:67
double communicationRangeLineWidth
Definition: MediumVisualizerBase.h:73
virtual void setReceptionFigure(const IRadio *radio, cFigure *figure)
Definition: MediumCanvasVisualizer.cc:199
cFigure::LineStyle communicationRangeLineStyle
Definition: MediumVisualizerBase.h:72
virtual NetworkNodeCanvasVisualization * getNetworkNodeVisualization(const cModule *networkNode) const
Definition: NetworkNodeCanvasVisualizer.cc:63
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:65
Displacement transmissionDisplacementHint
Definition: MediumVisualizerBase.h:62
bool displayCommunicationRanges
Definition: MediumVisualizerBase.h:70
double receptionDisplacementPriority
Definition: MediumVisualizerBase.h:65
NetworkNodeFilter networkNodeFilter
Definition: MediumVisualizerBase.h:49
cFigure::Color communicationRangeLineColor
Definition: MediumVisualizerBase.h:71
cFigure::LineStyle interferenceRangeLineStyle
Definition: MediumVisualizerBase.h:68
value< double, units::m > m
Definition: Units.h:1047