Ref T259, Ref T243 return unit by reference

This commit is contained in:
Klaus Basan
2018-04-03 23:58:32 +02:00
parent bedfb5eb67
commit cf98c46231
3 changed files with 6 additions and 9 deletions

View File

@@ -257,6 +257,9 @@ namespace BlackMisc
//! Get altitude //! Get altitude
const CAltitude &getAltitude() const { return m_position.geodeticHeight(); } const CAltitude &getAltitude() const { return m_position.geodeticHeight(); }
//! Get altitude unit
const PhysicalQuantities::CLengthUnit &getAltitudeUnit() const { return m_position.geodeticHeight().getUnit(); }
//! Get altitude under consideration of ground elevation and ground flag //! Get altitude under consideration of ground elevation and ground flag
//! \remark with dragToGround it will also compensate overflows, otherwise ony underflow //! \remark with dragToGround it will also compensate overflows, otherwise ony underflow
CAltitude getCorrectedAltitude(const PhysicalQuantities::CLength &centerOfGravity = PhysicalQuantities::CLength::null(), bool enableDragToGround = true, AltitudeCorrection *correctetion = nullptr) const; CAltitude getCorrectedAltitude(const PhysicalQuantities::CLength &centerOfGravity = PhysicalQuantities::CLength::null(), bool enableDragToGround = true, AltitudeCorrection *correctetion = nullptr) const;

View File

@@ -41,12 +41,6 @@ namespace BlackMisc
{ {
namespace PhysicalQuantities namespace PhysicalQuantities
{ {
template <class MU, class PQ>
MU CPhysicalQuantity<MU, PQ>::getUnit() const
{
return m_unit;
}
template <class MU, class PQ> template <class MU, class PQ>
void CPhysicalQuantity<MU, PQ>::setUnitBySymbol(const QString &unitName) void CPhysicalQuantity<MU, PQ>::setUnitBySymbol(const QString &unitName)
{ {

View File

@@ -60,7 +60,7 @@ namespace BlackMisc
//! Index //! Index
enum ColumnIndex enum ColumnIndex
{ {
IndexUnit = BlackMisc::CPropertyIndex::GlobalIndexCPhysicalQuantity, IndexUnit = CPropertyIndex::GlobalIndexCPhysicalQuantity,
IndexValue, IndexValue,
IndexValueRounded0DigitsWithUnit, IndexValueRounded0DigitsWithUnit,
IndexValueRounded1DigitsWithUnit, IndexValueRounded1DigitsWithUnit,
@@ -70,11 +70,11 @@ namespace BlackMisc
}; };
//! Unit //! Unit
MU getUnit() const; const MU &getUnit() const { return m_unit; }
//! Simply set unit, do no calclulate conversion //! Simply set unit, do no calclulate conversion
//! \sa switchUnit //! \sa switchUnit
void setUnit(MU unit) { this->m_unit = unit; } void setUnit(MU unit) { m_unit = unit; }
//! Set unit by string //! Set unit by string
void setUnitBySymbol(const QString &unitName); void setUnitBySymbol(const QString &unitName);