aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-11 23:37:16 +1200
committerGitHub <noreply@github.com>2017-08-11 23:37:16 +1200
commit30e8409375f9992a5248f7e2597691c0ee08188c (patch)
treeea51b7d111cfae849d23941ad82045139e87520b /src/org/traccar/reports
parent3562e0d927d539a1e9730c48ed376ee84ebc2b25 (diff)
parent26db3ccc2ed5d43a0e791a29d5cc4afca192e4b7 (diff)
downloadtrackermap-server-30e8409375f9992a5248f7e2597691c0ee08188c.tar.gz
trackermap-server-30e8409375f9992a5248f7e2597691c0ee08188c.tar.bz2
trackermap-server-30e8409375f9992a5248f7e2597691c0ee08188c.zip
Merge pull request #3431 from Abyss777/delayed_overspeed
Implement delayed overspeed events
Diffstat (limited to 'src/org/traccar/reports')
-rw-r--r--src/org/traccar/reports/ReportUtils.java9
-rw-r--r--src/org/traccar/reports/Stops.java7
-rw-r--r--src/org/traccar/reports/Trips.java7
3 files changed, 4 insertions, 19 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index e8db7e3b5..8c39bb9dc 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -155,15 +155,6 @@ public final class ReportUtils {
transformer.write();
}
- public static TripsConfig initTripsConfig() {
- return new TripsConfig(
- Context.getConfig().getLong("report.trip.minimalTripDistance", 500),
- Context.getConfig().getLong("report.trip.minimalTripDuration", 300) * 1000,
- Context.getConfig().getLong("report.trip.minimalParkingDuration", 300) * 1000,
- Context.getConfig().getBoolean("report.trip.greedyParking"),
- Context.getConfig().getLong("report.trip.minimalNoDataDuration", 3600) * 1000);
- }
-
private static TripReport calculateTrip(
ArrayList<Position> positions, int startIndex, int endIndex, boolean ignoreOdometer) {
Position startTrip = positions.get(startIndex);
diff --git a/src/org/traccar/reports/Stops.java b/src/org/traccar/reports/Stops.java
index ee6746e4e..3f7f674b5 100644
--- a/src/org/traccar/reports/Stops.java
+++ b/src/org/traccar/reports/Stops.java
@@ -33,7 +33,6 @@ import org.traccar.model.Group;
import org.traccar.reports.model.BaseReport;
import org.traccar.reports.model.DeviceReport;
import org.traccar.reports.model.StopReport;
-import org.traccar.reports.model.TripsConfig;
public final class Stops {
@@ -43,13 +42,11 @@ public final class Stops {
private static Collection<StopReport> detectStops(long deviceId, Date from, Date to) throws SQLException {
double speedThreshold = Context.getConfig().getDouble("event.motion.speedThreshold", 0.01);
- TripsConfig tripsConfig = ReportUtils.initTripsConfig();
-
boolean ignoreOdometer = Context.getDeviceManager()
.lookupAttributeBoolean(deviceId, "report.ignoreOdometer", false, true);
- Collection<? extends BaseReport> result = ReportUtils.detectTripsAndStops(tripsConfig,
- ignoreOdometer, speedThreshold,
+ Collection<? extends BaseReport> result = ReportUtils.detectTripsAndStops(
+ Context.getTripsConfig(), ignoreOdometer, speedThreshold,
Context.getDataManager().getPositions(deviceId, from, to), false);
return (Collection<StopReport>) result;
diff --git a/src/org/traccar/reports/Trips.java b/src/org/traccar/reports/Trips.java
index 6b97507f4..a4dcf00f1 100644
--- a/src/org/traccar/reports/Trips.java
+++ b/src/org/traccar/reports/Trips.java
@@ -32,7 +32,6 @@ import org.traccar.model.Group;
import org.traccar.reports.model.BaseReport;
import org.traccar.reports.model.DeviceReport;
import org.traccar.reports.model.TripReport;
-import org.traccar.reports.model.TripsConfig;
public final class Trips {
@@ -42,13 +41,11 @@ public final class Trips {
private static Collection<TripReport> detectTrips(long deviceId, Date from, Date to) throws SQLException {
double speedThreshold = Context.getConfig().getDouble("event.motion.speedThreshold", 0.01);
- TripsConfig tripsConfig = ReportUtils.initTripsConfig();
-
boolean ignoreOdometer = Context.getDeviceManager()
.lookupAttributeBoolean(deviceId, "report.ignoreOdometer", false, true);
- Collection<? extends BaseReport> result = ReportUtils.detectTripsAndStops(tripsConfig,
- ignoreOdometer, speedThreshold,
+ Collection<? extends BaseReport> result = ReportUtils.detectTripsAndStops(
+ Context.getTripsConfig(), ignoreOdometer, speedThreshold,
Context.getDataManager().getPositions(deviceId, from, to), true);
return (Collection<TripReport>) result;