refs #395, MS'review points

Also removed blackmisc variant samples, https://dev.vatsim-germany.org/issues/395#note-9
This commit is contained in:
Klaus Basan
2015-05-12 20:28:27 +01:00
committed by Mathew Sutcliffe
parent 6119c22c78
commit b494cb51b8
7 changed files with 11 additions and 120 deletions

View File

@@ -115,6 +115,8 @@ namespace BlackCore
{
m_aircraftCallsignTimestamps.clear();
m_atcCallsignTimestamps.clear();
QWriteLocker l(&m_lockSnapshot);
m_latestAircraftSnapshot = CAirspaceAircraftSnapshot();
}

View File

@@ -37,7 +37,7 @@ namespace BlackCore
static QString getMessageCategory() { return "swift.interpolatorlinear"; }
};
} // namespace BlackCore
} // guard
#endif // guard

View File

@@ -58,7 +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");
Q_ASSERT_X(distance >= 0, Q_FUNC_INFO, "distance should never calculate to negative values");
return CLength(distance, CLengthUnit::m());
}

View File

@@ -17,7 +17,6 @@ namespace BlackMisc
m_updateTimer(new QTimer(this))
{ }
QDateTime CThreadedReader::getUpdateTimestamp() const
{
QReadLocker(&this->m_lock);
@@ -49,14 +48,17 @@ namespace BlackMisc
void CThreadedReader::setInterval(int updatePeriodMs)
{
Q_ASSERT(this->m_updateTimer);
bool s;
if (updatePeriodMs < 1)
{
QMetaObject::invokeMethod(m_updateTimer, "stop");
s = QMetaObject::invokeMethod(m_updateTimer, "stop");
}
else
{
QMetaObject::invokeMethod(m_updateTimer, "start", Q_ARG(int, updatePeriodMs));
s = QMetaObject::invokeMethod(m_updateTimer, "start", Q_ARG(int, updatePeriodMs));
}
Q_ASSERT_X(s, Q_FUNC_INFO, "Failed invoke");
Q_UNUSED(s);
}
int CThreadedReader::interval() const
@@ -67,8 +69,7 @@ namespace BlackMisc
void CThreadedReader::threadAssertCheck() const
{
Q_ASSERT_X(QCoreApplication::instance()->thread() != QThread::currentThread(), "CThreadedReader::threadAssertCheck", "Needs to run in own thread");
Q_ASSERT_X(QObject::thread() == QThread::currentThread(), "CThreadedReader::threadAssertCheck", "Needs to run in own thread");
Q_ASSERT_X(QCoreApplication::instance()->thread() != QThread::currentThread(), Q_FUNC_INFO, "Needs to run in own thread");
Q_ASSERT_X(QObject::thread() == QThread::currentThread(), Q_FUNC_INFO, "Wrong object thread");
}
} // namespace