refs #837 Using new abbreviated syntax for null units.

This commit is contained in:
Mathew Sutcliffe
2016-12-14 21:36:52 +00:00
parent 0ca9fe0a8a
commit b252673928
12 changed files with 18 additions and 18 deletions

View File

@@ -133,7 +133,7 @@ namespace BlackCore
bool m_simulatorRenderedAircraftRestricted = false;
bool m_simulatorRenderingEnabled = true;
int m_simulatorMaxRenderedAircraft = -1;
BlackMisc::PhysicalQuantities::CLength m_simulatorMaxRenderedDistance { 0.0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit() };
BlackMisc::PhysicalQuantities::CLength m_simulatorMaxRenderedDistance { 0.0, nullptr };
mutable QReadWriteLock m_lockSnapshot; //!< lock snapshot
mutable QReadWriteLock m_lockRestrictions; //!< lock simulator restrictions
};

View File

@@ -201,7 +201,7 @@ namespace BlackGui
{
// get initial aircraft to render
CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup();
CLength newDistance(0, CLengthUnit::nullUnit());
CLength newDistance(0, nullptr);
if (!ui->le_MaxDistance->text().isEmpty())
{
newDistance = CLength(ui->le_MaxDistance->text().toInt(), CLengthUnit::NM());

View File

@@ -79,7 +79,7 @@ namespace BlackMisc
bool ok = false;
double dv = v.toDouble(&ok) * 100.0;
CAltitude a(ok ? dv : 0.0, FlightLevel,
ok ? CLengthUnit::ft() : CLengthUnit::nullUnit());
ok ? CLengthUnit::ft() : nullptr);
*this = a;
return;
}

View File

