mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #837 ICoordinateGeodetic::geodeticHeight is a CAltitude.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace BlackSample
|
||||
QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour
|
||||
QDateTime dtFrom2 = dtUntil;
|
||||
QDateTime dtUntil2 = dtUntil.addSecs(60 * 60);
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft()));
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
|
||||
CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()),
|
||||
geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackSample
|
||||
CFrequency freqEddmTwr(118.7, CFrequencyUnit::MHz());
|
||||
CCallsign callsignEddmTwr("eddm_twr");
|
||||
CCoordinateGeodetic geoPos =
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft()));
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
|
||||
CAtcStation station1(callsignEddmTwr, CUser("123456", "Joe Doe"),
|
||||
freqEddmTwr,
|
||||
geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil);
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace BlackSample
|
||||
qDebug() << "-------";
|
||||
QDateTime dtFrom = QDateTime::currentDateTimeUtc();
|
||||
QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft()));
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
|
||||
CAtcStation station(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()), geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil);
|
||||
json = station.toJson();
|
||||
|
||||
@@ -360,7 +360,7 @@ namespace BlackSample
|
||||
testserviceInterface.receiveCallsign(callsign);
|
||||
qDebug() << "Send callsign via interface" << callsign;
|
||||
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft())); // Munich
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() }); // Munich
|
||||
CAtcStation station(CCallsign("eddm_twr"), CUser("123456", "Joe Controller"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()),
|
||||
geoPos, CLength(50, CLengthUnit::km()));
|
||||
@@ -370,7 +370,7 @@ namespace BlackSample
|
||||
|
||||
// Geo
|
||||
// EDDF: 50° 2′ 0″ N, 8° 34′ 14″ E, 100m MSL
|
||||
geoPos = CCoordinateGeodetic::fromWgs84("50° 2′ 1″ 23 N", "8° 34′ 14″ E", CLength(111, CLengthUnit::m()));
|
||||
geoPos = CCoordinateGeodetic::fromWgs84("50° 2′ 1″ 23 N", "8° 34′ 14″ E", { 111, CLengthUnit::m() });
|
||||
testserviceInterface.receiveGeoPosition(geoPos);
|
||||
qDebug() << "Send geo position" << geoPos;
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace BlackSample
|
||||
*/
|
||||
CAtcStation Testservice::getAtcStation() const
|
||||
{
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft())); // Munich
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() }); // Munich
|
||||
CAtcStation station(CCallsign("eddm_twr"), CUser("654321", "client"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()),
|
||||
geoPos, CLength(50, CLengthUnit::km()));
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace BlackSample
|
||||
QDateTime dtFrom2 = dtUntil;
|
||||
QDateTime dtUntil2 = dtUntil.addSecs(60 * 60);
|
||||
CCoordinateGeodetic geoPos =
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft()));
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
|
||||
CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()),
|
||||
geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace BlackGui
|
||||
this->m_columns.addColumn(CColumn("distance", CAirport::IndexRelativeDistance, new CAirspaceDistanceFormatter()));
|
||||
this->m_columns.addColumn(CColumn("bearing", CAirport::IndexRelativeBearing, new CAngleDegreeFormatter()));
|
||||
this->m_columns.addColumn(CColumn::standardString("name", CAirport::IndexDescriptiveName));
|
||||
this->m_columns.addColumn(CColumn("elevation", CAirport::IndexElevation, new CPhysiqalQuantiyFormatter<CLengthUnit, CLength>(CLengthUnit::ft(), 0)));
|
||||
this->m_columns.addColumn(CColumn("elevation", CAirport::IndexElevation, new CAltitudeFormatter()));
|
||||
this->m_columns.addColumn(CColumn("latitude", CAirport::IndexLatitude, new CLatLonFormatter()));
|
||||
this->m_columns.addColumn(CColumn("longitude", CAirport::IndexLatitude, new CLatLonFormatter()));
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace BlackMisc
|
||||
const BlackMisc::PhysicalQuantities::CAngle &pitch = {},
|
||||
const BlackMisc::PhysicalQuantities::CAngle &bank = {},
|
||||
const BlackMisc::PhysicalQuantities::CSpeed &gs = {},
|
||||
const BlackMisc::Aviation::CAltitude &groundElevation = { { 0, nullptr }, BlackMisc::Aviation::CAltitude::MeanSeaLevel });
|
||||
const BlackMisc::Aviation::CAltitude &groundElevation = { 0, nullptr });
|
||||
|
||||
//! Comprehensive constructor
|
||||
CAircraftSituation(const BlackMisc::Aviation::CCallsign &correspondingCallsign,
|
||||
@@ -75,7 +75,7 @@ namespace BlackMisc
|
||||
const BlackMisc::PhysicalQuantities::CAngle &pitch = {},
|
||||
const BlackMisc::PhysicalQuantities::CAngle &bank = {},
|
||||
const BlackMisc::PhysicalQuantities::CSpeed &gs = {},
|
||||
const BlackMisc::Aviation::CAltitude &groundElevation = { { 0, nullptr }, BlackMisc::Aviation::CAltitude::MeanSeaLevel });
|
||||
const BlackMisc::Aviation::CAltitude &groundElevation = { 0, nullptr });
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace BlackMisc
|
||||
{
|
||||
CAirport airport(json.value(prefix + "icao").toString());
|
||||
airport.setDescriptiveName(json.value(prefix + "name").toString());
|
||||
airport.setElevation(CLength(json.value(prefix + "altitude").toInt(), CLengthUnit::ft()));
|
||||
airport.setElevation(CAltitude(json.value(prefix + "altitude").toInt(), CLengthUnit::ft()));
|
||||
const CCoordinateGeodetic pos(json.value(prefix + "latitude").toDouble(), json.value(prefix + "longitude").toDouble(), 0);
|
||||
airport.setPosition(pos);
|
||||
airport.setOperating(json.value(prefix + "operating").toString() == QStringLiteral("Y"));
|
||||
|
||||
@@ -93,11 +93,11 @@ namespace BlackMisc
|
||||
|
||||
//! Elevation
|
||||
//! \sa geodeticHeight
|
||||
const BlackMisc::PhysicalQuantities::CLength getElevation() const { return this->geodeticHeight(); }
|
||||
const BlackMisc::Aviation::CAltitude &getElevation() const { return this->geodeticHeight(); }
|
||||
|
||||
//! Elevation
|
||||
//! \sa setGeodeticHeight
|
||||
void setElevation(const BlackMisc::PhysicalQuantities::CLength &elevation) { return this->m_position.setGeodeticHeight(elevation); }
|
||||
void setElevation(const BlackMisc::Aviation::CAltitude &elevation) { return this->m_position.setGeodeticHeight(elevation); }
|
||||
|
||||
//! Is the airport still active?
|
||||
bool isOperating() const { return m_operating; }
|
||||
@@ -109,8 +109,7 @@ namespace BlackMisc
|
||||
void updateMissingParts(const CAirport &airport);
|
||||
|
||||
//! \copydoc Geo::ICoordinateGeodetic::geodeticHeight
|
||||
//! \remarks this should be used for elevation as depicted here: http://en.wikipedia.org/wiki/Altitude#mediaviewer/File:Vertical_distances.svg
|
||||
const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const override { return this->m_position.geodeticHeight(); }
|
||||
const BlackMisc::Aviation::CAltitude &geodeticHeight() const override { return this->m_position.geodeticHeight(); }
|
||||
|
||||
//! Valid ICAO code
|
||||
bool hasValidIcaoCode() const { return !this->getIcao().isEmpty(); }
|
||||
|
||||
@@ -79,6 +79,9 @@ namespace BlackMisc
|
||||
//! Constructor
|
||||
CAltitude(double value, ReferenceDatum datum, const BlackMisc::PhysicalQuantities::CLengthUnit &unit) : CLength(value, unit), m_datum(datum) {}
|
||||
|
||||
//! Constructor
|
||||
CAltitude(double value, const BlackMisc::PhysicalQuantities::CLengthUnit &unit) : CLength(value, unit), m_datum(MeanSeaLevel) {}
|
||||
|
||||
//! Altitude as string
|
||||
CAltitude(const QString &altitudeAsString, BlackMisc::PhysicalQuantities::CPqString::SeparatorMode mode = BlackMisc::PhysicalQuantities::CPqString::SeparatorsLocale);
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace BlackMisc
|
||||
return this->getPosition().longitude();
|
||||
}
|
||||
|
||||
const CLength &CAtcStation::geodeticHeight() const
|
||||
const CAltitude &CAtcStation::geodeticHeight() const
|
||||
{
|
||||
return this->m_position.geodeticHeight();
|
||||
}
|
||||
|
||||
@@ -236,8 +236,7 @@ namespace BlackMisc
|
||||
virtual BlackMisc::Geo::CLongitude longitude() const override;
|
||||
|
||||
//! \copydoc Geo::ICoordinateGeodetic::geodeticHeight
|
||||
//! \remarks this should be used for elevation as depicted here: http://en.wikipedia.org/wiki/Altitude#mediaviewer/File:Vertical_distances.svg
|
||||
const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const override;
|
||||
const BlackMisc::Aviation::CAltitude &geodeticHeight() const override;
|
||||
|
||||
//! \copydoc Geo::ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const override;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <QtGlobal>
|
||||
#include <cmath>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Math;
|
||||
|
||||
@@ -29,7 +30,7 @@ namespace BlackMisc
|
||||
return s.arg(this->latitude().valueRoundedWithUnit(6, i18n)).arg(this->longitude().valueRoundedWithUnit(6, i18n)).arg(this->m_geodeticHeight.valueRoundedWithUnit(6, i18n));
|
||||
}
|
||||
|
||||
CCoordinateGeodetic CCoordinateGeodetic::fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const CLength &geodeticHeight)
|
||||
CCoordinateGeodetic CCoordinateGeodetic::fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const CAltitude &geodeticHeight)
|
||||
{
|
||||
CLatitude lat = CLatitude::fromWgs84(latitudeWgs84);
|
||||
CLongitude lon = CLongitude::fromWgs84(longitudeWgs84);
|
||||
@@ -189,7 +190,7 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
CCoordinateGeodetic::CCoordinateGeodetic(CLatitude latitude, CLongitude longitude, BlackMisc::PhysicalQuantities::CLength geodeticHeight) :
|
||||
CCoordinateGeodetic::CCoordinateGeodetic(CLatitude latitude, CLongitude longitude, CAltitude geodeticHeight) :
|
||||
m_x(latitude.cos() * longitude.cos()),
|
||||
m_y(latitude.cos() * longitude.sin()),
|
||||
m_z(latitude.sin()),
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define BLACKMISC_COORDINATEGEODETIC_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/geo/latitude.h"
|
||||
#include "blackmisc/geo/longitude.h"
|
||||
#include "blackmisc/metaclass.h"
|
||||
@@ -32,7 +33,9 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Geo
|
||||
{
|
||||
//! Geodetic coordinate
|
||||
//! Geodetic coordinate, a position in 3D space relative to the reference geoid.
|
||||
//!
|
||||
//! Composed of a latitude, longitude, and height (aka altitude, aka elevation).
|
||||
//! \sa http://www.esri.com/news/arcuser/0703/geoid1of3.html
|
||||
//! \sa http://http://www.gmat.unsw.edu.au/snap/gps/clynch_pdfs/coordcvt.pdf (page 5)
|
||||
//! \sa http://en.wikipedia.org/wiki/Geodetic_datum#Vertical_datum
|
||||
@@ -61,10 +64,15 @@ namespace BlackMisc
|
||||
virtual CLongitude longitude() const = 0;
|
||||
|
||||
//! Height, ellipsoidal or geodetic height (used in GPS)
|
||||
//! This is approximately MSL (orthometric) height, aka elevation.
|
||||
//!
|
||||
//! This is approximately MSL (orthometric) height, aka altitude, aka elevation.
|
||||
//! The terms "geodetic height", "altitude", and "elevation" are interchangable.
|
||||
//! "Geodetic height" is the generic, context-free term for the vertical component of a position.
|
||||
//! This is commonly called "altitude" for objects that can move freely in the vertical component.
|
||||
//! By a similar convention, "elevation" is commonly used for objects that are fixed to the ground.
|
||||
//! \sa see http://www.gmat.unsw.edu.au/snap/gps/clynch_pdfs/coordcvt.pdf page 5
|
||||
//! \sa http://www.esri.com/news/arcuser/0703/geoid1of3.html
|
||||
virtual const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const = 0;
|
||||
virtual const BlackMisc::Aviation::CAltitude &geodeticHeight() const = 0;
|
||||
|
||||
//! Normal vector
|
||||
//! \note QVector3D uses floats, so don't use if double precision is needed
|
||||
@@ -180,7 +188,7 @@ namespace BlackMisc
|
||||
CCoordinateGeodetic(const QVector3D &normal) : m_x(normal.x()), m_y(normal.y()), m_z(normal.z()) {}
|
||||
|
||||
//! Constructor by values
|
||||
CCoordinateGeodetic(CLatitude latitude, CLongitude longitude, BlackMisc::PhysicalQuantities::CLength geodeticHeight);
|
||||
CCoordinateGeodetic(CLatitude latitude, CLongitude longitude, BlackMisc::Aviation::CAltitude geodeticHeight);
|
||||
|
||||
//! Constructor by double values, but no geodetic height
|
||||
CCoordinateGeodetic(double latitudeDegrees, double longitudeDegrees);
|
||||
@@ -195,7 +203,7 @@ namespace BlackMisc
|
||||
virtual CLongitude longitude() const override;
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::geodeticHeight
|
||||
virtual const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const override { return this->m_geodeticHeight; }
|
||||
virtual const BlackMisc::Aviation::CAltitude &geodeticHeight() const override { return this->m_geodeticHeight; }
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const override;
|
||||
@@ -222,7 +230,7 @@ namespace BlackMisc
|
||||
void setLatLong(const CLatitude &latitude, const CLongitude &longitude);
|
||||
|
||||
//! Set height (ellipsoidal or geodetic height)
|
||||
void setGeodeticHeight(const BlackMisc::PhysicalQuantities::CLength &height) { this->m_geodeticHeight = height; }
|
||||
void setGeodeticHeight(const BlackMisc::Aviation::CAltitude &height) { this->m_geodeticHeight = height; }
|
||||
|
||||
//! Set normal vector
|
||||
void setNormalVector(const QVector3D &normal) { this->m_x = normal.x(); this->m_y = normal.y(); this->m_z = normal.z(); }
|
||||
@@ -231,7 +239,7 @@ namespace BlackMisc
|
||||
void setNormalVector(double x, double y, double z) { this->m_x = x; this->m_y = y; this->m_z = z; }
|
||||
|
||||
//! Coordinate by WGS84 position data
|
||||
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const BlackMisc::PhysicalQuantities::CLength &geodeticHeight = {});
|
||||
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const BlackMisc::Aviation::CAltitude &geodeticHeight = {});
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
@@ -240,7 +248,7 @@ namespace BlackMisc
|
||||
double m_x = 0; //!< normal vector
|
||||
double m_y = 0; //!< normal vector
|
||||
double m_z = 0; //!< normal vector
|
||||
BlackMisc::PhysicalQuantities::CLength m_geodeticHeight { 0, nullptr }; //!< height, ellipsoidal or geodetic height
|
||||
BlackMisc::Aviation::CAltitude m_geodeticHeight { 0, nullptr }; //!< height, ellipsoidal or geodetic height
|
||||
|
||||
BLACK_METACLASS(
|
||||
CCoordinateGeodetic,
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace BlackMisc
|
||||
virtual BlackMisc::Geo::CLongitude longitude() const override { return this->m_situation.longitude(); }
|
||||
|
||||
//! \copydoc BlackMisc::Geo::ICoordinateGeodetic::geodeticHeight
|
||||
const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const override { return this->m_situation.geodeticHeight(); }
|
||||
const BlackMisc::Aviation::CAltitude &geodeticHeight() const override { return this->m_situation.geodeticHeight(); }
|
||||
|
||||
//! \copydoc BlackMisc::Geo::ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const override { return this->m_situation.normalVector(); }
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace BlackMisc
|
||||
|
||||
virtual Geo::CLatitude latitude() const override { return m_position.latitude(); }
|
||||
virtual Geo::CLongitude longitude() const override { return m_position.longitude(); }
|
||||
virtual const PhysicalQuantities::CLength &geodeticHeight() const override { return m_position.geodeticHeight(); }
|
||||
virtual const Aviation::CAltitude &geodeticHeight() const override { return m_position.geodeticHeight(); }
|
||||
virtual QVector3D normalVector() const override { return m_position.normalVector(); }
|
||||
virtual std::array<double, 3> normalVectorDouble() const override { return this->m_position.normalVectorDouble(); }
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <tuple>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
@@ -49,7 +50,7 @@ namespace BlackMisc
|
||||
{
|
||||
// from WGS is slow, so static const (only 1 time init)
|
||||
// https://dev.vatsim-germany.org/issues/322#note-2
|
||||
static const CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(index, CLengthUnit::ft()));
|
||||
static const CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CAltitude(index, CLengthUnit::ft()));
|
||||
QString cs = QString("%1_TWR").arg(index);
|
||||
QString usr = QString("Joe %1").arg(index);
|
||||
QString id = QString("00000%1").arg(index).right(6);
|
||||
@@ -164,11 +165,11 @@ namespace BlackMisc
|
||||
);
|
||||
|
||||
CCoordinateGeodetic c;
|
||||
const CLength h(333, CLengthUnit::m());
|
||||
const CAltitude a(333, CLengthUnit::m());
|
||||
for (int i = 0; i < times; i++)
|
||||
{
|
||||
int idx = (i % 5) * 2;
|
||||
c = CCoordinateGeodetic::fromWgs84(wgsLatLng.at(idx), wgsLatLng.at(idx + 1), h);
|
||||
c = CCoordinateGeodetic::fromWgs84(wgsLatLng.at(idx), wgsLatLng.at(idx + 1), a);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -350,7 +350,7 @@ namespace BlackSimPlugin
|
||||
CCoordinateGeodetic position = situation.getPosition();
|
||||
CLatitude lat(latitudeRaw * latCorrectionFactor, CAngleUnit::deg());
|
||||
CLongitude lon(longitudeRaw * lonCorrectionFactor, CAngleUnit::deg());
|
||||
CLength groundAltitude(groundAltitudeRaw / 256.0, CLengthUnit::m());
|
||||
CAltitude groundAltitude(groundAltitudeRaw / 256.0, CLengthUnit::m());
|
||||
position.setLatitude(lat);
|
||||
position.setLongitude(lon);
|
||||
position.setGeodeticHeight(groundAltitude);
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace BlackSimPlugin
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
|
||||
m_airportsInRange.push_back({ *icaoIt, { CLatitude(*latIt, CAngleUnit::deg()), CLongitude(*lonIt, CAngleUnit::deg()), CLength(*altIt, CLengthUnit::ft()) }, *nameIt });
|
||||
m_airportsInRange.push_back({ *icaoIt, { CLatitude(*latIt, CAngleUnit::deg()), CLongitude(*lonIt, CAngleUnit::deg()), CAltitude(*altIt, CLengthUnit::ft()) }, *nameIt });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgs
|
||||
CCoordinateGeodetic coordinate(
|
||||
CLatitude::fromWgs84(wgsLatitude),
|
||||
CLongitude::fromWgs84(wgsLongitude),
|
||||
CLength(0, CLengthUnit::m()));
|
||||
CAltitude(0, CLengthUnit::m()));
|
||||
|
||||
this->m_ownAircraft.setPosition(coordinate);
|
||||
this->m_ownAircraft.setAltitude(altitude);
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace BlackCoreTest
|
||||
QVERIFY2(heathrow[0].isOperating(), "Wrong airport data");
|
||||
|
||||
auto airports = m_airportReader->getAirports();
|
||||
airports.sortByRange(CCoordinateGeodetic(CLatitude(51.5085300, CAngleUnit::deg()), CLongitude(-0.1257400, CAngleUnit::deg()), CLength()), true);
|
||||
airports.sortByRange(CCoordinateGeodetic(CLatitude(51.5085300, CAngleUnit::deg()), CLongitude(-0.1257400, CAngleUnit::deg()), CAltitude()), true);
|
||||
QVERIFY2(airports[0].getIcao() == CAirportIcaoCode("EGLW"), "Wrong airport data");
|
||||
|
||||
CApplication::processEventsFor(2500); // make sure events are processed
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace BlackMiscTest
|
||||
QDateTime dtFrom2 = dtUntil;
|
||||
QDateTime dtUntil2 = dtUntil.addSecs(60 * 60);
|
||||
CCoordinateGeodetic geoPos =
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft()));
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
|
||||
CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()),
|
||||
geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil);
|
||||
@@ -98,7 +98,7 @@ namespace BlackMiscTest
|
||||
QDateTime dtFrom = QDateTime::currentDateTimeUtc();
|
||||
QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour
|
||||
CCoordinateGeodetic geoPos =
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(1487, CLengthUnit::ft()));
|
||||
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
|
||||
CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()),
|
||||
geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil);
|
||||
|
||||
Reference in New Issue
Block a user