mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-26 23:46:36 +00:00
added rank for competitor chart detail
This commit is contained in:
+2
-2
@@ -10,8 +10,8 @@ import java.io.Serializable;
|
||||
*
|
||||
*/
|
||||
public enum DetailType implements Serializable {
|
||||
DISTANCE_TRAVELED(0), AVERAGE_SPEED_OVER_GROUND_IN_KNOTS(2), RANK_GAIN(0), NUMBER_OF_MANEUVERS(0), CURRENT_SPEED_OVER_GROUND_IN_KNOTS(2),
|
||||
ESTIMATED_TIME_TO_NEXT_WAYPOINT_IN_SECONDS(1), VELOCITY_MADE_GOOD_IN_KNOTS(2), GAP_TO_LEADER_IN_SECONDS(0),
|
||||
DISTANCE_TRAVELED(0), AVERAGE_SPEED_OVER_GROUND_IN_KNOTS(2), RACE_RANK(0), RANK_GAIN(0), NUMBER_OF_MANEUVERS(0),
|
||||
CURRENT_SPEED_OVER_GROUND_IN_KNOTS(2), ESTIMATED_TIME_TO_NEXT_WAYPOINT_IN_SECONDS(1), VELOCITY_MADE_GOOD_IN_KNOTS(2), GAP_TO_LEADER_IN_SECONDS(0),
|
||||
WINDWARD_DISTANCE_TO_GO_IN_METERS(0), RACE_DISTANCE_TRAVELED(0), RACE_AVERAGE_SPEED_OVER_GROUND_IN_KNOTS(2), RACE_GAP_TO_LEADER_IN_SECONDS(0),
|
||||
RACE_DISTANCE_TO_LEADER_IN_METERS(0),
|
||||
WINDWARD_DISTANCE_TO_OVERALL_LEADER(0), HEAD_UP(0), BEAR_AWAY(0), TACK(0), JIBE(0), PENALTY_CIRCLE(0), MARK_PASSING(0), CURRENT_LEG(0),
|
||||
|
||||
+2
@@ -11,6 +11,8 @@ public class DetailTypeFormatter {
|
||||
return stringMessages.averageSpeedInKnots();
|
||||
case RANK_GAIN:
|
||||
return stringMessages.rankGain();
|
||||
case RACE_RANK:
|
||||
return stringMessages.rank();
|
||||
case NUMBER_OF_MANEUVERS:
|
||||
return stringMessages.numberOfManeuvers();
|
||||
case CURRENT_SPEED_OVER_GROUND_IN_KNOTS:
|
||||
|
||||
+15
-15
@@ -73,27 +73,27 @@ import com.sap.sailing.gwt.ui.shared.panels.SimpleBusyIndicator;
|
||||
*/
|
||||
public abstract class AbstractChartPanel<SettingsType extends ChartSettings> extends SimpleChartPanel
|
||||
implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeListener, RequiresResize {
|
||||
protected static final int LINE_WIDTH = 1;
|
||||
protected MultiCompetitorRaceDataDTO chartData;
|
||||
protected final SailingServiceAsync sailingService;
|
||||
protected final AsyncActionsExecutor asyncActionsExecutor;
|
||||
protected final ErrorReporter errorReporter;
|
||||
protected Chart chart;
|
||||
private static final int LINE_WIDTH = 1;
|
||||
private MultiCompetitorRaceDataDTO chartData;
|
||||
private final SailingServiceAsync sailingService;
|
||||
private final AsyncActionsExecutor asyncActionsExecutor;
|
||||
private final ErrorReporter errorReporter;
|
||||
private Chart chart;
|
||||
private boolean compactChart;
|
||||
protected final AbsolutePanel busyIndicatorPanel;
|
||||
protected final Label noCompetitorsSelectedLabel;
|
||||
protected final Map<CompetitorDTO, Series> dataSeriesByCompetitor;
|
||||
protected final Map<CompetitorDTO, Series> markPassingSeriesByCompetitor;
|
||||
private final AbsolutePanel busyIndicatorPanel;
|
||||
private final Label noCompetitorsSelectedLabel;
|
||||
private final Map<CompetitorDTO, Series> dataSeriesByCompetitor;
|
||||
private final Map<CompetitorDTO, Series> markPassingSeriesByCompetitor;
|
||||
private Series timeLineSeries;
|
||||
private boolean timeLineNeedsUpdate = true;
|
||||
private final boolean allowTimeAdjust;
|
||||
private boolean ignoreTimeAdjustOnce;
|
||||
protected final RaceSelectionProvider raceSelectionProvider;
|
||||
protected long stepSize = 5000;
|
||||
private final RaceSelectionProvider raceSelectionProvider;
|
||||
private long stepSize = 5000;
|
||||
protected final StringMessages stringMessages;
|
||||
protected final DateTimeFormat dateFormat = DateTimeFormat.getFormat("HH:mm:ss");
|
||||
protected DetailType dataToShow;
|
||||
protected final CompetitorSelectionProvider competitorSelectionProvider;
|
||||
private final DateTimeFormat dateFormat = DateTimeFormat.getFormat("HH:mm:ss");
|
||||
private DetailType dataToShow;
|
||||
private final CompetitorSelectionProvider competitorSelectionProvider;
|
||||
|
||||
public AbstractChartPanel(SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, RaceSelectionProvider raceSelectionProvider,
|
||||
|
||||
+4
-3
@@ -24,9 +24,10 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
||||
*
|
||||
*/
|
||||
public class MultiChartPanel extends AbstractChartPanel<MultiChartSettings> implements Component<MultiChartSettings> {
|
||||
public MultiChartPanel(SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor, CompetitorSelectionProvider competitorSelectionProvider,
|
||||
RaceSelectionProvider raceSelectionProvider, Timer timer, final StringMessages stringMessages,
|
||||
ErrorReporter errorReporter, boolean compactChart, boolean allowTimeAdjust) {
|
||||
public MultiChartPanel(SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, RaceSelectionProvider raceSelectionProvider,
|
||||
Timer timer, final StringMessages stringMessages, ErrorReporter errorReporter, boolean compactChart,
|
||||
boolean allowTimeAdjust) {
|
||||
super(sailingService, asyncActionsExecutor, competitorSelectionProvider, raceSelectionProvider, timer, stringMessages, errorReporter,
|
||||
/*show initially*/ DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, compactChart, allowTimeAdjust);
|
||||
}
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@ public class MultiChartSettingsComponent extends AbstractChartSettingsComponent<
|
||||
dataSelection = dialog.createListBox(/* isMultiSelect */ false);
|
||||
int i=0;
|
||||
for (DetailType detailType : new DetailType[] { DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, DetailType.DISTANCE_TRAVELED,
|
||||
DetailType.VELOCITY_MADE_GOOD_IN_KNOTS, DetailType.GAP_TO_LEADER_IN_SECONDS, DetailType.CURRENT_SPEED_OVER_GROUND_IN_KNOTS }) {
|
||||
DetailType.VELOCITY_MADE_GOOD_IN_KNOTS, DetailType.GAP_TO_LEADER_IN_SECONDS, DetailType.CURRENT_SPEED_OVER_GROUND_IN_KNOTS,
|
||||
DetailType.RACE_RANK }) {
|
||||
dataSelection.addItem(DetailTypeFormatter.format(detailType, getStringMessages()), detailType.toString());
|
||||
if (detailType == initialDataToShow) {
|
||||
dataSelection.setSelectedIndex(i);
|
||||
|
||||
+3
@@ -1564,6 +1564,9 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
Distance distanceToLeader = trackedLeg.getWindwardDistanceToOverallLeader(timePoint);
|
||||
result = (distanceToLeader == null) ? null : distanceToLeader.getMeters();
|
||||
break;
|
||||
case RACE_RANK:
|
||||
result = (double) trackedLeg.getRank(timePoint);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user