refs #395, added isInRange to ATC stations

* use null as default values for some members to detect those are not yet set
* used simplified bool formatter for views
This commit is contained in:
Klaus Basan
2015-04-22 18:55:32 +02:00
committed by Mathew Sutcliffe
parent a3b147d59a
commit 3300b1ad9b
9 changed files with 72 additions and 51 deletions

View File

@@ -37,7 +37,7 @@ namespace BlackMisc
PhysicalQuantities::CLength calculateGreatCircleDistance(const ICoordinateGeodetic &coordinate1, const ICoordinateGeodetic &coordinate2)
{
// same coordinate results in 0 distance
// same coordinates results in 0 distance
if (coordinate1.latitude() == coordinate2.latitude() && coordinate1.longitude() == coordinate2.longitude())
{
return CLength(0, CLengthUnit::m());
@@ -58,6 +58,7 @@ namespace BlackMisc
double c = 2.0 * qAtan(qSqrt(a) / qSqrt(1.0 - a));
double distance = earthRadiusM * c;
Q_ASSERT_X(distance >= 0, Q_FUNC_INFO, "distance < 0");
return CLength(distance, CLengthUnit::m());
}