mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
Merge branch 'master' into racecommittee_integrated
This commit is contained in:
commit
05651baffb
30 files changed
+4325
-3352
No files matched your search
+17
-11
@@ -251,12 +251,16 @@ public class MatchAndApplyScoreCorrectionsDialog extends DataEntryDialog<BulkSco
|
||||
if (officialSailID != null && raceNameOrNumber != null) {
|
||||
ScoreCorrectionEntryDTO officialCorrectionEntry = regattaScoreCorrection
|
||||
.getScoreCorrectionsByRaceNameOrNumber().get(raceNameOrNumber).get(officialSailID);
|
||||
result.addMaxPointsReasonUpdate(competitor, raceColumn,
|
||||
officialCorrectionEntry.getMaxPointsReason());
|
||||
if (officialCorrectionEntry.getScore() != null) {
|
||||
double officialTotalPoints = officialCorrectionEntry.getScore().doubleValue();
|
||||
double officialNetPoints = officialTotalPoints / raceColumn.getEffectiveFactor();
|
||||
result.addScoreUpdate(competitor, raceColumn, officialNetPoints);
|
||||
// the competitor may not have an official result for this race, for example, if in case of split fleets
|
||||
// the competitor raced in a different fleet
|
||||
if (officialCorrectionEntry != null) {
|
||||
result.addMaxPointsReasonUpdate(competitor, raceColumn,
|
||||
officialCorrectionEntry.getMaxPointsReason());
|
||||
if (officialCorrectionEntry.getScore() != null) {
|
||||
double officialTotalPoints = officialCorrectionEntry.getScore().doubleValue();
|
||||
double officialNetPoints = officialTotalPoints / raceColumn.getEffectiveFactor();
|
||||
result.addScoreUpdate(competitor, raceColumn, officialNetPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,22 +320,24 @@ public class MatchAndApplyScoreCorrectionsDialog extends DataEntryDialog<BulkSco
|
||||
final MaxPointsReason officialMaxPointsReason = officialCorrectionEntry == null ? null :
|
||||
officialCorrectionEntry.getMaxPointsReason();
|
||||
SafeHtmlBuilder sb = new SafeHtmlBuilder();
|
||||
boolean entriesDiffer =
|
||||
((officialNetPoints == null && entry.netPoints != null) || (officialNetPoints != null && (entry.netPoints == null || !new Double(entry.netPoints).equals(officialNetPoints)))) ||
|
||||
// entries not considered "different' in case we haven't got an entry for the competitor/race at all;
|
||||
// those non-existing "entries" will be ignored by getResults anyhow
|
||||
boolean entriesDiffer = officialCorrectionEntry != null &&
|
||||
(((officialNetPoints == null && entry.netPoints != null) || (officialNetPoints != null && (entry.netPoints == null || !new Double(entry.netPoints).equals(officialNetPoints)))) ||
|
||||
((officialTotalPoints == null && entry.totalPoints != null) || (officialTotalPoints != null && (entry.totalPoints == null || !new Double(entry.totalPoints).equals(officialTotalPoints)))) ||
|
||||
((officialMaxPointsReason == null && entry.reasonForMaxPoints != MaxPointsReason.NONE) ||
|
||||
officialMaxPointsReason != null && officialMaxPointsReason != entry.reasonForMaxPoints);
|
||||
officialMaxPointsReason != null && officialMaxPointsReason != entry.reasonForMaxPoints));
|
||||
if (entriesDiffer) {
|
||||
sb.appendHtmlConstant("<span style=\"color: #0000FF;\"><b>");
|
||||
}
|
||||
if (officialNetPoints == null) {
|
||||
sb.append(0);
|
||||
sb.appendEscaped("null");
|
||||
} else {
|
||||
sb.append(officialNetPoints);
|
||||
}
|
||||
sb.appendEscaped("/");
|
||||
if (officialTotalPoints == null) {
|
||||
sb.append(0);
|
||||
sb.appendEscaped("null");
|
||||
} else {
|
||||
sb.append(officialTotalPoints);
|
||||
}
|
||||
|
||||
+1
-1
@@ -527,7 +527,7 @@ public class WindChart extends RaceChart implements Component<WindChartSettings>
|
||||
if (timeOfEarliestRequestInMillis == null || date.getTime() < timeOfEarliestRequestInMillis) {
|
||||
loadData(timeRangeWithZoomProvider.getFromTime(), date, /* append */ true);
|
||||
} else if (date.getTime() > timeOfLatestRequestInMillis) {
|
||||
loadData(new Date(timeOfLatestRequestInMillis), timeRangeWithZoomProvider.getToTime(), /* append */true);
|
||||
loadData(new Date(timeOfLatestRequestInMillis), date, /* append */true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user