mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-06 04:13:51 +00:00
changed time point used for average speed over ground; use time of competitor's last fix if leg not completed;
return null if no fix found at all for competitor
This commit is contained in:
1 parent
910c860e69
commit
b745acb11f
3 files changed
+9
-2
No files matched your search
+1
@@ -28,6 +28,7 @@ public class DynamicGPSFixMovingTrackImpl<ItemType> extends DynamicTrackImpl<Ite
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SpeedWithBearing getEstimatedSpeed(TimePoint at) {
|
public SpeedWithBearing getEstimatedSpeed(TimePoint at) {
|
||||||
|
// TODO factor out the obtaining of relevant fixes which should be the same in super.getEstimatedSpeed(at)
|
||||||
DummyGPSFixMoving atTimed = new DummyGPSFixMoving(at);
|
DummyGPSFixMoving atTimed = new DummyGPSFixMoving(at);
|
||||||
NavigableSet<GPSFixMoving> beforeSet = getInternalFixes().headSet(atTimed, /* inclusive */ true);
|
NavigableSet<GPSFixMoving> beforeSet = getInternalFixes().headSet(atTimed, /* inclusive */ true);
|
||||||
NavigableSet<GPSFixMoving> afterSet = getInternalFixes().tailSet(atTimed, /* inclusive */ true);
|
NavigableSet<GPSFixMoving> afterSet = getInternalFixes().tailSet(atTimed, /* inclusive */ true);
|
||||||
|
|||||||
+8
-1
@@ -107,7 +107,14 @@ public class TrackedLegOfCompetitorImpl implements TrackedLegOfCompetitor {
|
|||||||
if (hasFinishedLeg(timePoint)) {
|
if (hasFinishedLeg(timePoint)) {
|
||||||
timePointToUse = getMarkPassingForLegEnd().getTimePoint();
|
timePointToUse = getMarkPassingForLegEnd().getTimePoint();
|
||||||
} else {
|
} else {
|
||||||
timePointToUse = getTrackedRace().getTimePointOfNewestEvent();
|
// use time point of latest fix
|
||||||
|
GPSFixMoving lastFix = getTrackedRace().getTrack(getCompetitor()).getLastFix();
|
||||||
|
if (lastFix != null) {
|
||||||
|
timePointToUse = lastFix.getTimePoint();
|
||||||
|
} else {
|
||||||
|
// No fix at all? Then we can't determine any speed
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Distance d = getDistanceTraveled(timePointToUse);
|
Distance d = getDistanceTraveled(timePointToUse);
|
||||||
long millis = timePointToUse.asMillis() - legStart.getTimePoint().asMillis();
|
long millis = timePointToUse.asMillis() - legStart.getTimePoint().asMillis();
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ public interface MongoWindStoreFactory {
|
|||||||
/**
|
/**
|
||||||
* Gets the default Mongo store based on the properties mongo.hostname[=localhost], mongo.port[=27017]
|
* Gets the default Mongo store based on the properties mongo.hostname[=localhost], mongo.port[=27017]
|
||||||
* and mongo.dbName[=<contents of constant {@link #DEFAULT_DB_NAME}>] specified in the bundle context
|
* and mongo.dbName[=<contents of constant {@link #DEFAULT_DB_NAME}>] specified in the bundle context
|
||||||
* @param mongoObjectFactory TODO
|
|
||||||
*/
|
*/
|
||||||
MongoWindStore getMongoWindStore(MongoObjectFactory mongoObjectFactory) throws UnknownHostException, MongoException;
|
MongoWindStore getMongoWindStore(MongoObjectFactory mongoObjectFactory) throws UnknownHostException, MongoException;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user