mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 22:43:57 +00:00
Added javadoc to maneuver analysis code
This commit is contained in:
1 parent
dd564badcc
commit
aebda7dac6
21 files changed
+135
-7
No files matched your search
+5
@@ -2,6 +2,11 @@ package com.sap.sailing.datamining.shared;
|
||||
|
||||
import com.sap.sse.common.settings.SerializableSettings;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public abstract class ManeuverSettings extends SerializableSettings {
|
||||
|
||||
private static final long serialVersionUID = -393430331972342L;
|
||||
|
||||
+5
@@ -1,5 +1,10 @@
|
||||
package com.sap.sailing.datamining.shared;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSettingsImpl extends ManeuverSettings {
|
||||
|
||||
private static final long serialVersionUID = 69258712144L;
|
||||
|
||||
+5
@@ -2,6 +2,11 @@ package com.sap.sailing.datamining.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public interface ManeuverSpeedDetailsAggregation extends Serializable {
|
||||
|
||||
double[] getValuePerTWA();
|
||||
|
||||
+5
@@ -1,5 +1,10 @@
|
||||
package com.sap.sailing.datamining.shared;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsAggregationImpl implements ManeuverSpeedDetailsAggregation {
|
||||
private static final long serialVersionUID = 9177124509619315750L;
|
||||
private double[] valuePerTWA;
|
||||
|
||||
+5
@@ -3,6 +3,11 @@ package com.sap.sailing.datamining.shared;
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
import com.sap.sse.common.settings.SerializableSettings;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public abstract class ManeuverSpeedDetailsSettings extends SerializableSettings {
|
||||
|
||||
private static final long serialVersionUID = -39384430331972342L;
|
||||
|
||||
+5
@@ -2,6 +2,11 @@ package com.sap.sailing.datamining.shared;
|
||||
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsSettingsImpl extends ManeuverSpeedDetailsSettings {
|
||||
|
||||
private static final long serialVersionUID = 61329258712144L;
|
||||
|
||||
+6
@@ -5,6 +5,12 @@ import com.sap.sse.datamining.annotations.Connector;
|
||||
import com.sap.sse.datamining.annotations.Dimension;
|
||||
import com.sap.sse.datamining.annotations.Statistic;
|
||||
|
||||
/**
|
||||
* Contains statistics for speed trend analysis within maneuvers.
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public interface HasManeuverSpeedDetailsContext {
|
||||
|
||||
// FIXME due to UI bug there is at least one dimension per fact required
|
||||
|
||||
+5
@@ -3,6 +3,11 @@ package com.sap.sailing.datamining.data;
|
||||
import com.sap.sailing.datamining.shared.ManeuverSpeedDetailsSettings;
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public interface ManeuverSpeedDetailsStatistic {
|
||||
|
||||
double[] getManeuverValuePerTWA();
|
||||
|
||||
+5
@@ -23,6 +23,11 @@ import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
import com.sap.sse.datamining.components.Processor;
|
||||
import com.sap.sse.datamining.impl.components.AbstractRetrievalProcessor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsRetrievalProcessor
|
||||
extends AbstractRetrievalProcessor<HasManeuverContext, HasManeuverSpeedDetailsContext> {
|
||||
|
||||
|
||||
+5
@@ -4,6 +4,11 @@ import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsUtils {
|
||||
|
||||
public static NauticalSide determineNauticalSideByClosestAngleDistance(double firstBearingAngle,
|
||||
|
||||
+5
@@ -13,6 +13,11 @@ import com.sap.sailing.datamining.shared.ManeuverSpeedDetailsSettings;
|
||||
import com.sap.sse.datamining.impl.components.GroupedDataEntry;
|
||||
import com.sap.sse.datamining.shared.GroupKey;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsStatisticAggregationProcessorHelper {
|
||||
|
||||
private final Map<GroupKey, ManeuverSpeedDetailsAggregationCreatorHelper> resultMap = new HashMap<>();
|
||||
|
||||
+5
@@ -15,6 +15,11 @@ import com.sap.sse.datamining.impl.components.SimpleAggregationProcessorDefiniti
|
||||
import com.sap.sse.datamining.impl.components.aggregators.AbstractParallelGroupedDataAggregationProcessor;
|
||||
import com.sap.sse.datamining.shared.GroupKey;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsStatisticAvgAggregationProcessor extends
|
||||
AbstractParallelGroupedDataAggregationProcessor<ManeuverSpeedDetailsStatistic, ManeuverSpeedDetailsAggregation> {
|
||||
|
||||
|
||||
+5
@@ -17,6 +17,11 @@ import com.sap.sse.datamining.impl.components.SimpleAggregationProcessorDefiniti
|
||||
import com.sap.sse.datamining.impl.components.aggregators.AbstractParallelGroupedDataStoringAggregationProcessor;
|
||||
import com.sap.sse.datamining.shared.GroupKey;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsStatisticMedianAggregationProcessor extends
|
||||
AbstractParallelGroupedDataStoringAggregationProcessor<ManeuverSpeedDetailsStatistic, ManeuverSpeedDetailsAggregation> {
|
||||
|
||||
|
||||
+5
@@ -4,6 +4,11 @@ import com.sap.sailing.datamining.data.ManeuverSpeedDetailsStatistic;
|
||||
import com.sap.sailing.datamining.shared.ManeuverSpeedDetailsSettings;
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsStatisticImpl implements ManeuverSpeedDetailsStatistic {
|
||||
|
||||
private double[] maneuverValuePerTWA;
|
||||
|
||||
+5
@@ -9,6 +9,11 @@ import com.sap.sailing.datamining.impl.components.ManeuverSpeedDetailsUtils;
|
||||
import com.sap.sailing.datamining.shared.ManeuverSpeedDetailsSettings;
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsWithContext implements HasManeuverSpeedDetailsContext {
|
||||
|
||||
private final HasManeuverContext maneuverContext;
|
||||
|
||||
@@ -11,16 +11,26 @@ import com.sap.sailing.domain.tracking.GPSFixTrack;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
/**
|
||||
* Util class which is used for bearing calculation for positions within a GPS track of a competitor.
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class TrackedRaceUtil {
|
||||
/**
|
||||
* Gets a list of bearings between the provided time range (inclusive the boundaries). The bearings are retrieved by
|
||||
* means of track.getEstimatedSpeed(timePoint) with the provided frequency between each bearing step.
|
||||
* means of {@link GPSFixTrack#getEstimatedSpeed(TimePoint)} with the provided frequency between each bearing step.
|
||||
*
|
||||
* @param track
|
||||
* The GPS track of competitor to use for bearings calculation
|
||||
* @param fromTimePoint
|
||||
* The from time point (inclusive) for resulting bearing steps
|
||||
* @param tillTimePoint
|
||||
* The till time point (inclusive) for resulting bearing steps
|
||||
* @param frequency
|
||||
* @return
|
||||
* Time distance between bearing time point
|
||||
* @return The list of bearings between the provided time range
|
||||
*/
|
||||
public static List<BearingStep> getBearingSteps(GPSFixTrack<Competitor, GPSFixMoving> track,
|
||||
TimePoint fromTimePoint, TimePoint tillTimePoint, Duration frequency) {
|
||||
@@ -59,6 +69,13 @@ public class TrackedRaceUtil {
|
||||
return relevantBearings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a bearing step within a certain part of a GPS track. It consists of time point, speed with bearing,
|
||||
* and course change in degrees.
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public static class BearingStep {
|
||||
private final TimePoint timePoint;
|
||||
private final SpeedWithBearing speedWithBearing;
|
||||
|
||||
+18
-5
@@ -8,20 +8,33 @@ import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* Provides a service for export of chart data into CSV format.
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ChartToCsvExporter {
|
||||
|
||||
|
||||
private final StringMessages stringMessages;
|
||||
|
||||
public ChartToCsvExporter(StringMessages stringMessages) {
|
||||
this.stringMessages = stringMessages;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts the data of the chart into CSV format and copies that into clipboard. Finally, window alert gets shown
|
||||
* to the user with information that the CSV has been put into clipboard.
|
||||
*
|
||||
* @param chartToExport
|
||||
* Chart with data to export
|
||||
*/
|
||||
public void exportChartAsCsvToClipboard(Chart chartToExport) {
|
||||
String csvContentExport = createCsvExportContentForStatisticsCurve(chartToExport);
|
||||
copyTextToClipboard(csvContentExport);
|
||||
Window.alert(stringMessages.csvCopiedToClipboard());
|
||||
}
|
||||
|
||||
|
||||
private static String createCsvExportContentForStatisticsCurve(Chart chartToExport) {
|
||||
if (chartToExport != null && chartToExport.getSeries().length > 0) {
|
||||
StringBuilder csvStr = new StringBuilder("Series name");
|
||||
@@ -81,9 +94,9 @@ public class ChartToCsvExporter {
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
try {
|
||||
var successful = document.execCommand('copy');
|
||||
var successful = document.execCommand('copy');
|
||||
} catch (err) {
|
||||
console.log('Unable to copy');
|
||||
console.log('Unable to copy');
|
||||
}
|
||||
document.body.removeChild(textArea);
|
||||
}-*/;
|
||||
|
||||
+6
@@ -14,6 +14,12 @@ import org.moxieapps.gwt.highcharts.client.plotOptions.Marker;
|
||||
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* Contains factory methods for various data mining charts.
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ChartFactory extends Chart {
|
||||
|
||||
public static Chart createPolarChart() {
|
||||
|
||||
+5
@@ -13,6 +13,11 @@ import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.Validator;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSettingsDialogComponent implements SettingsDialogComponent<ManeuverSettings> {
|
||||
|
||||
private ManeuverSettings settings;
|
||||
|
||||
+6
@@ -10,6 +10,12 @@ import com.google.gwt.user.client.ui.IntegerBox;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* A control panel for maneuver speed details charts.
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsChartConfigurationPanel extends HorizontalPanel {
|
||||
|
||||
private IntegerBox minCountDataIntegerBox = new IntegerBox();
|
||||
|
||||
+5
@@ -15,6 +15,11 @@ import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.Validator;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
public class ManeuverSpeedDetailsSettingsDialogComponent
|
||||
implements SettingsDialogComponent<ManeuverSpeedDetailsSettings> {
|
||||
|
||||
|
||||
Reference in new issue
Block a user