e2128fd2b7fc5e50409fa8998f95940f51412bfc
java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/DomainObjectFactory.java
| ... | ... | @@ -236,7 +236,6 @@ public interface DomainObjectFactory { |
| 236 | 236 | |
| 237 | 237 | Map<RaceIdentifier, ManeuverRaceFingerprint> loadFingerprintsForManeuverHashes(); |
| 238 | 238 | |
| 239 | - |
|
| 240 | 239 | /** |
| 241 | 240 | * For races that have a {@link MarkPassingRaceFingerprint} stored in the database (see {@link #loadFingerprintsForMarkPassingHashes()}) |
| 242 | 241 | * a caller can load the corresponding mark passings with this method. |
java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/FieldNames.java
| ... | ... | @@ -197,11 +197,15 @@ public enum FieldNames { |
| 197 | 197 | // MARKPASSINGS collection |
| 198 | 198 | MARK_PASSINGS_FINGERPRINT, MARK_PASSINGS, |
| 199 | 199 | |
| 200 | - // MANEUVER collection |
|
| 201 | - MANEUVER_FINGERPRINT, MANEUVERS, TYPE, TACK, POSITION_LAT_RAD, POSITION_LNG_RAD, TIMEPOINT, MAIN_CURVE_BOUNDARIES, MANEUVER_CURVE_WITH_STABLE_SPEED_AND_COURSE_BOUNDERIES, MAX_TURNING_RATE_IN_DEGREE_PER_SECOUND, MANEUVER_LOSS, |
|
| 202 | - //Test |
|
| 203 | - TIMEPOINT_BEFORE, TIMEPOINT_AFTER, SPEED_WITH_BEARING_BEFORE, SPEED_WITH_BEARING_AFTER, DIRECTION_CHANGE_IN_DEGREES, LOWEST_SPEED, HIGHEST_SPEED, |
|
| 204 | - DISTANCE_SAILED_POMA, DISTANCE_SAILED_INMPOMA, SPEED_WITH_BEARING_BEFORE_DEGREES, SPEED_WITH_BEARING_BEFORE_SPEED, SPEED_WITH_BEARING_AFTER_DEGREES, SPEED_WITH_BEARING_AFTER_SPEED, |
|
| 205 | - START_POSITION_LAT_RAD, START_POSITION_LNG_RAD, END_POSITION_LAT_RAD, END_POSITION_LNG_RAD, MIDDLE_MAEUVER_ANGLE, DURATION |
|
| 200 | + // MANEUVERS collection: |
|
| 201 | + MANEUVER_FINGERPRINT, MANEUVERS, TYPE, TACK, POSITION_LAT_RAD, POSITION_LNG_RAD, TIMEPOINT, MAIN_CURVE_BOUNDARIES, |
|
| 202 | + MANEUVER_CURVE_WITH_STABLE_SPEED_AND_COURSE_BOUNDERIES, MAX_TURNING_RATE_IN_DEGREE_PER_SECOUND, MANEUVER_LOSS, |
|
| 203 | + // MANEUVERS main curve boundaries properties, see MAIN_CURVE_BOUNDARIES field above |
|
| 204 | + MANEUVER_TIMEPOINT_BEFORE, MANEUVER_TIMEPOINT_AFTER, MANEUVER_SPEED_WITH_BEARING_BEFORE, MANEUVER_SPEED_WITH_BEARING_AFTER, |
|
| 205 | + MANEUVER_DIRECTION_CHANGE_IN_DEGREES, MANEUVER_LOWEST_SPEED, MANEUVER_HIGHEST_SPEED, |
|
| 206 | + MANEUVER_DISTANCE_SAILED_POMA, MANEUVER_DISTANCE_SAILED_INMPOMA, MANEUVER_SPEED_WITH_BEARING_BEFORE_DEGREES, |
|
| 207 | + MANEUVER_SPEED_WITH_BEARING_BEFORE_SPEED, MANEUVER_SPEED_WITH_BEARING_AFTER_DEGREES, MANEUVER_SPEED_WITH_BEARING_AFTER_SPEED, |
|
| 208 | + MANEUVER_START_POSITION_LAT_RAD, MANEUVER_START_POSITION_LNG_RAD, MANEUVER_END_POSITION_LAT_RAD, |
|
| 209 | + MANEUVER_END_POSITION_LNG_RAD, MIDDLE_MAEUVER_ANGLE, MANEUVER_LOSS_DURATION |
|
| 206 | 210 | ; |
| 207 | 211 | } |
java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/MongoObjectFactory.java
| ... | ... | @@ -250,7 +250,6 @@ public interface MongoObjectFactory { |
| 250 | 250 | |
| 251 | 251 | void removeMarkPassings(RaceIdentifier raceIdentifier); |
| 252 | 252 | |
| 253 | - |
|
| 254 | 253 | void storeManeuvers(RaceIdentifier raceIdentifier, ManeuverRaceFingerprint fingerprint, Course course, Map<Competitor, List<Maneuver>> maneuvers); |
| 255 | 254 | |
| 256 | 255 | void removeManeuvers(RaceIdentifier raceIdentifier); |
java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/impl/DomainObjectFactoryImpl.java
| ... | ... | @@ -3380,21 +3380,21 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory { |
| 3380 | 3380 | private ManeuverLoss loadManeuverLoss(Document document) { |
| 3381 | 3381 | final ManeuverLoss maneuverLoss; |
| 3382 | 3382 | if (document != null) { |
| 3383 | - final Double distanceDouble = document.getDouble(FieldNames.DISTANCE_SAILED_POMA.name()); |
|
| 3383 | + final Double distanceDouble = document.getDouble(FieldNames.MANEUVER_DISTANCE_SAILED_POMA.name()); |
|
| 3384 | 3384 | final Distance distance = new MeterDistance(distanceDouble); |
| 3385 | - final Distance distanceIfNorManeuvering = new MeterDistance(document.getDouble(FieldNames.DISTANCE_SAILED_INMPOMA.name())); |
|
| 3386 | - final double startPositionLatRad = document.getDouble(FieldNames.START_POSITION_LAT_RAD.name()); |
|
| 3387 | - final double startPositionLngRad = document.getDouble(FieldNames.START_POSITION_LNG_RAD.name()); |
|
| 3385 | + final Distance distanceIfNorManeuvering = new MeterDistance(document.getDouble(FieldNames.MANEUVER_DISTANCE_SAILED_INMPOMA.name())); |
|
| 3386 | + final double startPositionLatRad = document.getDouble(FieldNames.MANEUVER_START_POSITION_LAT_RAD.name()); |
|
| 3387 | + final double startPositionLngRad = document.getDouble(FieldNames.MANEUVER_START_POSITION_LNG_RAD.name()); |
|
| 3388 | 3388 | final Position startPosition = new RadianPosition(startPositionLatRad, startPositionLngRad); |
| 3389 | - final double endPositionLatRad = document.getDouble(FieldNames.END_POSITION_LAT_RAD.name()); |
|
| 3390 | - final double endPositionLngRad = document.getDouble(FieldNames.END_POSITION_LNG_RAD.name()); |
|
| 3389 | + final double endPositionLatRad = document.getDouble(FieldNames.MANEUVER_END_POSITION_LAT_RAD.name()); |
|
| 3390 | + final double endPositionLngRad = document.getDouble(FieldNames.MANEUVER_END_POSITION_LNG_RAD.name()); |
|
| 3391 | 3391 | final Position endPosition = new RadianPosition(endPositionLatRad, endPositionLngRad); |
| 3392 | - final Duration duration = Duration.ofMillis(document.getLong(FieldNames.DURATION.name())); |
|
| 3393 | - final Double SpeedWithBearingBeforeDegrees = document.getDouble(FieldNames.SPEED_WITH_BEARING_BEFORE_DEGREES.name()); |
|
| 3394 | - final Double SpeedWithBearingBeforeSpeed = document.getDouble(FieldNames.SPEED_WITH_BEARING_BEFORE_SPEED.name()); |
|
| 3392 | + final Duration duration = Duration.ofMillis(document.getLong(FieldNames.MANEUVER_LOSS_DURATION.name())); |
|
| 3393 | + final Double SpeedWithBearingBeforeDegrees = document.getDouble(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_DEGREES.name()); |
|
| 3394 | + final Double SpeedWithBearingBeforeSpeed = document.getDouble(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_SPEED.name()); |
|
| 3395 | 3395 | final Bearing bearingBefore = new DegreeBearingImpl(SpeedWithBearingBeforeDegrees); |
| 3396 | 3396 | final SpeedWithBearing SpeedWithBearingBefore = new KnotSpeedWithBearingImpl(SpeedWithBearingBeforeSpeed, bearingBefore); |
| 3397 | - final Bearing middeManeuverAngle = new DegreeBearingImpl(document.getDouble(FieldNames.DEGREE_BEARING.name())); |
|
| 3397 | + final Bearing middeManeuverAngle = new DegreeBearingImpl(document.getDouble(FieldNames.MIDDLE_MAEUVER_ANGLE.name())); |
|
| 3398 | 3398 | maneuverLoss = new ManeuverLoss(distance, distanceIfNorManeuvering, startPosition, endPosition, duration, SpeedWithBearingBefore, middeManeuverAngle); |
| 3399 | 3399 | } else { |
| 3400 | 3400 | maneuverLoss = null; |
| ... | ... | @@ -3403,20 +3403,20 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory { |
| 3403 | 3403 | } |
| 3404 | 3404 | |
| 3405 | 3405 | private ManeuverCurveBoundaries loadManeuverCurveBoundaries(Document document) { |
| 3406 | - final TimePoint timePointBefore = TimePoint.of(document.getLong(FieldNames.TIMEPOINT_BEFORE.name())); |
|
| 3407 | - final TimePoint timePointAfter = TimePoint.of(document.getLong(FieldNames.TIMEPOINT_AFTER.name())); |
|
| 3408 | - final Double SpeedWithBearingBeforeDegrees = document.getDouble(FieldNames.SPEED_WITH_BEARING_BEFORE_DEGREES.name()); |
|
| 3409 | - final Double SpeedWithBearingBeforeSpeed = document.getDouble(FieldNames.SPEED_WITH_BEARING_BEFORE_SPEED.name()); |
|
| 3406 | + final TimePoint timePointBefore = TimePoint.of(document.getLong(FieldNames.MANEUVER_TIMEPOINT_BEFORE.name())); |
|
| 3407 | + final TimePoint timePointAfter = TimePoint.of(document.getLong(FieldNames.MANEUVER_TIMEPOINT_AFTER.name())); |
|
| 3408 | + final Double SpeedWithBearingBeforeDegrees = document.getDouble(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_DEGREES.name()); |
|
| 3409 | + final Double SpeedWithBearingBeforeSpeed = document.getDouble(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_SPEED.name()); |
|
| 3410 | 3410 | final Bearing bearingBefore = new DegreeBearingImpl(SpeedWithBearingBeforeDegrees); |
| 3411 | 3411 | final SpeedWithBearing SpeedWithBearingBefore = new KnotSpeedWithBearingImpl(SpeedWithBearingBeforeSpeed, bearingBefore); |
| 3412 | - final Double SpeedWithBearingAfterDegrees = document.getDouble(FieldNames.SPEED_WITH_BEARING_AFTER_DEGREES.name()); |
|
| 3413 | - final Double SpeedWithBearingAfterSpeed = document.getDouble(FieldNames.SPEED_WITH_BEARING_AFTER_SPEED.name()); |
|
| 3412 | + final Double SpeedWithBearingAfterDegrees = document.getDouble(FieldNames.MANEUVER_SPEED_WITH_BEARING_AFTER_DEGREES.name()); |
|
| 3413 | + final Double SpeedWithBearingAfterSpeed = document.getDouble(FieldNames.MANEUVER_SPEED_WITH_BEARING_AFTER_SPEED.name()); |
|
| 3414 | 3414 | final Bearing bearingAfter = new DegreeBearingImpl(SpeedWithBearingAfterSpeed); |
| 3415 | 3415 | final SpeedWithBearing SpeedWithBearingAfter = new KnotSpeedWithBearingImpl(SpeedWithBearingAfterDegrees, bearingAfter); |
| 3416 | - final double directionChangeInDegrees = document.getDouble(FieldNames.DIRECTION_CHANGE_IN_DEGREES.name()); |
|
| 3417 | - final double lowestSpeedDouble = document.getDouble(FieldNames.LOWEST_SPEED.name()); |
|
| 3416 | + final double directionChangeInDegrees = document.getDouble(FieldNames.MANEUVER_DIRECTION_CHANGE_IN_DEGREES.name()); |
|
| 3417 | + final double lowestSpeedDouble = document.getDouble(FieldNames.MANEUVER_LOWEST_SPEED.name()); |
|
| 3418 | 3418 | final Speed lowestSpeed = new KnotSpeedImpl(lowestSpeedDouble); |
| 3419 | - final double highestSpeedDouble = document.getDouble(FieldNames.HIGHEST_SPEED.name()); |
|
| 3419 | + final double highestSpeedDouble = document.getDouble(FieldNames.MANEUVER_HIGHEST_SPEED.name()); |
|
| 3420 | 3420 | final Speed highestSpeed = new KnotSpeedImpl(highestSpeedDouble); |
| 3421 | 3421 | ManeuverCurveBoundaries maneuverCurveBoundaries = new ManeuverCurveBoundariesImpl(timePointBefore, |
| 3422 | 3422 | timePointAfter, SpeedWithBearingBefore, SpeedWithBearingAfter, directionChangeInDegrees, lowestSpeed, |
java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/impl/MongoObjectFactoryImpl.java
| ... | ... | @@ -2068,29 +2068,29 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory { |
| 2068 | 2068 | |
| 2069 | 2069 | private Document storeManeuverLoss(ManeuverLoss maneuverLoss) { |
| 2070 | 2070 | final Document maneuverLossDoc = new Document(); |
| 2071 | - maneuverLossDoc.put(FieldNames.DISTANCE_SAILED_POMA.name(), maneuverLoss.getDistanceSailedIfNotManeuveringProjectedOnMiddleManeuverAngle().getMeters()); |
|
| 2072 | - maneuverLossDoc.put(FieldNames.DISTANCE_SAILED_INMPOMA.name(), maneuverLoss.getDistanceSailedIfNotManeuveringProjectedOnMiddleManeuverAngle().getMeters()); |
|
| 2073 | - maneuverLossDoc.put(FieldNames.START_POSITION_LAT_RAD.name(), maneuverLoss.getManeuverStartPosition().getLatRad()); |
|
| 2074 | - maneuverLossDoc.put(FieldNames.START_POSITION_LNG_RAD.name(), maneuverLoss.getManeuverStartPosition().getLngRad()); |
|
| 2075 | - maneuverLossDoc.put(FieldNames.END_POSITION_LAT_RAD.name(), maneuverLoss.getManeuverStartPosition().getLngRad()); |
|
| 2076 | - maneuverLossDoc.put(FieldNames.END_POSITION_LNG_RAD.name(), maneuverLoss.getManeuverStartPosition().getLngRad()); |
|
| 2077 | - maneuverLossDoc.put(FieldNames.SPEED_WITH_BEARING_BEFORE_DEGREES.name(), maneuverLoss.getSpeedWithBearingBefore().getBearing().getDegrees()); |
|
| 2078 | - maneuverLossDoc.put(FieldNames.SPEED_WITH_BEARING_BEFORE_SPEED.name(), maneuverLoss.getSpeedWithBearingBefore().getKnots()); |
|
| 2079 | - maneuverLossDoc.put(FieldNames.DEGREE_BEARING.name(), maneuverLoss.getMiddleManeuverAngle().getDegrees()); |
|
| 2080 | - maneuverLossDoc.put(FieldNames.DURATION.name(), maneuverLoss.getManeuverDuration().asMillis()); |
|
| 2071 | + maneuverLossDoc.put(FieldNames.MANEUVER_DISTANCE_SAILED_POMA.name(), maneuverLoss.getDistanceSailedIfNotManeuveringProjectedOnMiddleManeuverAngle().getMeters()); |
|
| 2072 | + maneuverLossDoc.put(FieldNames.MANEUVER_DISTANCE_SAILED_INMPOMA.name(), maneuverLoss.getDistanceSailedIfNotManeuveringProjectedOnMiddleManeuverAngle().getMeters()); |
|
| 2073 | + maneuverLossDoc.put(FieldNames.MANEUVER_START_POSITION_LAT_RAD.name(), maneuverLoss.getManeuverStartPosition().getLatRad()); |
|
| 2074 | + maneuverLossDoc.put(FieldNames.MANEUVER_START_POSITION_LNG_RAD.name(), maneuverLoss.getManeuverStartPosition().getLngRad()); |
|
| 2075 | + maneuverLossDoc.put(FieldNames.MANEUVER_END_POSITION_LAT_RAD.name(), maneuverLoss.getManeuverStartPosition().getLngRad()); |
|
| 2076 | + maneuverLossDoc.put(FieldNames.MANEUVER_END_POSITION_LNG_RAD.name(), maneuverLoss.getManeuverStartPosition().getLngRad()); |
|
| 2077 | + maneuverLossDoc.put(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_DEGREES.name(), maneuverLoss.getSpeedWithBearingBefore().getBearing().getDegrees()); |
|
| 2078 | + maneuverLossDoc.put(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_SPEED.name(), maneuverLoss.getSpeedWithBearingBefore().getKnots()); |
|
| 2079 | + maneuverLossDoc.put(FieldNames.MIDDLE_MAEUVER_ANGLE.name(), maneuverLoss.getMiddleManeuverAngle().getDegrees()); |
|
| 2080 | + maneuverLossDoc.put(FieldNames.MANEUVER_LOSS_DURATION.name(), maneuverLoss.getManeuverDuration().asMillis()); |
|
| 2081 | 2081 | return maneuverLossDoc; |
| 2082 | 2082 | } |
| 2083 | 2083 | |
| 2084 | 2084 | private Document storeMainCurveBoundaries(ManeuverCurveBoundaries f, Document d) { |
| 2085 | - d.put(FieldNames.TIMEPOINT_BEFORE.name(), f.getTimePointBefore().asMillis()); |
|
| 2086 | - d.put(FieldNames.TIMEPOINT_AFTER.name(), f.getTimePointAfter().asMillis()); |
|
| 2087 | - d.put(FieldNames.SPEED_WITH_BEARING_BEFORE_DEGREES.name(), f.getSpeedWithBearingBefore().getBearing().getDegrees()); |
|
| 2088 | - d.put(FieldNames.SPEED_WITH_BEARING_BEFORE_SPEED.name(), f.getSpeedWithBearingBefore().getKnots()); |
|
| 2089 | - d.put(FieldNames.SPEED_WITH_BEARING_AFTER_DEGREES.name(), f.getSpeedWithBearingAfter().getBearing().getDegrees()); |
|
| 2090 | - d.put(FieldNames.SPEED_WITH_BEARING_AFTER_SPEED.name(), f.getSpeedWithBearingAfter().getKnots()); |
|
| 2091 | - d.put(FieldNames.DIRECTION_CHANGE_IN_DEGREES.name(), f.getDirectionChangeInDegrees()); |
|
| 2092 | - d.put(FieldNames.LOWEST_SPEED.name(), f.getLowestSpeed().getKnots()); |
|
| 2093 | - d.put(FieldNames.HIGHEST_SPEED.name(), f.getHighestSpeed().getKnots()); |
|
| 2085 | + d.put(FieldNames.MANEUVER_TIMEPOINT_BEFORE.name(), f.getTimePointBefore().asMillis()); |
|
| 2086 | + d.put(FieldNames.MANEUVER_TIMEPOINT_AFTER.name(), f.getTimePointAfter().asMillis()); |
|
| 2087 | + d.put(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_DEGREES.name(), f.getSpeedWithBearingBefore().getBearing().getDegrees()); |
|
| 2088 | + d.put(FieldNames.MANEUVER_SPEED_WITH_BEARING_BEFORE_SPEED.name(), f.getSpeedWithBearingBefore().getKnots()); |
|
| 2089 | + d.put(FieldNames.MANEUVER_SPEED_WITH_BEARING_AFTER_DEGREES.name(), f.getSpeedWithBearingAfter().getBearing().getDegrees()); |
|
| 2090 | + d.put(FieldNames.MANEUVER_SPEED_WITH_BEARING_AFTER_SPEED.name(), f.getSpeedWithBearingAfter().getKnots()); |
|
| 2091 | + d.put(FieldNames.MANEUVER_DIRECTION_CHANGE_IN_DEGREES.name(), f.getDirectionChangeInDegrees()); |
|
| 2092 | + d.put(FieldNames.MANEUVER_LOWEST_SPEED.name(), f.getLowestSpeed().getKnots()); |
|
| 2093 | + d.put(FieldNames.MANEUVER_HIGHEST_SPEED.name(), f.getHighestSpeed().getKnots()); |
|
| 2094 | 2094 | return d; |
| 2095 | 2095 | } |
| 2096 | 2096 |
java/com.sap.sailing.mongodb.test/src/com/sap/sailing/mongodb/test/ManeuverRaceFingerprintConversionTest.java
| ... | ... | @@ -67,7 +67,6 @@ public class ManeuverRaceFingerprintConversionTest extends OnlineTracTracBasedTe |
| 67 | 67 | final MongoClient myFirstMongo = newMongo(); |
| 68 | 68 | final MongoDatabase firstDatabase = myFirstMongo.getDatabase(dbConfiguration.getDatabaseName()); |
| 69 | 69 | final RaceIdentifier raceIdentifier = trackedRace1.getRaceIdentifier(); |
| 70 | - //List<Competitor> competetors = trackedRace1.getCompetitor(null); |
|
| 71 | 70 | final Map<Competitor, List<Maneuver>> maneuvers = new HashMap<>(); |
| 72 | 71 | for (final Competitor competitor : getRace().getCompetitors()) { |
| 73 | 72 | final List<Maneuver> maneuversForCompetitor = (List<Maneuver>) trackedRace1.getManeuvers(competitor, true); |