diff options
Diffstat (limited to 'src/org/traccar/reports')
-rw-r--r-- | src/org/traccar/reports/ReportUtils.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java index 1e004beae..705f11429 100644 --- a/src/org/traccar/reports/ReportUtils.java +++ b/src/org/traccar/reports/ReportUtils.java @@ -220,7 +220,12 @@ public final class ReportUtils { >= tripsConfig.getMinimalNoDataDuration()) { return false; } - return positions.get(index).getSpeed() > speedThreshold; + if (positions.get(index).getAttributes().containsKey(Position.KEY_MOTION) + && positions.get(index).getAttributes().get(Position.KEY_MOTION) instanceof Boolean) { + return positions.get(index).getBoolean(Position.KEY_MOTION); + } else { + return positions.get(index).getSpeed() > speedThreshold; + } } public static Collection<BaseReport> detectTripsAndStops(TripsConfig tripsConfig, boolean ignoreOdometer, @@ -295,7 +300,7 @@ public final class ReportUtils { previousEndParkingIndex)); } } - result.add(calculateStop(positions, startParkingIndex, endParkingIndex)); + result.add(calculateStop(positions, startParkingIndex, isLast ? i : endParkingIndex)); } } previousEndParkingIndex = endParkingIndex; |