mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
Added legal header, changed include guards to contain namespace prefix e.g BLACKMISC_XYZ_H
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
|
||||
#include "avaltitude.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CLength;
|
||||
using BlackMisc::PhysicalQuantities::CLengthUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/* Copyright (C) 2013 VATSIM Community
|
||||
/* 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 AVALTITUDE_H
|
||||
#define AVALTITUDE_H
|
||||
#ifndef BLACKMISC_AVALTITUDE_H
|
||||
#define BLACKMISC_AVALTITUDE_H
|
||||
#include "blackmisc/pqlength.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CLength;
|
||||
using BlackMisc::PhysicalQuantities::CLengthUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
@@ -19,7 +16,7 @@ namespace Aviation
|
||||
* \brief Altitude as used in aviation, can be AGL or MSL Altitude
|
||||
* \remarks Intentionally allowing +/- CLength , and >= / <= CLength.
|
||||
*/
|
||||
class CAltitude : public CLength
|
||||
class CAltitude : public BlackMisc::PhysicalQuantities::CLength
|
||||
{
|
||||
private:
|
||||
bool m_msl; //!< MSL or AGL?
|
||||
@@ -35,34 +32,34 @@ public:
|
||||
/*!
|
||||
* \brief Default constructor: 0 Altitude true
|
||||
*/
|
||||
CAltitude() : CLength(0, CLengthUnit::m()), m_msl(true) {}
|
||||
CAltitude() : BlackMisc::PhysicalQuantities::CLength(0, BlackMisc::PhysicalQuantities::CLengthUnit::m()), m_msl(true) {}
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param value
|
||||
* \param msl MSL or AGL?
|
||||
* \param unit
|
||||
*/
|
||||
CAltitude(double value, bool msl, const CLengthUnit &unit) : CLength(value, unit), m_msl(msl) {}
|
||||
CAltitude(double value, bool msl, const BlackMisc::PhysicalQuantities::CLengthUnit &unit) : BlackMisc::PhysicalQuantities::CLength(value, unit), m_msl(msl) {}
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param value
|
||||
* \param msl MSL or AGL?
|
||||
* \param unit
|
||||
*/
|
||||
CAltitude(int value, bool msl, const CLengthUnit &unit) : CLength(value, unit), m_msl(msl) {}
|
||||
CAltitude(int value, bool msl, const BlackMisc::PhysicalQuantities::CLengthUnit &unit) : CLength(value, unit), m_msl(msl) {}
|
||||
/*!
|
||||
* \brief Constructor by CLength
|
||||
* \param Altitude
|
||||
* \param msl
|
||||
*/
|
||||
CAltitude(CLength altitude, bool msl) : CLength(), m_msl(msl) {
|
||||
CLength::operator =(altitude);
|
||||
CAltitude(BlackMisc::PhysicalQuantities::CLength altitude, bool msl) : BlackMisc::PhysicalQuantities::CLength(), m_msl(msl) {
|
||||
BlackMisc::PhysicalQuantities::CLength::operator =(altitude);
|
||||
}
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
* \param otherAltitude
|
||||
*/
|
||||
CAltitude(const CAltitude &otherAltitude) : CLength(otherAltitude), m_msl(otherAltitude.m_msl) {}
|
||||
CAltitude(const CAltitude &otherAltitude) : BlackMisc::PhysicalQuantities::CLength(otherAltitude), m_msl(otherAltitude.m_msl) {}
|
||||
/*!
|
||||
* \brief Assignment operator =
|
||||
* \param otherQuantity
|
||||
@@ -100,4 +97,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // AVALTITUDE_H
|
||||
#endif // BLACKMISC_AVALTITUDE_H
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
#include "avheading.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CAngle;
|
||||
using BlackMisc::PhysicalQuantities::CAngleUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
* 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 AVHEADING_H
|
||||
#define AVHEADING_H
|
||||
#ifndef BLACKMISC_AVHEADING_H
|
||||
#define BLACKMISC_AVHEADING_H
|
||||
#include "blackmisc/pqangle.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CAngle;
|
||||
using BlackMisc::PhysicalQuantities::CAngleUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
@@ -18,7 +15,7 @@ namespace Aviation
|
||||
* \brief Heading as used in aviation, can be true or magnetic heading
|
||||
* \remarks Intentionally allowing +/- CAngle , and >= / <= CAngle.
|
||||
*/
|
||||
class CHeading : public CAngle
|
||||
class CHeading : public BlackMisc::PhysicalQuantities::CAngle
|
||||
{
|
||||
private:
|
||||
bool m_magnetic; //!< magnetic or true heading?
|
||||
@@ -34,21 +31,21 @@ public:
|
||||
/*!
|
||||
* \brief Default constructor: 0 heading true
|
||||
*/
|
||||
CHeading() : CAngle(0, CAngleUnit::rad()), m_magnetic(true) {}
|
||||
CHeading() : CAngle(0, BlackMisc::PhysicalQuantities::CAngleUnit::rad()), m_magnetic(true) {}
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param value
|
||||
* \param magnetic
|
||||
* \param unit
|
||||
*/
|
||||
CHeading(double value, bool magnetic, const CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
CHeading(double value, bool magnetic, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param value
|
||||
* \param magnetic
|
||||
* \param unit
|
||||
*/
|
||||
CHeading(int value, bool magnetic, const CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
CHeading(int value, bool magnetic, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
/*!
|
||||
* \brief Constructor by CAngle
|
||||
* \param heading
|
||||
@@ -98,4 +95,4 @@ public:
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // AVHEADING_H
|
||||
#endif // BLACKMISC_AVHEADING_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 AVIOADFSYSTEM_H
|
||||
#define AVIOADFSYSTEM_H
|
||||
#ifndef BLACKMISC_AVIOADFSYSTEM_H
|
||||
#define BLACKMISC_AVIOADFSYSTEM_H
|
||||
|
||||
#include "blackmisc/aviomodulator.h"
|
||||
|
||||
@@ -244,4 +244,4 @@ public:
|
||||
} // namespace
|
||||
|
||||
|
||||
#endif // AVIOADFSYSTEM_H
|
||||
#endif // BLACKMISC_AVIOADFSYSTEM_H
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/* Copyright (C) 2013 VATSIM Community
|
||||
/* 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 AVIOBASE_H
|
||||
#define AVIOBASE_H
|
||||
#ifndef BLACKMISC_AVIOBASE_H
|
||||
#define BLACKMISC_AVIOBASE_H
|
||||
|
||||
// QtGlobal is required for asserts
|
||||
#include <QtGlobal>
|
||||
#include "blackmisc/pqconstants.h"
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -105,4 +105,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // AVIOBASE_H
|
||||
#endif // BLACKMISC_AVIOBASE_H
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
* 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 AVIOCOMUNIT_H
|
||||
#define AVIOCOMUNIT_H
|
||||
#ifndef BLACKMISC_AVIOCOMUNIT_H
|
||||
#define BLACKMISC_AVIOCOMUNIT_H
|
||||
#include "blackmisc/aviomodulator.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CPhysicalQuantitiesConstants;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
@@ -25,8 +23,8 @@ private:
|
||||
* \param f
|
||||
* \return
|
||||
*/
|
||||
bool isValidCivilAviationFrequency(CFrequency f) const {
|
||||
double fr = f.valueRounded(CFrequencyUnit::MHz(), this->m_digits);
|
||||
bool isValidCivilAviationFrequency(BlackMisc::PhysicalQuantities::CFrequency f) const {
|
||||
double fr = f.valueRounded(BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz(), this->m_digits);
|
||||
return fr >= 118.0 && fr <= 136.975;
|
||||
}
|
||||
/*!
|
||||
@@ -34,8 +32,8 @@ private:
|
||||
* \param f
|
||||
* \return
|
||||
*/
|
||||
bool isValidMilitaryFrequency(CFrequency f) const {
|
||||
double fr = f.valueRounded(CFrequencyUnit::MHz(), this->m_digits);
|
||||
bool isValidMilitaryFrequency(BlackMisc::PhysicalQuantities::CFrequency f) const {
|
||||
double fr = f.valueRounded(BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz(), this->m_digits);
|
||||
return fr >= 220.0 && fr <= 399.95;
|
||||
}
|
||||
/*!
|
||||
@@ -47,7 +45,7 @@ private:
|
||||
* \param digits
|
||||
*
|
||||
*/
|
||||
CComSystem(bool validate, const QString &name, const CFrequency &activeFrequency, const CFrequency &standbyFrequency, int digits = 3):
|
||||
CComSystem(bool validate, const QString &name, const BlackMisc::PhysicalQuantities::CFrequency &activeFrequency, const BlackMisc::PhysicalQuantities::CFrequency &standbyFrequency, int digits = 3):
|
||||
CModulator(name, activeFrequency, standbyFrequency, digits) {
|
||||
this->validate(validate);
|
||||
}
|
||||
@@ -97,7 +95,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \param digits
|
||||
*/
|
||||
CComSystem(const QString &name, const CFrequency &activeFrequency, const CFrequency &standbyFrequency = CModulator::FrequencyNotSet(), int digits = 3):
|
||||
CComSystem(const QString &name, const BlackMisc::PhysicalQuantities::CFrequency &activeFrequency, const BlackMisc::PhysicalQuantities::CFrequency &standbyFrequency = CModulator::FrequencyNotSet(), int digits = 3):
|
||||
CModulator(name, activeFrequency, standbyFrequency == CModulator::FrequencyNotSet() ? activeFrequency : standbyFrequency, digits) {
|
||||
this->validate(true);
|
||||
}
|
||||
@@ -122,14 +120,14 @@ public:
|
||||
*/
|
||||
void setActiveUnicom() {
|
||||
this->toggleActiveStandby();
|
||||
this->setFrequencyActive(CPhysicalQuantitiesConstants::FrequencyUnicom());
|
||||
this->setFrequencyActive(BlackMisc::PhysicalQuantities::CPhysicalQuantitiesConstants::FrequencyUnicom());
|
||||
}
|
||||
/*!
|
||||
* \brief Set International Air Distress 121.5MHz
|
||||
*/
|
||||
void setActiveInternationalAirDistress() {
|
||||
this->toggleActiveStandby();
|
||||
this->setFrequencyActive(CPhysicalQuantitiesConstants::FrequencyInternationalAirDistress());
|
||||
this->setFrequencyActive(BlackMisc::PhysicalQuantities::CPhysicalQuantitiesConstants::FrequencyInternationalAirDistress());
|
||||
}
|
||||
/*!
|
||||
* \brief Assigment operator =
|
||||
@@ -167,7 +165,7 @@ public:
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetComSystem(CComSystem &comSystem, const QString &name, double activeFrequencyMHz, double standbyFrequencyMHz = -1) {
|
||||
comSystem = CComSystem(false, name, CFrequency(activeFrequencyMHz, CFrequencyUnit::MHz()), CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, CFrequencyUnit::MHz()));
|
||||
comSystem = CComSystem(false, name, BlackMisc::PhysicalQuantities::CFrequency(activeFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()), BlackMisc::PhysicalQuantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
bool s;
|
||||
if (!(s = comSystem.validate(false))) comSystem = CComSystem(); // reset to default
|
||||
return s;
|
||||
@@ -182,7 +180,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetComSystem(CComSystem &comSystem, const QString &name, CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static bool tryGetComSystem(CComSystem &comSystem, const QString &name, BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
comSystem = CComSystem(false, name, activeFrequency, standbyFrequency);
|
||||
bool s;
|
||||
if (!(s = comSystem.validate(false))) comSystem = CComSystem(); // reset to default
|
||||
@@ -195,7 +193,7 @@ public:
|
||||
* \return
|
||||
*/
|
||||
static CComSystem getCom1System(double activeFrequencyMHz, double standbyFrequencyMHz = -1) {
|
||||
return CComSystem(CModulator::NameCom1(), CFrequency(activeFrequencyMHz, CFrequencyUnit::MHz()), CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, CFrequencyUnit::MHz()));
|
||||
return CComSystem(CModulator::NameCom1(), BlackMisc::PhysicalQuantities::CFrequency(activeFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()), BlackMisc::PhysicalQuantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
}
|
||||
/*!
|
||||
* \brief COM1 unit
|
||||
@@ -203,7 +201,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static CComSystem getCom1System(CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static CComSystem getCom1System(BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CComSystem(CModulator::NameCom1(), activeFrequency, standbyFrequency == CModulator::FrequencyNotSet() ? activeFrequency : standbyFrequency);
|
||||
}
|
||||
/*!
|
||||
@@ -223,7 +221,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetCom1Unit(CComSystem &comSystem, CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static bool tryGetCom1Unit(CComSystem &comSystem, BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CComSystem::tryGetComSystem(comSystem, CModulator::NameCom1(), activeFrequency, standbyFrequency);
|
||||
}
|
||||
/*!
|
||||
@@ -233,7 +231,7 @@ public:
|
||||
* \return
|
||||
*/
|
||||
static CComSystem getCom2System(double activeFrequencyMHz, double standbyFrequencyMHz = -1) {
|
||||
return CComSystem(CModulator::NameCom2(), CFrequency(activeFrequencyMHz, CFrequencyUnit::MHz()), CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, CFrequencyUnit::MHz()));
|
||||
return CComSystem(CModulator::NameCom2(), BlackMisc::PhysicalQuantities::CFrequency(activeFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()), BlackMisc::PhysicalQuantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
}
|
||||
/*!
|
||||
* \brief COM2 unit
|
||||
@@ -241,7 +239,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static CComSystem getCom2System(CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static CComSystem getCom2System(BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CComSystem(CModulator::NameCom2(), activeFrequency, standbyFrequency == CModulator::FrequencyNotSet() ? activeFrequency : standbyFrequency);
|
||||
}
|
||||
/*!
|
||||
@@ -261,7 +259,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetCom2System(CComSystem &comSystem, CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static bool tryGetCom2System(CComSystem &comSystem, BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CComSystem::tryGetComSystem(comSystem, CModulator::NameCom2(), activeFrequency, standbyFrequency);
|
||||
}
|
||||
|
||||
@@ -272,7 +270,7 @@ public:
|
||||
* \return
|
||||
*/
|
||||
static CComSystem getCom3System(double activeFrequencyMHz, double standbyFrequencyMHz = -1) {
|
||||
return CComSystem(CModulator::NameCom3(), CFrequency(activeFrequencyMHz, CFrequencyUnit::MHz()), CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, CFrequencyUnit::MHz()));
|
||||
return CComSystem(CModulator::NameCom3(), BlackMisc::PhysicalQuantities::CFrequency(activeFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()), BlackMisc::PhysicalQuantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
}
|
||||
/*!
|
||||
* \brief COM3 unit
|
||||
@@ -280,7 +278,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static CComSystem getCom3System(CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static CComSystem getCom3System(BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CComSystem(CModulator::NameCom3(), activeFrequency, standbyFrequency == CModulator::FrequencyNotSet() ? activeFrequency : standbyFrequency);
|
||||
}
|
||||
|
||||
@@ -301,7 +299,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetCom3System(CComSystem &comSystem, CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static bool tryGetCom3System(CComSystem &comSystem, BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CComSystem::tryGetComSystem(comSystem, CModulator::NameCom3(), activeFrequency, standbyFrequency);
|
||||
}
|
||||
};
|
||||
@@ -310,4 +308,4 @@ public:
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // AVIOCOMUNIT_H
|
||||
#endif // include guard
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
/* 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 "blackmisc/aviomodulator.h"
|
||||
#include "blackmisc/aviocomsystem.h"
|
||||
#include "blackmisc/avionavsystem.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CFrequency;
|
||||
using BlackMisc::PhysicalQuantities::CFrequencyUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
@@ -27,14 +35,6 @@ template <class AVIO> QString CModulator<AVIO>::stringForStreamingOperator() con
|
||||
s.append(" Standby: ").append(this->m_frequencyStandby.unitValueRoundedWithUnit(3));
|
||||
return s;
|
||||
}
|
||||
/* Copyright (C) 2013 VATSIM Community
|
||||
* 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/. */
|
||||
/* Copyright (C) 2013 VATSIM Community
|
||||
* 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/. */
|
||||
|
||||
/**
|
||||
* Assigment operator =
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
* 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 AVIOMODULATORUNIT_H
|
||||
#define AVIOMODULATORUNIT_H
|
||||
#ifndef BLACKMISC_AVIOMODULATORUNIT_H
|
||||
#define BLACKMISC_AVIOMODULATORUNIT_H
|
||||
#include "blackmisc/aviobase.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CFrequency;
|
||||
using BlackMisc::PhysicalQuantities::CFrequencyUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
@@ -21,8 +18,8 @@ namespace Aviation
|
||||
template <class AVIO> class CModulator : public CAvionicsBase
|
||||
{
|
||||
private:
|
||||
CFrequency m_frequencyActive; //!< active frequency
|
||||
CFrequency m_frequencyStandby; //!< standby frequency
|
||||
BlackMisc::PhysicalQuantities::CFrequency m_frequencyActive; //!< active frequency
|
||||
BlackMisc::PhysicalQuantities::CFrequency m_frequencyStandby; //!< standby frequency
|
||||
|
||||
protected:
|
||||
int m_digits; //!< digits used
|
||||
@@ -44,7 +41,7 @@ protected:
|
||||
* \param activeFrequency
|
||||
* \param standbyFrequency
|
||||
*/
|
||||
CModulator(const QString &name, const CFrequency &activeFrequency, const CFrequency &standbyFrequency, int digits) :
|
||||
CModulator(const QString &name, const BlackMisc::PhysicalQuantities::CFrequency &activeFrequency, const BlackMisc::PhysicalQuantities::CFrequency &standbyFrequency, int digits) :
|
||||
m_frequencyActive(activeFrequency),
|
||||
m_digits(digits), m_frequencyStandby(standbyFrequency), CAvionicsBase(name) { }
|
||||
/*!
|
||||
@@ -71,14 +68,14 @@ protected:
|
||||
* \param frequencyMHz
|
||||
*/
|
||||
void setFrequencyActiveMHz(double frequencyMHz) {
|
||||
this->m_frequencyActive = CFrequency(frequencyMHz, CFrequencyUnit::MHz());
|
||||
this->m_frequencyActive = BlackMisc::PhysicalQuantities::CFrequency(frequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz());
|
||||
}
|
||||
/*!
|
||||
* \brief Set standby frequency
|
||||
* \param frequencyMHz
|
||||
*/
|
||||
void setFrequencyStandbyMHz(double frequencyMHz) {
|
||||
this->m_frequencyStandby = CFrequency(frequencyMHz, CFrequencyUnit::MHz());
|
||||
this->m_frequencyStandby = BlackMisc::PhysicalQuantities::CFrequency(frequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz());
|
||||
}
|
||||
/*!
|
||||
* \brief Assigment operator =
|
||||
@@ -166,8 +163,8 @@ protected:
|
||||
* \brief Frequency not set
|
||||
* \return
|
||||
*/
|
||||
static const CFrequency& FrequencyNotSet() {
|
||||
static CFrequency f;
|
||||
static const BlackMisc::PhysicalQuantities::CFrequency& FrequencyNotSet() {
|
||||
static BlackMisc::PhysicalQuantities::CFrequency f;
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -191,28 +188,28 @@ public:
|
||||
* \brief Active frequency
|
||||
* \return
|
||||
*/
|
||||
CFrequency getFrequencyActive() const {
|
||||
BlackMisc::PhysicalQuantities::CFrequency getFrequencyActive() const {
|
||||
return this->m_frequencyActive;
|
||||
}
|
||||
/*!
|
||||
* \brief Standby frequency
|
||||
* \return
|
||||
*/
|
||||
CFrequency getFrequencyStandby() const {
|
||||
BlackMisc::PhysicalQuantities::CFrequency getFrequencyStandby() const {
|
||||
return this->m_frequencyActive;
|
||||
}
|
||||
/*!
|
||||
* \brief Set active frequency
|
||||
* \param frequency
|
||||
*/
|
||||
void setFrequencyActive(const CFrequency &frequency) {
|
||||
void setFrequencyActive(const BlackMisc::PhysicalQuantities::CFrequency &frequency) {
|
||||
this->m_frequencyActive = frequency;
|
||||
}
|
||||
/*!
|
||||
* \brief Set standby frequency
|
||||
* \param frequency
|
||||
*/
|
||||
void setFrequencyStandby(const CFrequency &frequency) {
|
||||
void setFrequencyStandby(const BlackMisc::PhysicalQuantities::CFrequency &frequency) {
|
||||
this->m_frequencyStandby = frequency;
|
||||
}
|
||||
};
|
||||
@@ -220,4 +217,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // AVIOMODULATORUNIT_H
|
||||
#endif // guard
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
/* Copyright (C) 2013 VATSIM Community
|
||||
/* 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 AVIONAVSYSTEM_H
|
||||
#define AVIONAVSYSTEM_H
|
||||
#ifndef BLACKMISC_AVIONAVSYSTEM_H
|
||||
#define BLACKMISC_AVIONAVSYSTEM_H
|
||||
#include "blackmisc/aviomodulator.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
@@ -24,8 +23,8 @@ private:
|
||||
* \param f
|
||||
* \return
|
||||
*/
|
||||
bool isValidCivilNavigationFrequency(CFrequency f) const {
|
||||
double fr = f.valueRounded(CFrequencyUnit::MHz(), this->m_digits);
|
||||
bool isValidCivilNavigationFrequency(BlackMisc::PhysicalQuantities::CFrequency f) const {
|
||||
double fr = f.valueRounded(BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz(), this->m_digits);
|
||||
return fr >= 108.0 && fr <= 117.95;
|
||||
}
|
||||
/*!
|
||||
@@ -33,7 +32,7 @@ private:
|
||||
* \param f
|
||||
* \return
|
||||
*/
|
||||
bool isValidMilitaryNavigationFrequency(CFrequency f) const {
|
||||
bool isValidMilitaryNavigationFrequency(BlackMisc::PhysicalQuantities::CFrequency f) const {
|
||||
return false;
|
||||
}
|
||||
/*!
|
||||
@@ -45,7 +44,7 @@ private:
|
||||
* \param digits
|
||||
*
|
||||
*/
|
||||
CNavSystem(bool validate, const QString &name, const CFrequency &activeFrequency, const CFrequency &standbyFrequency, int digits = 3):
|
||||
CNavSystem(bool validate, const QString &name, const BlackMisc::PhysicalQuantities::CFrequency &activeFrequency, const BlackMisc::PhysicalQuantities::CFrequency &standbyFrequency, int digits = 3):
|
||||
CModulator(name, activeFrequency, standbyFrequency, digits) {
|
||||
this->validate(validate);
|
||||
}
|
||||
@@ -96,7 +95,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \param digits
|
||||
*/
|
||||
CNavSystem(const QString &name, const CFrequency &activeFrequency, const CFrequency &standbyFrequency, int digits = 3):
|
||||
CNavSystem(const QString &name, const BlackMisc::PhysicalQuantities::CFrequency &activeFrequency, const BlackMisc::PhysicalQuantities::CFrequency &standbyFrequency, int digits = 3):
|
||||
CModulator(name, activeFrequency, standbyFrequency, digits) {
|
||||
this->validate(true);
|
||||
}
|
||||
@@ -121,7 +120,7 @@ public:
|
||||
* \param otherSystem
|
||||
* \return
|
||||
*/
|
||||
CNavSystem& operator =(const CNavSystem &otherSystem) {
|
||||
CNavSystem &operator =(const CNavSystem &otherSystem) {
|
||||
CModulator::operator =(otherSystem);
|
||||
return (*this);
|
||||
}
|
||||
@@ -152,7 +151,7 @@ public:
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetNavSystem(CNavSystem &navSystem, const QString &name, double activeFrequencyMHz, double standbyFrequencyMHz = -1) {
|
||||
navSystem = CNavSystem(false, name, CFrequency(activeFrequencyMHz, CFrequencyUnit::MHz()), CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, CFrequencyUnit::MHz()));
|
||||
navSystem = CNavSystem(false, name, BlackMisc::PhysicalQuantities::CFrequency(activeFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()), BlackMisc::PhysicalQuantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
bool s;
|
||||
if (!(s = navSystem.validate(false))) navSystem = CNavSystem(); // reset to default
|
||||
return s;
|
||||
@@ -166,7 +165,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetNavSystem(CNavSystem &navSystem, const QString &name, CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static bool tryGetNavSystem(CNavSystem &navSystem, const QString &name, BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
navSystem = CNavSystem(false, name, activeFrequency, standbyFrequency);
|
||||
bool s;
|
||||
if (!(s = navSystem.validate(false))) navSystem = CNavSystem(); // reset to default
|
||||
@@ -179,7 +178,7 @@ public:
|
||||
* \return
|
||||
*/
|
||||
static CNavSystem getNav1System(double activeFrequencyMHz, double standbyFrequencyMHz = -1) {
|
||||
return CNavSystem(CModulator::NameNav1(), CFrequency(activeFrequencyMHz, CFrequencyUnit::MHz()), CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, CFrequencyUnit::MHz()));
|
||||
return CNavSystem(CModulator::NameNav1(), BlackMisc::PhysicalQuantities::CFrequency(activeFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()), BlackMisc::PhysicalQuantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
}
|
||||
/*!
|
||||
* \brief NAV1 unit
|
||||
@@ -187,7 +186,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static CNavSystem getNav1System(CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static CNavSystem getNav1System(BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CNavSystem(CModulator::NameNav1(), activeFrequency, standbyFrequency == CModulator::FrequencyNotSet() ? activeFrequency : standbyFrequency);
|
||||
}
|
||||
/*!
|
||||
@@ -207,7 +206,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetNav1System(CNavSystem &navSystem, CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static bool tryGetNav1System(CNavSystem &navSystem, BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CNavSystem::tryGetNavSystem(navSystem, CModulator::NameNav1(), activeFrequency, standbyFrequency);
|
||||
}
|
||||
/*!
|
||||
@@ -217,7 +216,7 @@ public:
|
||||
* \return
|
||||
*/
|
||||
static CNavSystem getNav2System(double activeFrequencyMHz, double standbyFrequencyMHz = -1) {
|
||||
return CNavSystem(CModulator::NameNav2(), CFrequency(activeFrequencyMHz, CFrequencyUnit::MHz()), CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, CFrequencyUnit::MHz()));
|
||||
return CNavSystem(CModulator::NameNav2(), BlackMisc::PhysicalQuantities::CFrequency(activeFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()), BlackMisc::PhysicalQuantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
}
|
||||
/*!
|
||||
* \brief NAV2 unit
|
||||
@@ -225,7 +224,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static CNavSystem getNav2System(CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static CNavSystem getNav2System(BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CNavSystem(CModulator::NameNav2(), activeFrequency, standbyFrequency == CModulator::FrequencyNotSet() ? activeFrequency : standbyFrequency);
|
||||
}
|
||||
/*!
|
||||
@@ -245,7 +244,7 @@ public:
|
||||
* \param standbyFrequency
|
||||
* \return
|
||||
*/
|
||||
static bool tryGetNav2System(CNavSystem &navSystem, CFrequency activeFrequency, CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
static bool tryGetNav2System(CNavSystem &navSystem, BlackMisc::PhysicalQuantities::CFrequency activeFrequency, BlackMisc::PhysicalQuantities::CFrequency standbyFrequency = CModulator::FrequencyNotSet()) {
|
||||
return CNavSystem::tryGetNavSystem(navSystem, CModulator::NameNav2(), activeFrequency, standbyFrequency);
|
||||
}
|
||||
};
|
||||
@@ -253,4 +252,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // AVIONAVSYSTEM_H
|
||||
#endif // BLACKMISC_AVIONAVSYSTEM_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 AVIOTRANSPONDER_H
|
||||
#define AVIOTRANSPONDER_H
|
||||
#ifndef BLACKMISC_AVIOTRANSPONDER_H
|
||||
#define BLACKMISC_AVIOTRANSPONDER_H
|
||||
#include "blackmisc/aviobase.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
* \param otherTransponder
|
||||
* \return
|
||||
*/
|
||||
CTransponder& operator =(const CTransponder &otherTransponder) {
|
||||
CTransponder &operator =(const CTransponder &otherTransponder) {
|
||||
CAvionicsBase::operator =(otherTransponder);
|
||||
this->m_transponderMode = otherTransponder.m_transponderMode;
|
||||
this->m_transponderCode = otherTransponder.m_transponderCode;
|
||||
@@ -272,4 +272,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // AVIOTRANSPONDER_H
|
||||
#endif // BLACKMISC_AVIOTRANSPONDER_H
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
#include "avtrack.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CAngle;
|
||||
using BlackMisc::PhysicalQuantities::CAngleUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
|
||||
@@ -3,24 +3,21 @@
|
||||
* 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 AVTRACK_H
|
||||
#define AVTRACK_H
|
||||
#ifndef BLACKMISC_AVTRACK_H
|
||||
#define BLACKMISC_AVTRACK_H
|
||||
#include "blackmisc/pqangle.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CAngle;
|
||||
using BlackMisc::PhysicalQuantities::CAngleUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief Track as used in aviation, can be true or magnetic Track
|
||||
* \remarks Intentionally allowing +/- CAngle , and >= / <= CAngle.
|
||||
* \remarks Intentionally allowing +/- BlackMisc::PhysicalQuantities::CAngle , and >= / <= CAngle.
|
||||
*/
|
||||
class CTrack : public CAngle
|
||||
class CTrack : public BlackMisc::PhysicalQuantities::CAngle
|
||||
{
|
||||
private:
|
||||
bool m_magnetic; //!< magnetic or true Track?
|
||||
@@ -34,36 +31,36 @@ protected:
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor: 0 Track true
|
||||
* \brief Default constructor: 0 Track magnetic
|
||||
*/
|
||||
CTrack() : CAngle(0, CAngleUnit::rad()), m_magnetic(true) {}
|
||||
CTrack() : BlackMisc::PhysicalQuantities::CAngle(0, BlackMisc::PhysicalQuantities::CAngleUnit::rad()), m_magnetic(true) {}
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param value
|
||||
* \param magnetic
|
||||
* \param unit
|
||||
*/
|
||||
CTrack(double value, bool magnetic, const CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
CTrack(double value, bool magnetic, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : BlackMisc::PhysicalQuantities::CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param value
|
||||
* \param magnetic
|
||||
* \param unit
|
||||
*/
|
||||
CTrack(int value, bool magnetic, const CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
CTrack(int value, bool magnetic, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : BlackMisc::PhysicalQuantities::CAngle(value, unit), m_magnetic(magnetic) {}
|
||||
/*!
|
||||
* \brief Constructor by CAngle
|
||||
* \param Track
|
||||
* \param magnetic
|
||||
*/
|
||||
CTrack(CAngle track, bool magnetic) : CAngle(), m_magnetic(magnetic) {
|
||||
CAngle::operator =(track);
|
||||
CTrack(BlackMisc::PhysicalQuantities::CAngle track, bool magnetic) : BlackMisc::PhysicalQuantities::CAngle(), m_magnetic(magnetic) {
|
||||
BlackMisc::PhysicalQuantities::CAngle::operator =(track);
|
||||
}
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
* \param otherTrack
|
||||
*/
|
||||
CTrack(const CTrack &otherTrack) : CAngle(otherTrack), m_magnetic(otherTrack.m_magnetic) {}
|
||||
CTrack(const CTrack &otherTrack) : BlackMisc::PhysicalQuantities::CAngle(otherTrack), m_magnetic(otherTrack.m_magnetic) {}
|
||||
/*!
|
||||
* \brief Assignment operator =
|
||||
* \param otherQuantity
|
||||
@@ -102,4 +99,4 @@ public:
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // AVTRACK_H
|
||||
#endif // BLACKMISC_AVTRACK_H
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
|
||||
#include "avverticalpositions.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CLength;
|
||||
using BlackMisc::PhysicalQuantities::CLengthUnit;
|
||||
using BlackMisc::PhysicalQuantities::CPhysicalQuantitiesConstants;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
* 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 AVLATERALPOSITION_H
|
||||
#define AVLATERALPOSITION_H
|
||||
#ifndef BLACKMISC_AVLATERALPOSITION_H
|
||||
#define BLACKMISC_AVLATERALPOSITION_H
|
||||
|
||||
#include "blackmisc/avaltitude.h"
|
||||
#include "blackmisc/pqconstants.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CLength;
|
||||
using BlackMisc::PhysicalQuantities::CPhysicalQuantitiesConstants;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
@@ -39,8 +37,8 @@ class CAviationVerticalPositions
|
||||
friend CLogMessage operator<<(CLogMessage log, const CAviationVerticalPositions &positions);
|
||||
|
||||
private:
|
||||
CLength m_height; //!< height
|
||||
CLength m_elevation; //!< elevation
|
||||
BlackMisc::PhysicalQuantities::CLength m_height; //!< height
|
||||
BlackMisc::PhysicalQuantities::CLength m_elevation; //!< elevation
|
||||
CAltitude m_altitude; //!< altitude
|
||||
|
||||
protected:
|
||||
@@ -61,7 +59,7 @@ public:
|
||||
* \param elevation
|
||||
* \param height
|
||||
*/
|
||||
CAviationVerticalPositions(const CAltitude &altitude, const CLength &elevation, const CLength &height);
|
||||
CAviationVerticalPositions(const CAltitude &altitude, const BlackMisc::PhysicalQuantities::CLength &elevation, const BlackMisc::PhysicalQuantities::CLength &height);
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
* \param otherPosition
|
||||
@@ -89,14 +87,14 @@ public:
|
||||
* \brief Height
|
||||
* \return
|
||||
*/
|
||||
CLength getHeight() const {
|
||||
BlackMisc::PhysicalQuantities::CLength getHeight() const {
|
||||
return this->m_height;
|
||||
}
|
||||
/*!
|
||||
* \brief Elevation
|
||||
* \return
|
||||
*/
|
||||
CLength getElevation() const {
|
||||
BlackMisc::PhysicalQuantities::CLength getElevation() const {
|
||||
return this->m_elevation;
|
||||
}
|
||||
/*!
|
||||
@@ -125,4 +123,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // AVLATERALPOSITION_H
|
||||
#endif // BLACKMISC_AVLATERALPOSITION_H
|
||||
|
||||
@@ -1,32 +1,30 @@
|
||||
/* Copyright (C) 2013 VATSIM Community
|
||||
/* 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 PQANGLE_H
|
||||
#define PQANGLE_H
|
||||
#ifndef BLACKMISC_PQANGLE_H
|
||||
#define BLACKMISC_PQANGLE_H
|
||||
#include "blackmisc/pqphysicalquantity.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief Physical unit degree
|
||||
* \author KWB
|
||||
*/
|
||||
class CAngle : public CPhysicalQuantity<CAngleUnit, CAngle>
|
||||
{
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
*/
|
||||
CAngle() : CPhysicalQuantity(0, CAngleUnit::rad(), CAngleUnit::rad()) {}
|
||||
/**
|
||||
* \brief Copy constructor
|
||||
*/
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
*/
|
||||
CAngle(const CAngle &angle) : CPhysicalQuantity(angle) {}
|
||||
/*!
|
||||
* \brief Init by int value
|
||||
@@ -63,4 +61,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // PQANGLE_H
|
||||
#endif // BLACKMISC_PQANGLE_H
|
||||
|
||||
@@ -3,17 +3,16 @@
|
||||
* 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 PQBASE_H
|
||||
#define PQBASE_H
|
||||
#ifndef BLACKMISC_PQBASE_H
|
||||
#define BLACKMISC_PQBASE_H
|
||||
|
||||
#include "blackmisc/debug.h"
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
#include <QDebug>
|
||||
#include "blackmisc/debug.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
|
||||
@@ -131,7 +130,7 @@ public:
|
||||
* \brief Unit "None"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& None() {
|
||||
static const CMeasurementPrefix &None() {
|
||||
static CMeasurementPrefix none("", "", 0.0);
|
||||
return none;
|
||||
}
|
||||
@@ -139,7 +138,7 @@ public:
|
||||
* \brief Unit "One"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& One() {
|
||||
static const CMeasurementPrefix &One() {
|
||||
static CMeasurementPrefix one("one", "", 1.0);
|
||||
return one;
|
||||
}
|
||||
@@ -147,7 +146,7 @@ public:
|
||||
* \brief Unit "mega"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& M() {
|
||||
static const CMeasurementPrefix &M() {
|
||||
static CMeasurementPrefix mega("mega", "M", 1E6);
|
||||
return mega;
|
||||
}
|
||||
@@ -155,7 +154,7 @@ public:
|
||||
* \brief Unit "kilo"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& k() {
|
||||
static const CMeasurementPrefix &k() {
|
||||
static CMeasurementPrefix kilo("kilo", "k", 1000.0);
|
||||
return kilo;
|
||||
}
|
||||
@@ -163,7 +162,7 @@ public:
|
||||
* \brief Unit "giga"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& G() {
|
||||
static const CMeasurementPrefix &G() {
|
||||
static CMeasurementPrefix giga("giga", "G", 1E9);
|
||||
return giga;
|
||||
}
|
||||
@@ -171,7 +170,7 @@ public:
|
||||
* \brief Unit "hecto"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& h() {
|
||||
static const CMeasurementPrefix &h() {
|
||||
static CMeasurementPrefix hecto("hecto", "h", 100.0);
|
||||
return hecto;
|
||||
}
|
||||
@@ -179,7 +178,7 @@ public:
|
||||
* \brief Unit "centi"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& c() {
|
||||
static const CMeasurementPrefix &c() {
|
||||
static CMeasurementPrefix centi("centi", "c", 0.01);
|
||||
return centi;
|
||||
}
|
||||
@@ -187,7 +186,7 @@ public:
|
||||
* \brief Unit "milli"
|
||||
* \return
|
||||
*/
|
||||
static const CMeasurementPrefix& m() {
|
||||
static const CMeasurementPrefix &m() {
|
||||
static CMeasurementPrefix milli("milli", "m", 1E-03);
|
||||
return milli;
|
||||
}
|
||||
@@ -225,7 +224,7 @@ protected:
|
||||
/*!
|
||||
* Points to a individual converter method
|
||||
*/
|
||||
typedef double(*UnitConverter)(const CMeasurementUnit&, double);
|
||||
typedef double(*UnitConverter)(const CMeasurementUnit &, double);
|
||||
|
||||
private:
|
||||
QString m_name; //!< name, e.g. "meter"
|
||||
@@ -442,7 +441,7 @@ public:
|
||||
* \brief Unit is not specified
|
||||
* \return
|
||||
*/
|
||||
static CMeasurementUnit& None() {
|
||||
static CMeasurementUnit &None() {
|
||||
static CMeasurementUnit none("none", "", "", false, false, 0.0, CMeasurementPrefix::None(), 0, 0);
|
||||
return none;
|
||||
}
|
||||
@@ -451,4 +450,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // PQBASE_H
|
||||
#endif // BLACKMISC_PQBASE_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 PQCONSTANTS_H
|
||||
#define PQCONSTANTS_H
|
||||
#ifndef BLACKMISC_PQCONSTANTS_H
|
||||
#define BLACKMISC_PQCONSTANTS_H
|
||||
|
||||
#include "blackmisc/pqallquantities.h"
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace BlackMisc
|
||||
{
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
|
||||
class CPhysicalQuantitiesConstants
|
||||
{
|
||||
|
||||
@@ -92,4 +91,4 @@ public:
|
||||
};
|
||||
} //namespace
|
||||
} // namespace
|
||||
#endif // PQCONSTANTS_H
|
||||
#endif // BLACKMISC_PQCONSTANTS_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 PQFREQUENCY_H
|
||||
#define PQFREQUENCY_H
|
||||
#ifndef BLACKMISC_PQFREQUENCY_H
|
||||
#define BLACKMISC_PQFREQUENCY_H
|
||||
#include "pqphysicalquantity.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -46,4 +46,4 @@ public:
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // PQFREQUENCY_H
|
||||
#endif // BLACKMISC_PQFREQUENCY_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 PQlength_H
|
||||
#define PQlength_H
|
||||
#ifndef BLACKMISC_PQLENGTH_H
|
||||
#define BLACKMISC_PQLENGTH_H
|
||||
#include "blackmisc/pqphysicalquantity.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -46,4 +46,4 @@ public:
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // PQlength_H
|
||||
#endif // BLACKMISC_PQLENGTH_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 PQMASS_H
|
||||
#define PQMASS_H
|
||||
#ifndef BLACKMISC_PQMASS_H
|
||||
#define BLACKMISC_PQMASS_H
|
||||
#include "blackmisc/pqphysicalquantity.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -48,4 +48,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // PQMASS_H
|
||||
#endif // BLACKMISC_PQMASS_H
|
||||
|
||||
@@ -3,21 +3,20 @@
|
||||
* 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 PQPHYSICALQUANTITY_H
|
||||
#define PQPHYSICALQUANTITY_H
|
||||
#ifndef BLACKMISC_PQPHYSICALQUANTITY_H
|
||||
#define BLACKMISC_PQPHYSICALQUANTITY_H
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QString>
|
||||
#include <QLocale>
|
||||
#include "blackmisc/pqbase.h"
|
||||
#include "blackmisc/pqunits.h"
|
||||
#include "blackmisc/debug.h"
|
||||
#include <QtGlobal>
|
||||
#include <QString>
|
||||
#include <QLocale>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief A physical quantity such as "5m", "20s", "1500ft/s"
|
||||
* \author KWB
|
||||
@@ -362,4 +361,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // PQPHYSICALQUANTITY_H
|
||||
#endif // BLACKMISC_PQPHYSICALQUANTITY_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 PQPRESSURE_H
|
||||
#define PQPRESSURE_H
|
||||
#ifndef BLACKMISC_PQPRESSURE_H
|
||||
#define BLACKMISC_PQPRESSURE_H
|
||||
|
||||
#include "pqphysicalquantity.h"
|
||||
|
||||
@@ -47,4 +47,4 @@ public:
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // PQPRESSURE_H
|
||||
#endif // BLACKMISC_PQPRESSURE_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 CSPEED_H
|
||||
#define CSPEED_H
|
||||
#ifndef BLACKMISC_CSPEED_H
|
||||
#define BLACKMISC_CSPEED_H
|
||||
#include "pqphysicalquantity.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -47,4 +47,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // CSPEED_H
|
||||
#endif // BLACKMISC_CSPEED_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 CTEMPERATURE_H
|
||||
#define CTEMPERATURE_H
|
||||
#ifndef BLACKMISC_CTEMPERATURE_H
|
||||
#define BLACKMISC_CTEMPERATURE_H
|
||||
#include "pqphysicalquantity.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -46,4 +46,4 @@ public:
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // CTEMPERATURE_H
|
||||
#endif // BLACKMISC_CTEMPERATURE_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* 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 PQTIME_H
|
||||
#define PQTIME_H
|
||||
#ifndef BLACKMISC_PQTIME_H
|
||||
#define BLACKMISC_PQTIME_H
|
||||
|
||||
#include "pqphysicalquantity.h"
|
||||
|
||||
@@ -48,4 +48,4 @@ public:
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // PQTIME_H
|
||||
#endif // BLACKMISC_PQTIME_H
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* Copyright (C) 2013 VATSIM Community
|
||||
/* 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 PQUNITS_H
|
||||
#define PQUNITS_H
|
||||
#ifndef BLACKMISC_PQUNITS_H
|
||||
#define BLACKMISC_PQUNITS_H
|
||||
#include "blackmisc/pqbase.h"
|
||||
#include <math.h>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
//
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
|
||||
@@ -590,4 +589,4 @@ public:
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // PQUNITS_H
|
||||
#endif // BLACKMISC_PQUNITS_H
|
||||
|
||||
Reference in New Issue
Block a user