refs #192, Doxygen / formatting

This commit is contained in:
Klaus Basan
2014-03-26 18:53:38 +01:00
parent 853259709a
commit e2461cb67c
5 changed files with 59 additions and 234 deletions

View File

@@ -316,9 +316,7 @@ namespace BlackMisc
return fr >= 118.0 && fr <= 136.975; return fr >= 118.0 && fr <= 136.975;
} }
/*! //! \brief Valid military aviation frequency?
* \brief Valid military aviation frequency?
*/
static bool isValidMilitaryFrequency(const BlackMisc::PhysicalQuantities::CFrequency &f) static bool isValidMilitaryFrequency(const BlackMisc::PhysicalQuantities::CFrequency &f)
{ {
double fr = f.valueRounded(BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz(), 3); double fr = f.valueRounded(BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz(), 3);
@@ -331,13 +329,10 @@ namespace BlackMisc
*/ */
static void roundToChannelSpacing(BlackMisc::PhysicalQuantities::CFrequency &frequency, ChannelSpacing channelSpacing); static void roundToChannelSpacing(BlackMisc::PhysicalQuantities::CFrequency &frequency, ChannelSpacing channelSpacing);
/*! //! \brief Is compareFrequency within channel spacing of setFrequency
* \brief Is compareFrequency within channel spacing of setFrequency
*/
static bool isWithinChannelSpacing(const BlackMisc::PhysicalQuantities::CFrequency &setFrequency, const BlackMisc::PhysicalQuantities::CFrequency &compareFrequency, ChannelSpacing channelSpacing); static bool isWithinChannelSpacing(const BlackMisc::PhysicalQuantities::CFrequency &setFrequency, const BlackMisc::PhysicalQuantities::CFrequency &compareFrequency, ChannelSpacing channelSpacing);
}; };
} // namespace } // namespace
} // namespace } // namespace

View File

