removed CAviationVerticalPositions

This commit is contained in:
Mathew Sutcliffe
2013-08-13 22:23:55 +01:00
parent e6e6dea4cd
commit e8b52b33d0
5 changed files with 0 additions and 282 deletions

View File

@@ -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();

View File

@@ -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"

View File

@@ -13,6 +13,5 @@
#include "blackmisc/avionavsystem.h"
#include "blackmisc/aviotransponder.h"
#include "blackmisc/avtrack.h"
#include "blackmisc/avverticalpositions.h"
#endif // guard

View File

@@ -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<CAviationVerticalPositions>(typeid(CAviationVerticalPositions).name());
qDBusRegisterMetaType<CAviationVerticalPositions>();
}
} // namespace
} // namespace

View File

@@ -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