Merge branch 'master' into api_changes

This commit is contained in:
Leon Radeck committed 2017-08-19 04:04:50 +02:00
commit b1ae3d8158
24 files changed
+109 -41

No files matched your search

@@ -19,6 +19,7 @@ public enum BoatClassMasterdata {
_470 ("470", true, 4.70, 1.68, BoatHullType.MONOHULL, true, "470er", "470M", "470W", "470 - M", "470 - W"),
_5O5 ("5O5", true, 5.03, 1.88, BoatHullType.MONOHULL, true, "505", "5o5", "505er", "5o5er"),
_5_5MR ("5.5mR", true, 9.50, 1.92, BoatHullType.MONOHULL, true, "5.5 Meter", "5.5 Metre", "5.5", "5.5M", "5.5-metre", "5.5 metre"),
_6MR ("6mR", true, 11, 2.2, BoatHullType.MONOHULL, true, "6 Meter", "6 Metre", "6", "6M", "6-metre", "6 metre"),
_8MR ("8mR", true, 9.62, 2.45, BoatHullType.MONOHULL, true, "8 Meter", "8 Metre", "8M", "8-metre"),
A_CAT ("A-Catamaran", true, 5.49, 2.30, BoatHullType.CATAMARAN, false, "A-Cat", "ACat", "A-Class Catamaran"),
ALBIN_EXPRESS ("Albin Express", true, 7.77, 2.50, BoatHullType.MONOHULL, false),
@@ -71,10 +71,18 @@ public class RaceStartedAndFinishedReceiver extends AbstractReceiverWithQueue<IR
final IRace race = event.getA();
// An uninitialized race means that all timing data is not valid; we replace start of tracking,
// end of tracking and start time received by null values.
IStartStopData startEndRaceTimesData = event.getC();
if (startEndRaceTimesData != null) {
final long startTime = startEndRaceTimesData.getStartTime();
TimePoint startOfRace = startTime == 0 ? null : getSimulator() == null ? new MillisecondsTimePoint(
startTime) : getSimulator().advance(new MillisecondsTimePoint(startTime));
trackedRace.setStartTimeReceived(startOfRace);
// Note that end of race can't currently be set on a tracked race
logger.info("Received race start time update for race "+race.getName()+": "+startTime);
}
if (!race.isInitialized()) {
trackedRace.setStartOfTrackingReceived(null);
trackedRace.setEndOfTrackingReceived(null);
trackedRace.setStartTimeReceived(null);
logger.info("Received isInitialized()==false for race "+race.getName());
} else {
IStartStopData startEndTrackingTimesData = event.getB();
@@ -91,15 +99,6 @@ public class RaceStartedAndFinishedReceiver extends AbstractReceiverWithQueue<IR
trackedRace.setEndOfTrackingReceived(endOfTracking);
logger.info("Received tracking times update for race "+race.getName()+": "+startOfTracking+".."+endOfTracking);
}
IStartStopData startEndRaceTimesData = event.getC();
if (startEndRaceTimesData != null) {
final long startTime = startEndRaceTimesData.getStartTime();
TimePoint startOfRace = startTime == 0 ? null : getSimulator() == null ? new MillisecondsTimePoint(
startTime) : getSimulator().advance(new MillisecondsTimePoint(startTime));
trackedRace.setStartTimeReceived(startOfRace);
// Note that end of race can't currently be set on a tracked race
logger.info("Received race start time update for race "+race.getName()+": "+startTime);
}
}
} else {
logger.warning("Couldn't find tracked race for race " + event.getA().getName()
@@ -34,6 +34,7 @@ public class BoatClassImageResolver {
boatClassIconsMap.put(BoatClassMasterdata._49ER.getDisplayName(), imageResources._49erIcon());
boatClassIconsMap.put(BoatClassMasterdata._5O5.getDisplayName(), imageResources._505mIcon());
boatClassIconsMap.put(BoatClassMasterdata._5_5MR.getDisplayName(), imageResources._5_5MRIcon());
boatClassIconsMap.put(BoatClassMasterdata._6MR.getDisplayName(), imageResources._6MRIcon());
boatClassIconsMap.put(BoatClassMasterdata._8MR.getDisplayName(), imageResources._8MRIcon());
boatClassIconsMap.put(BoatClassMasterdata.A_CAT.getDisplayName(), imageResources.A_CatIcon());
boatClassIconsMap.put(BoatClassMasterdata.ALBIN_EXPRESS.getDisplayName(), imageResources.AlbinExpressIcon());
@@ -40,6 +40,9 @@ public interface BoatClassImageResources extends ClientBundle {
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/5.5mR.png")
ImageResource _5_5MRIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/6MR.png")
ImageResource _6MRIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/8MR.png")
ImageResource _8MRIcon();
@@ -50,6 +50,7 @@
}
.regattaheader_content_details {
overflow: hidden;
min-height: 1.133333333333333em;
}
.regattaheader_content_details_item {
float: left;
@@ -28,7 +28,7 @@ public class DesktopStatisticsBoxView extends Composite implements StatisticsBox
StatisticsBoxResources.INSTANCE.css().ensureInjected();
initWidget(uiBinder.createAndBindUi(this));
titleUi.setInnerText(title);
if(embedded) {
if (embedded) {
addStyleName(StatisticsBoxResources.INSTANCE.css().box_embedded());
}
setVisible(false);
@@ -14,6 +14,9 @@
therefore, e.g., be used to "predict" the best course on the first upwind leg based on
the latest wind measurements.
</li>
<li>In several places you can now find statistics regarding the highest speed and the competitor that produced it (fastest competitor).
These statistics are available for events and regattas as well as in the yearly statistics.
</li>
</ul>
<h5 class="articleSubheadline">July 2017</h5>
@@ -615,7 +615,7 @@ public class RaceContext {
* {@link RaceViewState#RUNNING}, false otherwise
*/
public boolean isLive() {
return getLiveRaceViewState() == RaceViewState.RUNNING;
return getLiveRaceViewState() == RaceViewState.RUNNING || getLiveRaceViewState() == RaceViewState.FINISHING;
}
public Collection<SimpleCompetitorDTO> getCompetitors() {
@@ -5865,18 +5865,23 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
@Override
public List<TrackFileImportDeviceIdentifierDTO> getTrackFileImportDeviceIds(List<String> uuids)
throws NoCorrespondingServiceRegisteredException, TransformationException {
List<TrackFileImportDeviceIdentifierDTO> result = new ArrayList<>();
for (String uuidAsString : uuids) {
UUID uuid = UUID.fromString(uuidAsString);
TrackFileImportDeviceIdentifier device = TrackFileImportDeviceIdentifierImpl.getOrCreate(uuid);
long numFixes = getService().getSensorFixStore().getNumberOfFixes(device);
TimeRange timeRange = getService().getSensorFixStore().getTimeRangeCoveredByFixes(device);
Date from = timeRange == null ? null : timeRange.from().asDate();
Date to = timeRange == null ? null : timeRange.to().asDate();
result.add(new TrackFileImportDeviceIdentifierDTO(uuidAsString, device.getFileName(), device.getTrackName(),
numFixes, from, to));
try {
final List<TrackFileImportDeviceIdentifierDTO> result = new ArrayList<>();
for (String uuidAsString : uuids) {
UUID uuid = UUID.fromString(uuidAsString);
TrackFileImportDeviceIdentifier device = TrackFileImportDeviceIdentifierImpl.getOrCreate(uuid);
long numFixes = getService().getSensorFixStore().getNumberOfFixes(device);
TimeRange timeRange = getService().getSensorFixStore().getTimeRangeCoveredByFixes(device);
Date from = timeRange == null ? null : timeRange.from().asDate();
Date to = timeRange == null ? null : timeRange.to().asDate();
result.add(new TrackFileImportDeviceIdentifierDTO(uuidAsString, device.getFileName(), device.getTrackName(),
numFixes, from, to));
}
return result;
} catch (Exception e) {
logger.log(Level.SEVERE, "Exception trying to obtain track file import device IDs", e);
throw e;
}
return result;
}
@Override
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.
Binary file not shown.
@@ -1,5 +1,6 @@
package com.sap.sailing.nmeaconnector.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.FileInputStream;
@@ -48,4 +49,28 @@ public class NmeaFromZipImportTest {
}
}
}
@Test
public void testYetAnotherZipFile() throws IOException, InterruptedException {
zipInputStream = new ZipInputStream(new FileInputStream("resources/NMEA.zip"));
ZipEntry entry;
while ((entry=zipInputStream.getNextEntry()) != null) {
if (entry.getName().toLowerCase().endsWith(".txt")) {
Iterable<Wind> windFixes = NmeaFactory.INSTANCE.readWind(zipInputStream);
assertEquals(740, Util.size(windFixes));
}
}
}
@Test
public void testZipFileExcerptWithOnlyEmptyWindRecords() throws IOException, InterruptedException {
zipInputStream = new ZipInputStream(new FileInputStream("resources/NMEA_Snippet.zip"));
ZipEntry entry;
while ((entry=zipInputStream.getNextEntry()) != null) {
if (entry.getName().toLowerCase().endsWith(".txt")) {
Iterable<Wind> windFixes = NmeaFactory.INSTANCE.readWind(zipInputStream);
assertTrue(Util.isEmpty(windFixes));
}
}
}
}
@@ -25,7 +25,6 @@ public abstract class AbstractEnrichingProcessor<InputType, ResultType> extends
@Override
protected ProcessorInstruction<ResultType> createInstruction(final InputType element) {
return new AbstractProcessorInstruction<ResultType>(this) {
@Override
public ResultType computeResult() {
return enrich(element);
@@ -193,7 +193,6 @@ public class PolarDataMiner {
preFilteringProcessor = new ParallelFilteringProcessor<GPSFixMovingWithOriginInfo>(
GPSFixMovingWithOriginInfo.class, executor, preFilterResultReceivers,
new FilterCriterion<GPSFixMovingWithOriginInfo>() {
@Override
public boolean matches(GPSFixMovingWithOriginInfo element) {
boolean result = false;
@@ -434,7 +433,7 @@ public class PolarDataMiner {
}
public void raceFinishedTracking(TrackedRace race) {
Set<GPSFixMovingWithOriginInfo> fixes = null;
final Set<GPSFixMovingWithOriginInfo> fixes;
synchronized (fixesForRacesWhichAreStillLoading) {
fixes = fixesForRacesWhichAreStillLoading.remove(race);
}
@@ -1,6 +1,8 @@
package com.sap.sailing.server.gateway.impl.rc;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import javax.servlet.ServletException;
@@ -11,11 +13,13 @@ import org.json.simple.JSONArray;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.base.CourseArea;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.racegroup.RaceGroup;
import com.sap.sailing.domain.common.racelog.RaceLogServletConstants;
import com.sap.sailing.domain.leaderboard.FlexibleLeaderboard;
import com.sap.sailing.domain.leaderboard.Leaderboard;
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
import com.sap.sailing.domain.leaderboard.RegattaLeaderboardWithEliminations;
import com.sap.sailing.server.gateway.AbstractJsonHttpServlet;
import com.sap.sailing.server.gateway.serialization.JsonSerializer;
import com.sap.sailing.server.gateway.serialization.impl.BoatClassJsonSerializer;
@@ -41,7 +45,6 @@ public class RaceGroupJsonExportServlet extends AbstractJsonHttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String courseAreaFilter = request.getParameter(RaceLogServletConstants.PARAM_COURSE_AREA_FILTER);
if (courseAreaFilter == null) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Need to set a course area filter.");
@@ -52,7 +55,6 @@ public class RaceGroupJsonExportServlet extends AbstractJsonHttpServlet {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Course area filter must be valid UUID.");
return;
}
CourseArea filterCourseArea = getService().getCourseArea(courseAreaId);
if (filterCourseArea == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND, "No course area found with given UUID.");
@@ -67,20 +69,26 @@ public class RaceGroupJsonExportServlet extends AbstractJsonHttpServlet {
}
JsonSerializer<RaceGroup> serializer = createSerializer(clientUuid);
JSONArray result = new JSONArray();
RaceGroupFactory raceGroupFactory = new RaceGroupFactory();
final Set<Regatta> regattasForWhichRegattaLeaderboardsWereAdded = new HashSet<>();
for (Leaderboard leaderboard : getService().getLeaderboards().values()) {
if (filterCourseArea.equals(leaderboard.getDefaultCourseArea())) {
RaceGroup raceGroup = null;
if (leaderboard instanceof RegattaLeaderboard) {
raceGroup = raceGroupFactory.convert((RegattaLeaderboard) leaderboard);
if (leaderboard instanceof RegattaLeaderboard && !(leaderboard instanceof RegattaLeaderboardWithEliminations)) {
result.add(serializer.serialize(raceGroupFactory.convert((RegattaLeaderboard) leaderboard)));
regattasForWhichRegattaLeaderboardsWereAdded.add(((RegattaLeaderboard) leaderboard).getRegatta());
} else if (leaderboard instanceof FlexibleLeaderboard) {
raceGroup = raceGroupFactory.convert((FlexibleLeaderboard) leaderboard);
result.add(serializer.serialize(raceGroupFactory.convert((FlexibleLeaderboard) leaderboard)));
}
result.add(serializer.serialize(raceGroup));
}
}
// now add only those RegattaLeaderboardWithEliminations for which the original RegattaLeaderboard hasn't been added
for (Leaderboard leaderboard : getService().getLeaderboards().values()) {
if (leaderboard instanceof RegattaLeaderboardWithEliminations &&
filterCourseArea.equals(leaderboard.getDefaultCourseArea()) &&
!regattasForWhichRegattaLeaderboardsWereAdded.contains(((RegattaLeaderboardWithEliminations) leaderboard).getRegatta())) {
result.add(serializer.serialize(raceGroupFactory.convert((RegattaLeaderboardWithEliminations) leaderboard)));
}
}
setJsonResponseHeader(response);
result.writeJSONString(response.getWriter());
}
@@ -7,6 +7,8 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -34,7 +36,7 @@ import com.sap.sailing.server.gateway.windimport.AbstractWindImportServlet.WindI
import com.sap.sse.common.Util;
public abstract class AbstractWindImportServlet extends SailingServerHttpServlet {
private static final Logger logger = Logger.getLogger(AbstractWindImportServlet.class.getName());
private static final long serialVersionUID = 1L;
public static class UploadRequest {
@@ -192,6 +194,7 @@ public abstract class AbstractWindImportServlet extends SailingServerHttpServlet
// Use text/html to prevent browsers from wrapping the response body,
// see "Handling File Upload Responses in GWT" at http://www.artofsolving.com/node/50
} catch (Exception e) {
logger.log(Level.SEVERE, "Error ocurred trying to import wind fixes", e);
windImportResult.error = e.toString();
}
response.setContentType("text/html;charset=UTF-8");
@@ -139,8 +139,6 @@ public class MediaMasterDataExportTest {
Fleet defaultFleet = raceColumn.getFleets().iterator().next();
raceColumn.setRaceIdentifier(defaultFleet, regattaAndRaceIdentifier);
}
List<? extends Leaderboard> leaderboards = Arrays.asList(regattaLeaderboard, flexibleLeaderboard);
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("name", "description", "displayName", displayGroupsInReverseOrder , leaderboards);
Set<LeaderboardGroup> groupsToExport = Collections.singleton(leaderboardGroup);
@@ -321,9 +321,10 @@ public class RemoteSailingServerSet {
if (ref != null) {
cachedEventsForRemoteSailingServers.remove(ref);
cachedStatisticsByYearForRemoteSailingServers.remove(ref);
cachedTrackedRacesForRemoteSailingServers.remove(ref);
}
return ref;
}finally{
} finally {
LockUtil.unlockAfterWrite(lock);
}
}
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TracTrac Client module
Bundle-SymbolicName: com.tractrac.clientmodule
Bundle-Version: 3.7.5
Bundle-Version: 3.7.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .,
lib/TracAPI.jar
+22
View File
@@ -16,6 +16,28 @@ It contains also some files:
- test.sh -> script that compiles the code in the src folder, creates the test.jar library and execute the code of the example.
- Manifest.txt -> manifest used to create the test.jar file
********************************************
************* TracAPI 3.7.6 ****************
********************************************
This is a final version.It fixes bugs in the implementation and it adds a some features.
It keeps the backward compatibility.
Release date: 14/08/2017
Build number: 14241
1) Features
- Two new RaceCompetitorStatusType values have been added: 8 (Did not finish) and 9 (Missing data). (Requested by
Chris Terkelsen, 28/07/2017)
2) Bugs
- Releasing the memory when the ISubscriber.close method is called (Reported by Axel Uhl, 04/08/2017)
- The live messages (e.g: race start time updated, live delay updated...) are not arriving sometimes,
despite of the server is sending them all the time. The implementation of this part has been
downgraded to the version used in TracAPI 3.6.x (Reported by SAP)
********************************************
************* TracAPI 3.7.5 ****************
********************************************
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -8,6 +8,6 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>com.tractrac.clientmodule</artifactId>
<version>3.7.5</version>
<version>3.7.6</version>
<packaging>eclipse-plugin</packaging>
</project>