From e8b52b33d04bba0b68c63b33e3c4d879a3a6a24e Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Tue, 13 Aug 2013 22:23:55 +0100 Subject: [PATCH] removed CAviationVerticalPositions --- .../blackmiscquantities/samplesaviation.cpp | 4 - samples/blackmiscquantities/samplesaviation.h | 1 - src/blackmisc/avallclasses.h | 1 - src/blackmisc/avverticalpositions.cpp | 143 ------------------ src/blackmisc/avverticalpositions.h | 133 ---------------- 5 files changed, 282 deletions(-) delete mode 100644 src/blackmisc/avverticalpositions.cpp delete mode 100644 src/blackmisc/avverticalpositions.h diff --git a/samples/blackmiscquantities/samplesaviation.cpp b/samples/blackmiscquantities/samplesaviation.cpp index 8ca2ba9c1..d775dea48 100644 --- a/samples/blackmiscquantities/samplesaviation.cpp +++ b/samples/blackmiscquantities/samplesaviation.cpp @@ -22,10 +22,6 @@ int CSamplesAviation::samples() qDebug() << h1; qDebug() << h1 << h2 << (h1 == h2) << (h1 != h2) << (h1 == h1); - CAviationVerticalPositions vp1 = CAviationVerticalPositions::fromAltitudeAndElevationInFt(10000.0, 1111.0); - CAviationVerticalPositions vp2 = vp1; - qDebug() << vp1 << (vp1 == vp2) << (vp1 != vp2); - CComSystem c1 = CComSystem::getCom1System(125.3); qDebug() << c1; c1.setActiveUnicom(); diff --git a/samples/blackmiscquantities/samplesaviation.h b/samples/blackmiscquantities/samplesaviation.h index 67093c95e..f4ebe94af 100644 --- a/samples/blackmiscquantities/samplesaviation.h +++ b/samples/blackmiscquantities/samplesaviation.h @@ -8,7 +8,6 @@ #include "blackmisc/pqconstants.h" #include "blackmisc/avheading.h" -#include "blackmisc/avverticalpositions.h" #include "blackmisc/aviocomsystem.h" #include "blackmisc/avionavsystem.h" #include "blackmisc/aviotransponder.h" diff --git a/src/blackmisc/avallclasses.h b/src/blackmisc/avallclasses.h index a1626c962..bc37c9a3f 100644 --- a/src/blackmisc/avallclasses.h +++ b/src/blackmisc/avallclasses.h @@ -13,6 +13,5 @@ #include "blackmisc/avionavsystem.h" #include "blackmisc/aviotransponder.h" #include "blackmisc/avtrack.h" -#include "blackmisc/avverticalpositions.h" #endif // guard diff --git a/src/blackmisc/avverticalpositions.cpp b/src/blackmisc/avverticalpositions.cpp deleted file mode 100644 index 6b6c4d38d..000000000 --- a/src/blackmisc/avverticalpositions.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "avverticalpositions.h" - -using BlackMisc::PhysicalQuantities::CLength; -using BlackMisc::PhysicalQuantities::CLengthUnit; -using BlackMisc::PhysicalQuantities::CPhysicalQuantitiesConstants; - -namespace BlackMisc -{ -namespace Aviation -{ - -/* - * Constructor - */ -CAviationVerticalPositions::CAviationVerticalPositions() : - m_altitude(CAltitude(0, true, CLengthUnit::ft())), - m_elevation(CPhysicalQuantitiesConstants::Length0ft()), - m_height(CPhysicalQuantitiesConstants::Length0ft()) -{ - // void -} - -/* - * Constructor - */ -CAviationVerticalPositions::CAviationVerticalPositions(const CAltitude &altitude, const CLength &elevation, const CLength &height) : - m_altitude(altitude), m_elevation(elevation), m_height(height) -{ - // void -} - -/* - * Copy constructor - */ -CAviationVerticalPositions::CAviationVerticalPositions(const CAviationVerticalPositions &otherPosition) : - m_altitude(otherPosition.m_altitude), m_elevation(otherPosition.m_elevation), m_height(otherPosition.m_height) -{ - // void -} - -/* - * Assigment - */ -CAviationVerticalPositions &CAviationVerticalPositions::operator =(const CAviationVerticalPositions &otherPositions) -{ - if (this == &otherPositions) return *this; // Same object? - this->m_altitude = otherPositions.m_altitude; - this->m_elevation = otherPositions.m_elevation; - this->m_height = otherPositions.m_height; - return *this; -} - -/* - * Equal operator - */ -bool CAviationVerticalPositions::operator ==(const CAviationVerticalPositions &otherPositions) -{ - return this->m_altitude == otherPositions.m_altitude && - this->m_elevation == otherPositions.m_elevation && - this->m_height == otherPositions.m_height; -} - -/* - * Unequal operator - */ -bool CAviationVerticalPositions::operator !=(const CAviationVerticalPositions &otherPositions) -{ - return !(*this == otherPositions); -} - -/* - * String representation for converter - */ -QString CAviationVerticalPositions::convertToQString(bool /** i18n **/) const -{ - QString s = QString("Altitude: "). - append(this->m_altitude.unitValueRoundedWithUnit()). - append(" Elevation: "). - append(this->m_elevation.unitValueRoundedWithUnit()). - append(" Height: "). - append(this->m_height.unitValueRoundedWithUnit()); - return s; -} - -/* - * Factory by elevation and altitude - */ -CAviationVerticalPositions CAviationVerticalPositions::fromAltitudeAndElevationInFt(double altitudeMslFt, double elevationFt) -{ - CAltitude a(altitudeMslFt, true, CLengthUnit::ft()); - CLength e(elevationFt, CLengthUnit::ft()); - CLength h(altitudeMslFt - elevationFt, CLengthUnit::ft()); - return CAviationVerticalPositions(a, e, h); -} - -/* - * Factory by elevation and altitude - */ -CAviationVerticalPositions CAviationVerticalPositions::fromAltitudeAndElevationInM(double altitudeMslM, double elevationM) -{ - CAltitude a(altitudeMslM, true, CLengthUnit::m()); - CLength e(elevationM, CLengthUnit::m()); - CLength h(altitudeMslM - elevationM, CLengthUnit::m()); - return CAviationVerticalPositions(a, e, h); -} - - -/*! - * \brief Stream to DBus << - * \param argument - */ -void CAviationVerticalPositions::marshallToDbus(QDBusArgument &argument) const { - argument << this->m_altitude; - argument << this->m_elevation; - argument << this->m_height; -} - -/*! - * \brief Stream from DBus >> - * \param argument - */ -void CAviationVerticalPositions::unmarshallFromDbus(const QDBusArgument &argument) { - argument >> this->m_altitude; - argument >> this->m_elevation; - argument >> this->m_height; -} - -/* - * Register metadata - */ -void CAviationVerticalPositions::registerMetadata() -{ - qRegisterMetaType(typeid(CAviationVerticalPositions).name()); - qDBusRegisterMetaType(); -} - -} // namespace -} // namespace diff --git a/src/blackmisc/avverticalpositions.h b/src/blackmisc/avverticalpositions.h deleted file mode 100644 index ead990609..000000000 --- a/src/blackmisc/avverticalpositions.h +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BLACKMISC_AVVERTICALPOSITION_H -#define BLACKMISC_AVVERTICALPOSITION_H - -#include "blackmisc/avaltitude.h" -#include "blackmisc/pqconstants.h" -#include "blackmisc/basestreamstringifier.h" - -namespace BlackMisc -{ -namespace Aviation -{ - -/*! - * \brief Vertical (Z) positions of an aircraft - */ -class CAviationVerticalPositions : public BlackMisc::CBaseStreamStringifier -{ -private: - BlackMisc::Aviation::CAltitude m_altitude; //!< altitude - BlackMisc::PhysicalQuantities::CLength m_elevation; //!< elevation - BlackMisc::PhysicalQuantities::CLength m_height; //!< height - -protected: - /*! - * \brief String for converter - * \param i18n - * \return - */ - virtual QString convertToQString(bool i18n = false) const; - - /*! - * \brief Unmarshall from Dbus - * \param argument - */ - virtual void unmarshallFromDbus(const QDBusArgument &argument); - - /*! - * \brief Unmarshall from Dbus - * \param argument - */ - virtual void marshallToDbus(QDBusArgument &argument) const; - -public: - /*! - * \brief Default constructor - */ - CAviationVerticalPositions(); - /*! - * \brief Constructor - * \param altitude - * \param elevation - * \param height - */ - CAviationVerticalPositions(const CAltitude &altitude, const BlackMisc::PhysicalQuantities::CLength &elevation, const BlackMisc::PhysicalQuantities::CLength &height); - /*! - * \brief Copy constructor - * \param otherPosition - */ - CAviationVerticalPositions(const CAviationVerticalPositions &otherPosition); - /*! - * \brief Assignment operator = - * \param otherPositions - * @return - */ - CAviationVerticalPositions &operator =(const CAviationVerticalPositions &otherPositions); - /*! - * \brief Equal operator == - * \param otherPositions - * @return - */ - bool operator ==(const CAviationVerticalPositions &otherPositions); - /*! - * \brief Unequal operator == - * \param otherPositions - * @return - */ - bool operator !=(const CAviationVerticalPositions &otherPositions); - /*! - * \brief Height - * \return - */ - BlackMisc::PhysicalQuantities::CLength getHeight() const - { - return this->m_height; - } - /*! - * \brief Elevation - * \return - */ - BlackMisc::PhysicalQuantities::CLength getElevation() const - { - return this->m_elevation; - } - /*! - * \brief Altitude - * \return - */ - CAltitude getAltitude()const - { - return this->m_altitude; - } - /*! - * \brief Factory getting tupel frome levation and altitude values in ft - * \param altitudeMslFt - * \param elevationFt - * \return - */ - - static CAviationVerticalPositions fromAltitudeAndElevationInFt(double altitudeMslFt, double elevationFt); - /*! - * \brief Factory getting tupel frome levation and altitude values in meters - * \param altitudeMslM - * \param elevationM - * \return - */ - static CAviationVerticalPositions fromAltitudeAndElevationInM(double altitudeMslM, double elevationM); - - /*! - * \brief Register metadata - */ - static void registerMetadata(); -}; - -} // namespace -} // namespace -Q_DECLARE_METATYPE(BlackMisc::Aviation::CAviationVerticalPositions) - -#endif // BLACKMISC_AVVERTICALPOSITION_H