mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-04 19:33:52 +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
|
||||
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);
|
||||
NavigableSet<GPSFixMoving> beforeSet = getInternalFixes().headSet(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)) {
|
||||
timePointToUse = getMarkPassingForLegEnd().getTimePoint();
|
||||
} 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);
|
||||
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]
|
||||
* 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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user