mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
Bug 4316: BravoFixTrack now knows if it has extended fixes
This commit is contained in:
1 parent
9b3a9968f9
commit
4daedc9563
5 files changed
+15
-5
No files matched your search
+1
-1
@@ -20,7 +20,7 @@ public class BravoDataFixMapper implements SensorFixMapper<BravoFix, DynamicSens
|
||||
@Override
|
||||
public DynamicSensorFixTrack<Competitor, BravoFix> getTrack(DynamicTrackedRace race, Competitor key) {
|
||||
return race.getOrCreateSensorTrack(key, BravoFixTrack.TRACK_NAME,
|
||||
() -> new BravoFixTrackImpl<Competitor>(key, BravoFixTrack.TRACK_NAME));
|
||||
() -> new BravoFixTrackImpl<Competitor>(key, BravoFixTrack.TRACK_NAME, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public class BravoExtendedDataFixMapper implements SensorFixMapper<BravoFix, Dyn
|
||||
@Override
|
||||
public DynamicSensorFixTrack<Competitor, BravoFix> getTrack(DynamicTrackedRace race, Competitor key) {
|
||||
return race.getOrCreateSensorTrack(key, BravoFixTrack.TRACK_NAME,
|
||||
() -> new BravoFixTrackImpl<Competitor>(key, BravoFixTrack.TRACK_NAME));
|
||||
() -> new BravoFixTrackImpl<Competitor>(key, BravoFixTrack.TRACK_NAME, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class BravoFixTrackSerializationTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
Competitor competitor = TrackBasedTest.createCompetitor("SAP Extreme Sailing Team");
|
||||
track = new BravoFixTrackImpl<Competitor>(competitor, BravoFixTrack.TRACK_NAME);
|
||||
track = new BravoFixTrackImpl<Competitor>(competitor, BravoFixTrack.TRACK_NAME, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -73,4 +73,6 @@ public interface BravoFixTrack<ItemType extends WithID & Serializable> extends S
|
||||
* The distance sailed foiling during the time range provided
|
||||
*/
|
||||
Distance getDistanceSpentFoiling(GPSFixTrack<Competitor, GPSFixMoving> gpsFixTrack, TimePoint from, TimePoint to);
|
||||
|
||||
boolean hasExtendedFixes();
|
||||
}
|
||||
+10
-2
@@ -22,7 +22,9 @@ import com.sap.sse.common.WithID;
|
||||
*/
|
||||
public class BravoFixTrackImpl<ItemType extends WithID & Serializable> extends SensorFixTrackImpl<ItemType, BravoFix>
|
||||
implements DynamicBravoFixTrack<ItemType> {
|
||||
private static final long serialVersionUID = 5517848726456424386L;
|
||||
private static final long serialVersionUID = 460944392510182976L;
|
||||
|
||||
private final boolean hasExtendedFixes;
|
||||
|
||||
/**
|
||||
* @param trackedItem
|
||||
@@ -30,8 +32,9 @@ public class BravoFixTrackImpl<ItemType extends WithID & Serializable> extends S
|
||||
* @param trackName
|
||||
* the name of the track by which it can be obtained from the {@link TrackedRace}.
|
||||
*/
|
||||
public BravoFixTrackImpl(ItemType trackedItem, String trackName) {
|
||||
public BravoFixTrackImpl(ItemType trackedItem, String trackName, boolean hasExtendedFixes) {
|
||||
super(trackedItem, trackName, BravoFixTrack.TRACK_NAME + " for " + trackedItem);
|
||||
this.hasExtendedFixes = hasExtendedFixes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,4 +170,9 @@ public class BravoFixTrackImpl<ItemType extends WithID & Serializable> extends S
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasExtendedFixes() {
|
||||
return hasExtendedFixes;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user