mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Send distance if own aircraft has been moved
This commit is contained in:
committed by
Mat Sutcliffe
parent
8278a7d5e6
commit
668659248e
@@ -193,16 +193,20 @@ namespace BlackCore
|
||||
|
||||
// using copy to minimize lock time
|
||||
// 500km/h => 1sec: 0.1388 km
|
||||
// we check if there are situation for own aircraft outside the max.distance
|
||||
static const CLength maxDistance(25, CLengthUnit::km());
|
||||
const CAircraftSituation latest = situations.front();
|
||||
const bool jumpDetected = situations.containsObjectOutsideRange(situations.front(), maxDistance);
|
||||
|
||||
if (jumpDetected)
|
||||
{
|
||||
const CAircraftSituationList ownDistances = situations.findFarthest(1, latest);
|
||||
const CLength distance = ownDistances.front().calculateGreatCircleDistance(latest);
|
||||
{
|
||||
QWriteLocker wl(&m_lockAircraft);
|
||||
m_situationHistory.clear();
|
||||
}
|
||||
emit this->movedAircraft();
|
||||
emit this->movedAircraft(distance);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user