mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 17:49:40 +00:00
added closing event for open ended device mappings
This commit is contained in:
1 parent
33fedad405
commit
a716775c44
25 files changed
+344
-125
No files matched your search
+11
@@ -129,6 +129,7 @@ import com.sap.sailing.domain.racelog.RevokeEvent;
|
||||
import com.sap.sailing.domain.racelog.impl.CompetitorResultsImpl;
|
||||
import com.sap.sailing.domain.racelog.impl.RaceLogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.racelog.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.racelog.tracking.CloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DefineMarkEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DeviceCompetitorMappingEvent;
|
||||
@@ -1182,6 +1183,8 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
return loadRaceLogRegisterCompetitorEvent(createdAt, author, logicalTimePoint, id, passId, competitors, dbObject);
|
||||
} else if (eventClass.equals(DefineMarkEvent.class.getSimpleName())) {
|
||||
return loadRaceLogDefineMarkEvent(createdAt, author, logicalTimePoint, id, passId, competitors, dbObject);
|
||||
} else if (eventClass.equals(CloseOpenEndedDeviceMappingEvent.class.getSimpleName())) {
|
||||
return loadRaceLogCloseOpenEndedDeviceMappingEvent(createdAt, author, logicalTimePoint, id, passId, competitors, dbObject);
|
||||
}
|
||||
|
||||
throw new IllegalStateException(String.format("Unknown RaceLogEvent type %s", eventClass));
|
||||
@@ -1258,6 +1261,14 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
return raceLogEventFactory.createDefineMarkEvent(createdAt, author, logicalTimePoint, id, passId, mark);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogCloseOpenEndedDeviceMappingEvent(TimePoint createdAt, RaceLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
Serializable deviceMappingEventId = Helpers.tryUuidConversion((Serializable) dbObject.get(FieldNames.RACE_LOG_DEVICE_MAPPING_EVENT_ID.name()));
|
||||
TimePoint closingTimePoint = loadTimePoint(dbObject, FieldNames.RACE_LOG_CLOSING_TIMEPOINT);
|
||||
return raceLogEventFactory.createCloseOpenEndedDeviceMappingEvent(createdAt, author, logicalTimePoint, id, passId,
|
||||
deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogRaceLogProtestStartTimeEvent(TimePoint createdAt, RaceLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
TimePoint protestStartTime = loadTimePoint(dbObject, FieldNames.RACE_LOG_PROTEST_START_TIME);
|
||||
|
||||
+2
-1
@@ -76,7 +76,8 @@ public enum FieldNames {
|
||||
WAYPOINT_PASSINGINSTRUCTIONS, CONTROLPOINT, CONTROLPOINT_CLASS, MARK_ID, MARK_COLOR, MARK_NAME, MARK_PATTERN, MARK_SHAPE, MARK_TYPE,
|
||||
CONTROLPOINT_VALUE, CONTROLPOINTWITHTWOMARKS_ID, CONTROLPOINTWITHTWOMARKS_NAME, CONTROLPOINTWITHTWOMARKS_LEFT, CONTROLPOINTWITHTWOMARKS_RIGHT,
|
||||
RACE_LOG_POSITIONED_COMPETITORS, RACE_LOG_PATHFINDER_ID, RACE_LOG_GATE_LINE_OPENING_TIME, RACE_LOG_GOLF_DOWN_TIME, RACE_LOG_START_PROCEDURE_TYPE,
|
||||
RACE_LOG_PROTEST_START_TIME, RACE_LOG_COURSE_DESIGN_NAME, RACE_LOG_REVOKED_EVENT_ID, RACE_LOG_FROM, RACE_LOG_TO, RACE_LOG_MARK,
|
||||
RACE_LOG_PROTEST_START_TIME, RACE_LOG_COURSE_DESIGN_NAME, RACE_LOG_REVOKED_EVENT_ID, RACE_LOG_FROM, RACE_LOG_TO, RACE_LOG_MARK, RACE_LOG_DEVICE_MAPPING_EVENT_ID,
|
||||
RACE_LOG_CLOSING_TIMEPOINT,
|
||||
/** @deprecated Replaced by WAYPOINT_PASSINGINSTRUCTIONS, still used to migrate old races*/ @Deprecated WAYPOINT_PASSINGSIDE,
|
||||
/** @deprecated Replaced by CONTROLPOINTWITHTWOMARKS_ID, still used to migrate old races*/ @Deprecated GATE_ID,
|
||||
/** @deprecated Replaced by CONTROLPOINTWITHTWOMARKS_NAME, still used to migrate old races*/ @Deprecated GATE_NAME,
|
||||
|
||||
+19
@@ -82,6 +82,7 @@ import com.sap.sailing.domain.racelog.RaceLogStartProcedureChangedEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.racelog.RevokeEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.CloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DefineMarkEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DeviceCompetitorMappingEvent;
|
||||
@@ -764,6 +765,14 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
result.put(FieldNames.RACE_LOG_EVENT.name(), storeRaceLogDefineMarkEvent(event));
|
||||
return result;
|
||||
}
|
||||
|
||||
public DBObject storeRaceLogEntry(RaceLogIdentifier raceLogIdentifier, CloseOpenEndedDeviceMappingEvent event) {
|
||||
BasicDBObject result = new BasicDBObject();
|
||||
result.put(FieldNames.RACE_LOG_IDENTIFIER.name(), TripleSerializer.serialize(raceLogIdentifier.getIdentifier()));
|
||||
|
||||
result.put(FieldNames.RACE_LOG_EVENT.name(), storeRaceLogCloseOpenEndedDeviceMappingEvent(event));
|
||||
return result;
|
||||
}
|
||||
|
||||
private Object storeRaceLogWindFix(RaceLogWindFixEvent event) {
|
||||
DBObject result = new BasicDBObject();
|
||||
@@ -883,6 +892,16 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
return result;
|
||||
}
|
||||
|
||||
private Object storeRaceLogCloseOpenEndedDeviceMappingEvent(CloseOpenEndedDeviceMappingEvent event) {
|
||||
DBObject result = new BasicDBObject();
|
||||
storeRaceLogEventProperties(event, result);
|
||||
|
||||
result.put(FieldNames.RACE_LOG_EVENT_CLASS.name(), CloseOpenEndedDeviceMappingEvent.class.getSimpleName());
|
||||
result.put(FieldNames.RACE_LOG_DEVICE_MAPPING_EVENT_ID.name(), event.getDeviceMappingEventId());
|
||||
storeTimePoint(event.getClosingTimePoint(), result, FieldNames.RACE_LOG_CLOSING_TIMEPOINT);
|
||||
return result;
|
||||
}
|
||||
|
||||
public DBObject storeRaceLogFlagEvent(RaceLogFlagEvent flagEvent) {
|
||||
DBObject result = new BasicDBObject();
|
||||
storeRaceLogEventProperties(flagEvent, result);
|
||||
|
||||
+7
@@ -21,6 +21,7 @@ import com.sap.sailing.domain.racelog.RaceLogStartProcedureChangedEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.racelog.RevokeEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.CloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DefineMarkEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.racelog.tracking.DeviceCompetitorMappingEvent;
|
||||
@@ -167,4 +168,10 @@ public class MongoRaceLogStoreVisitor implements RaceLogEventVisitor {
|
||||
DBObject object = mongoObjectFactory.storeRaceLogEntry(raceLogIdentifier, event);
|
||||
storeEventInCollection(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(CloseOpenEndedDeviceMappingEvent event) {
|
||||
DBObject object = mongoObjectFactory.storeRaceLogEntry(raceLogIdentifier, event);
|
||||
storeEventInCollection(object);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user