mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-06 12:23:55 +00:00
bug1564: some fixes after self review
Change-Id: I364c79ffa53f5173723655b24f14ff123ff56f99
This commit is contained in:
1 parent
73e0eba758
commit
f048a43aac
9 files changed
+93
-90
No files matched your search
+2
-2
@@ -1144,12 +1144,12 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
logger.log(Level.WARNING, "Error loading racing procedure configration for regatta.", e);
|
||||
}
|
||||
}
|
||||
final Double cicleRadius = (Double) dbRegatta.get(FieldNames.REGATTA_HULL_LENGTH_RADIUS_FACTOR.name());
|
||||
final Double hullLengthRadiusFactor = (Double) dbRegatta.get(FieldNames.REGATTA_HULL_LENGTH_RADIUS_FACTOR.name());
|
||||
final Boolean useStartTimeInference = (Boolean) dbRegatta.get(FieldNames.REGATTA_USE_START_TIME_INFERENCE.name());
|
||||
final Boolean controlTrackingFromStartAndFinishTimes = (Boolean) dbRegatta.get(FieldNames.REGATTA_CONTROL_TRACKING_FROM_START_AND_FINISH_TIMES.name());
|
||||
final RankingMetricConstructor rankingMetricConstructor = loadRankingMetricConstructor(dbRegatta);
|
||||
result = new RegattaImpl(getRaceLogStore(), getRegattaLogStore(), name, boatClass, startDate, endDate, series, /* persistent */true,
|
||||
loadScoringScheme(dbRegatta), id, courseArea, cicleRadius == null ? Regatta.DEFAULT_HULL_LENGHT_FACTOR : cicleRadius, useStartTimeInference == null ? true
|
||||
loadScoringScheme(dbRegatta), id, courseArea, hullLengthRadiusFactor == null ? Regatta.DEFAULT_HULL_LENGHT_FACTOR : hullLengthRadiusFactor, useStartTimeInference == null ? true
|
||||
: useStartTimeInference, controlTrackingFromStartAndFinishTimes == null ? false : controlTrackingFromStartAndFinishTimes,
|
||||
rankingMetricConstructor);
|
||||
result.setRegattaConfiguration(configuration);
|
||||
|
||||
@@ -158,6 +158,10 @@ public interface Regatta extends NamedWithID, IsRegattaLike, HasRaceColumnsAndRe
|
||||
|
||||
RegattaAndRaceIdentifier getRaceIdentifier(RaceDefinition race);
|
||||
|
||||
/**
|
||||
* Define the value which would be multipled by hull length from {@link BoatClass}.
|
||||
* Next the calculated value {@link RegattaUtil} would be used to fill out radius of buoy on race map setting.
|
||||
*/
|
||||
public double getHullLengthRadiusFactor();
|
||||
|
||||
public void setHullLengthRadiusFactor(double hullLengthRadiusFactor);
|
||||
|
||||
@@ -205,7 +205,7 @@ public class RegattaImpl extends NamedImpl implements Regatta, RaceColumnListene
|
||||
/* isMedal */false, /* isFleetsCanRunInParallel */ true, Collections
|
||||
.singletonList(new FleetImpl(LeaderboardNameConstants.DEFAULT_FLEET_NAME)),
|
||||
/* race column names */new ArrayList<String>(), trackedRegattaRegistry)), /* persistent */false,
|
||||
scoringScheme, id, courseArea, 1.0, /* useStartTimeInference */true, controlTrackingFromStartAndFinishTimes,
|
||||
scoringScheme, id, courseArea, /*hullLengthRadiusFactor*/2.0, /* useStartTimeInference */true, controlTrackingFromStartAndFinishTimes,
|
||||
rankingMetricConstructor);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ public abstract class AbstractRegattaWithSeriesAndFleetsDialog<T> extends DataEn
|
||||
|
||||
protected StringMessages stringMessages;
|
||||
private final RegattaDTO regatta;
|
||||
|
||||
|
||||
protected final BetterDateTimeBox startDateBox;
|
||||
protected final BetterDateTimeBox endDateBox;
|
||||
protected final ListBox scoringSchemeListBox;
|
||||
@@ -54,7 +54,7 @@ public abstract class AbstractRegattaWithSeriesAndFleetsDialog<T> extends DataEn
|
||||
protected final DoubleBox hullLengthRadiusFactorDoubleBox;
|
||||
protected final ListEditorComposite<SeriesDTO> seriesEditor;
|
||||
private final ListBox rankingMetricListBox;
|
||||
|
||||
|
||||
protected final List<EventDTO> existingEvents;
|
||||
private EventDTO defaultEvent;
|
||||
|
||||
|
||||
+79
-79
@@ -1,79 +1,79 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gwt.user.client.ui.CheckBox;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent.Handler;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.AbstractLeaderboardConfigPanel.RaceColumnDTOAndFleetDTOWithNameBasedEquality;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableMultiSelectionModel;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
|
||||
public class CopyCourseAndCompetitorsDialog extends DataEntryDialog<CourseAndCompetitorCopyOperation> {
|
||||
private final RaceTableWrapper<RefreshableMultiSelectionModel<RaceColumnDTOAndFleetDTOWithNameBasedEquality>>
|
||||
racesTable;
|
||||
private final CheckBox courseCheckBox;
|
||||
private final CheckBox competitorCheckBox;
|
||||
private SailingServiceAsync sailingService;
|
||||
private ErrorReporter errorReporter;
|
||||
|
||||
|
||||
public CopyCourseAndCompetitorsDialog(SailingServiceAsync sailingService, ErrorReporter errorReporter, final StringMessages stringMessages,
|
||||
Collection<RaceColumnDTOAndFleetDTOWithNameBasedEquality> races,
|
||||
String leaderboardName, double regattaHullLenghtCircleFactor, DialogCallback<CourseAndCompetitorCopyOperation> dialogCallback) {
|
||||
super(stringMessages.selectRaces(), stringMessages.selectRaces(), stringMessages.ok(), stringMessages.cancel(),
|
||||
new Validator<CourseAndCompetitorCopyOperation>() {
|
||||
@Override
|
||||
public String getErrorMessage(CourseAndCompetitorCopyOperation valueToValidate) {
|
||||
if (valueToValidate.getRaceLogsToCopyTo().isEmpty()) {
|
||||
return stringMessages.selectAtLeastOne();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}, true, dialogCallback);
|
||||
racesTable = new RaceTableWrapper<RefreshableMultiSelectionModel<RaceColumnDTOAndFleetDTOWithNameBasedEquality>>(
|
||||
sailingService, stringMessages, errorReporter, /* multiSelection */ true);
|
||||
racesTable.setSelectedLeaderboardName(leaderboardName);
|
||||
racesTable.setSelectedRegattaHullLenghtCircleFactor(regattaHullLenghtCircleFactor);
|
||||
racesTable.getDataProvider().getList().addAll(races);
|
||||
racesTable.getSelectionModel().addSelectionChangeHandler(new Handler() {
|
||||
@Override
|
||||
public void onSelectionChange(SelectionChangeEvent event) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
courseCheckBox = new CheckBox(stringMessages.copyCourse());
|
||||
courseCheckBox.setValue(true);
|
||||
competitorCheckBox = new CheckBox(stringMessages.copyCompetitors());
|
||||
competitorCheckBox.setValue(false); // competitors are usually registered on the regatta
|
||||
this.sailingService = sailingService;
|
||||
this.errorReporter = errorReporter;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Widget getAdditionalWidget() {
|
||||
FlowPanel mainPanel = new FlowPanel();
|
||||
|
||||
HorizontalPanel checkBoxPanel = new HorizontalPanel();
|
||||
checkBoxPanel.add(courseCheckBox);
|
||||
checkBoxPanel.add(competitorCheckBox);
|
||||
|
||||
mainPanel.add(checkBoxPanel);
|
||||
mainPanel.add(racesTable);
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CourseAndCompetitorCopyOperation getResult() {
|
||||
Set<RaceColumnDTOAndFleetDTOWithNameBasedEquality> racesToCopyTo = racesTable.getSelectionModel().getSelectedSet();
|
||||
return new CourseAndCompetitorCopyOperation(racesToCopyTo, courseCheckBox.getValue(), competitorCheckBox.getValue(), sailingService, errorReporter);
|
||||
}
|
||||
|
||||
}
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gwt.user.client.ui.CheckBox;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent.Handler;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.AbstractLeaderboardConfigPanel.RaceColumnDTOAndFleetDTOWithNameBasedEquality;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableMultiSelectionModel;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
|
||||
public class CopyCourseAndCompetitorsDialog extends DataEntryDialog<CourseAndCompetitorCopyOperation> {
|
||||
private final RaceTableWrapper<RefreshableMultiSelectionModel<RaceColumnDTOAndFleetDTOWithNameBasedEquality>>
|
||||
racesTable;
|
||||
private final CheckBox courseCheckBox;
|
||||
private final CheckBox competitorCheckBox;
|
||||
private SailingServiceAsync sailingService;
|
||||
private ErrorReporter errorReporter;
|
||||
|
||||
|
||||
public CopyCourseAndCompetitorsDialog(SailingServiceAsync sailingService, ErrorReporter errorReporter, final StringMessages stringMessages,
|
||||
Collection<RaceColumnDTOAndFleetDTOWithNameBasedEquality> races,
|
||||
String leaderboardName, double regattaHullLenghtCircleFactor, DialogCallback<CourseAndCompetitorCopyOperation> dialogCallback) {
|
||||
super(stringMessages.selectRaces(), stringMessages.selectRaces(), stringMessages.ok(), stringMessages.cancel(),
|
||||
new Validator<CourseAndCompetitorCopyOperation>() {
|
||||
@Override
|
||||
public String getErrorMessage(CourseAndCompetitorCopyOperation valueToValidate) {
|
||||
if (valueToValidate.getRaceLogsToCopyTo().isEmpty()) {
|
||||
return stringMessages.selectAtLeastOne();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}, true, dialogCallback);
|
||||
racesTable = new RaceTableWrapper<RefreshableMultiSelectionModel<RaceColumnDTOAndFleetDTOWithNameBasedEquality>>(
|
||||
sailingService, stringMessages, errorReporter, /* multiSelection */ true);
|
||||
racesTable.setSelectedLeaderboardName(leaderboardName);
|
||||
racesTable.setSelectedRegattaHullLenghtCircleFactor(regattaHullLenghtCircleFactor);
|
||||
racesTable.getDataProvider().getList().addAll(races);
|
||||
racesTable.getSelectionModel().addSelectionChangeHandler(new Handler() {
|
||||
@Override
|
||||
public void onSelectionChange(SelectionChangeEvent event) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
courseCheckBox = new CheckBox(stringMessages.copyCourse());
|
||||
courseCheckBox.setValue(true);
|
||||
competitorCheckBox = new CheckBox(stringMessages.copyCompetitors());
|
||||
competitorCheckBox.setValue(false); // competitors are usually registered on the regatta
|
||||
this.sailingService = sailingService;
|
||||
this.errorReporter = errorReporter;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Widget getAdditionalWidget() {
|
||||
FlowPanel mainPanel = new FlowPanel();
|
||||
|
||||
HorizontalPanel checkBoxPanel = new HorizontalPanel();
|
||||
checkBoxPanel.add(courseCheckBox);
|
||||
checkBoxPanel.add(competitorCheckBox);
|
||||
|
||||
mainPanel.add(checkBoxPanel);
|
||||
mainPanel.add(racesTable);
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CourseAndCompetitorCopyOperation getResult() {
|
||||
Set<RaceColumnDTOAndFleetDTOWithNameBasedEquality> racesToCopyTo = racesTable.getSelectionModel().getSelectedSet();
|
||||
return new CourseAndCompetitorCopyOperation(racesToCopyTo, courseCheckBox.getValue(), competitorCheckBox.getValue(), sailingService, errorReporter);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ extends TableWrapper<RaceColumnDTOAndFleetDTOWithNameBasedEquality, S> {
|
||||
private final AnchorTemplates ANCHORTEMPLATE = GWT.create(AnchorTemplates.class);
|
||||
private String selectedLeaderboardName;
|
||||
private double selectedRegattaHullLenghtCircleFactor;
|
||||
|
||||
|
||||
public RaceTableWrapper(SailingServiceAsync sailingService, StringMessages stringMessages,
|
||||
ErrorReporter errorReporter, boolean multiSelection) {
|
||||
super(sailingService, stringMessages, errorReporter, multiSelection, /* enablePager */ false,
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class RegattaDetailsComposite extends Composite {
|
||||
private final ErrorReporter errorReporter;
|
||||
private final StringMessages stringMessages;
|
||||
private final RegattaRefresher regattaRefresher;
|
||||
|
||||
|
||||
private final Label regattaId;
|
||||
private final Label regattaName;
|
||||
private final Label startDate;
|
||||
|
||||
+2
-3
@@ -64,7 +64,7 @@ public class RaceMapSettings extends AbstractSettings {
|
||||
/* showMapControls */ true,
|
||||
new RaceMapHelpLinesSettings(),
|
||||
/* windUp */ false,
|
||||
/* showDouglasPeuckerPoints */ 0.0,
|
||||
/* buoyZoneRadiusInMeters */ DEFAULT_BUOY_ZONE_RADIUS,
|
||||
/* showWindStreamletOverlay */ false,
|
||||
/* showWindStreamletColors */ false,
|
||||
/* showSimulationOverlay */ false);
|
||||
@@ -95,7 +95,7 @@ public class RaceMapSettings extends AbstractSettings {
|
||||
private RaceMapSettings(boolean showMapControls, boolean showCourseGeometry, boolean windUp, double buoyZoneRadiusInMeters, boolean showWindStreamletOverlay, boolean showWindStreamletColors, boolean showSimulationOverlay) {
|
||||
this(showMapControls, new RaceMapHelpLinesSettings(createHelpLineSettings(showCourseGeometry)), windUp, buoyZoneRadiusInMeters, showWindStreamletOverlay, showWindStreamletColors, showSimulationOverlay);
|
||||
}
|
||||
|
||||
|
||||
private RaceMapSettings(boolean showMapControls, RaceMapHelpLinesSettings helpLineSettings, boolean windUp, double buoyZoneRadiusInMeters, boolean showWindStreamletOverlay, boolean showWindStreamletColors, boolean showSimulationOverlay) {
|
||||
this(
|
||||
new RaceMapZoomSettings(),
|
||||
@@ -250,5 +250,4 @@ public class RaceMapSettings extends AbstractSettings {
|
||||
public Set<ManeuverType> getManeuverTypesToShow() {
|
||||
return maneuverTypesToShow;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -559,7 +559,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
Activator activator = Activator.getInstance();
|
||||
if (context != null) {
|
||||
activator.setSailingService(this); // register so this service is informed when the bundle shuts down
|
||||
}
|
||||
}
|
||||
quickRanksLiveCache = new QuickRanksLiveCache(this);
|
||||
racingEventServiceTracker = ServiceTrackerFactory.createAndOpen(context, RacingEventService.class);
|
||||
replicationServiceTracker = ServiceTrackerFactory.createAndOpen(context, ReplicationService.class);
|
||||
|
||||
Reference in new issue
Block a user