diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/Leaderboard.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/Leaderboard.java index fa5f8732108..bbeae7174cb 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/Leaderboard.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/Leaderboard.java @@ -125,6 +125,9 @@ public interface Leaderboard extends Named { * When computing the ranks after all columns up to and including the race column that is the key of the resulting * map, the method applies the discarding and tie breaking rules as they would have had to be applied had the races * in the respective column just completed. + * + * @return The resulting map is guaranteed to have the same iteration order regarding the race columns + * as {@link #getRaceColumns()}. */ Map> getRankedCompetitorsFromBestToWorstAfterEachRaceColumn(TimePoint timePoint) throws NoWindException; diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java index 5be61680fb4..072f7ed20a3 100755 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java @@ -682,7 +682,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race @Override public Map> getRankedCompetitorsFromBestToWorstAfterEachRaceColumn(TimePoint timePoint) throws NoWindException { - Map> result = new HashMap<>(); + Map> result = new LinkedHashMap<>(); List raceColumnsToConsider = new ArrayList<>(); for (RaceColumn raceColumn : getRaceColumns()) { raceColumnsToConsider.add(raceColumn); diff --git a/java/com.sap.sailing.gwt.ui/SailingGWT Remote Profiling.launch b/java/com.sap.sailing.gwt.ui/SailingGWT Remote Profiling.launch index 0f7980a58d2..3b48a46e865 100755 --- a/java/com.sap.sailing.gwt.ui/SailingGWT Remote Profiling.launch +++ b/java/com.sap.sailing.gwt.ui/SailingGWT Remote Profiling.launch @@ -1,53 +1,53 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.gwt.ui/SailingGWT.launch b/java/com.sap.sailing.gwt.ui/SailingGWT.launch index eede0fe288c..a737234f455 100755 --- a/java/com.sap.sailing.gwt.ui/SailingGWT.launch +++ b/java/com.sap.sailing.gwt.ui/SailingGWT.launch @@ -1,54 +1,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/SailingServiceAsync.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/SailingServiceAsync.java index 5d88a3d0701..89d7d4c52db 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/SailingServiceAsync.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/SailingServiceAsync.java @@ -433,6 +433,15 @@ public interface SailingServiceAsync { void updateRegatta(RegattaIdentifier regattaIdentifier, UUID defaultCourseAreaUuid, RegattaConfigurationDTO regattaConfiguration, AsyncCallback callback); + + /** + * @param detailType + * supports {@link DetailType#REGATTA_RANK}, {@link DetailType#REGATTA_TOTAL_POINTS} and + * {@link DetailType#OVERALL_RANK}. + * + * @return the first triple element is the race column name; then follows the list of competitors, and finally the + * list of values whose indices correspond with the elements in the {@link CompetitorDTO} list. + */ void getLeaderboardDataEntriesForAllRaceColumns(String leaderboardName, Date date, DetailType detailType, AsyncCallback, List>>> callback); diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java index de59a78719c..e4cc2783f3c 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java @@ -2433,33 +2433,14 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S return result; } - private Triple, List> getLeaderboardDataEntriesForRaceColumn(DetailType detailType, - LeaderboardDTO leaderboard, RaceColumnDTO raceColumn) throws NoWindException { + private Triple, List> getTotalPointsForRaceColumn(LeaderboardDTO leaderboard, + RaceColumnDTO raceColumn) throws NoWindException { List values = new ArrayList(); List competitorDTOs = new ArrayList(); - if(detailType != null) { - switch (detailType) { - case REGATTA_TOTAL_POINTS: - for (Entry entry : leaderboard.rows.entrySet()) { - LeaderboardEntryDTO leaderboardEntryDTO = entry.getValue().fieldsByRaceColumnName.get(raceColumn.getName()); - values.add(leaderboardEntryDTO != null ? leaderboardEntryDTO.totalPoints : null); - competitorDTOs.add(entry.getKey()); - } - - break; - case REGATTA_RANK: - case OVERALL_RANK: - List competitorsFromBestToWorst = leaderboard.getCompetitorsFromBestToWorst(raceColumn); - int rank = 1; - for(CompetitorDTO competitor: competitorsFromBestToWorst) { - values.add(new Double(rank)); - competitorDTOs.add(competitor); - rank++; - } - break; - default: - break; - } + for (Entry entry : leaderboard.rows.entrySet()) { + LeaderboardEntryDTO leaderboardEntryDTO = entry.getValue().fieldsByRaceColumnName.get(raceColumn.getName()); + values.add(leaderboardEntryDTO != null ? leaderboardEntryDTO.totalPoints : null); + competitorDTOs.add(entry.getKey()); } return new Triple, List>(raceColumn.getName(), competitorDTOs, values); } @@ -2468,9 +2449,8 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S public List, List>> getLeaderboardDataEntriesForAllRaceColumns(String leaderboardName, Date date, DetailType detailType) throws Exception { List, List>> result = new ArrayList,List>>(); - // Attention: The reason why we read the data from the LeaderboardDTO and not from the leaderboard directly is to ensure - // the use of the leaderboard cache and the reuse of all the logic in the getLeaderboardByName method + // the use of the leaderboard cache. final Leaderboard leaderboard = getService().getLeaderboardByName(leaderboardName); if (leaderboard != null) { TimePoint timePoint; @@ -2479,11 +2459,38 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S } else { timePoint = new MillisecondsTimePoint(date); } - LeaderboardDTO leaderboardDTO = leaderboard.getLeaderboardDTO(timePoint, Collections. emptyList(), - getService(), baseDomainFactory); - for (RaceColumnDTO raceColumnDTO : leaderboardDTO.getRaceList()) { - result.add(getLeaderboardDataEntriesForRaceColumn(detailType, leaderboardDTO, raceColumnDTO)); + if (detailType != null) { + switch (detailType) { + case REGATTA_TOTAL_POINTS: + LeaderboardDTO leaderboardDTO = leaderboard.getLeaderboardDTO(timePoint, Collections. emptyList(), + getService(), baseDomainFactory); + for (RaceColumnDTO raceColumnDTO : leaderboardDTO.getRaceList()) { + result.add(getTotalPointsForRaceColumn(leaderboardDTO, raceColumnDTO)); + } + break; + case REGATTA_RANK: + case OVERALL_RANK: + TimePoint effectiveTimePoint = timePoint == null ? + leaderboard.getNowMinusDelay() : timePoint; + Map> competitorsFromBestToWorst = leaderboard + .getRankedCompetitorsFromBestToWorstAfterEachRaceColumn(effectiveTimePoint); + for (Entry> e : competitorsFromBestToWorst.entrySet()) { + int rank = 1; + List values = new ArrayList(); + List competitorDTOs = new ArrayList(); + for (Competitor competitor : e.getValue()) { + values.add(new Double(rank)); + competitorDTOs.add(baseDomainFactory.convertToCompetitorDTO(competitor)); + rank++; + } + result.add(new Triple, List>(e.getKey().getName(), competitorDTOs, values)); + } + break; + default: + break; + } } + } return result; } diff --git a/java/com.sap.sailing.www/release_notes_analyze.html b/java/com.sap.sailing.www/release_notes_analyze.html index 6df6e250ff2..3cd247d8e85 100644 --- a/java/com.sap.sailing.www/release_notes_analyze.html +++ b/java/com.sap.sailing.www/release_notes_analyze.html @@ -38,11 +38,23 @@

February 2014

    +
  • Fixed an issue with boat rotation on Safari browsers
  • + +
  • Maneuver analysis now counts tacks and jibes based on wind + at boat position and not based on leg type; subsequently, + penalty circle analysis is now based on a tack and a jibe + in close succession instead of a full circle.
  • + +
  • Regatta rank and overall rank in competitor chart of leaderboard panel + has been fixed; it did erroneously display the rank of the particular + race, not the regatta/overall rank after that race.
  • +
  • Regatta overview now also displays all regatta leaderboards
  • Boat colors match tail colors
  • When selecting boats in leaderboard, de-selected boats' tails turn grey
  • +