@@ -308,7 +308,7 @@ namespace BlackMisc
CTime CAtcStation::bookedWhen() const
{
if (!this->hasValidBookingTimes()) { return CTime(0, CTimeUnit::nullUnit()); }
if (!this->hasValidBookingTimes()) { return CTime(0, nullptr); }
QDateTime now = QDateTime::currentDateTimeUtc();
qint64 diffMs;
if (this->m_bookedFromUtc > now)

View File

@@ -197,7 +197,7 @@ namespace BlackMisc
{}
CCoordinateGeodetic::CCoordinateGeodetic(double latitudeDegrees, double longitudeDegrees) :
CCoordinateGeodetic( { latitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg() }, { longitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg() }, { 0.0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit() }) {}
CCoordinateGeodetic( { latitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg() }, { longitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg() }, { 0, nullptr }) {}
CCoordinateGeodetic::CCoordinateGeodetic(double latitudeDegrees, double longitudeDegrees, double heightMeters) :
CCoordinateGeodetic( { latitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg() }, { longitudeDegrees, BlackMisc::PhysicalQuantities::CAngleUnit::deg() }, { heightMeters, BlackMisc::PhysicalQuantities::CLengthUnit::m() }) {}

View File

@@ -164,8 +164,8 @@ namespace BlackMisc
//! Can given index be handled?
static bool canHandleIndex(const BlackMisc::CPropertyIndex &index);
BlackMisc::PhysicalQuantities::CAngle m_relativeBearing {0.0, BlackMisc::PhysicalQuantities::CAngleUnit::nullUnit()}; //!< temporary stored value
BlackMisc::PhysicalQuantities::CLength m_relativeDistance {0.0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit()}; //!< temporary stored value
BlackMisc::PhysicalQuantities::CAngle m_relativeBearing { 0, nullptr }; //!< temporary stored value
BlackMisc::PhysicalQuantities::CLength m_relativeDistance { 0, nullptr }; //!< temporary stored value
};
//! Geodetic coordinate
@@ -240,7 +240,7 @@ namespace BlackMisc
double m_x = 0; //!< normal vector
double m_y = 0; //!< normal vector
double m_z = 0; //!< normal vector
BlackMisc::PhysicalQuantities::CLength m_geodeticHeight { 0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit() }; //!< height, ellipsoidal or geodetic height
BlackMisc::PhysicalQuantities::CLength m_geodeticHeight { 0, nullptr }; //!< height, ellipsoidal or geodetic height
BLACK_METACLASS(
CCoordinateGeodetic,

View File

@@ -69,7 +69,7 @@ namespace BlackMisc
if (distance == m_maxRenderedDistance) { return false; }
if (distance.isNull() || distance.isNegativeWithEpsilonConsidered())
{
m_maxRenderedDistance = CLength(0.0, CLengthUnit::nullUnit());
m_maxRenderedDistance = CLength(0.0, nullptr);
}
else if (distance.isZeroEpsilonConsidered())
{
@@ -93,7 +93,7 @@ namespace BlackMisc
void CInterpolationAndRenderingSetup::clearMaxRenderedDistance()
{
this->setMaxRenderedDistance(CLength(0.0, CLengthUnit::nullUnit()));
this->setMaxRenderedDistance(CLength(0.0, nullptr));
}
bool CInterpolationAndRenderingSetup::isMaxAircraftRestricted() const
@@ -103,7 +103,7 @@ namespace BlackMisc
void CInterpolationAndRenderingSetup::clearAllRenderingRestrictions()
{
this->m_maxRenderedDistance = CLength(0, CLengthUnit::nullUnit());
this->m_maxRenderedDistance = CLength(0, nullptr);
this->m_maxRenderedAircraft = InfiniteAircraft();
}

View File

@@ -119,7 +119,7 @@ namespace BlackMisc
bool m_forceFullInterpolation = false; //! always do a full interpolation, even if aircraft is not moving
bool m_enabledAircraftParts = true; //! Update aircraft parts
int m_maxRenderedAircraft = InfiniteAircraft(); //!< max.rendered aircraft
BlackMisc::PhysicalQuantities::CLength m_maxRenderedDistance { 0.0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit()}; //!< max.distance for rendering
BlackMisc::PhysicalQuantities::CLength m_maxRenderedDistance { 0, nullptr }; //!< max.distance for rendering
BLACK_METACLASS(
CInterpolationAndRenderingSetup,

View File

@@ -61,7 +61,7 @@ namespace BlackMisc
//! Constructor, private message
CTextMessage(const QString &message, const BlackMisc::Aviation::CCallsign &senderCallsign, const BlackMisc::Aviation::CCallsign &recipientCallsign = BlackMisc::Aviation::CCallsign())
: m_message(message), m_senderCallsign(senderCallsign), m_recipientCallsign(recipientCallsign), m_frequency(0, BlackMisc::PhysicalQuantities::CFrequencyUnit::nullUnit()) {}
: m_message(message), m_senderCallsign(senderCallsign), m_recipientCallsign(recipientCallsign), m_frequency(0, nullptr) {}
//! Get callsign (from)
const BlackMisc::Aviation::CCallsign &getSenderCallsign() const { return m_senderCallsign; }
@@ -174,7 +174,7 @@ namespace BlackMisc
QString m_message;
BlackMisc::Aviation::CCallsign m_senderCallsign;
BlackMisc::Aviation::CCallsign m_recipientCallsign;
BlackMisc::PhysicalQuantities::CFrequency m_frequency {0, BlackMisc::PhysicalQuantities::CFrequencyUnit::nullUnit()};
BlackMisc::PhysicalQuantities::CFrequency m_frequency { 0, nullptr };
bool m_wasSent = false;
BLACK_METACLASS(

View File

@@ -43,7 +43,7 @@ namespace BlackMisc
bool restricted = false,
bool renderingEnabled = true,
int maxAircraft = 100,
const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance = BlackMisc::PhysicalQuantities::CLength(0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit()));
const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance = { 0, nullptr });
//! Time when snapshot was taken
const QDateTime getTimestamp() const { return QDateTime::fromMSecsSinceEpoch(m_timestampMsSinceEpoch); }