INET Framework for OMNeT++/OMNEST
inet::physicallayer::ParabolicAntenna Class Reference

#include <ParabolicAntenna.h>

Inheritance diagram for inet::physicallayer::ParabolicAntenna:
inet::physicallayer::AntennaBase inet::physicallayer::IAntenna inet::physicallayer::IPrintableObject

Public Member Functions

 ParabolicAntenna ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual double getMaxGain () const override
 Returns the maximum possible antenna gain independent of any direction. More...
 
virtual double computeGain (const EulerAngles direction) const override
 Returns the antenna gain in the provided direction. More...
 
- Public Member Functions inherited from inet::physicallayer::AntennaBase
 AntennaBase ()
 
virtual IMobilitygetMobility () const override
 Returns the mobility of this antenna that describes its position and orientation over time. More...
 
virtual int getNumAntennas () const override
 Returns the number of antennas in the array. More...
 
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Protected Member Functions

virtual void initialize (int stage) override
 

Protected Attributes

double maxGain
 
double minGain
 
degree beamWidth
 
- Protected Attributes inherited from inet::physicallayer::AntennaBase
IMobilitymobility
 
int numAntennas
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 

Constructor & Destructor Documentation

inet::physicallayer::ParabolicAntenna::ParabolicAntenna ( )
26  :
27  AntennaBase(),
28  maxGain(NaN),
29  minGain(NaN),
31 {
32 }
double maxGain
Definition: ParabolicAntenna.h:30
degree beamWidth
Definition: ParabolicAntenna.h:32
AntennaBase()
Definition: AntennaBase.cc:25
scale< rad, 180000000, 3141593 > degree
Definition: Units.h:974
double minGain
Definition: ParabolicAntenna.h:31
#define NaN
Definition: INETMath.h:103

Member Function Documentation

double inet::physicallayer::ParabolicAntenna::computeGain ( const EulerAngles  direction) const
overridevirtual

Returns the antenna gain in the provided direction.

The direction is relative to the antenna geometry, so the result depends only on the antenna characteristics. 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 the specified direction.

Implements inet::physicallayer::IAntenna.

55 {
56  return std::max(minGain, maxGain * math::dB2fraction(-12 * pow(direction.alpha / math::deg2rad(beamWidth.get()), 2)));
57 }
double maxGain
Definition: ParabolicAntenna.h:30
degree beamWidth
Definition: ParabolicAntenna.h:32
double minGain
Definition: ParabolicAntenna.h:31
const value_type & get() const
Definition: Units.h:89
double max(double a, double b)
Returns the greater of the given parameters.
Definition: INETMath.h:161
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:166
double deg2rad(double deg)
Convert a degree value to radian.
Definition: INETMath.h:186
virtual double inet::physicallayer::ParabolicAntenna::getMaxGain ( ) const
inlineoverridevirtual

Returns the maximum possible antenna gain independent of any direction.

Implements inet::physicallayer::IAntenna.

41 { return maxGain; }
double maxGain
Definition: ParabolicAntenna.h:30
void inet::physicallayer::ParabolicAntenna::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::physicallayer::AntennaBase.

35 {
37  if (stage == INITSTAGE_LOCAL) {
38  maxGain = math::dB2fraction(par("maxGain"));
39  minGain = math::dB2fraction(par("minGain"));
40  beamWidth = degree(par("beamWidth"));
41  }
42 }
double maxGain
Definition: ParabolicAntenna.h:30
degree beamWidth
Definition: ParabolicAntenna.h:32
scale< rad, 180000000, 3141593 > degree
Definition: Units.h:974
double minGain
Definition: ParabolicAntenna.h:31
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:166
Local initializations.
Definition: InitStages.h:35
virtual void initialize(int stage) override
Definition: AntennaBase.cc:31
std::ostream & inet::physicallayer::ParabolicAntenna::printToStream ( std::ostream &  stream,
int  level 
) const
overridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::AntennaBase.

45 {
46  stream << "ParabolicAntenna";
47  if (level <= PRINT_LEVEL_DETAIL)
48  stream << ", maxGain = " << maxGain
49  << ", minGain = " << minGain
50  << ", beamWidth = " << beamWidth;
51  return AntennaBase::printToStream(stream, level);
52 }
double maxGain
Definition: ParabolicAntenna.h:30
degree beamWidth
Definition: ParabolicAntenna.h:32
double minGain
Definition: ParabolicAntenna.h:31
virtual std::ostream & printToStream(std::ostream &stream, int level) const override
Prints this object to the provided output stream.
Definition: AntennaBase.cc:39

Member Data Documentation

degree inet::physicallayer::ParabolicAntenna::beamWidth
protected
double inet::physicallayer::ParabolicAntenna::maxGain
protected
double inet::physicallayer::ParabolicAntenna::minGain
protected

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