mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Remove aircrafts with time of latest update greater than 15 seks
refs #229
This commit is contained in:
committed by
Klaus Basan
parent
83776c5cc9
commit
8341ef54d2
@@ -7,6 +7,7 @@
|
||||
#define BLACKCORE_INTERPOLATOR_H
|
||||
|
||||
#include "blackmisc/avaircraftsituation.h"
|
||||
#include <QDateTime>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
@@ -40,6 +41,12 @@ namespace BlackCore
|
||||
* \return
|
||||
*/
|
||||
virtual BlackMisc::Aviation::CAircraftSituation getCurrentSituation() = 0;
|
||||
|
||||
/*!
|
||||
* \brief Get timestamp of the last received aircraft situation
|
||||
* \return
|
||||
*/
|
||||
virtual const QDateTime &getTimeOfLastReceivedSituation() const = 0;
|
||||
};
|
||||
|
||||
} // namespace BlackCore
|
||||
|
||||
@@ -104,4 +104,9 @@ namespace BlackCore
|
||||
|
||||
return currentSituation;
|
||||
}
|
||||
|
||||
const QDateTime &CInterpolatorLinear::getTimeOfLastReceivedSituation() const
|
||||
{
|
||||
return m_aircraftSituationList.back().getTimestamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ namespace BlackCore
|
||||
//! \copydoc IInterpolator::getCurrentSituation()
|
||||
virtual BlackMisc::Aviation::CAircraftSituation getCurrentSituation() override;
|
||||
|
||||
//! \copydoc IInterpolator::getTimeOfLastReceivedSituation()
|
||||
virtual const QDateTime &getTimeOfLastReceivedSituation() const override;
|
||||
|
||||
private:
|
||||
BlackMisc::Aviation::CAircraftSituationList m_aircraftSituationList;
|
||||
|
||||
|
||||
@@ -388,6 +388,8 @@ namespace BlackSimPlugin
|
||||
{
|
||||
foreach(CSimConnectObject simObj, m_simConnectObjects)
|
||||
{
|
||||
if (simObj.getInterpolator()->getTimeOfLastReceivedSituation().secsTo(QDateTime::currentDateTimeUtc()) > 15)
|
||||
removeRemoteAircraft(simObj);
|
||||
|
||||
if (simObj.getInterpolator()->hasEnoughAircraftSituations())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user