Merge branch 'master' into ubilabs--rcapp--develop

This commit is contained in:
Peter Siegmund committed 2015-03-25 14:36:07 +01:00
commit a31da6556f
9 files changed
+129 -121

No files matched your search

@@ -4,8 +4,6 @@ import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Style.Visibility;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Image;
@@ -157,7 +157,8 @@ public class IgtimiWindReceiver implements BulkFixReceiver {
notifyListeners(wind, aws.getSensor().getDeviceSerialNumber());
} else {
if (!loggedWindFixGenerationProblem) {
logger.info("Not enough information to build a Wind fix out of data provided. AWS received but most probably HDG or HDGM not received (yet) - check your compass.");
logger.info("Not enough information to build a Wind fix out of data provided by sensor "+aws.getSensor()+
". AWS received but most probably HDG or HDGM not received (yet) - check your compass.");
loggedWindFixGenerationProblem = true;
}
}
@@ -2,8 +2,10 @@ package com.sap.sailing.gwt.ui.adminconsole;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -29,8 +31,11 @@ import com.sap.sailing.domain.common.RegattaNameAndRaceName;
import com.sap.sailing.domain.common.dto.FleetDTO;
import com.sap.sailing.domain.common.dto.NamedDTO;
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
import com.sap.sailing.gwt.ui.adminconsole.RaceColumnInLeaderboardDialog.RaceColumnDescriptor;
import com.sap.sailing.gwt.ui.client.LeaderboardsDisplayer;
import com.sap.sailing.gwt.ui.client.LeaderboardsRefresher;
import com.sap.sailing.gwt.ui.client.ParallelExecutionCallback;
import com.sap.sailing.gwt.ui.client.ParallelExecutionHolder;
import com.sap.sailing.gwt.ui.client.RaceSelectionChangeListener;
import com.sap.sailing.gwt.ui.client.RaceSelectionModel;
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
@@ -39,11 +44,13 @@ import com.sap.sailing.gwt.ui.client.RegattasDisplayer;
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.SelectionCheckboxColumn;
import com.sap.sailing.gwt.ui.shared.RaceLogDTO;
import com.sap.sailing.gwt.ui.shared.RegattaDTO;
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
import com.sap.sse.common.Util;
import com.sap.sse.gwt.client.ErrorReporter;
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
public abstract class AbstractLeaderboardConfigPanel extends FormPanel implements SelectedLeaderboardProvider,
@@ -519,4 +526,97 @@ public abstract class AbstractLeaderboardConfigPanel extends FormPanel implement
protected LeaderboardsRefresher getLeaderboardsRefresher() {
return leaderboardsRefresher;
}
protected void editRaceColumnOfLeaderboard(final RaceColumnDTOAndFleetDTOWithNameBasedEquality raceColumnWithFleet) {
final String selectedLeaderboardName = getSelectedLeaderboardName();
final boolean oldIsMedalRace = raceColumnWithFleet.getA().isMedalRace();
final String oldRaceColumnName = raceColumnWithFleet.getA().getRaceColumnName();
final Double oldExplicitFactor = raceColumnWithFleet.getA().getExplicitFactor();
// use a set to avoid duplicates in the case of regatta leaderboards with multiple fleets per column
Set<RaceColumnDTO> existingRacesWithoutThisRace = new HashSet<RaceColumnDTO>();
for (RaceColumnDTOAndFleetDTOWithNameBasedEquality pair : raceColumnTable.getDataProvider().getList()) {
existingRacesWithoutThisRace.add(pair.getA());
}
existingRacesWithoutThisRace.remove(raceColumnWithFleet.getA());
final RaceColumnInLeaderboardDialog raceDialog = new RaceColumnInLeaderboardDialog(existingRacesWithoutThisRace,
raceColumnWithFleet.getA(), getSelectedLeaderboard().type.isRegattaLeaderboard(), stringMessages, new DialogCallback<RaceColumnDescriptor>() {
@Override
public void cancel() {
}
@Override
public void ok(final RaceColumnDescriptor result) {
boolean rename = !oldRaceColumnName.equals(result.getName());
boolean updateIsMedalRace = oldIsMedalRace != result.isMedalRace();
boolean updateFactor = oldExplicitFactor != result.getExplicitFactor();
List<ParallelExecutionCallback<Void>> callbacks = new ArrayList<ParallelExecutionCallback<Void>>();
final ParallelExecutionCallback<Void> renameLeaderboardColumnCallback = new ParallelExecutionCallback<Void>();
if (rename) {
callbacks.add(renameLeaderboardColumnCallback);
}
final ParallelExecutionCallback<Void> updateIsMedalRaceCallback = new ParallelExecutionCallback<Void>();
if (updateIsMedalRace) {
callbacks.add(updateIsMedalRaceCallback);
}
final ParallelExecutionCallback<Void> updateLeaderboardColumnFactorCallback = new ParallelExecutionCallback<Void>();
if (updateFactor) {
callbacks.add(updateLeaderboardColumnFactorCallback);
}
new ParallelExecutionHolder(callbacks.toArray(new ParallelExecutionCallback<?>[0])) {
@Override
public void handleSuccess() {
loadAndRefreshLeaderboard(selectedLeaderboardName, result.getName());
}
@Override
public void handleFailure(Throwable t) {
errorReporter.reportError("Error trying to update data of race column "
+ oldRaceColumnName + " in leaderboard " + selectedLeaderboardName + ": "
+ t.getMessage());
}
};
if (rename) {
sailingService.renameLeaderboardColumn(selectedLeaderboardName, oldRaceColumnName,
result.getName(), renameLeaderboardColumnCallback);
}
if (updateIsMedalRace) {
sailingService.updateIsMedalRace(selectedLeaderboardName, result.getName(),
result.isMedalRace(), updateIsMedalRaceCallback);
}
if (updateFactor) {
sailingService.updateLeaderboardColumnFactor(selectedLeaderboardName, result.getName(),
result.getExplicitFactor(), updateLeaderboardColumnFactorCallback);
}
}
});
raceDialog.show();
}
protected void showRaceLog(final RaceColumnDTO raceColumnDTO, final FleetDTO fleetDTO) {
final String selectedLeaderboardName = getSelectedLeaderboardName();
sailingService.getRaceLog(selectedLeaderboardName, raceColumnDTO, fleetDTO,
new MarkedAsyncCallback<RaceLogDTO>(
new AsyncCallback<RaceLogDTO>() {
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError(caught.getMessage(), true);
}
@Override
public void onSuccess(RaceLogDTO result) {
openRaceLogDialog(result);
}
}));
}
private void openRaceLogDialog(RaceLogDTO raceLogDTO) {
RaceLogDialog dialog = new RaceLogDialog(raceLogDTO, stringMessages, new DialogCallback<RaceLogDTO>() {
@Override
public void cancel() {
}
@Override
public void ok(RaceLogDTO result) {
}
});
dialog.show();
}
}
@@ -37,12 +37,9 @@ import com.sap.sailing.domain.common.dto.CompetitorDTO;
import com.sap.sailing.domain.common.dto.FleetDTO;
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
import com.sap.sailing.gwt.ui.adminconsole.DisablableCheckboxCell.IsEnabled;
import com.sap.sailing.gwt.ui.adminconsole.RaceColumnInLeaderboardDialog.RaceColumnDescriptor;
import com.sap.sailing.gwt.ui.client.EntryPointLinkFactory;
import com.sap.sailing.gwt.ui.client.LeaderboardsDisplayer;
import com.sap.sailing.gwt.ui.client.LeaderboardsRefresher;
import com.sap.sailing.gwt.ui.client.ParallelExecutionCallback;
import com.sap.sailing.gwt.ui.client.ParallelExecutionHolder;
import com.sap.sailing.gwt.ui.client.RaceSelectionChangeListener;
import com.sap.sailing.gwt.ui.client.RegattaRefresher;
import com.sap.sailing.gwt.ui.client.RegattasDisplayer;
@@ -52,7 +49,6 @@ import com.sap.sailing.gwt.ui.client.shared.controls.SelectionCheckboxColumn;
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardEntryPoint;
import com.sap.sailing.gwt.ui.leaderboard.ScoringSchemeTypeFormatter;
import com.sap.sailing.gwt.ui.shared.EventDTO;
import com.sap.sailing.gwt.ui.shared.RaceLogDTO;
import com.sap.sailing.gwt.ui.shared.RaceLogSetStartTimeAndProcedureDTO;
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
import com.sap.sse.common.Util;
@@ -482,35 +478,6 @@ TrackedRaceChangedListener, LeaderboardsDisplayer {
}).show();
}
private void showRaceLog(final RaceColumnDTO raceColumnDTO, final FleetDTO fleetDTO) {
final String selectedLeaderboardName = getSelectedLeaderboardName();
sailingService.getRaceLog(selectedLeaderboardName, raceColumnDTO, fleetDTO,
new MarkedAsyncCallback<RaceLogDTO>(
new AsyncCallback<RaceLogDTO>() {
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError(caught.getMessage(), true);
}
@Override
public void onSuccess(RaceLogDTO result) {
openRaceLogDialog(result);
}
}));
}
private void openRaceLogDialog(RaceLogDTO raceLogDTO) {
RaceLogDialog dialog = new RaceLogDialog(raceLogDTO, stringMessages, new DialogCallback<RaceLogDTO>() {
@Override
public void cancel() {
}
@Override
public void ok(RaceLogDTO result) {
}
});
dialog.show();
}
private void removeRaceColumn(final RaceColumnDTO raceColumnDTO) {
final String selectedLeaderboardName = getSelectedLeaderboardName();
final String raceColumnString = raceColumnDTO.getRaceColumnName();
@@ -592,70 +559,6 @@ TrackedRaceChangedListener, LeaderboardsDisplayer {
}
}
private void editRaceColumnOfLeaderboard(final RaceColumnDTOAndFleetDTOWithNameBasedEquality raceColumnWithFleet) {
final String selectedLeaderboardName = getSelectedLeaderboardName();
final boolean oldIsMedalRace = raceColumnWithFleet.getA().isMedalRace();
final String oldRaceColumnName = raceColumnWithFleet.getA().getRaceColumnName();
final Double oldExplicitFactor = raceColumnWithFleet.getA().getExplicitFactor();
// use a set to avoid duplicates in the case of regatta leaderboards with multiple fleets per column
Set<RaceColumnDTO> existingRacesWithoutThisRace = new HashSet<RaceColumnDTO>();
for (RaceColumnDTOAndFleetDTOWithNameBasedEquality pair : raceColumnTable.getDataProvider().getList()) {
existingRacesWithoutThisRace.add(pair.getA());
}
existingRacesWithoutThisRace.remove(raceColumnWithFleet.getA());
final RaceColumnInLeaderboardDialog raceDialog = new RaceColumnInLeaderboardDialog(existingRacesWithoutThisRace,
raceColumnWithFleet.getA(), getSelectedLeaderboard().type.isRegattaLeaderboard(), stringMessages, new DialogCallback<RaceColumnDescriptor>() {
@Override
public void cancel() {
}
@Override
public void ok(final RaceColumnDescriptor result) {
boolean rename = !oldRaceColumnName.equals(result.getName());
boolean updateIsMedalRace = oldIsMedalRace != result.isMedalRace();
boolean updateFactor = oldExplicitFactor != result.getExplicitFactor();
List<ParallelExecutionCallback<Void>> callbacks = new ArrayList<ParallelExecutionCallback<Void>>();
final ParallelExecutionCallback<Void> renameLeaderboardColumnCallback = new ParallelExecutionCallback<Void>();
if (rename) {
callbacks.add(renameLeaderboardColumnCallback);
}
final ParallelExecutionCallback<Void> updateIsMedalRaceCallback = new ParallelExecutionCallback<Void>();
if (updateIsMedalRace) {
callbacks.add(updateIsMedalRaceCallback);
}
final ParallelExecutionCallback<Void> updateLeaderboardColumnFactorCallback = new ParallelExecutionCallback<Void>();
if (updateFactor) {
callbacks.add(updateLeaderboardColumnFactorCallback);
}
new ParallelExecutionHolder(callbacks.toArray(new ParallelExecutionCallback<?>[0])) {
@Override
public void handleSuccess() {
loadAndRefreshLeaderboard(selectedLeaderboardName, result.getName());
}
@Override
public void handleFailure(Throwable t) {
errorReporter.reportError("Error trying to update data of race column "
+ oldRaceColumnName + " in leaderboard " + selectedLeaderboardName + ": "
+ t.getMessage());
}
};
if (rename) {
sailingService.renameLeaderboardColumn(selectedLeaderboardName, oldRaceColumnName,
result.getName(), renameLeaderboardColumnCallback);
}
if (updateIsMedalRace) {
sailingService.updateIsMedalRace(selectedLeaderboardName, result.getName(),
result.isMedalRace(), updateIsMedalRaceCallback);
}
if (updateFactor) {
sailingService.updateLeaderboardColumnFactor(selectedLeaderboardName, result.getName(),
result.getExplicitFactor(), updateLeaderboardColumnFactorCallback);
}
}
});
raceDialog.show();
}
private void setIsMedalRace(String leaderboardName, final RaceColumnDTO raceInLeaderboard,
final boolean isMedalRace) {
sailingService.updateIsMedalRace(leaderboardName, raceInLeaderboard.getRaceColumnName(), isMedalRace,
@@ -6,7 +6,6 @@ import java.util.Comparator;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.cellview.client.TextColumn;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.view.client.SelectionModel;
import com.sap.sailing.gwt.ui.adminconsole.ColorColumn.ColorRetriever;
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
@@ -101,18 +100,4 @@ public class MarkTableWrapper<S extends SelectionModel<MarkDTO>> extends TableWr
}
});
}
public void refresh(String leaderboardName, String raceColumnName, String fleetName) {
sailingService.getMarksInRaceLog(leaderboardName, raceColumnName, fleetName, new AsyncCallback<Iterable<MarkDTO>>() {
@Override
public void onSuccess(Iterable<MarkDTO> result) {
refresh(result);
}
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError("Could not load marks: " + caught.getMessage());
}
});
}
}
@@ -270,8 +270,16 @@ public class RaceLogTrackingEventManagementPanel extends AbstractLeaderboardConf
@Override
public void cancel() {}
}).show();
} else if (RaceLogTrackingEventManagementRaceImagesBarCell.ACTION_SET_START_TIME.equals(value)) {
} else if (LeaderboardRaceConfigImagesBarCell.ACTION_EDIT.equals(value)) {
editRaceColumnOfLeaderboard(object);
} else if (LeaderboardRaceConfigImagesBarCell.ACTION_UNLINK.equals(value)) {
unlinkRaceColumnFromTrackedRace(object.getA().getRaceColumnName(), object.getB());
} else if (LeaderboardRaceConfigImagesBarCell.ACTION_REFRESH_RACELOG.equals(value)) {
refreshRaceLog(object.getA(), object.getB(), true);
} else if (RaceLogTrackingEventManagementRaceImagesBarCell.ACTION_SET_STARTTIME.equals(value)) {
setStartTime(getSelectedRaceColumnWithFleet().getA(), getSelectedRaceColumnWithFleet().getB());
} else if (LeaderboardRaceConfigImagesBarCell.ACTION_SHOW_RACELOG.equals(value)) {
showRaceLog(object.getA(), object.getB());
}
}
});
@@ -15,7 +15,11 @@ public class RaceLogTrackingEventManagementRaceImagesBarCell extends ImagesBarCe
public final static String ACTION_DEFINE_COURSE = "ACTION_DEFINE_COURSE";
public final static String ACTION_MAP_DEVICES = "ACTION_MAP_DEVICES";
public final static String ACTION_COPY = "ACTION_COPY";
public final static String ACTION_SET_START_TIME = "ACTION_SET_START_TIME";
public final static String ACTION_EDIT = "ACTION_EDIT";
public final static String ACTION_REFRESH_RACELOG = "ACTION_REFRESH_RACE_LOG";
public final static String ACTION_SET_STARTTIME = "ACTION_SET_STARTTIME";
public final static String ACTION_SHOW_RACELOG = "ACTION_SHOW_RACELOG";
private final StringMessages stringMessages;
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
@@ -36,10 +40,12 @@ public class RaceLogTrackingEventManagementRaceImagesBarCell extends ImagesBarCe
result.add(new ImageSpec(ACTION_COMPETITOR_REGISTRATIONS, stringMessages.competitorRegistrations(), makeImagePrototype(resources.competitorRegistrations())));
result.add(new ImageSpec(ACTION_DEFINE_COURSE, stringMessages.defineCourse(), makeImagePrototype(resources.defineCourse())));
result.add(new ImageSpec(ACTION_MAP_DEVICES, stringMessages.mapDevices(), makeImagePrototype(resources.mapDevices())));
result.add(new ImageSpec(ACTION_SET_START_TIME, stringMessages.setStartTime(), makeImagePrototype(resources.clockIcon())));
result.add(new ImageSpec(ACTION_COPY, stringMessages.copyCourseAndCompetitors(), makeImagePrototype(resources.copy())));
}
result.add(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())));
result.add(new ImageSpec(ACTION_REFRESH_RACELOG, stringMessages.refreshRaceLog(), makeImagePrototype(resources.reloadIcon())));
result.add(new ImageSpec(ACTION_SET_STARTTIME, stringMessages.setStartTime(), makeImagePrototype(resources.clockIcon())));
result.add(new ImageSpec(ACTION_SHOW_RACELOG, stringMessages.raceLog(), makeImagePrototype(resources.flagIcon())));
return result;
}
}
@@ -7,11 +7,18 @@
<h5 class="articleSubheadline">March 2015</h5>
<ul class="bulletList">
<li>Added competitor chart type for Course Over Ground (COG)
</li>
<li>Added leaderboard column and competitor chart entry for distances considering
gate starts. With gate starts, late starters sail a shorter distance in their first
leg. To still make distances comparable, a new metric has been introduced that for a gate
start adds the distance between the port side of the start line and the position where
the competitor started to the distance sailed in the first leg.
</li>
<li>The weights of the wind measurement units, the wind estimation and manual wind inputs by the
race committee are now used properly for the wind streamlet visualization. This fixes issues
with exaggerated weights for an estimated wind direction of very low confidence.
</li>
<li>The expand/collapse toggle button in the race viewer's time panel has correct arrows now.
</li>
</ul>
@@ -215,7 +215,7 @@ public class WindStatusServlet extends SailingServerHttpServlet implements Igtim
}
private class IgtimiMessageInfo {
Wind wind;
private Wind wind;
private String deviceSerialInfo;
public IgtimiMessageInfo(Wind wind, String deviceSerialInfo) {