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