Commit 2e9d1120 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Keep 3 minutes of trajectory points (#3706)

parent 196153aa
...@@ -1279,6 +1279,10 @@ void Vehicle::_missionManagerError(int errorCode, const QString& errorMsg) ...@@ -1279,6 +1279,10 @@ void Vehicle::_missionManagerError(int errorCode, const QString& errorMsg)
void Vehicle::_addNewMapTrajectoryPoint(void) void Vehicle::_addNewMapTrajectoryPoint(void)
{ {
if (_mapTrajectoryHaveFirstCoordinate) { if (_mapTrajectoryHaveFirstCoordinate) {
// Keep three minutes of trajectory
if (_mapTrajectoryList.count() * _mapTrajectoryMsecsBetweenPoints > 3 * 1000 * 60) {
_mapTrajectoryList.removeAt(0)->deleteLater();
}
_mapTrajectoryList.append(new CoordinateVector(_mapTrajectoryLastCoordinate, _coordinate, this)); _mapTrajectoryList.append(new CoordinateVector(_mapTrajectoryLastCoordinate, _coordinate, this));
} }
_mapTrajectoryHaveFirstCoordinate = true; _mapTrajectoryHaveFirstCoordinate = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment