mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 09:11:02 +00:00
Merge branch 'master' into bug2
This commit is contained in:
commit
80637e2623
6 files changed
+61
-8
No files matched your search
+2
@@ -110,4 +110,6 @@ public interface SharedDomainFactory extends CompetitorFactory {
|
||||
ControlPointWithTwoMarks getOrCreateControlPointWithTwoMarks(String id, String name, Mark left, Mark right);
|
||||
|
||||
RaceLogResolver getRaceLogResolver();
|
||||
|
||||
Mark getOrCreateMark(String name, MarkType markType);
|
||||
}
|
||||
+10
-1
@@ -154,9 +154,18 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
|
||||
return getOrCreateMark(name, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mark getOrCreateMark(String name, MarkType markType) {
|
||||
return getOrCreateMark(name, name, markType);
|
||||
}
|
||||
|
||||
private Mark getOrCreateMark(Serializable id, String name, MarkType markType) {
|
||||
return getOrCreateMark(id, name, markType, /* color */ null, /* shape */ null, /* pattern */ null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mark getOrCreateMark(Serializable id, String name) {
|
||||
return getOrCreateMark(id, name, null, null, null, null);
|
||||
return getOrCreateMark(id, name, /* type */ null, /* color */ null, /* shape */ null, /* pattern */ null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@ import com.sap.sailing.domain.base.Nationality;
|
||||
import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStore;
|
||||
import com.sap.sailing.domain.regattalog.RegattaLogStore;
|
||||
@@ -67,7 +68,7 @@ public interface DomainFactory {
|
||||
long delayToLiveInMillis, SwissTimingFactory swissTimingFactory, DomainFactory domainFactory,
|
||||
RaceLogStore raceLogStore, RegattaLogStore regattaLogStore, boolean useInternalMarkPassingAlgorithm);
|
||||
|
||||
ControlPoint getOrCreateControlPoint(Iterable<String> devices);
|
||||
ControlPoint getOrCreateControlPoint(Iterable<String> devices, MarkType markType);
|
||||
|
||||
RaceDefinition createRaceDefinition(Regatta regatta, String raceID, Iterable<Competitor> competitors,
|
||||
List<ControlPoint> courseDefinition);
|
||||
|
||||
+22
-4
@@ -28,6 +28,7 @@ import com.sap.sailing.domain.base.impl.PersonImpl;
|
||||
import com.sap.sailing.domain.base.impl.RaceDefinitionImpl;
|
||||
import com.sap.sailing.domain.base.impl.RegattaImpl;
|
||||
import com.sap.sailing.domain.base.impl.TeamImpl;
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
@@ -264,7 +265,7 @@ public class DomainFactoryImpl implements DomainFactory {
|
||||
private com.sap.sailing.domain.base.Course createCourse(String courseName, Course course) {
|
||||
List<Waypoint> waypoints = new ArrayList<Waypoint>();
|
||||
for (Mark mark : course.getMarks()) {
|
||||
ControlPoint controlPoint = getOrCreateControlPoint(mark.getDevices());
|
||||
ControlPoint controlPoint = getOrCreateControlPoint(mark.getDevices(), getMarkType(mark.getMarkType()));
|
||||
Waypoint waypoint = baseDomainFactory.createWaypoint(controlPoint, /* passingInstruction */ PassingInstruction.None);
|
||||
waypoints.add(waypoint);
|
||||
}
|
||||
@@ -272,15 +273,28 @@ public class DomainFactoryImpl implements DomainFactory {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a mark type as defined by SwissTiming into a {@link MarkType} as defined by the domain model
|
||||
*/
|
||||
private MarkType getMarkType(com.sap.sailing.domain.swisstimingadapter.Mark.MarkType markType) {
|
||||
final MarkType result;
|
||||
if (markType == null) {
|
||||
result = null;
|
||||
} else {
|
||||
result = MarkType.BUOY;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControlPoint getOrCreateControlPoint(Iterable<String> devices) {
|
||||
public ControlPoint getOrCreateControlPoint(Iterable<String> devices, MarkType markType) {
|
||||
ControlPoint result;
|
||||
synchronized (controlPointCache) {
|
||||
result = controlPointCache.get(devices);
|
||||
if (result == null) {
|
||||
switch (Util.size(devices)) {
|
||||
case 1:
|
||||
result = getOrCreateMark(devices.iterator().next());
|
||||
result = getOrCreateMark(devices.iterator().next(), markType);
|
||||
break;
|
||||
case 2:
|
||||
Iterator<String> markNameIter = devices.iterator();
|
||||
@@ -299,6 +313,10 @@ public class DomainFactoryImpl implements DomainFactory {
|
||||
return result;
|
||||
}
|
||||
|
||||
private ControlPoint getOrCreateMark(String name, MarkType markType) {
|
||||
return baseDomainFactory.getOrCreateMark(name, markType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param trackerID
|
||||
* the "device name" and the "sail number" in case of an {@link MessageType#RPD RPD} message, used as the mark's
|
||||
@@ -321,7 +339,7 @@ public class DomainFactoryImpl implements DomainFactory {
|
||||
List<com.sap.sse.common.Util.Pair<com.sap.sailing.domain.base.ControlPoint, PassingInstruction>> newDomainControlPoints = new ArrayList<com.sap.sse.common.Util.Pair<com.sap.sailing.domain.base.ControlPoint, PassingInstruction>>();
|
||||
for (Mark mark : marks) {
|
||||
// TODO bug 1043: propagate the mark names to the waypoint names
|
||||
com.sap.sailing.domain.base.ControlPoint domainControlPoint = getOrCreateControlPoint(mark.getDevices());
|
||||
com.sap.sailing.domain.base.ControlPoint domainControlPoint = getOrCreateControlPoint(mark.getDevices(), getMarkType(mark.getMarkType()));
|
||||
newDomainControlPoints.add(new com.sap.sse.common.Util.Pair<>(domainControlPoint, PassingInstruction.None));
|
||||
}
|
||||
courseToUpdate.update(newDomainControlPoints, baseDomainFactory);
|
||||
|
||||
+24
-1
@@ -294,7 +294,7 @@ public class SwissTimingReplayToDomainAdapter extends SwissTimingReplayAdapter i
|
||||
if (id2 != null && !id2.trim().isEmpty()) {
|
||||
markNames.add(id2.trim());
|
||||
}
|
||||
final ControlPoint controlPoint = domainFactory.getOrCreateControlPoint(markNames);
|
||||
final ControlPoint controlPoint = domainFactory.getOrCreateControlPoint(markNames, getMarkType(markType));
|
||||
if (index == 0) {
|
||||
currentCourseDefinition = new ArrayList<>();
|
||||
}
|
||||
@@ -311,6 +311,29 @@ public class SwissTimingReplayToDomainAdapter extends SwissTimingReplayAdapter i
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a domain {@link com.sap.sailing.domain.common.MarkType} from a SwissTiming replay {@link MarkType mark type}.
|
||||
*/
|
||||
private com.sap.sailing.domain.common.MarkType getMarkType(MarkType markType) {
|
||||
final com.sap.sailing.domain.common.MarkType result;
|
||||
if (markType == null) {
|
||||
result = null;
|
||||
} else {
|
||||
if (markType.isBoat()) {
|
||||
if (markType.isStart()) {
|
||||
result = com.sap.sailing.domain.common.MarkType.STARTBOAT;
|
||||
} else if (markType.isFinish()) {
|
||||
result = com.sap.sailing.domain.common.MarkType.FINISHBOAT;
|
||||
} else {
|
||||
result = com.sap.sailing.domain.common.MarkType.BUOY;
|
||||
}
|
||||
} else {
|
||||
result = com.sap.sailing.domain.common.MarkType.BUOY;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trackersCount(short trackersCount) {
|
||||
RaceDefinition race = racePerRaceID.get(currentRaceID);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console -clean"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dfile.encoding=cp1252 -Dexpedition.udp.port=2010 -Xmx6000m -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -Dkiwo.results=${project_loc:com.sap.sailing.kiworesultimport.test}/resources -Dpersistentcompetitors.clear=false -XX:+UseMembar -Digtimi.client.id=7fcdd217e0aa16090edb4ad55b09ec43b2021090e209541fc9b7003c2a2b70c6 -Digtimi.client.secret=aa569cf4909bdc7b0e04b11873f3c4ea20687421e010fcc25b771cca9e6f3f9a -Digtimi.client.redirecturi=http://127.0.0.1:8888/igtimi/oauth/v1/authorizationcallback -Dpolardata.source.url=https://www.sapsailing.com"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dfile.encoding=cp1252 -Dexpedition.udp.port=2010 -Xmx6000m -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -Dkiwo.results=${project_loc:com.sap.sailing.kiworesultimport.test}/resources -Dpersistentcompetitors.clear=false -XX:+UseMembar -Digtimi.client.id=7fcdd217e0aa16090edb4ad55b09ec43b2021090e209541fc9b7003c2a2b70c6 -Digtimi.client.secret=aa569cf4909bdc7b0e04b11873f3c4ea20687421e010fcc25b771cca9e6f3f9a -Digtimi.client.redirecturi=http://127.0.0.1:8888/igtimi/oauth/v1/authorizationcallback -Dpolardata.source.url=https://dev.sapsailing.com"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
|
||||
<stringAttribute key="pde.version" value="3.3"/>
|
||||
<stringAttribute key="profilingTraceType-ALLOCATION_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%INCREASE_COUNT%CTX_KEY%8192%CTX_ENTRY%KEY_MIN_SIZE%CTX_KEY%32%CTX_ENTRY%KEY_MAX_SIZE%CTX_KEY%65536%CTX_ENTRY%KEY_INC_LINE_NRS%CTX_KEY%true%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%CLASS_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_TENANT_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ADAPTIVE%CTX_KEY%false%CTX_ENTRY%"/>
|
||||
|
||||
Reference in new issue
Block a user