@@ -18,9 +18,7 @@ namespace BlackMisc
class CTransponder : public CAvionicsBase class CTransponder : public CAvionicsBase
{ {
public: public:
/*! //! \brief Transponder codes
* \brief Our transponder codes
*/
enum TransponderMode enum TransponderMode
{ {
StateStandby = 0, // not a real mode, more a state StateStandby = 0, // not a real mode, more a state
@@ -178,107 +176,66 @@ namespace BlackMisc
return QVariant::fromValue(*this); return QVariant::fromValue(*this);
} }
/*! //! \brief Transponder mode as string
* \brief Transponder mode as string
* \return
*/
QString getModeAsString() const; QString getModeAsString() const;
/*! //! \brief Transponder mode as string
* \brief Transponder mode as string
* \param mode
* \throws std::range_error
*/
void setModeAsString(const QString &mode); void setModeAsString(const QString &mode);
/*! //! \brief Transponder mode
* \brief Transponder mode
* \return
* \throws std::range_error
*/
TransponderMode getTransponderMode() const TransponderMode getTransponderMode() const
{ {
return this->m_transponderMode; return this->m_transponderMode;
} }
/*! //! \brief Transponder code
* \brief Transponder code
* \return
*/
qint32 getTransponderCode() const qint32 getTransponderCode() const
{ {
return this->m_transponderCode; return this->m_transponderCode;
} }
/*! //! \brief Transponder code
* \brief Transponder code
* \return
*/
QString getTransponderCodeFormatted() const; QString getTransponderCodeFormatted() const;
/*! //! \brief Formatted with code / mode
* \brief Formatted with code / mode
* \return
*/
QString getTransponderCodeAndModeFormatted() const; QString getTransponderCodeAndModeFormatted() const;
//! \brief Set transponder code
/*!
* \brief Set transponder code
* \param transponderCode
*/
void setTransponderCode(qint32 transponderCode) void setTransponderCode(qint32 transponderCode)
{ {
this->m_transponderCode = transponderCode; this->m_transponderCode = transponderCode;
this->validate(true); this->validate(true);
} }
/*! //! \brief Set transponder code
* \brief Set transponder code
* \param transponderCode
*/
void setTransponderCode(const QString &transponderCode); void setTransponderCode(const QString &transponderCode);
//! \brief Set transponder mode
/*!
* \brief Set transponder mode
* \param mode
*/
void setTransponderMode(TransponderMode mode) void setTransponderMode(TransponderMode mode)
{ {
this->m_transponderMode = mode ; this->m_transponderMode = mode ;
this->validate(true); this->validate(true);
} }
/*! //! \brief Set emergency
* \brief Set emergency
*/
void setEmergency() void setEmergency()
{ {
this->m_transponderCode = 7700; this->m_transponderCode = 7700;
} }
/*! //! \brief Set VFR
* \brief Set VFR
*/
void setVFR() void setVFR()
{ {
this->m_transponderCode = 7000; this->m_transponderCode = 7000;
} }
/*! //! \brief Set IFR
* \brief Set IFR
*/
void setIFR() void setIFR()
{ {
this->m_transponderCode = 2000; this->m_transponderCode = 2000;
} }
/*! //! \brief operator ==
* \brief operator ==
* \param other
* \return
*/
bool operator ==(const CTransponder &other) const bool operator ==(const CTransponder &other) const
{ {
return return
@@ -287,11 +244,7 @@ namespace BlackMisc
this->CAvionicsBase::operator ==(other); this->CAvionicsBase::operator ==(other);
} }
/*! //! \brief operator =!
* \brief operator =!
* \param other
* \return
*/
bool operator !=(const CTransponder &other) const bool operator !=(const CTransponder &other) const
{ {
return !((*this) == other); return !((*this) == other);
@@ -369,24 +322,17 @@ namespace BlackMisc
//! \copydoc CValueObject::getValueHash() //! \copydoc CValueObject::getValueHash()
virtual uint getValueHash() const override; virtual uint getValueHash() const override;
/*! //! \brief Is valid transponder code?
* \brief Is valid transponder code?
*/
static bool isValidTransponderCode(const QString &transponderCode); static bool isValidTransponderCode(const QString &transponderCode);
/*! //! \brief Is valid transponder code?
* \brief Is valid transponder code?
*/
static bool isValidTransponderCode(qint32 transponderMode); static bool isValidTransponderCode(qint32 transponderMode);
/*! //! \brief Register metadata
* \brief Register metadata of unit and quantity
*/
static void registerMetadata(); static void registerMetadata();
//! \copydoc CValueObject::toJson //! \copydoc CValueObject::toJson
virtual QJsonObject toJson() const override; virtual QJsonObject toJson() const override;
};
//! \copydoc CValueObject::fromJson //! \copydoc CValueObject::fromJson
void fromJson(const QJsonObject &json) override; void fromJson(const QJsonObject &json) override;

View File

@@ -25,14 +25,10 @@ namespace BlackMisc
{ {
public: public:
/*! //! \brief Default constructor.
* Default constructor.
*/
CSelcal() {} CSelcal() {}
/*! //! \brief Constructor.
* Constructor.
*/
CSelcal(const QString &code) : m_code(code.trimmed()) {} CSelcal(const QString &code) : m_code(code.trimmed()) {}
/*! /*!
@@ -41,23 +37,16 @@ namespace BlackMisc
*/ */
CSelcal(const char *code) : m_code(code) {} CSelcal(const char *code) : m_code(code) {}
/*! //! \copydoc CValueObject::toQVariant
* \copydoc CValueObject::toQVariant
*/
virtual QVariant toQVariant() const override virtual QVariant toQVariant() const override
{ {
return QVariant::fromValue(*this); return QVariant::fromValue(*this);
} }
/*! //! \brief Is valid?
* \brief Is valid?
* \return
*/
bool isValid() const { return CSelcal::isValidCode(this->m_code); } bool isValid() const { return CSelcal::isValidCode(this->m_code); }
/*! //! \brief Get SELCAL code
* Get SELCAL code
*/
const QString &getCode() const { return this->m_code; } const QString &getCode() const { return this->m_code; }
/*! /*!
@@ -66,19 +55,13 @@ namespace BlackMisc
*/ */
QList<BlackMisc::PhysicalQuantities::CFrequency> getFrequencies() const; QList<BlackMisc::PhysicalQuantities::CFrequency> getFrequencies() const;
/*! //! \brief Equal operator ==
* \brief Equal operator ==
*/
bool operator ==(const CSelcal &other) const; bool operator ==(const CSelcal &other) const;
/*! //! \brief Unequal operator !=
* \brief Unequal operator !=
*/
bool operator !=(const CSelcal &other) const; bool operator !=(const CSelcal &other) const;
/*! //! \copydoc CValueObject::getValueHash
* \copydoc CValueObject::getValueHash
*/
virtual uint getValueHash() const override; virtual uint getValueHash() const override;
//! \copydoc CValueObject::toJson //! \copydoc CValueObject::toJson
@@ -88,9 +71,6 @@ namespace BlackMisc
void fromJson(const QJsonObject &json) override; void fromJson(const QJsonObject &json) override;
//! \brief Register metadata //! \brief Register metadata
/*!
* \brief Register metadata
*/
static void registerMetadata(); static void registerMetadata();
//! \copydoc TupleConverter<>::jsonMembers() //! \copydoc TupleConverter<>::jsonMembers()
@@ -99,29 +79,19 @@ namespace BlackMisc
//! \brief Equals given string //! \brief Equals given string
bool equalsString(const QString &code) const; bool equalsString(const QString &code) const;
/*! //! \brief Valid SELCAL characters
* \brief Valid SELCAL characters
*/
static const QString &validCharacters(); static const QString &validCharacters();
/*! //! \brief Is given character a valid SELCAL characer?
* \brief Is given character a valid SELCAL characer?
*/
static bool isValidCharacter(QChar c); static bool isValidCharacter(QChar c);
/*! //! \brief Valid SELCAL code?
* Valid SELCAL code?
*/
static bool isValidCode(const QString &code); static bool isValidCode(const QString &code);
/*! //! \brief Audio frequency for character
* \brief Audio frequency for character
*/
static const BlackMisc::PhysicalQuantities::CFrequency &audioFrequencyEquivalent(QChar c); static const BlackMisc::PhysicalQuantities::CFrequency &audioFrequencyEquivalent(QChar c);
/*! //! \brief All valid code pairs: AB, AC, AD ...
* \brief All valid code pairs: AB, AC, AD ...
*/
static const QStringList &codePairs(); static const QStringList &codePairs();
protected: protected:

View File

@@ -118,43 +118,31 @@ namespace BlackMisc
CCoordinateGeodetic(double latitudeDegrees, double longitudeDegrees, double heightMeters) : CCoordinateGeodetic(double latitudeDegrees, double longitudeDegrees, double heightMeters) :
m_latitude(latitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg()), m_longitude(longitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg()), m_height(heightMeters, BlackMisc::PhysicalQuantities::CLengthUnit::m()) {} m_latitude(latitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg()), m_longitude(longitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg()), m_height(heightMeters, BlackMisc::PhysicalQuantities::CLengthUnit::m()) {}
/*! //! \copydoc ICoordinateGeodetic::latitude
* \copydoc ICoordinateGeodetic::latitude
*/
virtual const CLatitude &latitude() const override virtual const CLatitude &latitude() const override
{ {
return this->m_latitude; return this->m_latitude;
} }
/*! //! \copydoc ICoordinateGeodetic::longitude
* \copydoc ICoordinateGeodetic::longitude
*/
virtual const CLongitude &longitude() const override virtual const CLongitude &longitude() const override
{ {
return this->m_longitude; return this->m_longitude;
} }
/*! //! \brief Height
* \brief Height
*/
const BlackMisc::PhysicalQuantities::CLength &height() const const BlackMisc::PhysicalQuantities::CLength &height() const
{ {
return this->m_height; return this->m_height;
} }
/*! //! \copydoc CValueObject::toQVariant
* \copydoc CValueObject::toQVariant
*/
virtual QVariant toQVariant() const override virtual QVariant toQVariant() const override
{ {
return QVariant::fromValue(*this); return QVariant::fromValue(*this);
} }
/*! //! \brief Switch unit of latitude / longitude
* \brief Switch unit of latitude / longitude
* \param unit
* \return
*/
CCoordinateGeodetic &switchUnit(const BlackMisc::PhysicalQuantities::CAngleUnit &unit) CCoordinateGeodetic &switchUnit(const BlackMisc::PhysicalQuantities::CAngleUnit &unit)
{ {
this->m_latitude.switchUnit(unit); this->m_latitude.switchUnit(unit);
@@ -162,56 +150,35 @@ namespace BlackMisc
return *this; return *this;
} }
/*! //! \brief Switch unit of height
* \brief Switch unit of height
* \param unit
* \return
*/
CCoordinateGeodetic &switchUnit(const BlackMisc::PhysicalQuantities::CLengthUnit &unit) CCoordinateGeodetic &switchUnit(const BlackMisc::PhysicalQuantities::CLengthUnit &unit)
{ {
this->m_height.switchUnit(unit); this->m_height.switchUnit(unit);
return *this; return *this;
} }
/*! //! \brief Set latitude
* \brief Set latitude
* \param latitude
*/
void setLatitude(const CLatitude &latitude) void setLatitude(const CLatitude &latitude)
{ {
this->m_latitude = latitude; this->m_latitude = latitude;
} }
/*! //! \brief Set longitude
* \brief Set longitude
* \param longitude
*/
void setLongitude(const CLongitude &longitude) void setLongitude(const CLongitude &longitude)
{ {
this->m_longitude = longitude; this->m_longitude = longitude;
} }
/*! //! \brief Set height
* \brief Set height
* \param height
*/
void setHeight(const BlackMisc::PhysicalQuantities::CLength &height) void setHeight(const BlackMisc::PhysicalQuantities::CLength &height)
{ {
this->m_height = height; this->m_height = height;
} }
/*! //! \brief Equal operator ==
* \brief Equal operator ==
* \param other
* \return
*/
bool operator ==(const CCoordinateGeodetic &other) const; bool operator ==(const CCoordinateGeodetic &other) const;
/*! //! \brief Unequal operator !=
* \brief Unequal operator !=
* \param other
* \return
*/
bool operator !=(const CCoordinateGeodetic &other) const; bool operator !=(const CCoordinateGeodetic &other) const;
//! \copydoc CValueObject::getValueHash //! \copydoc CValueObject::getValueHash

View File

@@ -17,22 +17,13 @@ namespace BlackMisc
template <class LATorLON> class CEarthAngle : public BlackMisc::PhysicalQuantities::CAngle template <class LATorLON> class CEarthAngle : public BlackMisc::PhysicalQuantities::CAngle
{ {
protected: protected:
/*! //! \brief Default constructor
* \brief Default constructor
*/
CEarthAngle() : CAngle(0.0, BlackMisc::PhysicalQuantities::CAngleUnit::deg()) {} CEarthAngle() : CAngle(0.0, BlackMisc::PhysicalQuantities::CAngleUnit::deg()) {}
/*! //! \brief Init by double value
* \brief Init by double value
* \param value
* \param unit
*/
CEarthAngle(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CAngle(value, unit) {} CEarthAngle(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CAngle(value, unit) {}
/*! //! \brief Init by CAngle value
* \brief Init by double value
* \param angle
*/
CEarthAngle(const BlackMisc::PhysicalQuantities::CAngle &angle) : CAngle(angle) {} CEarthAngle(const BlackMisc::PhysicalQuantities::CAngle &angle) : CAngle(angle) {}
//! \copydoc CValueObject::convertToQString //! \copydoc CValueObject::convertToQString
@@ -63,98 +54,60 @@ namespace BlackMisc
} }
public: public:
/*! //! \brief Virtual destructor
* \brief Virtual destructor
*/
virtual ~CEarthAngle() {} virtual ~CEarthAngle() {}
/*! //! \brief Equal operator ==
* \brief Equal operator ==
* \param latOrLon
* \return
*/
bool operator==(const CEarthAngle &latOrLon) const bool operator==(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator ==(latOrLon); return this->CAngle::operator ==(latOrLon);
} }
/*! //! \brief Not equal operator !=
* \brief Not equal operator !=
* \param latOrLon
* \return
*/
bool operator!=(const CEarthAngle &latOrLon) const bool operator!=(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator !=(latOrLon); return this->CAngle::operator !=(latOrLon);
} }
/*! //! \brief Plus operator +=
* \brief Plus operator +=
* \param latOrLon
* \return
*/
CEarthAngle &operator +=(const CEarthAngle &latOrLon) CEarthAngle &operator +=(const CEarthAngle &latOrLon)
{ {
this->CAngle::operator +=(latOrLon); this->CAngle::operator +=(latOrLon);
return *this; return *this;
} }
/*! //! \brief Minus operator-=
* \brief Minus operator-=
* \param latOrLon
* \return
*/
CEarthAngle &operator -=(const CEarthAngle &latOrLon) CEarthAngle &operator -=(const CEarthAngle &latOrLon)
{ {
this->CAngle::operator -=(latOrLon); this->CAngle::operator -=(latOrLon);
return *this; return *this;
} }
/*! //! \brief Greater operator >
* \brief Greater operator >
* \param latOrLon
* \return
*/
bool operator >(const CEarthAngle &latOrLon) const bool operator >(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator >(latOrLon); return this->CAngle::operator >(latOrLon);
} }
/*! //! \brief Less operator <
* \brief Less operator <
* \param latOrLon
* \return
*/
bool operator <(const CEarthAngle &latOrLon) const bool operator <(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator >(latOrLon); return this->CAngle::operator >(latOrLon);
} }
/*! //! \brief Less equal operator <=
* \brief Less equal operator <=
* \param latOrLon
* \return
*/
bool operator <=(const CEarthAngle &latOrLon) const bool operator <=(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator <=(latOrLon); return this->CAngle::operator <=(latOrLon);
} }
/*! //! \brief Greater equal operator >=
* \brief Greater equal operator >=
* \param latOrLon
* \return
*/
bool operator >=(const CEarthAngle &latOrLon) const bool operator >=(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator >=(latOrLon); return this->CAngle::operator >=(latOrLon);
} }
/*! //! \brief Plus operator +
* \brief Plus operator +
* \param latOrLon
* \return
*/
LATorLON operator +(const CEarthAngle &latOrLon) const LATorLON operator +(const CEarthAngle &latOrLon) const
{ {
LATorLON l(*this); LATorLON l(*this);
@@ -162,11 +115,7 @@ namespace BlackMisc
return l; return l;
} }
/*! //! \brief Minus operator -
* \brief Minus operator -
* \param latOrLon
* \return
*/
LATorLON operator -(const CEarthAngle &latOrLon) const LATorLON operator -(const CEarthAngle &latOrLon) const
{ {
LATorLON l(*this); LATorLON l(*this);
@@ -174,9 +123,7 @@ namespace BlackMisc
return l; return l;
} }
/*! //! \brief Register metadata
* Register metadata
*/
static void registerMetadata(); static void registerMetadata();
/*! /*!