mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Renamed to geodetic height, as discussed in meeting
This commit is contained in:
@@ -83,10 +83,10 @@ namespace BlackMisc
|
||||
virtual const BlackMisc::Geo::CLongitude &longitude() const override { return this->m_position.longitude(); }
|
||||
|
||||
//! \copydoc CCoordinateGeodetic::height
|
||||
const BlackMisc::PhysicalQuantities::CLength &getHeight() const { return this->m_position.height(); }
|
||||
const BlackMisc::PhysicalQuantities::CLength &getHeight() const { return this->m_position.geodeticHeight(); }
|
||||
|
||||
//! \brief Set height
|
||||
void setHeight(const BlackMisc::PhysicalQuantities::CLength &height) { this->m_position.setHeight(height); }
|
||||
void setHeight(const BlackMisc::PhysicalQuantities::CLength &height) { this->m_position.setGeodeticHeight(height); }
|
||||
|
||||
//! \brief Get heading
|
||||
const BlackMisc::Aviation::CHeading &getHeading() const { return this->m_heading; }
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace BlackMisc
|
||||
QString CCoordinateGeodetic::convertToQString(bool i18n) const
|
||||
{
|
||||
QString s = "Geodetic: {%1, %2, %3}";
|
||||
return s.arg(this->m_latitude.valueRoundedWithUnit(6, i18n)).arg(this->m_longitude.valueRoundedWithUnit(6, i18n)).arg(this->m_height.valueRoundedWithUnit(6, i18n));
|
||||
return s.arg(this->m_latitude.valueRoundedWithUnit(6, i18n)).arg(this->m_longitude.valueRoundedWithUnit(6, i18n)).arg(this->m_geodeticHeight.valueRoundedWithUnit(6, i18n));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace BlackMisc
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CCoordinateGeodetic)
|
||||
BlackMisc::Geo::CLatitude m_latitude; //!< Latitude
|
||||
BlackMisc::Geo::CLongitude m_longitude; //!< Longitude
|
||||
BlackMisc::PhysicalQuantities::CLength m_height; //!< height, ellipsoidal or geodetic height
|
||||
BlackMisc::PhysicalQuantities::CLength m_geodeticHeight; //!< height, ellipsoidal or geodetic height
|
||||
|
||||
protected:
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
@@ -82,15 +82,15 @@ namespace BlackMisc
|
||||
|
||||
public:
|
||||
//! Default constructor
|
||||
CCoordinateGeodetic() : m_latitude(), m_longitude(), m_height() {}
|
||||
CCoordinateGeodetic() : m_latitude(), m_longitude(), m_geodeticHeight() {}
|
||||
|
||||
//! Constructor by values
|
||||
CCoordinateGeodetic(CLatitude latitude, CLongitude longitude, BlackMisc::PhysicalQuantities::CLength height) :
|
||||
m_latitude(latitude), m_longitude(longitude), m_height(height) {}
|
||||
m_latitude(latitude), m_longitude(longitude), m_geodeticHeight(height) {}
|
||||
|
||||
//! Constructor by values
|
||||
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_geodeticHeight(heightMeters, BlackMisc::PhysicalQuantities::CLengthUnit::m()) {}
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::latitude
|
||||
virtual const CLatitude &latitude() const override { return this->m_latitude; }
|
||||
@@ -98,9 +98,11 @@ namespace BlackMisc
|
||||
//! \copydoc ICoordinateGeodetic::longitude
|
||||
virtual const CLongitude &longitude() const override { return this->m_longitude; }
|
||||
|
||||
//! Height, ellipsoidal or geodetic height
|
||||
//! \remarks see http://www.gmat.unsw.edu.au/snap/gps/clynch_pdfs/coordcvt.pdf page 5
|
||||
const BlackMisc::PhysicalQuantities::CLength &height() const { return this->m_height; }
|
||||
//! Height, ellipsoidal or geodetic height (used in GPS)
|
||||
//! This is approximately MSL (orthometric) height, aka elevation.
|
||||
//! \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
|
||||
const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const { return this->m_geodeticHeight; }
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
@@ -116,7 +118,7 @@ namespace BlackMisc
|
||||
//! Switch unit of height
|
||||
CCoordinateGeodetic &switchUnit(const BlackMisc::PhysicalQuantities::CLengthUnit &unit)
|
||||
{
|
||||
this->m_height.switchUnit(unit);
|
||||
this->m_geodeticHeight.switchUnit(unit);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -127,7 +129,7 @@ namespace BlackMisc
|
||||
void setLongitude(const CLongitude &longitude) { this->m_longitude = longitude; }
|
||||
|
||||
//! Set height (ellipsoidal or geodetic height)
|
||||
void setHeight(const BlackMisc::PhysicalQuantities::CLength &height) { this->m_height = height; }
|
||||
void setGeodeticHeight(const BlackMisc::PhysicalQuantities::CLength &height) { this->m_geodeticHeight = height; }
|
||||
|
||||
//! Equal operator ==
|
||||
bool operator ==(const CCoordinateGeodetic &other) const;
|
||||
@@ -151,13 +153,13 @@ namespace BlackMisc
|
||||
static const QStringList &jsonMembers();
|
||||
|
||||
//! Coordinate by WGS84 position data
|
||||
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const BlackMisc::PhysicalQuantities::CLength height = BlackMisc::PhysicalQuantities::CLength());
|
||||
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const BlackMisc::PhysicalQuantities::CLength geodeticHeight = BlackMisc::PhysicalQuantities::CLength());
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Geo::CCoordinateGeodetic, (o.m_latitude, o.m_longitude, o.m_height))
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Geo::CCoordinateGeodetic, (o.m_latitude, o.m_longitude, o.m_geodeticHeight))
|
||||
Q_DECLARE_METATYPE(BlackMisc::Geo::CCoordinateGeodetic)
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -75,12 +75,10 @@ namespace BlackMisc
|
||||
double cphi = cos(phi);
|
||||
|
||||
double n = EarthRadiusMeters() / sqrt(1 - e2() * CMath::square(sphi));
|
||||
|
||||
double slambda = sin(lambdaRad);
|
||||
|
||||
double clambda = cos(lambdaRad);
|
||||
|
||||
double h = geo.height().value(CLengthUnit::m());
|
||||
double h = geo.geodeticHeight().value(CLengthUnit::m());
|
||||
double x = (n + h) * cphi;
|
||||
double y = x * slambda;
|
||||
x *= clambda;
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace BlackSimPlugin
|
||||
CLength groundAltitude(groundAltitudeRaw / 256.0, CLengthUnit::m());
|
||||
position.setLatitude(lat);
|
||||
position.setLongitude(lon);
|
||||
position.setHeight(groundAltitude);
|
||||
position.setGeodeticHeight(groundAltitude);
|
||||
situation.setPosition(position);
|
||||
|
||||
// speeds, situation
|
||||
|
||||
Reference in New Issue
Block a user