#include <InterpolatingAntenna.h>
◆ AntennaGain()
| inet::physicallayer::InterpolatingAntenna::AntennaGain::AntennaGain |
( |
const char * |
elevation, |
|
|
const char * |
heading, |
|
|
const char * |
bank |
|
) |
| |
◆ computeGain() [1/2]
| double inet::physicallayer::InterpolatingAntenna::AntennaGain::computeGain |
( |
const Quaternion & |
direction | ) |
const |
|
overridevirtual |
Returns the antenna gain in the provided direction.
The direction is determined by rotating the X axis using the given quaternion. The direction is to be interpreted in the local coordinate system of the radiation pattern. This way the gain depends only on the antenna radion pattern characteristics, and not on the antenna orientation determined by the antenna's mobility model.
For transmissions, it determines how well the antenna converts input power into radio waves headed in the specified direction. For receptions, it determines how well the antenna converts radio waves arriving from the specified direction.
Implements inet::physicallayer::IAntennaGain.
98 auto eulerAngles = direction.toEulerAngles();
◆ computeGain() [2/2]
| double inet::physicallayer::InterpolatingAntenna::AntennaGain::computeGain |
( |
const std::map< rad, double > & |
gainMap, |
|
|
rad |
angle |
|
) |
| const |
|
protectedvirtual |
78 std::map<rad, double>::const_iterator lowerBound = gainMap.lower_bound(angle);
79 std::map<rad, double>::const_iterator upperBound = gainMap.upper_bound(angle);
80 if (lowerBound->first != angle)
82 if (upperBound == gainMap.end())
84 if (upperBound == lowerBound)
85 return lowerBound->second;
87 auto lowerAngle = lowerBound->first;
88 auto upperAngle = upperBound->first;
89 double lowerGain = lowerBound->second;
90 double upperGain = upperBound->second;
91 double alpha =
unit((angle - lowerAngle) / (upperAngle - lowerAngle)).get();
92 return (1 -
alpha) * lowerGain +
alpha * upperGain;
◆ getMaxGain()
| virtual double inet::physicallayer::InterpolatingAntenna::AntennaGain::getMaxGain |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getMinGain()
| virtual double inet::physicallayer::InterpolatingAntenna::AntennaGain::getMinGain |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ parseMap()
| void inet::physicallayer::InterpolatingAntenna::AntennaGain::parseMap |
( |
std::map< rad, double > & |
gainMap, |
|
|
const char * |
text |
|
) |
| |
|
protectedvirtual |
47 cStringTokenizer tokenizer(text);
48 const char *firstAngle = tokenizer.nextToken();
50 throw cRuntimeError(
"Insufficient number of values");
51 if (strcmp(firstAngle,
"0"))
52 throw cRuntimeError(
"The first angle must be 0");
53 const char *firstGain = tokenizer.nextToken();
55 throw cRuntimeError(
"Insufficient number of values");
58 while (tokenizer.hasMoreTokens()) {
59 const char *angleString = tokenizer.nextToken();
60 const char *gainString = tokenizer.nextToken();
61 if (!angleString || !gainString)
62 throw cRuntimeError(
"Insufficient number of values");
63 auto angle =
deg(atof(angleString));
69 gainMap.insert(std::pair<rad, double>(angle,
gain));
Referenced by AntennaGain().
◆ bankGainMap
| std::map<rad, double> inet::physicallayer::InterpolatingAntenna::AntennaGain::bankGainMap |
|
protected |
◆ elevationGainMap
| std::map<rad, double> inet::physicallayer::InterpolatingAntenna::AntennaGain::elevationGainMap |
|
protected |
◆ headingGainMap
| std::map<rad, double> inet::physicallayer::InterpolatingAntenna::AntennaGain::headingGainMap |
|
protected |
◆ maxGain
| double inet::physicallayer::InterpolatingAntenna::AntennaGain::maxGain |
|
protected |
◆ minGain
| double inet::physicallayer::InterpolatingAntenna::AntennaGain::minGain |
|
protected |
The documentation for this class was generated from the following files: