mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +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;
|
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;
|
m_datum = MeanSeaLevel;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAltitude::convertToPressureAltitude(const CPressure &seaLevelPressure)
|
void CAltitude::convertToPressureAltitude(const CPressure &seaLevelPressure)
|
||||||
@@ -173,7 +175,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
QString v(value.trimmed());
|
QString v(value.trimmed());
|
||||||
this->setNull();
|
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")); }
|
if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude empty or too short")); }
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -133,10 +133,10 @@ namespace BlackMisc
|
|||||||
ReferenceDatum getReferenceDatum() const { return m_datum; }
|
ReferenceDatum getReferenceDatum() const { return m_datum; }
|
||||||
|
|
||||||
//! MSL to flightlevel
|
//! MSL to flightlevel
|
||||||
void toFlightLevel();
|
bool toFlightLevel();
|
||||||
|
|
||||||
//! Flightlevel to MSL
|
//! Flightlevel to MSL
|
||||||
void toMeanSeaLevel();
|
bool toMeanSeaLevel();
|
||||||
|
|
||||||
//! Current altitude type
|
//! Current altitude type
|
||||||
AltitudeType getAltitudeType() const { return m_altitudeType; }
|
AltitudeType getAltitudeType() const { return m_altitudeType; }
|
||||||
|
|||||||
Reference in New Issue
Block a user