mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 14:56:41 +00:00
Merge branch 'master' into bug2842
Change-Id: I5a9b52b7c0353502440d240a34cef8135014f095
This commit is contained in:
commit
337b64e64d
8 files changed
+73
-52
No files matched your search
+2
-1
@@ -47,6 +47,7 @@ public enum BoatClassMasterdata {
|
||||
FARR_30 ("Farr 30", true, 9.42, 3.08, BoatHullType.MONOHULL, true, "F30", "F-30", "Farr-30"),
|
||||
FARR_280 ("Farr 280", true, 8.72, 2.87, BoatHullType.MONOHULL, true, "F280", "F-280", "Farr-280"),
|
||||
FINN ("Finn", true, 4.50, 1.51, BoatHullType.MONOHULL, false),
|
||||
FIRST_CLASS_7_5 ("First Class 7.5", true, 7.86, 2.54, BoatHullType.MONOHULL, true, "Beneteau First Class 7.5"),
|
||||
FLYING_DUTCHMAN ("Flying Dutchman", true, 6.10, 1.80, BoatHullType.MONOHULL, true, "FD"),
|
||||
FLYING_JUNIOR ("Flying Junior", true, 4.03, 1.50, BoatHullType.MONOHULL, true, "FJ"),
|
||||
FLYING_PHANTOM ("Flying Phantom", false, 5.52, 3.00, BoatHullType.CATAMARAN, true),
|
||||
@@ -74,7 +75,7 @@ public enum BoatClassMasterdata {
|
||||
LASER_2 ("Laser 2", true, 4.39, 1.42, BoatHullType.MONOHULL, false, "Laser II", "Laser2", "Laser-2", "Laser-II"),
|
||||
LASER_4_7 ("Laser 4.7", true, 4.20, 1.39, BoatHullType.MONOHULL, false, "L4.7"),
|
||||
LASER_RADIAL ("Laser Radial", true, 4.19, 1.41, BoatHullType.MONOHULL, false, "LAR", "Laser RAD", "RAD", "Radial"),
|
||||
LASER_INT ("Laser Int.", true, 4.19, 1.39, BoatHullType.MONOHULL, false, "Laser", "LSR"),
|
||||
LASER_INT ("Laser Int.", true, 4.19, 1.39, BoatHullType.MONOHULL, false, "Laser", "LSR", "Laser Standard"),
|
||||
LASER_SB3 ("Laser SB3", true, 6.15, 2.15, BoatHullType.MONOHULL, false, "LSB3", "SB20"),
|
||||
LAGO_26 ("Lago 26", true, 7.95, 2.50, BoatHullType.MONOHULL, true, "Lago26"),
|
||||
LONGTZE ("Longtze", true, 6.85, 2.57, BoatHullType.MONOHULL, true, "Swiss Longtze Class"),
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ public abstract class AbstractRankingMetric implements RankingMetric {
|
||||
result = null;
|
||||
} else if (result == null) {
|
||||
result = AbstractRankingMetric.this.getCompetitorFarthestAheadInLeg(getTrackedRace().getTrackedLeg(leg), timePoint, cache);
|
||||
competitorFarthestAheadInLeg.put(leg, result);
|
||||
competitorFarthestAheadInLeg.put(leg, result == null ? NULL_COMPETITOR : result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+1
@@ -62,6 +62,7 @@ public class BoatClassImageResolver {
|
||||
boatClassIconsMap.put(BoatClassMasterdata.FARR_30.getDisplayName(), imageResources.Farr30Icon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.FARR_280.getDisplayName(), imageResources.Farr280Icon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.FINN.getDisplayName(), imageResources.FinnIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.FIRST_CLASS_7_5.getDisplayName(), imageResources.FirstClass75Icon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.FLYING_DUTCHMAN.getDisplayName(), imageResources.FlyingDutchmanIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.FLYING_JUNIOR.getDisplayName(), imageResources.FlyingJuniorIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.FLYING_PHANTOM.getDisplayName(), imageResources.FlyingPhantomIcon());
|
||||
|
||||
+5
@@ -144,6 +144,10 @@ public interface BoatClassImageResources extends ClientBundle {
|
||||
@ImageOptions(preventInlining = true)
|
||||
ImageResource Farr280Icon();
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/FirstClass_7_5.png")
|
||||
@ImageOptions(preventInlining = true)
|
||||
ImageResource FirstClass75Icon();
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/FINN.png")
|
||||
@ImageOptions(preventInlining = true)
|
||||
ImageResource FinnIcon();
|
||||
@@ -503,4 +507,5 @@ public interface BoatClassImageResources extends ClientBundle {
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/VARIANTA.png")
|
||||
@ImageOptions(preventInlining = true)
|
||||
ImageResource VariantaIcon();
|
||||
|
||||
}
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class BoatClassVectorGraphicsResolver {
|
||||
BoatClassMasterdata.NACRA_17_FOIL, BoatClassMasterdata.F_16, BoatClassMasterdata.F_18,
|
||||
BoatClassMasterdata.HOBIE_WILD_CAT, BoatClassMasterdata.HOBIE_16, BoatClassMasterdata.HOBIE_TIGER,
|
||||
BoatClassMasterdata.A_CAT, BoatClassMasterdata.TORNADO, BoatClassMasterdata.FLYING_PHANTOM);
|
||||
BoatClassVectorGraphics keelBoatWithGennaker = new KeelBoatWithGennakerVectorGraphics(BoatClassMasterdata.J70,
|
||||
BoatClassVectorGraphics keelBoatWithGennaker = new KeelBoatWithGennakerVectorGraphics(BoatClassMasterdata.FIRST_CLASS_7_5,BoatClassMasterdata.J70,
|
||||
BoatClassMasterdata.B_ONE, BoatClassMasterdata.J80, BoatClassMasterdata.LASER_SB3, BoatClassMasterdata.LONGTZE,
|
||||
BoatClassMasterdata.RS_FEVA, BoatClassMasterdata.RS_TERA, BoatClassMasterdata.RS100, BoatClassMasterdata.TP52,
|
||||
BoatClassMasterdata.CLUB_SWAN_50, BoatClassMasterdata.BAVARIA_CRUISER_41S, BoatClassMasterdata.BAVARIA_CRUISER_45,
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
+51
-49
@@ -141,7 +141,7 @@ public class LeaderboardsResourceV2 extends AbstractLeaderboardsResource {
|
||||
for (CompetitorDTO competitor : filteredCompetitorsFromBestToWorst) {
|
||||
LeaderboardRowDTO row = leaderboardDTO.rows.get(competitor);
|
||||
LeaderboardEntryDTO leaderboardEntry = row.fieldsByRaceColumnName.get(raceColumnName);
|
||||
FleetDTO fleetOfCompetitor = leaderboardEntry.fleet;
|
||||
FleetDTO fleetOfCompetitor = leaderboardEntry==null?null:leaderboardEntry.fleet;
|
||||
if (fleetOfCompetitor != null && fleetOfCompetitor.getName() != null) {
|
||||
Map<CompetitorDTO, Integer> competitorsOfFleet = competitorsOrderedByFleets.get(fleetOfCompetitor.getName());
|
||||
if (competitorsOfFleet == null) {
|
||||
@@ -195,58 +195,60 @@ public class LeaderboardsResourceV2 extends AbstractLeaderboardsResource {
|
||||
JSONObject jsonEntry = new JSONObject();
|
||||
jsonRaceColumns.put(raceColumnName, jsonEntry);
|
||||
LeaderboardEntryDTO leaderboardEntry = leaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
|
||||
BoatDTO entryBoatDTO = leaderboardEntry.boat;
|
||||
if (entryBoatDTO != null) {
|
||||
JSONObject jsonBoat = new JSONObject();
|
||||
writeBoatData(jsonBoat, entryBoatDTO, competitorAndBoatIdsOnly);
|
||||
jsonEntry.put("boat", jsonBoat);
|
||||
}
|
||||
final FleetDTO fleetOfCompetitor = leaderboardEntry.fleet;
|
||||
jsonEntry.put("fleet", fleetOfCompetitor == null ? "" : fleetOfCompetitor.getName());
|
||||
jsonEntry.put("totalPoints", leaderboardEntry.totalPoints);
|
||||
jsonEntry.put("uncorrectedTotalPoints", leaderboardEntry.totalPoints);
|
||||
jsonEntry.put("netPoints", leaderboardEntry.netPoints);
|
||||
MaxPointsReason maxPointsReason = leaderboardEntry.reasonForMaxPoints;
|
||||
jsonEntry.put("maxPointsReason", maxPointsReason != null ? maxPointsReason.toString() : null);
|
||||
jsonEntry.put("isDiscarded", leaderboardEntry.discarded);
|
||||
jsonEntry.put("isCorrected", leaderboardEntry.hasScoreCorrection());
|
||||
// if we have no fleet information there is no way to know in which fleet the competitor was racing
|
||||
Integer rank = null;
|
||||
if (fleetOfCompetitor != null && fleetOfCompetitor.getName() != null) {
|
||||
Map<String, Map<CompetitorDTO, Integer>> rcMap = competitorRanksPerRaceColumnsAndFleets.get(raceColumnName);
|
||||
if (rcMap != null && !rcMap.isEmpty()) {
|
||||
Map<CompetitorDTO, Integer> rankMap = rcMap.get(fleetOfCompetitor.getName());
|
||||
if (rankMap != null && !rankMap.isEmpty()) {
|
||||
rank = rankMap.get(competitor);
|
||||
if (leaderboardEntry != null) {
|
||||
BoatDTO entryBoatDTO = leaderboardEntry.boat;
|
||||
if (entryBoatDTO != null) {
|
||||
JSONObject jsonBoat = new JSONObject();
|
||||
writeBoatData(jsonBoat, entryBoatDTO, competitorAndBoatIdsOnly);
|
||||
jsonEntry.put("boat", jsonBoat);
|
||||
}
|
||||
final FleetDTO fleetOfCompetitor = leaderboardEntry.fleet;
|
||||
jsonEntry.put("fleet", fleetOfCompetitor == null ? "" : fleetOfCompetitor.getName());
|
||||
jsonEntry.put("totalPoints", leaderboardEntry.totalPoints);
|
||||
jsonEntry.put("uncorrectedTotalPoints", leaderboardEntry.totalPoints);
|
||||
jsonEntry.put("netPoints", leaderboardEntry.netPoints);
|
||||
MaxPointsReason maxPointsReason = leaderboardEntry.reasonForMaxPoints;
|
||||
jsonEntry.put("maxPointsReason", maxPointsReason != null ? maxPointsReason.toString() : null);
|
||||
jsonEntry.put("isDiscarded", leaderboardEntry.discarded);
|
||||
jsonEntry.put("isCorrected", leaderboardEntry.hasScoreCorrection());
|
||||
// if we have no fleet information there is no way to know in which fleet the competitor was racing
|
||||
Integer rank = null;
|
||||
if (fleetOfCompetitor != null && fleetOfCompetitor.getName() != null) {
|
||||
Map<String, Map<CompetitorDTO, Integer>> rcMap = competitorRanksPerRaceColumnsAndFleets.get(raceColumnName);
|
||||
if (rcMap != null && !rcMap.isEmpty()) {
|
||||
Map<CompetitorDTO, Integer> rankMap = rcMap.get(fleetOfCompetitor.getName());
|
||||
if (rankMap != null && !rankMap.isEmpty()) {
|
||||
rank = rankMap.get(competitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
jsonEntry.put("rank", rank);
|
||||
LegEntryDTO detailsOfLastAvailableLeg = getDetailsOfLastAvailableLeg(leaderboardEntry);
|
||||
jsonEntry.put("trackedRank", detailsOfLastAvailableLeg != null ? detailsOfLastAvailableLeg.rank : null);
|
||||
boolean finished = false;
|
||||
LegEntryDTO detailsOfLastCourseLeg = getDetailsOfLastCourseLeg(leaderboardEntry);
|
||||
if (detailsOfLastCourseLeg != null) {
|
||||
finished = detailsOfLastCourseLeg.finished;
|
||||
}
|
||||
jsonEntry.put("finished", finished);
|
||||
if (!raceDetailsToShow.isEmpty() && leaderboardEntry.race != null) {
|
||||
LegEntryDTO currentLegEntry = null;
|
||||
int currentLegNumber = leaderboardEntry.getOneBasedCurrentLegNumber();
|
||||
if (leaderboardEntry.legDetails != null && currentLegNumber > 0 && currentLegNumber <= leaderboardEntry.legDetails.size()) {
|
||||
currentLegEntry = leaderboardEntry.legDetails.get(currentLegNumber-1);
|
||||
if (currentLegEntry != null) {
|
||||
jsonEntry.put("trackedRank", currentLegEntry.rank);
|
||||
}
|
||||
jsonEntry.put("rank", rank);
|
||||
LegEntryDTO detailsOfLastAvailableLeg = getDetailsOfLastAvailableLeg(leaderboardEntry);
|
||||
jsonEntry.put("trackedRank", detailsOfLastAvailableLeg != null ? detailsOfLastAvailableLeg.rank : null);
|
||||
boolean finished = false;
|
||||
LegEntryDTO detailsOfLastCourseLeg = getDetailsOfLastCourseLeg(leaderboardEntry);
|
||||
if (detailsOfLastCourseLeg != null) {
|
||||
finished = detailsOfLastCourseLeg.finished;
|
||||
}
|
||||
JSONObject jsonRaceDetails = new JSONObject();
|
||||
jsonEntry.put("data", jsonRaceDetails);
|
||||
for (DetailType type : raceDetailsToShow) {
|
||||
Pair<String, Object> valueForRaceDetailType = getValueForRaceDetailType(type, leaderboardRowDTO, leaderboardEntry, currentLegEntry);
|
||||
if (valueForRaceDetailType != null && valueForRaceDetailType.getA() != null && valueForRaceDetailType.getB() != null) {
|
||||
jsonRaceDetails.put(valueForRaceDetailType.getA(), valueForRaceDetailType.getB());
|
||||
jsonEntry.put("finished", finished);
|
||||
if (!raceDetailsToShow.isEmpty() && leaderboardEntry.race != null) {
|
||||
LegEntryDTO currentLegEntry = null;
|
||||
int currentLegNumber = leaderboardEntry.getOneBasedCurrentLegNumber();
|
||||
if (leaderboardEntry.legDetails != null && currentLegNumber > 0 && currentLegNumber <= leaderboardEntry.legDetails.size()) {
|
||||
currentLegEntry = leaderboardEntry.legDetails.get(currentLegNumber-1);
|
||||
if (currentLegEntry != null) {
|
||||
jsonEntry.put("trackedRank", currentLegEntry.rank);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject jsonRaceDetails = new JSONObject();
|
||||
jsonEntry.put("data", jsonRaceDetails);
|
||||
for (DetailType type : raceDetailsToShow) {
|
||||
Pair<String, Object> valueForRaceDetailType = getValueForRaceDetailType(type, leaderboardRowDTO, leaderboardEntry, currentLegEntry);
|
||||
if (valueForRaceDetailType != null && valueForRaceDetailType.getA() != null && valueForRaceDetailType.getB() != null) {
|
||||
jsonRaceDetails.put(valueForRaceDetailType.getA(), valueForRaceDetailType.getB());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
competitorCounter++;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
Reference in new issue
Block a user