mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 22:15:26 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2f38d0aaf1
144 files changed
+813
-430
No files matched your search
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Regular → Executable
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Regular → Executable
File mode changed.
+12
-5
@@ -10,6 +10,7 @@ public class PairingListDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 102220422437194196L;
|
||||
private List<List<List<Pair<CompetitorDTO, BoatDTO>>>> pairingList;
|
||||
private List<BoatDTO> boats;
|
||||
private List<String> raceColumnNames;
|
||||
|
||||
public PairingListDTO() { }
|
||||
@@ -28,17 +29,23 @@ public class PairingListDTO implements Serializable {
|
||||
}
|
||||
|
||||
public List<BoatDTO> getBoats() {
|
||||
List<BoatDTO> boats = new ArrayList<>();
|
||||
for (List<Pair<CompetitorDTO, BoatDTO>> fleet : this.pairingList.get(0)) {
|
||||
for (Pair<CompetitorDTO, BoatDTO> competitorAndBoatPair : fleet) {
|
||||
if (!boats.contains(competitorAndBoatPair.getB())) {
|
||||
boats.add(competitorAndBoatPair.getB());
|
||||
if (boats == null) {
|
||||
boats = new ArrayList<>();
|
||||
for (List<Pair<CompetitorDTO, BoatDTO>> fleet : this.pairingList.get(0)) {
|
||||
for (Pair<CompetitorDTO, BoatDTO> competitorAndBoatPair : fleet) {
|
||||
if (!boats.contains(competitorAndBoatPair.getB())) {
|
||||
boats.add(competitorAndBoatPair.getB());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return boats;
|
||||
}
|
||||
|
||||
public void setBoats(final List<BoatDTO> boats) {
|
||||
this.boats = boats;
|
||||
}
|
||||
|
||||
public List<String> getRaceColumnNames() {
|
||||
return raceColumnNames;
|
||||
}
|
||||
|
||||
+43
-10
@@ -10,41 +10,50 @@ public class PairingListTemplateDTO implements Serializable {
|
||||
private int groupCount = 0;
|
||||
private int competitorCount = 0;
|
||||
private int flightMultiplier = 0;
|
||||
private int boatChangeFactor = 0;
|
||||
private int boatChanges;
|
||||
private int[][] pairingListTemplate;
|
||||
private double quality;
|
||||
|
||||
private double boatAssignmentQuality;
|
||||
private Iterable<String> selectedFlightNames;
|
||||
|
||||
public PairingListTemplateDTO() { }
|
||||
|
||||
public PairingListTemplateDTO(int competitorCount, int flightMultiplier) {
|
||||
this(0, 0, competitorCount, flightMultiplier, null, 0.0, /* selected flight names */ null);
|
||||
public PairingListTemplateDTO(int competitorCount, int flightMultiplier, int boatChangeFactor) {
|
||||
this(0, 0, competitorCount, flightMultiplier, boatChangeFactor, 0 , null, 0.0, 0.0, /* selected flight names */ null);
|
||||
}
|
||||
|
||||
public PairingListTemplateDTO(int competitorCount, int flightMultiplier, int[][] pairingListTemplate, double quality) {
|
||||
this(0, 0, competitorCount, flightMultiplier, pairingListTemplate, quality, /* selected flight names */ null);
|
||||
this(/* flight count */ 0, /* group count */ 0, competitorCount, flightMultiplier, /* boat change factor */ 0, /* boat changes */ 0, pairingListTemplate, quality, /* boat assignment quality */ 0.0, /* selected flight names */ null);
|
||||
}
|
||||
|
||||
public PairingListTemplateDTO(int competitorCount, int[][] pairingListTemplate, double quality) {
|
||||
this(0, 0, competitorCount, 0, pairingListTemplate, quality, /* selected flight names */ null);
|
||||
this(/* flight count */ 0, /* group count */ 0, competitorCount, /* flight multiplier */ 1, /* boat change factor */ 0, /* boat changes */ 0, pairingListTemplate, quality, /* boat assignment quality */ 0.0, /* selected flight names */ null);
|
||||
}
|
||||
|
||||
public PairingListTemplateDTO(int flightCount, int groupCount, int competitorCount, int flightMultiplier, int[][] pairingListTemplate, double quality) {
|
||||
this(flightCount, groupCount, competitorCount, flightMultiplier, pairingListTemplate, quality, /* selected flight names */ null);
|
||||
public PairingListTemplateDTO(int flightCount, int groupCount, int competitorCount, int flightMultiplier, int boatChangeFactor, int[][] pairingListTemplate, double quality) {
|
||||
this(flightCount, groupCount, competitorCount, flightMultiplier, boatChangeFactor, /* boat Changes */ 0, pairingListTemplate, quality, /* boat assignment quality */ 0.0, /* selected flight names */ null);
|
||||
}
|
||||
|
||||
public PairingListTemplateDTO(int flightCount, int groupCount, int competitorCount, int flightMultiplier,
|
||||
int[][] pairingListTemplate, double quality, Iterable<String> selectedFlightNames) {
|
||||
public PairingListTemplateDTO(int flightCount, int groupCount, int competitorCount, int flightMultiplier, int boatChangeFactor, int boatChanges, int[][] pairingListTemplate, double quality, double boatAssignmentQuality) {
|
||||
this(flightCount, groupCount, competitorCount, flightMultiplier, boatChangeFactor, boatChanges, pairingListTemplate, quality, boatAssignmentQuality, /* selected flight names */ null);
|
||||
}
|
||||
|
||||
public PairingListTemplateDTO(int flightCount, int groupCount, int competitorCount, int flightMultiplier, int boatChangeFactor,
|
||||
int boatChanges, int[][] pairingListTemplate, double quality, double boatAssigmentQuality, Iterable<String> selectedFlightNames) {
|
||||
this.flightCount = flightCount;
|
||||
this.groupCount = groupCount;
|
||||
this.competitorCount = competitorCount;
|
||||
this.flightMultiplier = flightMultiplier;
|
||||
this.boatChangeFactor = boatChangeFactor;
|
||||
this.boatChanges = boatChanges;
|
||||
this.boatAssignmentQuality = boatAssigmentQuality;
|
||||
this.quality = quality;
|
||||
this.pairingListTemplate = pairingListTemplate;
|
||||
this.selectedFlightNames = selectedFlightNames;
|
||||
}
|
||||
|
||||
public void setFlightCount(int flightCount){
|
||||
public void setFlightCount(int flightCount) {
|
||||
this.flightCount=flightCount;
|
||||
}
|
||||
|
||||
@@ -56,6 +65,10 @@ public class PairingListTemplateDTO implements Serializable {
|
||||
this.flightMultiplier = flightMultiplier;
|
||||
}
|
||||
|
||||
public void setTolerance(int tolerance) {
|
||||
this.boatChangeFactor = tolerance;
|
||||
}
|
||||
|
||||
public void setSelectedFlightNames(Iterable<String> selectedFlightNames) {
|
||||
this.selectedFlightNames = selectedFlightNames;
|
||||
}
|
||||
@@ -68,6 +81,14 @@ public class PairingListTemplateDTO implements Serializable {
|
||||
return this.quality;
|
||||
}
|
||||
|
||||
public double getBoatAssignmentQuality(){
|
||||
return this.boatAssignmentQuality;
|
||||
}
|
||||
|
||||
public int getBoatChanges(){
|
||||
return this.boatChanges;
|
||||
}
|
||||
|
||||
public int getFlightCount() {
|
||||
return this.flightCount;
|
||||
}
|
||||
@@ -84,8 +105,20 @@ public class PairingListTemplateDTO implements Serializable {
|
||||
return flightMultiplier;
|
||||
}
|
||||
|
||||
public int getBoatChangeFactor() {
|
||||
return boatChangeFactor;
|
||||
}
|
||||
|
||||
public Iterable<String> getSelectedFlightNames() {
|
||||
return selectedFlightNames;
|
||||
}
|
||||
|
||||
public void swapColumns(final int indexA, final int indexB) {
|
||||
for(int row = 0; row < this.pairingListTemplate.length; row++) {
|
||||
int tmpField = this.pairingListTemplate[row][indexA];
|
||||
this.pairingListTemplate[row][indexA] = this.pairingListTemplate[row][indexB];
|
||||
this.pairingListTemplate[row][indexB] = tmpField;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Executable → Regular
File mode changed.
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Regular → Executable
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Regular → Executable
File mode changed.
Executable → Regular
File mode changed.
+1
-1
@@ -1069,7 +1069,7 @@ TrackedRaceChangedListener, LeaderboardsDisplayer {
|
||||
BusyDialog busyDialog = new BusyDialog();
|
||||
busyDialog.show();
|
||||
sailingService.calculatePairingListTemplate(editedObject.getFlightCount(), editedObject.getGroupCount(),
|
||||
editedObject.getCompetitorCount(), editedObject.getFlightMultiplier(),
|
||||
editedObject.getCompetitorCount(), editedObject.getFlightMultiplier(), editedObject.getBoatChangeFactor(),
|
||||
new AsyncCallback<PairingListTemplateDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
+101
-42
@@ -1,5 +1,8 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
@@ -17,12 +20,14 @@ import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.dto.BoatDTO;
|
||||
import com.sap.sailing.domain.common.dto.PairingListDTO;
|
||||
import com.sap.sailing.domain.common.dto.PairingListTemplateDTO;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.Notification;
|
||||
import com.sap.sse.gwt.client.Notification.NotificationType;
|
||||
@@ -42,11 +47,13 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
private final Button applyToRacelogButton, printPreViewButton, refreshButton;
|
||||
private final Anchor cSVExportAnchor;
|
||||
private final ErrorReporter errorReporter;
|
||||
private final ScrollPanel pairingListTemplateScrollPanel;
|
||||
private final Grid pairingListGrid;
|
||||
|
||||
public PairingListCreationDialog(StrippedLeaderboardDTO leaderboardDTO, final StringMessages stringMessages,
|
||||
PairingListTemplateDTO template, SailingServiceAsync sailingService, ErrorReporter errorReporter) {
|
||||
super(/* title */ stringMessages.pairingList(), /* message */ null, stringMessages.close(), /* cancel button name */ null,
|
||||
/* validator */ null, /* callback */ null);
|
||||
super(/* title */ stringMessages.pairingList(), /* message */ null, stringMessages.close(),
|
||||
/* cancel button name */ null, /* validator */ null, /* callback */ null);
|
||||
this.errorReporter = errorReporter;
|
||||
this.stringMessages = stringMessages;
|
||||
this.template = template;
|
||||
@@ -58,27 +65,42 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
refreshButton = new Button(stringMessages.recalculate());
|
||||
cSVExportAnchor = new Anchor(stringMessages.csvExport());
|
||||
cSVExportAnchor.ensureDebugId("CSVExportAnchor");
|
||||
cSVExportAnchor.getElement().setAttribute("href",
|
||||
"data:text/plain;charset=utf-8," + getCSVFromPairingListTemplate(getResult().getPairingListTemplate()));
|
||||
cSVExportAnchor.getElement().setAttribute("href", "data:text/plain;charset=utf-8,"
|
||||
+ getCSVFromPairingListTemplate(this.template.getPairingListTemplate()));
|
||||
cSVExportAnchor.getElement().setAttribute("download", "pairingListTemplate.csv");
|
||||
if (template.getCompetitorCount() != leaderboardDTO.competitorsCount) {
|
||||
this.disableApplyToRacelogsAndPrintPreview();
|
||||
}
|
||||
sailingService.getPairingListFromTemplate(this.leaderboardDTO.getName(), this.template.getFlightMultiplier(),
|
||||
this.template.getSelectedFlightNames(), this.template, new AsyncCallback<PairingListDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
PairingListCreationDialog.this.errorReporter.reportError(stringMessages.errorCreatingPairingList(caught.getMessage()), /* silent */ true);
|
||||
pairingListDTO = null;
|
||||
applyToRacelogButton.setEnabled(false);
|
||||
printPreViewButton.setEnabled(false);
|
||||
}
|
||||
pairingListGrid = new Grid(this.template.getPairingListTemplate().length,
|
||||
this.template.getPairingListTemplate()[0].length);
|
||||
pairingListTemplateScrollPanel = new ScrollPanel(pairingListGrid);
|
||||
if (template.getCompetitorCount() == leaderboardDTO.competitorsCount
|
||||
&& template.getCompetitorCount() <= (template.getFlightCount() * template.getGroupCount())) {
|
||||
sailingService.getPairingListFromTemplate(this.leaderboardDTO.getName(),
|
||||
this.template.getFlightMultiplier(), this.template.getSelectedFlightNames(), this.template,
|
||||
new AsyncCallback<PairingListDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
PairingListCreationDialog.this.errorReporter.reportError(
|
||||
stringMessages.errorCreatingPairingList(caught.getMessage()), /* silent */ true);
|
||||
pairingListDTO = null;
|
||||
applyToRacelogButton.setEnabled(false);
|
||||
printPreViewButton.setEnabled(false);
|
||||
initTemplatePanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(PairingListDTO result) {
|
||||
pairingListDTO = result;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onSuccess(PairingListDTO result) {
|
||||
pairingListDTO = result;
|
||||
// Sort boats and template columns
|
||||
final List<BoatDTO> oldBoatPositions = new ArrayList<>(pairingListDTO.getBoats());
|
||||
Collections.sort(pairingListDTO.getBoats(), getBoatsComparator());
|
||||
PairingListCreationDialog.this.swapTemplateColumns(pairingListDTO.getBoats(),
|
||||
oldBoatPositions);
|
||||
initTemplatePanel();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.disableApplyToRacelogsAndPrintPreview();
|
||||
this.initTemplatePanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,10 +108,9 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
HorizontalPanel panel = new HorizontalPanel();
|
||||
|
||||
/* DATA PANEL */
|
||||
|
||||
CaptionPanel dataPanel = new CaptionPanel();
|
||||
dataPanel.setCaptionText(stringMessages.parameters());
|
||||
Grid formGrid = new Grid(6, 2);
|
||||
Grid formGrid = new Grid(8, 2);
|
||||
dataPanel.add(formGrid);
|
||||
Label flights = new Label(String.valueOf(this.template.getFlightCount()));
|
||||
flights.ensureDebugId("FlightCountLabel");
|
||||
@@ -113,15 +134,22 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
qualityHelpImage.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
Window.open("https://wiki.sapsailing.com/wiki/howto/eventmanagers/Pairing-Lists#pairing-list_general_quality", "", "");
|
||||
Window.open(
|
||||
"https://wiki.sapsailing.com/wiki/howto/eventmanagers/Pairing-Lists#pairing-list_general_quality",
|
||||
"", "");
|
||||
}
|
||||
});
|
||||
formGrid.setWidget(4, 0, qualityPanel);
|
||||
formGrid.setWidget(4, 1, new Label(String.valueOf(Math.floor(this.template.getQuality() * 1000) / 1000)));
|
||||
formGrid.setWidget(5, 0, new Label(stringMessages.boatAssignmentQuality()));
|
||||
formGrid.setWidget(5, 1,
|
||||
new Label(String.valueOf(Math.floor(this.template.getBoatAssignmentQuality() * 1000) / 1000)));
|
||||
formGrid.setWidget(6, 0, new Label(stringMessages.boatChanges()));
|
||||
formGrid.setWidget(6, 1, new Label(String.valueOf(template.getBoatChanges())));
|
||||
if (this.template.getFlightMultiplier() > 1) {
|
||||
Label flightMultiplierLabel = new Label(String.valueOf(this.template.getFlightMultiplier()));
|
||||
formGrid.setWidget(5, 0, new Label(stringMessages.amountOfFlightRepeats()));
|
||||
formGrid.setWidget(5, 1, flightMultiplierLabel);
|
||||
formGrid.setWidget(7, 0, new Label(stringMessages.amountOfFlightRepeats()));
|
||||
formGrid.setWidget(7, 1, flightMultiplierLabel);
|
||||
flightMultiplierLabel.ensureDebugId("FlightMultiplierCountLabel");
|
||||
}
|
||||
formGrid.setCellSpacing(10);
|
||||
@@ -133,19 +161,10 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
Grid pairingListGrid = new Grid(this.template.getPairingListTemplate().length,
|
||||
this.template.getPairingListTemplate()[0].length);
|
||||
pairingListGrid.setCellSpacing(5);
|
||||
ScrollPanel scrollPanel = new ScrollPanel(pairingListGrid);
|
||||
scrollPanel.setPixelSize((Window.getClientWidth() / 4), (Window.getClientHeight() / 3));
|
||||
pairingListTemplatePanel.add(scrollPanel);
|
||||
for (int groupIndex = 0; groupIndex < this.template.getPairingListTemplate().length; groupIndex++) {
|
||||
for (int boatIndex = 0; boatIndex < this.template.getPairingListTemplate()[0].length; boatIndex++) {
|
||||
pairingListGrid.setWidget(groupIndex, boatIndex,
|
||||
new Label(String.valueOf(this.template.getPairingListTemplate()[groupIndex][boatIndex] + 1)));
|
||||
pairingListGrid.getCellFormatter().setWidth(groupIndex, boatIndex, "50px");
|
||||
}
|
||||
}
|
||||
pairingListTemplateScrollPanel.setPixelSize((Window.getClientWidth() / 4), (Window.getClientHeight() / 3));
|
||||
pairingListTemplatePanel.add(pairingListTemplateScrollPanel);
|
||||
panel.add(pairingListTemplatePanel);
|
||||
configButtons();
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
@@ -178,12 +197,14 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
new AsyncCallback<Void>() {
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
Notification.notify(stringMessages.successfullyFilledRaceLogsFromPairingList(), NotificationType.SUCCESS);
|
||||
Notification.notify(stringMessages.successfullyFilledRaceLogsFromPairingList(),
|
||||
NotificationType.SUCCESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
errorReporter.reportError(stringMessages.errorFillingRaceLogsFromPairingList(caught.getMessage()));
|
||||
errorReporter.reportError(
|
||||
stringMessages.errorFillingRaceLogsFromPairingList(caught.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -195,11 +216,13 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
Util.asList(template.getSelectedFlightNames()), new AsyncCallback<List<String>>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
errorReporter.reportError(stringMessages.errorFetchingRaceDisplayNamedFromLeaderboard(caught.getMessage()));
|
||||
errorReporter.reportError(stringMessages
|
||||
.errorFetchingRaceDisplayNamedFromLeaderboard(caught.getMessage()));
|
||||
}
|
||||
|
||||
public void onSuccess(List<String> raceDisplayNames) {
|
||||
PairingListPreviewDialog dialog = new PairingListPreviewDialog(pairingListDTO, raceDisplayNames, stringMessages, leaderboardDTO.getName());
|
||||
PairingListPreviewDialog dialog = new PairingListPreviewDialog(pairingListDTO,
|
||||
raceDisplayNames, stringMessages, leaderboardDTO.getName());
|
||||
dialog.show();
|
||||
};
|
||||
});
|
||||
@@ -214,7 +237,7 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
try {
|
||||
sailingService.calculatePairingListTemplate(template.getFlightCount(), template.getGroupCount(),
|
||||
template.getCompetitorCount(), template.getFlightMultiplier(),
|
||||
new AsyncCallback<PairingListTemplateDTO>() {
|
||||
template.getBoatChangeFactor(), new AsyncCallback<PairingListTemplateDTO>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
@@ -254,4 +277,40 @@ public class PairingListCreationDialog extends DataEntryDialog<PairingListTempla
|
||||
printPreViewButton.setEnabled(false);
|
||||
}
|
||||
|
||||
private void initTemplatePanel() {
|
||||
pairingListTemplateScrollPanel.remove(pairingListGrid);
|
||||
for (int groupIndex = 0; groupIndex < this.template.getPairingListTemplate().length; groupIndex++) {
|
||||
for (int boatIndex = 0; boatIndex < this.template.getPairingListTemplate()[0].length; boatIndex++) {
|
||||
pairingListGrid.setWidget(groupIndex, boatIndex,
|
||||
new Label(String.valueOf(this.template.getPairingListTemplate()[groupIndex][boatIndex] + 1)));
|
||||
pairingListGrid.getCellFormatter().setWidth(groupIndex, boatIndex, "50px");
|
||||
}
|
||||
}
|
||||
pairingListTemplateScrollPanel.add(pairingListGrid);
|
||||
}
|
||||
|
||||
private String getBoatDisplayName(BoatDTO boat) {
|
||||
return boat.getName() == null ? boat.getSailId() : boat.getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare boats such that a natural ordering in the pairing list display is achieved. This is based on the natural
|
||||
* comparator principle, using the string that will be displayed for the boats.
|
||||
*/
|
||||
private Comparator<BoatDTO> getBoatsComparator() {
|
||||
final Comparator<String> naturalComparator = new NaturalComparator();
|
||||
return (b1, b2) -> naturalComparator.compare(getBoatDisplayName(b1), getBoatDisplayName(b2));
|
||||
}
|
||||
|
||||
private void swapTemplateColumns(final List<BoatDTO> boats, final List<BoatDTO> oldBoatPositions) {
|
||||
for (BoatDTO boat : boats) {
|
||||
int indexA = oldBoatPositions.indexOf(boat);
|
||||
int indexB = boats.indexOf(boat);
|
||||
if (indexA != indexB) {
|
||||
this.template.swapColumns(indexA, indexB);
|
||||
Collections.swap(oldBoatPositions, indexA, indexB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+34
-13
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||
@@ -10,6 +11,7 @@ import com.google.gwt.user.client.ui.CaptionPanel;
|
||||
import com.google.gwt.user.client.ui.CheckBox;
|
||||
import com.google.gwt.user.client.ui.Grid;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.ListBox;
|
||||
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
@@ -27,6 +29,8 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
private final CheckBox flightMultiplierCheckBox;
|
||||
private Iterable<CheckBox> selectedSeriesCheckboxes;
|
||||
|
||||
private ListBox boatChangeFactorListBox;
|
||||
|
||||
protected static class PairingListParameterValidator extends AbstractPairingListParameterValidator {
|
||||
public PairingListParameterValidator(StringMessages stringMessages) {
|
||||
super(stringMessages);
|
||||
@@ -35,10 +39,8 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
|
||||
public PairingListCreationSetupDialog(StrippedLeaderboardDTO leaderboardDTO, StringMessages stringMessages,
|
||||
DialogCallback<PairingListTemplateDTO> callback) {
|
||||
|
||||
super(leaderboardDTO, stringMessages.pairingList(), stringMessages,
|
||||
new PairingListParameterValidator(stringMessages), callback);
|
||||
|
||||
this.competitorCountTextBox = createIntegerBox(leaderboardDTO.competitorsCount, 2);
|
||||
this.competitorCountTextBox.ensureDebugId("CompetitorCountBox");
|
||||
this.flightMultiplierTextBox = createIntegerBox(1, 2);
|
||||
@@ -48,7 +50,8 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
this.flightMultiplierCheckBox.setTitle(this.stringMessages.multiplierInfo());
|
||||
this.flightMultiplierCheckBox.ensureDebugId("FlightMultiplierCheckBox");
|
||||
this.ensureDebugId("PairingListCreationSetupDialog");
|
||||
|
||||
this.boatChangeFactorListBox = new ListBox();
|
||||
this.boatChangeFactorListBox.setVisibleItemCount(1);
|
||||
this.flightMultiplierCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
||||
@Override
|
||||
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
||||
@@ -90,16 +93,18 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
infoScrollPanel.setPixelSize((Window.getClientWidth() / 3), 150);
|
||||
infoScrollPanel.add(new Label(stringMessages.pairingListCreationInfo()));
|
||||
infoPanel.add(infoScrollPanel);
|
||||
Grid formGrid = new Grid(Util.size(selectedSeriesCheckboxes) + 2, 2);
|
||||
Grid formGrid = new Grid(Util.size(selectedSeriesCheckboxes) + 3, 2);
|
||||
panel.add(formGrid);
|
||||
formGrid.setWidget(0, 0, new Label(stringMessages.setCompetitors()));
|
||||
formGrid.setWidget(0, 1, this.competitorCountTextBox);
|
||||
formGrid.setWidget(1, 0, this.flightMultiplierCheckBox);
|
||||
formGrid.setWidget(1, 1, this.flightMultiplierTextBox);
|
||||
formGrid.setWidget(2, 0, new Label(stringMessages.seriesHint()));
|
||||
formGrid.setWidget(2, 0, new Label(stringMessages.setBoatChangeFactor()));
|
||||
formGrid.setWidget(2, 1, boatChangeFactorListBox);
|
||||
formGrid.setWidget(3, 0, new Label(stringMessages.seriesHint()));
|
||||
int count = 0;
|
||||
for (CheckBox current : selectedSeriesCheckboxes) {
|
||||
formGrid.setWidget(2 + count, 1, current);
|
||||
formGrid.setWidget(3 + count, 1, current);
|
||||
count++;
|
||||
}
|
||||
return panel;
|
||||
@@ -108,7 +113,7 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
@Override
|
||||
protected PairingListTemplateDTO getResult() {
|
||||
PairingListTemplateDTO dto = new PairingListTemplateDTO(this.competitorCountTextBox.getValue(),
|
||||
this.flightMultiplierTextBox.getValue());
|
||||
this.flightMultiplierTextBox.getValue(), this.boatChangeFactorListBox.getSelectedIndex());
|
||||
if (Util.size(this.getCheckedSelectedCheckBoxes()) > 0) {
|
||||
String seriesName = Util.get(this.getCheckedSelectedCheckBoxes(), 0).getText();
|
||||
dto.setGroupCount(
|
||||
@@ -121,13 +126,19 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
} else {
|
||||
dto.setFlightMultiplier(1);
|
||||
}
|
||||
List<String> selectedFlightNames = getSelectedFlightNames();
|
||||
dto.setSelectedFlightNames(selectedFlightNames);
|
||||
dto.setFlightCount(selectedFlightNames.size());
|
||||
dto.setTolerance(Integer.parseInt(boatChangeFactorListBox.getSelectedValue()));
|
||||
return dto;
|
||||
}
|
||||
|
||||
private List<String> getSelectedFlightNames() {
|
||||
List<String> selectedFlightNames = new ArrayList<>();
|
||||
for (CheckBox box : getCheckedSelectedCheckBoxes()) {
|
||||
selectedFlightNames.addAll(getRaceColumnNamesFromSeriesName(box.getText(), leaderboardDTO.getRaceList()));
|
||||
}
|
||||
dto.setSelectedFlightNames(selectedFlightNames);
|
||||
dto.setFlightCount(selectedFlightNames.size());
|
||||
return dto;
|
||||
return selectedFlightNames;
|
||||
}
|
||||
|
||||
public void setDefaultCompetitorCount(final int competitorCount) {
|
||||
@@ -152,15 +163,14 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (Util.size(getCheckedSelectedCheckBoxes()) > 0) {
|
||||
|
||||
} else {
|
||||
if (Util.size(getCheckedSelectedCheckBoxes()) <= 0) {
|
||||
enableOrDisableAllSelectedSeriesCheckBoxes(true, false);
|
||||
}
|
||||
if (Util.size(getCheckedSelectedCheckBoxes()) < 2) {
|
||||
flightMultiplierCheckBox.setEnabled(true);
|
||||
}
|
||||
}
|
||||
updateBoatChangeFactorSelection(getSelectedFlightNames().size());
|
||||
}
|
||||
|
||||
private Iterable<String> getSeriesNamesFromAllRaces(final Iterable<RaceColumnDTO> raceColumns) {
|
||||
@@ -238,5 +248,16 @@ public class PairingListCreationSetupDialog extends AbstractPairingListCreationS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBoatChangeFactorSelection(final int flightCount) {
|
||||
this.boatChangeFactorListBox.clear();
|
||||
if (flightCount == 0) {
|
||||
this.boatChangeFactorListBox.addItem("0");
|
||||
} else {
|
||||
IntStream.range(0, flightCount + 1).forEach(i -> {
|
||||
this.boatChangeFactorListBox.addItem(String.valueOf(i));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
+2
-2
@@ -7,7 +7,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.sap.sailing.domain.abstractlog.Revokable;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
@@ -880,7 +880,7 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
|
||||
* is thrown if the leaderboard is not found by name
|
||||
*/
|
||||
PairingListTemplateDTO calculatePairingListTemplate(final int flightCount, final int groupCount, final int competitorCount,
|
||||
final int flightMultiplier)
|
||||
final int flightMultiplier, final int tolerance)
|
||||
throws NotFoundException, IllegalArgumentException;
|
||||
|
||||
PairingListDTO getPairingListFromTemplate(String leaderboardName, int flightMultiplier,
|
||||
|
||||
+6
-2
@@ -946,11 +946,15 @@ public interface SailingServiceAsync extends ServerInfoRetriever, FileStorageMan
|
||||
* the count of competitors
|
||||
* @param flightMultiplier
|
||||
* specifies how often the flights will be cloned
|
||||
* @param boatChangeFactor
|
||||
* specifies the priority of well distributed assignment of competitors to boats (smallest factor) or
|
||||
* minimization of boat changes within a {@link PairingList} (highest factor); valid factors are
|
||||
* {@code 0..numberOfFlights}
|
||||
* @param callback
|
||||
* returns a {@link PairingListTemplateDTO}
|
||||
*/
|
||||
void calculatePairingListTemplate(final int flightCount, final int groupCount, final int competitorCount,
|
||||
final int flightMultiplier, AsyncCallback<PairingListTemplateDTO> callback);
|
||||
final int flightMultiplier, final int boatChangeFactor, AsyncCallback<PairingListTemplateDTO> callback);
|
||||
|
||||
/**
|
||||
* Creates a {@link PairingListDTO} in which the competitors will be matched to a {@link PairingList} based on the
|
||||
@@ -962,7 +966,7 @@ public interface SailingServiceAsync extends ServerInfoRetriever, FileStorageMan
|
||||
* @param callback
|
||||
*/
|
||||
void getPairingListFromTemplate(final String leaderboardName, final int flightMultiplier,
|
||||
final Iterable<String> selectedFlightNames,PairingListTemplateDTO templateDTO, AsyncCallback<PairingListDTO> callback);
|
||||
final Iterable<String> selectedFlightNames, PairingListTemplateDTO templateDTO, AsyncCallback<PairingListDTO> callback);
|
||||
|
||||
/**
|
||||
* Creates a {@link PairingListDTO} that is based on the competitors in the race logs of a leaderboard.
|
||||
|
||||
+3
@@ -229,6 +229,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
|
||||
String pairingLists();
|
||||
String pairingListCreationInfo();
|
||||
String setCompetitors();
|
||||
String setBoatChangeFactor();
|
||||
String seriesHint();
|
||||
String amountOfFlightRepeats();
|
||||
String insertIntoRegatta();
|
||||
@@ -245,6 +246,8 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
|
||||
String numberOfFleets();
|
||||
String numberOfCompetitors();
|
||||
String quality();
|
||||
String boatAssignmentQuality();
|
||||
String boatChanges();
|
||||
String pairingListTemplate();
|
||||
String printHint();
|
||||
String blockedApplyButton();
|
||||
|
||||
+8
-3
@@ -238,10 +238,13 @@ pairingList=Pairing list
|
||||
pairingLists=Pairing lists
|
||||
pairingListCreationInfo=First of all a template will be calculated that contains only the competitor numbers and can be applied to other leaderboards. If the competitor count is not divisible by the boat count without remainder, empty placeholders will be entered into the pairing list. \
|
||||
\ In addition if the competitor count is unequal to the registered competitor count in the actual leaderboard, the pairing list cannot be applied to Race logs. \
|
||||
\ The count of the flights, that is used to generate a pairing list, is set by all flights of the leaderboard that are not medal races.
|
||||
\ The count of the flights that is used to generate a pairing list is defined by the number of flights in the leaderboard that are not medal races. \
|
||||
\ When using flight repeats, flight assignments can be repeated (e.g. 15 flights with 3 flight repeats: 5 unique flight assignments and each one will be repeated 3 times). \
|
||||
\ A boat change factor equals 0 leads to a well distributed assignment of competitors to boats whereas the maximum (number of flights) leads to fewer boat changes because of competitors sailing on the same boat for two fleets behind each other in different flights.
|
||||
setCompetitors=Please set the competitors count:
|
||||
setBoatChangeFactor=Please set the boat change factor:
|
||||
seriesHint=Please select one or more series that should be in a PairingList:
|
||||
amountOfFlightRepeats=Number of flight repeats
|
||||
amountOfFlightRepeats=Number of flight repeats:
|
||||
insertIntoRegatta=Insert into regatta
|
||||
recalculate=Recalculate
|
||||
csvExport=Export as CSV
|
||||
@@ -257,6 +260,8 @@ numberOfFleets=Number of races per flight
|
||||
numberOfCompetitors=Number of competiors
|
||||
numberOfRaces=Number of races
|
||||
quality=Quality
|
||||
boatAssignmentQuality=Boat Assignment Quality
|
||||
boatChanges=Boat Changes
|
||||
pairingListTemplate=Pairing list template
|
||||
printHint=Prints the applied version
|
||||
blockedApplyButton=Registered Competitors are unequal to Competitors from Pairinglist!
|
||||
@@ -2189,4 +2194,4 @@ sailorProfileRemoveMessage=Are you sure you want to remove this Sailor Profile?
|
||||
moreLoginInformationSectionSailorProfilesDescription=After logging in, you can now find a new area under your user profile, which is called 'Sailor Profiles'. You can add some competitors to such a Sailor Profile and get more insights about these competitors. In a Sailor Profile, you can see all the events your favorite competitors participated in and compare their placements to each others. Additionally, you get an overview about the most important statistics, like the maximum speed or the average distance to the start line with direct links to the Race Map to see the exact point in time, where for example the fastest competitor reached his record. For aggregative statistics like the average distance to startline at racestart, you can click on the arrow and are forwarded to Data Mining where you can drill down on the average values.
|
||||
moreLoginInformationSectionSailorProfilesHeading=Sailor Profiles
|
||||
confirmDeletion=Confirm Deletion
|
||||
priorityMustBeANonNegativeNumber=Priority must be a non-negative integer number
|
||||
priorityMustBeANonNegativeNumber=Priority must be a non-negative integer number
|
||||
java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties
Executable → Regular
+6
-4
@@ -240,10 +240,12 @@ pairingList=Gegner Paarungsliste
|
||||
pairingLists=Gegner Paarungslisten
|
||||
pairingListCreationInfo=Es wird zunächst ein Template berechnet, das nur aus Zahlen besteht. Wenn die Teilnehmer Anzahl nicht durch die Anzahl der Boote dividiert werden kann, entstehen leere Plätze in der Pairing List. \
|
||||
\ Wenn außerdem die Anzahl der Teilnehmer nicht der auf der Rangliste registrierten Teilnehmer Anzahl entspricht, kann die Pairing List nicht in die Race Logs eingetragen werden. \
|
||||
\ Es wird eine Vereinigungsmenge aus allen Rennen, die keine Medallien Rennen sind, als Rennenanzahl für die Pairing List gebildet.
|
||||
\ Es wird eine Vereinigungsmenge aus allen Rennen, die keine Medaillen Rennen sind, als Rennenanzahl für die Pairing List gebildet. \
|
||||
\ Es kann ein Booswechsel-Faktor angegeben werden, mit dem die Balance zwischen guter Verteilung der Teilnehmer über die Boote und möglichst wenigen Bootswechseln zwischen den Runden eingestellt werden kann. Der Wert muss zwischen 0 und der Anzahl an Flights liegen. Kleinere Werte verteilen die Teilnehmer besser über die Boote; größere Werte helfen, die Bootswechsel zu reduzieren.
|
||||
setCompetitors=Anzahl der Teilnehmer:
|
||||
seriesHint=Bitte wählen Sie eine oder mehr Serien für die eine Paarungsliste aus:
|
||||
amountOfFlightRepeats=Anzahl der Flight Wiederholungen
|
||||
setBoatChangeFactor=Bitte wählen Sie einen Bootswechselfaktor aus:
|
||||
seriesHint=Bitte wählen Sie eine oder mehrere Serien aus:
|
||||
amountOfFlightRepeats=Anzahl der Flight Wiederholungen:
|
||||
insertIntoRegatta=In Regatta einfügen
|
||||
recalculate=Neu berechnen
|
||||
csvExport=Export als CSV
|
||||
@@ -2184,4 +2186,4 @@ sailorProfileRemoveMessage=Sicher, dass das Seglerprofil gelöscht werden soll?
|
||||
moreLoginInformationSectionSailorProfilesDescription=Nach dem Login können Sie nun in ihrem Userprofil einen neuen Bereich namens 'Seglerprofile' finden. Dort können Sie ein solches Seglerprofil anlegen, um detailliertere Informationen zum ausgewählten Team zu erhalten. In einem Seglerprofil können Sie alle Events ihrer Lieblingsteams verfolgen und deren Platzierungen direkt miteinander vergleichen. Außerdem erhalten Sie eine Übersicht über die wichtigsten Statistiken, wie die Maximalgeschwindigkeit oder die durchschnittliche Distanz zur Startlinie am Rennstart. Von hier aus gibt es auch direkte Absprungpunkte zu den für die individuelle Statistik relevanten Orten in Sailing Analytics. So können Sie etwa direkt von der Maximalgeschwindigkeit in die Race Map springen, wo dann das Rennen zu dem Zeitpunkt der Maximalgeschwindigkeit startet. Von der durchschnittlichen Distanz zur Startlinie können Sie dagegen gleich ins Data Mining wechseln, wo Sie dann einen Drill Down der Durchschnittswerte sehen.
|
||||
moreLoginInformationSectionSailorProfilesHeading=Seglerprofile
|
||||
confirmDeletion=Löschen bestätigen
|
||||
priorityMustBeANonNegativeNumber=Priorität muss eine nicht-negative ganze Zahl sein
|
||||
priorityMustBeANonNegativeNumber=Priorität muss eine nicht-negative ganze Zahl sein
|
||||
Loaded 100 of 144 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user