antenna: doxygen fixes

This commit is contained in:
Tommaso Pecorella
2022-01-09 17:52:13 -06:00
parent 0a0222c299
commit df97e13ffa
15 changed files with 277 additions and 63 deletions

View File

@@ -30,7 +30,9 @@ NS_LOG_COMPONENT_DEFINE ("Angles");
bool Angles::m_printDeg = false;
/// Degrees to Radians conversion constant
const double DEG_TO_RAD = M_PI / 180.0;
/// Radians to Degrees conversion constant
const double RAD_TO_DEG = 180.0 / M_PI;

View File

@@ -178,7 +178,21 @@ public:
double GetInclination (void) const;
// friend methods
/**
* \brief Stream insertion operator.
*
* \param [in] os The reference to the output stream.
* \param [in] a The angle.
* \returns The reference to the output stream.
*/
friend std::ostream& operator<< (std::ostream& os, const Angles& a);
/**
* \brief Stream extraction operator.
*
* \param [in] is The reference to the input stream.
* \param [out] a The angle.
* \returns The reference to the input stream.
*/
friend std::istream& operator>> (std::istream& is, Angles& a);
static bool m_printDeg; //!< flag for printing in radians or degrees units

View File

@@ -27,6 +27,19 @@
namespace ns3 {
/**
* \defgroup antenna Antenna module
* \brief This module contains several antenna
* radiation pattern models.
*/
/**
* \ingroup antenna
* \ingroup tests
* \defgroup antenna-tests Antenna module tests
*/
/**
* \ingroup antenna
*
@@ -38,8 +51,6 @@ namespace ns3 {
* angles. This choice is the one proposed "Antenna Theory - Analysis
* and Design", C.A. Balanis, Wiley, 2nd Ed., see in particular
* section 2.2 "Radiation pattern".
*
*
*/
class AntennaModel : public Object
{
@@ -49,7 +60,10 @@ public:
AntennaModel ();
virtual ~AntennaModel ();
// inherited from Object
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId ();

View File

@@ -28,6 +28,7 @@
namespace ns3 {
/**
* \ingroup antenna
*
* \brief Cosine Antenna Model
*
@@ -49,7 +50,10 @@ namespace ns3 {
class CosineAntennaModel : public AntennaModel
{
public:
// inherited from Object
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId ();
// inherited from AntennaModel
@@ -95,7 +99,7 @@ private:
/**
* Compute the exponent of the cosine antenna model from the beamwidth
* \param beamwidthRadians the beamwidth in degrees
* \param beamwidthDegrees the beamwidth in degrees
* \return the exponent
*/
static double GetExponentFromBeamwidth (double beamwidthDegrees);

View File

@@ -28,6 +28,8 @@
namespace ns3 {
/**
* \ingroup antenna
*
* \brief Isotropic antenna model
*
* This is the simplest antenna model. The gain of this antenna is the same in all directions.
@@ -37,7 +39,11 @@ class IsotropicAntennaModel : public AntennaModel
public:
IsotropicAntennaModel ();
// inherited from Object
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId ();
// inherited from AntennaModel

View File

@@ -28,12 +28,13 @@
namespace ns3 {
/**
* \ingroup antenna
*
* \brief Antenna model based on a parabolic approximation of the main lobe radiation pattern.
*
* This class implements the parabolic model as described in some 3GPP document, e.g., R4-092042
*
* A similar model appears in
* A similar model appears in:
*
* George Calcev and Matt Dillon, "Antenna Tilt Control in CDMA Networks"
* in Proc. of the 2nd Annual International Wireless Internet Conference (WICON), 2006
@@ -46,7 +47,10 @@ class ParabolicAntennaModel : public AntennaModel
{
public:
// inherited from Object
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId ();
// inherited from AntennaModel
@@ -54,18 +58,32 @@ public:
// attribute getters/setters
/**
* Set the Beam width
* \param beamwidthDegrees Beam width in degrees
*/
void SetBeamwidth (double beamwidthDegrees);
/**
* Get the Beam width
* \return beam width in degrees
*/
double GetBeamwidth () const;
/**
* Set the antenna orientation
* \param orientationDegrees antenna orientation in degrees
*/
void SetOrientation (double orientationDegrees);
/**
* Get the antenna orientation
* \return antenna orientation in degrees
*/
double GetOrientation () const;
private:
double m_beamwidthRadians;
double m_orientationRadians;
double m_maxAttenuation;
double m_beamwidthRadians; //!< Beam width in radians
double m_orientationRadians; //!< Antenna orientation in radians
double m_maxAttenuation; //!< Max attenuation
};

View File

@@ -32,13 +32,6 @@ NS_LOG_COMPONENT_DEFINE ("PhasedArrayModel");
NS_OBJECT_ENSURE_REGISTERED (PhasedArrayModel);
/**
* Prints to the output stream the vector of complex numbers
*
* \param os output stream
* \param cv the vector of complex numbers
* \return ostream the output stream
*/
std::ostream&
operator<< (std::ostream& os, const PhasedArrayModel::ComplexVector& cv)
{

View File

@@ -48,7 +48,8 @@ public:
/**
* Inherited from Object
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void);
@@ -146,7 +147,13 @@ protected:
uint32_t m_id {0}; //!< the ID of this antenna array instance
};
/**
* \brief Stream insertion operator.
*
* \param [in] os The reference to the output stream.
* \param [in] cv A vector of complex values.
* \returns The reference to the output stream.
*/
std::ostream& operator<< (std::ostream& os, const PhasedArrayModel::ComplexVector& cv);
} /* namespace ns3 */

View File

@@ -38,7 +38,10 @@ public:
ThreeGppAntennaModel (void);
virtual ~ThreeGppAntennaModel (void) override;
// inherited from Object
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId ();
// inherited from AntennaModel
@@ -75,8 +78,8 @@ public:
double GetAntennaElementGain () const;
private:
double m_verticalBeamwidthDegrees; //!< beamwidth in the vertical direction (\theta_{3dB}) [deg]
double m_horizontalBeamwidthDegrees; //!< beamwidth in the horizontal direction (\phi_{3dB}) [deg]
double m_verticalBeamwidthDegrees; //!< beamwidth in the vertical direction \f$(\theta_{3dB})\f$ [deg]
double m_horizontalBeamwidthDegrees; //!< beamwidth in the horizontal direction \f$(\phi_{3dB})\f$ [deg]
double m_aMax; //!< maximum attenuation (A_{max}) [dB]
double m_slaV; //!< side-lobe attenuation in the vertical direction (SLA_V) [dB]
double m_geMax; //!< maximum directional gain of the antenna element (G_{E,max}) [dBi]

View File

@@ -28,17 +28,32 @@
using namespace ns3;
/**
* \ingroup tests
*
* \brief Angles Test using one vector for initialization
*/
class OneVectorConstructorTestCase : public TestCase
{
public:
/**
* Build the test name
* \param v test parameter
* \return the test name
*/
static std::string BuildNameString (Vector v);
/**
* Constructor
* \param v vector
* \param a expected angle
*/
OneVectorConstructorTestCase (Vector v, Angles a);
private:
virtual void DoRun (void);
Vector m_v;
Angles m_a;
Vector m_v; //!< vector
Angles m_a; //!< expected angle
};
std::string OneVectorConstructorTestCase::BuildNameString (Vector v)
@@ -65,20 +80,35 @@ OneVectorConstructorTestCase::DoRun ()
/**
* \ingroup tests
*
* \brief Angles Test using two vectors for initialization
*/
class TwoVectorsConstructorTestCase : public TestCase
{
public:
/**
* Build the test name
* \param v test parameter
* \param o test parameter
* \return the test name
*/
static std::string BuildNameString (Vector v, Vector o);
/**
* Constructor
* \param v point
* \param o origin
* \param a expected angle
*/
TwoVectorsConstructorTestCase (Vector v, Vector o, Angles a);
private:
virtual void DoRun (void);
Vector m_v;
Vector m_o;
Angles m_a;
Vector m_v; //!< point
Vector m_o; //!< origin
Angles m_a; //!< expected angle
};
std::string TwoVectorsConstructorTestCase::BuildNameString (Vector v, Vector o)
@@ -106,9 +136,11 @@ TwoVectorsConstructorTestCase::DoRun ()
/**
* \ingroup tests
*
* \brief Angles TestSuite
*/
class AnglesTestSuite : public TestSuite
{
public:
@@ -206,4 +238,5 @@ AnglesTestSuite::AnglesTestSuite ()
}
static AnglesTestSuite staticAnglesTestSuiteInstance;
/// Static variable for test initialization
static AnglesTestSuite g_staticAnglesTestSuiteInstance;

View File

@@ -33,27 +33,53 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TestCosineAntennaModel");
/**
* \ingroup antenna-tests
*
* \brief Test condition (equal to or less than)
*/
enum CosineAntennaModelGainTestCondition {
EQUAL = 0,
LESSTHAN = 1
};
/**
* \ingroup antenna-tests
*
* \brief CosineAntennaModel Test
*/
class CosineAntennaModelTestCase : public TestCase
{
public:
/**
* Build the test name
* \param a Antenna angle
* \param b Horizontal and Vertical Beamwidth
* \param o Orientation
* \param g MaxGain
* \return the test name
*/
static std::string BuildNameString (Angles a, double b, double o, double g);
/**
* Constructor
* \param a Antenna angle
* \param b Horizontal and Vertical Beamwidth
* \param o Orientation
* \param g MaxGain
* \param expectedGainDb Expeted antenna gain
* \param cond Test condition
*/
CosineAntennaModelTestCase (Angles a, double b, double o, double g, double expectedGainDb, CosineAntennaModelGainTestCondition cond);
private:
virtual void DoRun (void);
Angles m_a;
double m_b;
double m_o;
double m_g;
double m_expectedGain;
CosineAntennaModelGainTestCondition m_cond;
Angles m_a; //!< Antenna angle
double m_b; //!< Horizontal and Vertical Beamwidth
double m_o; //!< Orientation
double m_g; //!< MaxGain
double m_expectedGain; //!< Expected gain
CosineAntennaModelGainTestCondition m_cond; //!< Test condition
};
std::string CosineAntennaModelTestCase::BuildNameString (Angles a, double b, double o, double g)
@@ -105,6 +131,11 @@ CosineAntennaModelTestCase::DoRun ()
/**
* \ingroup antenna-tests
*
* \brief CosineAntennaModel TestSuite
*/
class CosineAntennaModelTestSuite : public TestSuite
{
public:
@@ -211,4 +242,5 @@ CosineAntennaModelTestSuite::CosineAntennaModelTestSuite ()
};
static CosineAntennaModelTestSuite staticCosineAntennaModelTestSuiteInstance;
/// Static variable for test initialization
static CosineAntennaModelTestSuite g_staticCosineAntennaModelTestSuiteInstance;

View File

@@ -28,18 +28,33 @@
using namespace ns3;
/**
* \ingroup tests
*
* \brief Test degree to radians conversion
*/
class DegreesToRadiansTestCase : public TestCase
{
public:
/**
* Build the test name
* \param a test param
* \return the test name
*/
static std::string BuildNameString (double a);
/**
* Constructor
* \param a angle in degrees
* \param b expected angle in radians
*/
DegreesToRadiansTestCase (double a, double b);
private:
virtual void DoRun (void);
double m_a;
double m_b;
double m_a; //!< angle in degrees
double m_b; //!< expected angle in radians
};
std::string DegreesToRadiansTestCase::BuildNameString (double a)
@@ -66,18 +81,33 @@ DegreesToRadiansTestCase::DoRun ()
/**
* \ingroup tests
*
* \brief Test radians to degree conversion
*/
class RadiansToDegreesTestCase : public TestCase
{
public:
/**
* Build the test name
* \param a test param
* \return the test name
*/
static std::string BuildNameString (double a);
/**
* Constructor
* \param a angle in radians
* \param b expected angle in degrees
*/
RadiansToDegreesTestCase (double a, double b);
private:
virtual void DoRun (void);
double m_a;
double m_b;
double m_a; //!< angle in radians
double m_b; //!< expected angle in degrees
};
std::string RadiansToDegreesTestCase::BuildNameString (double a)
@@ -104,6 +134,11 @@ RadiansToDegreesTestCase::DoRun ()
/**
* \ingroup tests
*
* \brief TestSuite: degree to radians (and viceversa) conversions
*/
class DegreesRadiansTestSuite : public TestSuite
{
public:
@@ -131,4 +166,5 @@ DegreesRadiansTestSuite::DegreesRadiansTestSuite ()
};
static DegreesRadiansTestSuite staticDegreesRadiansTestSuiteInstance;
/// Static variable for test initialization
static DegreesRadiansTestSuite g_staticDegreesRadiansTestSuiteInstance;

View File

@@ -28,18 +28,33 @@
using namespace ns3;
/**
* \ingroup antenna-tests
*
* \brief IsotropicAntennaModel Test
*/
class IsotropicAntennaModelTestCase : public TestCase
{
public:
/**
* Build the test name
* \param a Antenna angle
* \return the test name
*/
static std::string BuildNameString (Angles a);
/**
* Constructor
* \param a Antenna angle
* \param expectedGainDb Expeted antenna gain
*/
IsotropicAntennaModelTestCase (Angles a, double expectedGainDb);
private:
virtual void DoRun (void);
Angles m_a;
double m_expectedGain;
Angles m_a; //!< Antenna angle
double m_expectedGain; //!< Expected gain
};
std::string IsotropicAntennaModelTestCase::BuildNameString (Angles a)
@@ -68,6 +83,11 @@ IsotropicAntennaModelTestCase::DoRun ()
/**
* \ingroup antenna-tests
*
* \brief IsotropicAntennaModel TestSuite
*/
class IsotropicAntennaModelTestSuite : public TestSuite
{
public:
@@ -89,4 +109,5 @@ IsotropicAntennaModelTestSuite::IsotropicAntennaModelTestSuite ()
};
static IsotropicAntennaModelTestSuite staticIsotropicAntennaModelTestSuiteInstance;
/// Static variable for test initialization
static IsotropicAntennaModelTestSuite g_staticIsotropicAntennaModelTestSuiteInstance;

View File

@@ -33,27 +33,54 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TestParabolicAntennaModel");
/**
* \ingroup antenna-tests
*
* \brief Test condition (equal to or less than)
*/
enum ParabolicAntennaModelGainTestCondition {
EQUAL = 0,
LESSTHAN = 1
};
/**
* \ingroup antenna-tests
*
* \brief ParabolicAntennaModel Test
*/
class ParabolicAntennaModelTestCase : public TestCase
{
public:
/**
* Build the test name
* \param a Antenna angle
* \param b Beamwidth
* \param o Orientation
* \param g MaxGain
* \return the test name
*/
static std::string BuildNameString (Angles a, double b, double o, double g);
/**
* Constructor
* \param a Antenna angle
* \param b Beamwidth
* \param o Orientation
* \param g MaxGain
* \param expectedGainDb Expeted antenna gain
* \param cond Test condition
*/
ParabolicAntennaModelTestCase (Angles a, double b, double o, double g, double expectedGainDb, ParabolicAntennaModelGainTestCondition cond);
private:
virtual void DoRun (void);
Angles m_a;
double m_b;
double m_o;
double m_g;
double m_expectedGain;
ParabolicAntennaModelGainTestCondition m_cond;
Angles m_a; //!< Antenna angle
double m_b; //!< Beamwidth
double m_o; //!< Orientation
double m_g; //!< MaxGain
double m_expectedGain; //!< Expected gain
ParabolicAntennaModelGainTestCondition m_cond; //!< Test condition
};
std::string ParabolicAntennaModelTestCase::BuildNameString (Angles a, double b, double o, double g)
@@ -102,8 +129,11 @@ ParabolicAntennaModelTestCase::DoRun ()
}
/**
* \ingroup antenna-tests
*
* \brief ParabolicAntennaModel TestSuite
*/
class ParabolicAntennaModelTestSuite : public TestSuite
{
public:
@@ -182,4 +212,5 @@ ParabolicAntennaModelTestSuite::ParabolicAntennaModelTestSuite ()
};
static ParabolicAntennaModelTestSuite staticParabolicAntennaModelTestSuiteInstance;
/// Static variable for test initialization
static ParabolicAntennaModelTestSuite g_staticParabolicAntennaModelTestSuiteInstance;

View File

@@ -36,7 +36,7 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TestUniformPlanarArray");
/**
* \ingroup tests
* \ingroup antenna-tests
*
* \brief UniformPlanarArray Test Case
*/
@@ -173,7 +173,7 @@ UniformPlanarArrayTestCase::DoRun ()
/**
* \ingroup tests
* \ingroup antenna-tests
*
* \brief UniformPlanarArray Test Suite
*/