From df97e13ffa8bd8b144b734c6868a3f3e65a69a4b Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Sun, 9 Jan 2022 17:52:13 -0600 Subject: [PATCH] antenna: doxygen fixes --- src/antenna/model/angles.cc | 2 + src/antenna/model/angles.h | 14 +++++ src/antenna/model/antenna-model.h | 20 ++++++- src/antenna/model/cosine-antenna-model.h | 8 ++- src/antenna/model/isotropic-antenna-model.h | 8 ++- src/antenna/model/parabolic-antenna-model.h | 32 ++++++++--- src/antenna/model/phased-array-model.cc | 7 --- src/antenna/model/phased-array-model.h | 11 +++- src/antenna/model/three-gpp-antenna-model.h | 9 ++- src/antenna/test/test-angles.cc | 55 +++++++++++++++---- src/antenna/test/test-cosine-antenna.cc | 48 +++++++++++++--- src/antenna/test/test-degrees-radians.cc | 46 ++++++++++++++-- src/antenna/test/test-isotropic-antenna.cc | 27 ++++++++- src/antenna/test/test-parabolic-antenna.cc | 49 ++++++++++++++--- src/antenna/test/test-uniform-planar-array.cc | 4 +- 15 files changed, 277 insertions(+), 63 deletions(-) diff --git a/src/antenna/model/angles.cc b/src/antenna/model/angles.cc index d054e4d4b..d69f9d814 100644 --- a/src/antenna/model/angles.cc +++ b/src/antenna/model/angles.cc @@ -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; diff --git a/src/antenna/model/angles.h b/src/antenna/model/angles.h index e4c5da8d0..de4416de0 100644 --- a/src/antenna/model/angles.h +++ b/src/antenna/model/angles.h @@ -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 diff --git a/src/antenna/model/antenna-model.h b/src/antenna/model/antenna-model.h index d3f42a770..4809a2a74 100644 --- a/src/antenna/model/antenna-model.h +++ b/src/antenna/model/antenna-model.h @@ -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 (); diff --git a/src/antenna/model/cosine-antenna-model.h b/src/antenna/model/cosine-antenna-model.h index 9b855561b..8909f5a98 100644 --- a/src/antenna/model/cosine-antenna-model.h +++ b/src/antenna/model/cosine-antenna-model.h @@ -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); diff --git a/src/antenna/model/isotropic-antenna-model.h b/src/antenna/model/isotropic-antenna-model.h index 8288d30a4..543af316f 100644 --- a/src/antenna/model/isotropic-antenna-model.h +++ b/src/antenna/model/isotropic-antenna-model.h @@ -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 diff --git a/src/antenna/model/parabolic-antenna-model.h b/src/antenna/model/parabolic-antenna-model.h index 2fb624e25..0b4149f38 100644 --- a/src/antenna/model/parabolic-antenna-model.h +++ b/src/antenna/model/parabolic-antenna-model.h @@ -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 }; diff --git a/src/antenna/model/phased-array-model.cc b/src/antenna/model/phased-array-model.cc index b3febf167..6995f16d1 100644 --- a/src/antenna/model/phased-array-model.cc +++ b/src/antenna/model/phased-array-model.cc @@ -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) { diff --git a/src/antenna/model/phased-array-model.h b/src/antenna/model/phased-array-model.h index 80a8e4bcb..9993d915d 100644 --- a/src/antenna/model/phased-array-model.h +++ b/src/antenna/model/phased-array-model.h @@ -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 */ diff --git a/src/antenna/model/three-gpp-antenna-model.h b/src/antenna/model/three-gpp-antenna-model.h index dfb602190..61ad64824 100644 --- a/src/antenna/model/three-gpp-antenna-model.h +++ b/src/antenna/model/three-gpp-antenna-model.h @@ -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] diff --git a/src/antenna/test/test-angles.cc b/src/antenna/test/test-angles.cc index da239bcdf..eeeb6dfea 100644 --- a/src/antenna/test/test-angles.cc +++ b/src/antenna/test/test-angles.cc @@ -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; diff --git a/src/antenna/test/test-cosine-antenna.cc b/src/antenna/test/test-cosine-antenna.cc index 0409b476c..34d147bdd 100644 --- a/src/antenna/test/test-cosine-antenna.cc +++ b/src/antenna/test/test-cosine-antenna.cc @@ -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; diff --git a/src/antenna/test/test-degrees-radians.cc b/src/antenna/test/test-degrees-radians.cc index 0c3ceb052..18847fd6d 100644 --- a/src/antenna/test/test-degrees-radians.cc +++ b/src/antenna/test/test-degrees-radians.cc @@ -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; diff --git a/src/antenna/test/test-isotropic-antenna.cc b/src/antenna/test/test-isotropic-antenna.cc index d803d6862..136c534a1 100644 --- a/src/antenna/test/test-isotropic-antenna.cc +++ b/src/antenna/test/test-isotropic-antenna.cc @@ -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; diff --git a/src/antenna/test/test-parabolic-antenna.cc b/src/antenna/test/test-parabolic-antenna.cc index 421b839e7..3702bbc3c 100644 --- a/src/antenna/test/test-parabolic-antenna.cc +++ b/src/antenna/test/test-parabolic-antenna.cc @@ -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; diff --git a/src/antenna/test/test-uniform-planar-array.cc b/src/antenna/test/test-uniform-planar-array.cc index 7d405d088..b59c6f904 100644 --- a/src/antenna/test/test-uniform-planar-array.cc +++ b/src/antenna/test/test-uniform-planar-array.cc @@ -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 */