aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-21 10:53:55 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-21 10:53:55 +0500
commit6aaa8dd3b3ffff7927325616efb9b9bdd8228a67 (patch)
treecaf0bc9b04df133a9751df5bc3996acb2f400db2 /src
parent06bdcf65a08b233f6c56ddf4774287c0c0232597 (diff)
downloadtrackermap-server-6aaa8dd3b3ffff7927325616efb9b9bdd8228a67.tar.gz
trackermap-server-6aaa8dd3b3ffff7927325616efb9b9bdd8228a67.tar.bz2
trackermap-server-6aaa8dd3b3ffff7927325616efb9b9bdd8228a67.zip
Make check for valid in MotionEventHandler optional
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/Context.java3
-rw-r--r--src/org/traccar/events/FuelDropEventHandler.java2
-rw-r--r--src/org/traccar/events/MotionEventHandler.java3
-rw-r--r--src/org/traccar/reports/model/TripsConfig.java13
4 files changed, 17 insertions, 4 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 340eb742c..cf857178f 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -258,7 +258,8 @@ public final class Context {
config.getLong("report.trip.minimalTripDuration", 300) * 1000,
config.getLong("report.trip.minimalParkingDuration", 300) * 1000,
config.getLong("report.trip.minimalNoDataDuration", 3600) * 1000,
- config.getBoolean("report.trip.useIgnition"));
+ config.getBoolean("report.trip.useIgnition"),
+ config.getBoolean("event.motion.processInvalidPositions"));
}
public static void init(String[] arguments) throws Exception {
diff --git a/src/org/traccar/events/FuelDropEventHandler.java b/src/org/traccar/events/FuelDropEventHandler.java
index 4fc512162..2ee3e1a58 100644
--- a/src/org/traccar/events/FuelDropEventHandler.java
+++ b/src/org/traccar/events/FuelDropEventHandler.java
@@ -35,7 +35,7 @@ public class FuelDropEventHandler extends BaseEventHandler {
if (device == null) {
return null;
}
- if (!Context.getIdentityManager().isLatestPosition(position) || !position.getValid()) {
+ if (!Context.getIdentityManager().isLatestPosition(position)) {
return null;
}
diff --git a/src/org/traccar/events/MotionEventHandler.java b/src/org/traccar/events/MotionEventHandler.java
index ae64c10ea..0c1c4848f 100644
--- a/src/org/traccar/events/MotionEventHandler.java
+++ b/src/org/traccar/events/MotionEventHandler.java
@@ -109,7 +109,8 @@ public class MotionEventHandler extends BaseEventHandler {
if (device == null) {
return null;
}
- if (!Context.getIdentityManager().isLatestPosition(position) || !position.getValid()) {
+ if (!Context.getIdentityManager().isLatestPosition(position)
+ || !tripsConfig.getProcessInvalidPositions() && !position.getValid()) {
return null;
}
diff --git a/src/org/traccar/reports/model/TripsConfig.java b/src/org/traccar/reports/model/TripsConfig.java
index 22fddd072..ca361a466 100644
--- a/src/org/traccar/reports/model/TripsConfig.java
+++ b/src/org/traccar/reports/model/TripsConfig.java
@@ -22,12 +22,13 @@ public class TripsConfig {
}
public TripsConfig(double minimalTripDistance, long minimalTripDuration, long minimalParkingDuration,
- long minimalNoDataDuration, boolean useIgnition) {
+ long minimalNoDataDuration, boolean useIgnition, boolean processInvalidPositions) {
this.minimalTripDistance = minimalTripDistance;
this.minimalTripDuration = minimalTripDuration;
this.minimalParkingDuration = minimalParkingDuration;
this.minimalNoDataDuration = minimalNoDataDuration;
this.useIgnition = useIgnition;
+ this.processInvalidPositions = processInvalidPositions;
}
private double minimalTripDistance;
@@ -80,4 +81,14 @@ public class TripsConfig {
this.useIgnition = useIgnition;
}
+ private boolean processInvalidPositions;
+
+ public boolean getProcessInvalidPositions() {
+ return processInvalidPositions;
+ }
+
+ public void setProcessInvalidPositions(boolean processInvalidPositions) {
+ this.processInvalidPositions = processInvalidPositions;
+ }
+
}