mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-14 08:11:00 +00:00
Merge branch 'bug1564' of ssh://localhost:12347/home/trac/git into bug1564
This commit is contained in:
commit
f6009c714e
28 files changed
+98
-69
No files matched your search
+2
-2
@@ -448,12 +448,12 @@ public class MockedTrackedRace implements DynamicTrackedRace {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getHullLengthRadiusFactor(){
|
||||
public Double getHullLengthRadiusFactor(){
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHullLengthRadiusFactor(double hullLengthRadiusFactor){
|
||||
public void setHullLengthRadiusFactor(Double hullLengthRadiusFactor){
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -162,9 +162,9 @@ public interface Regatta extends NamedWithID, IsRegattaLike, HasRaceColumnsAndRe
|
||||
* 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 Double getHullLengthRadiusFactor();
|
||||
|
||||
public void setHullLengthRadiusFactor(double hullLengthRadiusFactor);
|
||||
public void setHullLengthRadiusFactor(Double hullLengthRadiusFactor);
|
||||
|
||||
/**
|
||||
* When there is no race committee app in place and no operator is managing the race start times for this regatta,
|
||||
|
||||
@@ -115,7 +115,7 @@ public class RegattaImpl extends NamedImpl implements Regatta, RaceColumnListene
|
||||
private transient RaceLogStore raceLogStore;
|
||||
private final IsRegattaLike regattaLikeHelper;
|
||||
private final RankingMetricConstructor rankingMetricConstructor;
|
||||
private double hullLengthRadiusFactor;
|
||||
private Double hullLengthRadiusFactor;
|
||||
|
||||
private CourseArea defaultCourseArea;
|
||||
private RegattaConfiguration configuration;
|
||||
@@ -216,7 +216,7 @@ public class RegattaImpl extends NamedImpl implements Regatta, RaceColumnListene
|
||||
*/
|
||||
public <S extends Series> RegattaImpl(RaceLogStore raceLogStore, RegattaLogStore regattaLogStore, String name,
|
||||
BoatClass boatClass, TimePoint startDate, TimePoint endDate, Iterable<S> series, boolean persistent,
|
||||
ScoringScheme scoringScheme, Serializable id, CourseArea courseArea, double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
ScoringScheme scoringScheme, Serializable id, CourseArea courseArea, Double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean controlTrackingFromStartAndFinishTimes, RankingMetricConstructor rankingMetricConstructor) {
|
||||
super(name);
|
||||
this.rankingMetricConstructor = rankingMetricConstructor;
|
||||
@@ -575,12 +575,12 @@ public class RegattaImpl extends NamedImpl implements Regatta, RaceColumnListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getHullLengthRadiusFactor() {
|
||||
public Double getHullLengthRadiusFactor() {
|
||||
return hullLengthRadiusFactor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHullLengthRadiusFactor(double hullLengthRadiusFactor) {
|
||||
public void setHullLengthRadiusFactor(Double hullLengthRadiusFactor) {
|
||||
this.hullLengthRadiusFactor = hullLengthRadiusFactor;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ public class RegattaUtil {
|
||||
|
||||
public static final double DEFAULT_BUOY_ZONE_RADIUS = 15;
|
||||
|
||||
public static double getCalculatedRegattaBuoyZoneRadius(Regatta regatta, BoatClass boatClass) {
|
||||
public static double getCalculatedRegattaBuoyZoneRadiusInMeters(Regatta regatta, BoatClass boatClass) {
|
||||
double hullLengthRadiusFactor = Regatta.DEFAULT_HULL_LENGHT_FACTOR;
|
||||
if (regatta != null) {
|
||||
if (regatta != null && regatta.getHullLengthRadiusFactor() != null) {
|
||||
hullLengthRadiusFactor = regatta.getHullLengthRadiusFactor();
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -18,7 +18,7 @@ public class RegattaMetadataDTO extends RegattaReferenceDTO implements HasRegatt
|
||||
private RegattaState state;
|
||||
private boolean flexibleLeaderboard;
|
||||
private RaceDataInfo raceDataInfo;
|
||||
private double buoyZoneRadius;
|
||||
private double buoyZoneRadiusInMeters;
|
||||
|
||||
public RegattaMetadataDTO() {
|
||||
}
|
||||
@@ -124,12 +124,12 @@ public class RegattaMetadataDTO extends RegattaReferenceDTO implements HasRegatt
|
||||
this.raceDataInfo = raceDataInfo;
|
||||
}
|
||||
|
||||
public double getBuoyZoneRadius() {
|
||||
return buoyZoneRadius;
|
||||
public double getBuoyZoneRadiusInMeters() {
|
||||
return buoyZoneRadiusInMeters;
|
||||
}
|
||||
|
||||
public void setBuoyZoneRadius(double buoyZoneRadius) {
|
||||
this.buoyZoneRadius = buoyZoneRadius;
|
||||
public void setBuoyZoneRadiusInMeters(double buoyZoneRadiusInMeters) {
|
||||
this.buoyZoneRadiusInMeters = buoyZoneRadiusInMeters;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -181,17 +181,17 @@ public abstract class AbstractEventActivity<PLACE extends AbstractEventPlace> ex
|
||||
linkParams.put(RaceMapSettings.PARAM_SHOW_MAPCONTROLS, "true");
|
||||
linkParams.put(RaceBoardPerspectiveSettings.PARAM_VIEW_SHOW_NAVIGATION_PANEL, "true");
|
||||
linkParams.put("regattaName", regattaName);
|
||||
linkParams.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS, String.valueOf(getRegattaBuoyZoneRadius(regattaName)));
|
||||
linkParams.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS_IN_METERS, String.valueOf(getRegattaBuoyZoneRadius(regattaName)));
|
||||
return linkParams;
|
||||
}
|
||||
|
||||
private double getRegattaBuoyZoneRadius(String regattaName) {
|
||||
for (RegattaMetadataDTO regatta : eventDTO.getRegattas()) {
|
||||
if (regattaName != null && regattaName.equals(regatta.getId())) {
|
||||
return regatta.getBuoyZoneRadius();
|
||||
return regatta.getBuoyZoneRadiusInMeters();
|
||||
}
|
||||
}
|
||||
return RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS;
|
||||
return RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS_IN_METERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-4
@@ -275,19 +275,19 @@ public abstract class AbstractEventActivity<PLACE extends AbstractEventPlace> ex
|
||||
}
|
||||
linkParams.put("raceName", trackedRaceName);
|
||||
linkParams.put("regattaName", regattaName);
|
||||
linkParams.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS, String.valueOf(getRegattaBuoyZoneRadius(regattaName)));
|
||||
linkParams.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS_IN_METERS, String.valueOf(getRegattaBuoyZoneRadiusInMeters(regattaName)));
|
||||
// TODO this must only be forwarded if there is a logged-on user
|
||||
// linkParams.put(RaceBoardViewConfiguration.PARAM_CAN_REPLAY_DURING_LIVE_RACES, "true");
|
||||
return linkParams;
|
||||
}
|
||||
|
||||
private double getRegattaBuoyZoneRadius(String regattaName) {
|
||||
private double getRegattaBuoyZoneRadiusInMeters(String regattaName) {
|
||||
for (RegattaMetadataDTO regatta : eventDTO.getRegattas()) {
|
||||
if (regattaName != null && regattaName.equals(regatta.getId())) {
|
||||
return regatta.getBuoyZoneRadius();
|
||||
return regatta.getBuoyZoneRadiusInMeters();
|
||||
}
|
||||
}
|
||||
return RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS;
|
||||
return RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS_IN_METERS;
|
||||
}
|
||||
|
||||
public String getRegattaId() {
|
||||
|
||||
+3
-3
@@ -250,13 +250,13 @@ public class LeaderboardContext {
|
||||
RegattaRaceDataInfoCalculator regattaRaceDataInfoCalculator = new RegattaRaceDataInfoCalculator();
|
||||
forRaces(regattaRaceDataInfoCalculator);
|
||||
regattaDTO.setRaceDataInfo(regattaRaceDataInfoCalculator.getRaceDataInfo());
|
||||
regattaDTO.setBuoyZoneRadius(getRegattaBuoyZoneRadius());
|
||||
regattaDTO.setBuoyZoneRadiusInMeters(getRegattaBuoyZoneRadiusInMeters());
|
||||
}
|
||||
|
||||
private double getRegattaBuoyZoneRadius() {
|
||||
private double getRegattaBuoyZoneRadiusInMeters() {
|
||||
Regatta regatta = service.getRegattaByName(getLeaderboardName());
|
||||
BoatClass boatClass = HomeServiceUtil.getBoatClass(leaderboard);
|
||||
double boatHullLength = RegattaUtil.getCalculatedRegattaBuoyZoneRadius(regatta, boatClass);
|
||||
double boatHullLength = RegattaUtil.getCalculatedRegattaBuoyZoneRadiusInMeters(regatta, boatClass);
|
||||
return boatHullLength;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -934,7 +934,7 @@ public class RegattaRaceStatesComponent extends SimplePanel implements Component
|
||||
raceLinkParameters.put("raceName", entryDTO.raceInfo.raceIdentifier.getRaceName());
|
||||
raceLinkParameters.put("canReplayDuringLiveRaces", "true");
|
||||
raceLinkParameters.put("regattaName", entryDTO.regattaName);
|
||||
raceLinkParameters.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS, String.valueOf(entryDTO.buyZoneRadius));
|
||||
raceLinkParameters.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS_IN_METERS, String.valueOf(entryDTO.buyZoneRadius));
|
||||
|
||||
return EntryPointLinkFactory.createRaceBoardLink(raceLinkParameters);
|
||||
}
|
||||
|
||||
+3
-3
@@ -192,9 +192,9 @@ public abstract class AbstractLeaderboardConfigPanel extends FormPanel implement
|
||||
raceColumnTable.setSelectedLeaderboardName(getSelectedLeaderboardName());
|
||||
|
||||
RegattaDTO regatta = getSelectedRegatta();
|
||||
double buoyZoneRadius = regatta == null ? RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS
|
||||
: regatta.getCalculatedBuoyZoneRadius();
|
||||
raceColumnTable.setSelectedRegattaHullLenghtCircleFactor(buoyZoneRadius);
|
||||
double buoyZoneRadius = regatta == null ? RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS_IN_METERS
|
||||
: regatta.getCalculatedBuoyZoneRadiusInMeters();
|
||||
raceColumnTable.setSelectedBuoyZoneRadiusInMeters(buoyZoneRadius);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ public class CopyCourseAndCompetitorsDialog extends DataEntryDialog<CourseAndCom
|
||||
|
||||
public CopyCourseAndCompetitorsDialog(SailingServiceAsync sailingService, ErrorReporter errorReporter, final StringMessages stringMessages,
|
||||
Collection<RaceColumnDTOAndFleetDTOWithNameBasedEquality> races,
|
||||
String leaderboardName, double regattaHullLenghtCircleFactor, DialogCallback<CourseAndCompetitorCopyOperation> dialogCallback) {
|
||||
String leaderboardName, double buoyZoneRadiusInMeters, DialogCallback<CourseAndCompetitorCopyOperation> dialogCallback) {
|
||||
super(stringMessages.selectRaces(), stringMessages.selectRaces(), stringMessages.ok(), stringMessages.cancel(),
|
||||
new Validator<CourseAndCompetitorCopyOperation>() {
|
||||
@Override
|
||||
@@ -41,7 +41,7 @@ public class CopyCourseAndCompetitorsDialog extends DataEntryDialog<CourseAndCom
|
||||
racesTable = new RaceTableWrapper<RefreshableMultiSelectionModel<RaceColumnDTOAndFleetDTOWithNameBasedEquality>>(
|
||||
sailingService, stringMessages, errorReporter, /* multiSelection */ true);
|
||||
racesTable.setSelectedLeaderboardName(leaderboardName);
|
||||
racesTable.setSelectedRegattaHullLenghtCircleFactor(regattaHullLenghtCircleFactor);
|
||||
racesTable.setSelectedBuoyZoneRadiusInMeters(buoyZoneRadiusInMeters);
|
||||
racesTable.getDataProvider().getList().addAll(races);
|
||||
racesTable.getSelectionModel().addSelectionChangeHandler(new Handler() {
|
||||
@Override
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@ public class RaceTableWrapper<S extends RefreshableSelectionModel<RaceColumnDTOA
|
||||
extends TableWrapper<RaceColumnDTOAndFleetDTOWithNameBasedEquality, S> {
|
||||
private final AnchorTemplates ANCHORTEMPLATE = GWT.create(AnchorTemplates.class);
|
||||
private String selectedLeaderboardName;
|
||||
private double selectedRegattaHullLenghtCircleFactor;
|
||||
private double selectedBuoyZoneRadiusInMeters;
|
||||
|
||||
public RaceTableWrapper(SailingServiceAsync sailingService, StringMessages stringMessages,
|
||||
ErrorReporter errorReporter, boolean multiSelection) {
|
||||
@@ -54,7 +54,7 @@ extends TableWrapper<RaceColumnDTOAndFleetDTOWithNameBasedEquality, S> {
|
||||
.getA().getRaceIdentifier(raceInLeaderboardDTOAndFleetName.getB());
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("leaderboardName", selectedLeaderboardName);
|
||||
params.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS, String.valueOf(selectedRegattaHullLenghtCircleFactor));
|
||||
params.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS_IN_METERS, String.valueOf(selectedBuoyZoneRadiusInMeters));
|
||||
params.put("regattaName", raceIdentifier.getRegattaName());
|
||||
params.put("raceName", raceIdentifier.getRaceName());
|
||||
params.put("canReplayDuringLiveRaces", "true");
|
||||
@@ -93,7 +93,7 @@ extends TableWrapper<RaceColumnDTOAndFleetDTOWithNameBasedEquality, S> {
|
||||
this.selectedLeaderboardName = name;
|
||||
}
|
||||
|
||||
public void setSelectedRegattaHullLenghtCircleFactor(double selectedRegattaHullLenghtCircleFactor) {
|
||||
this.selectedRegattaHullLenghtCircleFactor = selectedRegattaHullLenghtCircleFactor;
|
||||
public void setSelectedBuoyZoneRadiusInMeters(double selectedBuoyZoneRadiusInMeters) {
|
||||
this.selectedBuoyZoneRadiusInMeters = selectedBuoyZoneRadiusInMeters;
|
||||
}
|
||||
}
|
||||
+4
@@ -73,6 +73,10 @@ public class RegattaWithSeriesAndFleetsCreateDialog extends RegattaWithSeriesAnd
|
||||
errorMessage = stringMessages.regattaWithThisNameAlreadyExists();
|
||||
}
|
||||
|
||||
if (regattaToValidate.hullLengthRadiusFactor == null) {
|
||||
errorMessage = stringMessages.incorrectValueForRegattaHullLengthRadiusFactor();
|
||||
}
|
||||
|
||||
if (errorMessage == null) {
|
||||
List<SeriesDTO> seriesToValidate = regattaToValidate.series;
|
||||
int index = 0;
|
||||
|
||||
+18
-1
@@ -25,10 +25,27 @@ public class RegattaWithSeriesAndFleetsEditDialog extends RegattaWithSeriesAndFl
|
||||
|
||||
private RegattaConfigurationDTO currentRegattaConfiguration;
|
||||
|
||||
protected static class RegattaParameterValidator implements Validator<RegattaDTO> {
|
||||
private StringMessages stringMessages;
|
||||
|
||||
public RegattaParameterValidator(StringMessages stringMessages) {
|
||||
this.stringMessages = stringMessages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage(RegattaDTO regattaToValidate) {
|
||||
String errorMessage = null;
|
||||
if (regattaToValidate.hullLengthRadiusFactor == null) {
|
||||
errorMessage = stringMessages.incorrectValueForRegattaHullLengthRadiusFactor();
|
||||
}
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
public RegattaWithSeriesAndFleetsEditDialog(RegattaDTO regatta, Collection<RegattaDTO> existingRegattas,
|
||||
List<EventDTO> existingEvents, EventDTO correspondingEvent, final StringMessages stringMessages, DialogCallback<RegattaDTO> callback) {
|
||||
super(regatta, regatta.series, existingEvents, correspondingEvent, stringMessages.editRegatta(), stringMessages.ok(), stringMessages,
|
||||
null, callback);
|
||||
new RegattaParameterValidator(stringMessages), callback);
|
||||
ensureDebugId("RegattaWithSeriesAndFleetsEditDialog");
|
||||
currentRegattaConfiguration = regatta.configuration;
|
||||
|
||||
|
||||
+5
-2
@@ -49,6 +49,7 @@ import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.FlushableCellTable;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.SelectionCheckboxColumn;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapSettings;
|
||||
import com.sap.sailing.gwt.ui.shared.ControlPointDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.DeviceConfigurationDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
@@ -336,9 +337,11 @@ public class SmartphoneTrackingEventManagementPanel extends AbstractLeaderboardC
|
||||
List<RaceColumnDTOAndFleetDTOWithNameBasedEquality> races =
|
||||
new ArrayList<>(raceColumnTable.getDataProvider().getList());
|
||||
races.remove(raceColumnDTOAndFleetDTO);
|
||||
double regattaHullLenghtCircleFactor = getSelectedRegatta() != null ? null : getSelectedRegatta().hullLengthRadiusFactor;
|
||||
double buoyZoneRadiusInMeters = getSelectedRegatta() == null
|
||||
? RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS_IN_METERS
|
||||
: getSelectedRegatta().getCalculatedBuoyZoneRadiusInMeters();
|
||||
new CopyCourseAndCompetitorsDialog(sailingService, errorReporter, stringMessages, races,
|
||||
leaderboardName, regattaHullLenghtCircleFactor, new DialogCallback<CourseAndCompetitorCopyOperation>() {
|
||||
leaderboardName, buoyZoneRadiusInMeters, new DialogCallback<CourseAndCompetitorCopyOperation>() {
|
||||
@Override
|
||||
public void ok(CourseAndCompetitorCopyOperation operation) {
|
||||
operation.perform(leaderboardName, raceColumnDTOAndFleetDTO, /* onSuccessCallback */ new Runnable() {
|
||||
|
||||
+2
-2
@@ -215,7 +215,7 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
|
||||
|
||||
RegattaDTO createRegatta(String regattaName, String boatClassName, Date startDate, Date endDate,
|
||||
RegattaCreationParametersDTO seriesNamesWithFleetNamesAndFleetOrderingAndMedal, boolean persistent,
|
||||
ScoringSchemeType scoringSchemeType, UUID defaultCourseAreaId, double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
ScoringSchemeType scoringSchemeType, UUID defaultCourseAreaId, Double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean controlTrackingFromStartAndFinishTimes, RankingMetrics rankingMetricType);
|
||||
|
||||
void removeRegatta(RegattaIdentifier regattaIdentifier);
|
||||
@@ -225,7 +225,7 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
|
||||
void removeRegattas(Collection<RegattaIdentifier> regattas);
|
||||
|
||||
void updateRegatta(RegattaIdentifier regattaIdentifier, Date startDate, Date endDate, UUID defaultCourseAreaUuid,
|
||||
RegattaConfigurationDTO regattaConfiguration, double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes);
|
||||
RegattaConfigurationDTO regattaConfiguration, Double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes);
|
||||
|
||||
List<RaceColumnInSeriesDTO> addRaceColumnsToSeries(RegattaIdentifier regattaIdentifier, String seriesName,
|
||||
List<Pair<String, Integer>> columnNames);
|
||||
|
||||
+2
-2
@@ -441,7 +441,7 @@ public interface SailingServiceAsync extends ServerInfoRetriever, FileStorageMan
|
||||
|
||||
void createRegatta(String regattaName, String boatClassName, Date startDate, Date endDate,
|
||||
RegattaCreationParametersDTO seriesNamesWithFleetNamesAndFleetOrderingAndMedal, boolean persistent,
|
||||
ScoringSchemeType scoringSchemeType, UUID defaultCourseAreaId, double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
ScoringSchemeType scoringSchemeType, UUID defaultCourseAreaId, Double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean controlTrackingFromStartAndFinishTimes, RankingMetrics rankingMetricType,
|
||||
AsyncCallback<RegattaDTO> callback);
|
||||
|
||||
@@ -528,7 +528,7 @@ public interface SailingServiceAsync extends ServerInfoRetriever, FileStorageMan
|
||||
void storeSwissTimingArchiveConfiguration(String swissTimingUrl, AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void updateRegatta(RegattaIdentifier regattaIdentifier, Date startDate, Date endDate, UUID defaultCourseAreaUuid,
|
||||
RegattaConfigurationDTO regattaConfiguration, double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
RegattaConfigurationDTO regattaConfiguration, Double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean controlTrackingFromStartAndFinishTimes, AsyncCallback<Void> callback);
|
||||
|
||||
/**
|
||||
|
||||
+2
@@ -1740,4 +1740,6 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
|
||||
String lastFix();
|
||||
String filterDeviceMappings();
|
||||
String hullLengthRadiusFactor();
|
||||
|
||||
String incorrectValueForRegattaHullLengthRadiusFactor();
|
||||
}
|
||||
+2
-1
@@ -1712,4 +1712,5 @@ strategySimulatorReadMore=Learn More
|
||||
impressum=Imprint
|
||||
lastFix=Last fix
|
||||
filterDeviceMappings=Filter device mappings
|
||||
hullLengthRadiusFactor=Hull length radius factor
|
||||
hullLengthRadiusFactor=Hull length radius factor
|
||||
incorrectValueForRegattaHullLengthRadiusFactor=Incorrect value for "Hull length radius factor"
|
||||
+4
-4
@@ -17,9 +17,9 @@ public class RaceMapSettings extends AbstractSettings {
|
||||
public static final String PARAM_VIEW_SHOW_STREAMLETS = "viewShowStreamlets";
|
||||
public static final String PARAM_VIEW_SHOW_STREAMLET_COLORS = "viewShowStreamletColors";
|
||||
public static final String PARAM_VIEW_SHOW_SIMULATION = "viewShowSimulation";
|
||||
public static final String PARAM_BUOY_ZONE_RADIUS = "buoyZoneRadius";
|
||||
public static final String PARAM_BUOY_ZONE_RADIUS_IN_METERS = "buoyZoneRadiusInMeters";
|
||||
|
||||
public static final double DEFAULT_BUOY_ZONE_RADIUS = 15;
|
||||
public static final double DEFAULT_BUOY_ZONE_RADIUS_IN_METERS = 15;
|
||||
|
||||
private final boolean showDouglasPeuckerPoints;
|
||||
|
||||
@@ -64,7 +64,7 @@ public class RaceMapSettings extends AbstractSettings {
|
||||
/* showMapControls */ true,
|
||||
new RaceMapHelpLinesSettings(),
|
||||
/* windUp */ false,
|
||||
/* buoyZoneRadiusInMeters */ DEFAULT_BUOY_ZONE_RADIUS,
|
||||
/* buoyZoneRadiusInMeters */ DEFAULT_BUOY_ZONE_RADIUS_IN_METERS,
|
||||
/* showWindStreamletOverlay */ false,
|
||||
/* showWindStreamletColors */ false,
|
||||
/* showSimulationOverlay */ false);
|
||||
@@ -243,7 +243,7 @@ public class RaceMapSettings extends AbstractSettings {
|
||||
final boolean showWindStreamletOverlay = GwtHttpRequestUtils.getBooleanParameter(PARAM_VIEW_SHOW_STREAMLETS, defaultForViewShowStreamlets /* default */);
|
||||
final boolean showWindStreamletColors = GwtHttpRequestUtils.getBooleanParameter(PARAM_VIEW_SHOW_STREAMLET_COLORS, defaultForViewShowStreamletColors /* default */);
|
||||
final boolean showSimulationOverlay = GwtHttpRequestUtils.getBooleanParameter(PARAM_VIEW_SHOW_SIMULATION, defaultForViewShowSimulation /* default */);
|
||||
final double buoyZoneRadiusInMeters = GwtHttpRequestUtils.getDoubleParameter(PARAM_BUOY_ZONE_RADIUS, 0.0 /* default */);
|
||||
final double buoyZoneRadiusInMeters = GwtHttpRequestUtils.getDoubleParameter(PARAM_BUOY_ZONE_RADIUS_IN_METERS, DEFAULT_BUOY_ZONE_RADIUS_IN_METERS /* default */);
|
||||
return new RaceMapSettings(showMapControls, showCourseGeometry, windUp, buoyZoneRadiusInMeters, showWindStreamletOverlay, showWindStreamletColors, showSimulationOverlay);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -208,7 +208,7 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite<RaceBoardPerspe
|
||||
RaceTimePanelLifecycle raceTimePanelLifecycle = perspectiveLifecycleWithAllSettings.getPerspectiveLifecycle().getRaceTimePanelLifecycle();
|
||||
RaceTimePanelSettings raceTimePanelSettings = perspectiveLifecycleWithAllSettings.findComponentSettingsByLifecycle(raceTimePanelLifecycle);
|
||||
|
||||
final double buoyZoneRadiusInMeters = GwtHttpRequestUtils.getDoubleParameter(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS, RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS /* default */);
|
||||
final double buoyZoneRadiusInMeters = GwtHttpRequestUtils.getDoubleParameter(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS_IN_METERS, RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS_IN_METERS /* default */);
|
||||
final RaceMapSettings raceMapSettings = new RaceMapSettings(defaultRaceMapSettings.getZoomSettings(), defaultRaceMapSettings.getHelpLinesSettings(),
|
||||
defaultRaceMapSettings.getTransparentHoverlines(), defaultRaceMapSettings.getHoverlineStrokeWeight(),
|
||||
defaultRaceMapSettings.getTailLengthInMilliseconds(), defaultRaceMapSettings.isWindUp(),
|
||||
|
||||
+4
-4
@@ -3914,7 +3914,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
|
||||
@Override
|
||||
public void updateRegatta(RegattaIdentifier regattaName, Date startDate, Date endDate, UUID defaultCourseAreaUuid,
|
||||
RegattaConfigurationDTO configurationDTO, double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes) {
|
||||
RegattaConfigurationDTO configurationDTO, Double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes) {
|
||||
Regatta regatta = getService().getRegatta(regattaName);
|
||||
if (regatta != null) {
|
||||
SecurityUtils.getSubject().checkPermission(Permission.REGATTA.getStringPermissionForObjects(Mode.UPDATE, regatta.getName()));
|
||||
@@ -4013,7 +4013,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
@Override
|
||||
public RegattaDTO createRegatta(String regattaName, String boatClassName, Date startDate, Date endDate,
|
||||
RegattaCreationParametersDTO seriesNamesWithFleetNamesAndFleetOrderingAndMedal,
|
||||
boolean persistent, ScoringSchemeType scoringSchemeType, UUID defaultCourseAreaId, double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean persistent, ScoringSchemeType scoringSchemeType, UUID defaultCourseAreaId, Double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean controlTrackingFromStartAndFinishTimes, RankingMetrics rankingMetricType) {
|
||||
SecurityUtils.getSubject().checkPermission(Permission.REGATTA.getStringPermissionForObjects(Mode.CREATE, regattaName));
|
||||
TimePoint startTimePoint = startDate != null ? new MillisecondsTimePoint(startDate) : null;
|
||||
@@ -4236,7 +4236,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
RegattaLeaderboard regattaLeaderboard = (RegattaLeaderboard) leaderboard;
|
||||
Regatta regatta = regattaLeaderboard.getRegatta();
|
||||
BoatClass boatClass = regatta.getBoatClass();
|
||||
double buyZoneRadius = RegattaUtil.getCalculatedRegattaBuoyZoneRadius(regatta, boatClass);
|
||||
double buyZoneRadius = RegattaUtil.getCalculatedRegattaBuoyZoneRadiusInMeters(regatta, boatClass);
|
||||
for (Series series : regatta.getSeries()) {
|
||||
Map<String, List<RegattaOverviewEntryDTO>> entriesPerFleet = new HashMap<String, List<RegattaOverviewEntryDTO>>();
|
||||
for (RaceColumn raceColumn : series.getRaceColumns()) {
|
||||
@@ -4252,7 +4252,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
boatClass = trackedRace.getRace().getBoatClass();
|
||||
break;
|
||||
}
|
||||
double buyZoneRadius = RegattaUtil.getCalculatedRegattaBuoyZoneRadius(null, boatClass);
|
||||
double buyZoneRadius = RegattaUtil.getCalculatedRegattaBuoyZoneRadiusInMeters(null, boatClass);
|
||||
Map<String, List<RegattaOverviewEntryDTO>> entriesPerFleet = new HashMap<String, List<RegattaOverviewEntryDTO>>();
|
||||
for (RaceColumn raceColumn : leaderboard.getRaceColumns()) {
|
||||
getRegattaOverviewEntries(showOnlyRacesOfSameDay, dayToCheck, usedCourseArea,
|
||||
|
||||
+6
-4
@@ -5,6 +5,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.RegattaIdentifier;
|
||||
@@ -35,7 +36,7 @@ public class RegattaDTO extends NamedDTO {
|
||||
public boolean useStartTimeInference = true;
|
||||
public boolean controlTrackingFromStartAndFinishTimes = false;
|
||||
public RankingMetrics rankingMetricType;
|
||||
public double hullLengthRadiusFactor;
|
||||
public Double hullLengthRadiusFactor;
|
||||
|
||||
public RegattaDTO() {}
|
||||
|
||||
@@ -124,9 +125,10 @@ public class RegattaDTO extends NamedDTO {
|
||||
return false;
|
||||
}
|
||||
|
||||
public double getCalculatedBuoyZoneRadius() {
|
||||
double boatHullLength = boatClass == null ? 0.0 : boatClass.getHullLengthInMeters();
|
||||
return boatHullLength == 0.0 ? RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS : (boatHullLength * hullLengthRadiusFactor);
|
||||
public double getCalculatedBuoyZoneRadiusInMeters() {
|
||||
Double boatHullLength = boatClass == null ? null : boatClass.getHullLengthInMeters();
|
||||
double hullLengthFactor = this.hullLengthRadiusFactor == null ? Regatta.DEFAULT_HULL_LENGHT_FACTOR : this.hullLengthRadiusFactor;
|
||||
return boatHullLength == null ? RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS_IN_METERS : (boatHullLength * hullLengthFactor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-5
@@ -434,18 +434,18 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
Boolean.toString(showNavigationPanel));
|
||||
linkParams.put("regattaName", raceIdentifier.getRegattaName());
|
||||
linkParams.put("leaderboardGroupName", leaderboardGroup.getName());
|
||||
linkParams.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS,
|
||||
String.valueOf(getRegattaBuoyZoneRadius(raceIdentifier.getRegattaName())));
|
||||
linkParams.put(RaceMapSettings.PARAM_BUOY_ZONE_RADIUS_IN_METERS,
|
||||
String.valueOf(getRegattaBuoyZoneRadiusInMeters(raceIdentifier.getRegattaName())));
|
||||
if (viewMode != null && !viewMode.isEmpty()) {
|
||||
linkParams.put("viewMode", viewMode);
|
||||
}
|
||||
return linkParams;
|
||||
}
|
||||
|
||||
private double getRegattaBuoyZoneRadius(String regattaName) {
|
||||
private double getRegattaBuoyZoneRadiusInMeters(String regattaName) {
|
||||
RegattaDTO regatta = regattasByName.get(regattaName);
|
||||
double buoyZoneRadius = regatta == null ? RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS
|
||||
: regatta.getCalculatedBuoyZoneRadius();
|
||||
double buoyZoneRadius = regatta == null ? RaceMapSettings.DEFAULT_BUOY_ZONE_RADIUS_IN_METERS
|
||||
: regatta.getCalculatedBuoyZoneRadiusInMeters();
|
||||
return buoyZoneRadius;
|
||||
}
|
||||
|
||||
|
||||
@@ -314,12 +314,12 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
|
||||
* @param controlTrackingFromStartAndFinishTimes TODO
|
||||
*/
|
||||
Regatta createRegatta(String regattaName, String boatClassName, TimePoint startDate, TimePoint endDate, Serializable id, Iterable<? extends Series> series,
|
||||
boolean persistent, ScoringScheme scoringScheme, Serializable defaultCourseAreaId, double hullLengthRadiusFactor,
|
||||
boolean persistent, ScoringScheme scoringScheme, Serializable defaultCourseAreaId, Double hullLengthRadiusFactor,
|
||||
boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes, RankingMetricConstructor rankingMetricConstructor);
|
||||
|
||||
Regatta updateRegatta(RegattaIdentifier regattaIdentifier, TimePoint startDate, TimePoint endDate,
|
||||
Serializable newDefaultCourseAreaId, RegattaConfiguration regattaConfiguration,
|
||||
Iterable<? extends Series> series, double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
Iterable<? extends Series> series, Double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean controlTrackingFromStartAndFinishTimes);
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -1238,7 +1238,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
@Override
|
||||
public Regatta createRegatta(String fullRegattaName, String boatClassName, TimePoint startDate, TimePoint endDate,
|
||||
Serializable id, Iterable<? extends Series> series, boolean persistent, ScoringScheme scoringScheme,
|
||||
Serializable defaultCourseAreaId, double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes,
|
||||
Serializable defaultCourseAreaId, Double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes,
|
||||
RankingMetricConstructor rankingMetricConstructor) {
|
||||
com.sap.sse.common.Util.Pair<Regatta, Boolean> regattaWithCreatedFlag = getOrCreateRegattaWithoutReplication(
|
||||
fullRegattaName, boatClassName, startDate, endDate, id, series, persistent, scoringScheme,
|
||||
@@ -2143,7 +2143,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
@Override
|
||||
public Regatta updateRegatta(RegattaIdentifier regattaIdentifier, TimePoint startDate, TimePoint endDate,
|
||||
Serializable newDefaultCourseAreaId, RegattaConfiguration newRegattaConfiguration,
|
||||
Iterable<? extends Series> series, double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes) {
|
||||
Iterable<? extends Series> series, Double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes) {
|
||||
// We're not doing any renaming of the regatta itself, therefore we don't have to sync on the maps.
|
||||
Regatta regatta = getRegatta(regattaIdentifier);
|
||||
CourseArea newCourseArea = getCourseArea(newDefaultCourseAreaId);
|
||||
|
||||
+2
-2
@@ -29,14 +29,14 @@ public class AddSpecificRegatta extends AbstractAddRegattaOperation {
|
||||
private final boolean persistent;
|
||||
private final ScoringScheme scoringScheme;
|
||||
private final Serializable defaultCourseAreaId;
|
||||
private final double hullLengthRadiusFactor;
|
||||
private final Double hullLengthRadiusFactor;
|
||||
private final boolean useStartTimeInference;
|
||||
private final boolean controlTrackingFromStartAndFinishTimes;
|
||||
private final RankingMetrics rankingMetricType;
|
||||
|
||||
public AddSpecificRegatta(String regattaName, String boatClassName, TimePoint startDate, TimePoint endDate, Serializable id,
|
||||
RegattaCreationParametersDTO seriesNamesWithFleetNamesAndFleetOrderingAndMedalAndDiscardingThresholds,
|
||||
boolean persistent, ScoringScheme scoringScheme, Serializable defaultCourseAreaId, double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean persistent, ScoringScheme scoringScheme, Serializable defaultCourseAreaId, Double hullLengthRadiusFactor, boolean useStartTimeInference,
|
||||
boolean controlTrackingFromStartAndFinishTimes, RankingMetrics rankingMetricType) {
|
||||
super(regattaName, boatClassName, startDate, endDate, id);
|
||||
this.seriesNamesWithFleetNamesAndFleetOrderingAndMedalAndStartsWithZeroScoreAndDiscardingThresholds = seriesNamesWithFleetNamesAndFleetOrderingAndMedalAndDiscardingThresholds;
|
||||
|
||||
+2
-2
@@ -15,14 +15,14 @@ public class UpdateSpecificRegatta extends AbstractRacingEventServiceOperation<R
|
||||
private final RegattaIdentifier regattaIdentifier;
|
||||
private final UUID newDefaultCourseAreaId;
|
||||
private final RegattaConfiguration newConfiguration;
|
||||
private final double hullLengthRadiusFactor;
|
||||
private final Double hullLengthRadiusFactor;
|
||||
private final boolean useStartTimeInference;
|
||||
private final boolean controlTrackingFromStartAndFinishTimes;
|
||||
private final TimePoint startDate;
|
||||
private final TimePoint endDate;
|
||||
|
||||
public UpdateSpecificRegatta(RegattaIdentifier regattaIdentifier, TimePoint startDate, TimePoint endDate, UUID newDefaultCourseAreaId,
|
||||
RegattaConfiguration newConfiguration, double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes) {
|
||||
RegattaConfiguration newConfiguration, Double hullLengthRadiusFactor, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes) {
|
||||
this.regattaIdentifier = regattaIdentifier;
|
||||
this.startDate = startDate;
|
||||
this.endDate = endDate;
|
||||
|
||||
Reference in new issue
Block a user