mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T415, altitude function with return value
This commit is contained in:
@@ -88,16 +88,18 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAltitude::toFlightLevel()
|
||||
bool CAltitude::toFlightLevel()
|
||||
{
|
||||
Q_ASSERT(m_datum == MeanSeaLevel || m_datum == FlightLevel);
|
||||
if (m_datum != MeanSeaLevel && m_datum != FlightLevel) { return false; }
|
||||
m_datum = FlightLevel;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CAltitude::toMeanSeaLevel()
|
||||
bool CAltitude::toMeanSeaLevel()
|
||||
{
|
||||
Q_ASSERT(m_datum == MeanSeaLevel || m_datum == FlightLevel);
|
||||
if (m_datum != MeanSeaLevel && m_datum != FlightLevel) { return false; }
|
||||
m_datum = MeanSeaLevel;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CAltitude::convertToPressureAltitude(const CPressure &seaLevelPressure)
|
||||
@@ -173,7 +175,7 @@ namespace BlackMisc
|
||||
{
|
||||
QString v(value.trimmed());
|
||||
this->setNull();
|
||||
if (v.isEmpty() || v.length() < 3)
|
||||
if (v.length() < 3)
|
||||
{
|
||||
if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude empty or too short")); }
|
||||
return false;
|
||||
|
||||
@@ -133,10 +133,10 @@ namespace BlackMisc
|
||||
ReferenceDatum getReferenceDatum() const { return m_datum; }
|
||||
|
||||
//! MSL to flightlevel
|
||||
void toFlightLevel();
|
||||
bool toFlightLevel();
|
||||
|
||||
//! Flightlevel to MSL
|
||||
void toMeanSeaLevel();
|
||||
bool toMeanSeaLevel();
|
||||
|
||||
//! Current altitude type
|
||||
AltitudeType getAltitudeType() const { return m_altitudeType; }
|
||||
|
||||
Reference in New Issue
Block a user