mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-06 12:23:55 +00:00
Implemented a mechanism to sort statistics and dimensions
This commit is contained in:
1 parent
3550fd168f
commit
8bba0008aa
22 files changed
+116
-50
No files matched your search
+13
-13
@@ -25,11 +25,11 @@ public class DeprecatedEnumsToFunctionDTOConverter {
|
||||
switch (statisticType) {
|
||||
case Distance:
|
||||
functionDTO = new FunctionDTOImpl("getDistanceTraveled", HasTrackedLegOfCompetitorContext.class.getSimpleName(), "Double",
|
||||
new ArrayList<String>(), "Distance", false);
|
||||
new ArrayList<String>(), "Distance", false, 0);
|
||||
break;
|
||||
case Speed:
|
||||
functionDTO = new FunctionDTOImpl("getGPSFix -> getSpeed -> getKnots", HasGPSFixContext.class.getSimpleName(),
|
||||
"double", new ArrayList<String>(), "Speed", false);
|
||||
"double", new ArrayList<String>(), "Speed", false, 0);
|
||||
break;
|
||||
}
|
||||
statisticTypeToFunctionDTOMap.put(statisticType, functionDTO);
|
||||
@@ -40,47 +40,47 @@ public class DeprecatedEnumsToFunctionDTOConverter {
|
||||
switch (dimensionIdentifier) {
|
||||
case BoatClassName:
|
||||
functionDTO = new FunctionDTOImpl("getBoatClass -> getName", HasTrackedRaceContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Boat Class Name", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Boat Class Name", true, 0);
|
||||
break;
|
||||
case CompetitorName:
|
||||
functionDTO = new FunctionDTOImpl("getCompetitor -> getTeam -> getName", HasTrackedLegOfCompetitorContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Competitor Name", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Competitor Name", true, 0);
|
||||
break;
|
||||
case CourseAreaName:
|
||||
functionDTO = new FunctionDTOImpl("getCourseArea -> getName", HasTrackedRaceContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Course Area Name", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Course Area Name", true, 0);
|
||||
break;
|
||||
case FleetName:
|
||||
functionDTO = new FunctionDTOImpl("getFleet -> getName", HasTrackedRaceContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Fleet Name", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Fleet Name", true, 0);
|
||||
break;
|
||||
case LegNumber:
|
||||
functionDTO = new FunctionDTOImpl("getLegNumber", HasTrackedLegContext.class.getSimpleName(),
|
||||
"int", new ArrayList<String>(), "Leg Number", true);
|
||||
"int", new ArrayList<String>(), "Leg Number", true, 0);
|
||||
break;
|
||||
case LegType:
|
||||
functionDTO = new FunctionDTOImpl("getLegType", HasTrackedLegContext.class.getSimpleName(),
|
||||
LegType.class.getSimpleName(), new ArrayList<String>(), "Leg Type", true);
|
||||
LegType.class.getSimpleName(), new ArrayList<String>(), "Leg Type", true, 0);
|
||||
break;
|
||||
case Nationality:
|
||||
functionDTO = new FunctionDTOImpl("getCompetitor -> getTeam -> getNationality -> getThreeLetterIOCAcronym", HasTrackedLegOfCompetitorContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Nationality", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Nationality", true, 0);
|
||||
break;
|
||||
case RaceName:
|
||||
functionDTO = new FunctionDTOImpl("getRace -> getName", HasTrackedRaceContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Race Name", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Race Name", true, 0);
|
||||
break;
|
||||
case RegattaName:
|
||||
functionDTO = new FunctionDTOImpl("getRegatta -> getName", HasTrackedRaceContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Regattay Name", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Regattay Name", true, 0);
|
||||
break;
|
||||
case SailID:
|
||||
functionDTO = new FunctionDTOImpl("getCompetitor -> getBoat -> getSailID", HasTrackedLegOfCompetitorContext.class.getSimpleName(),
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Sail ID", true);
|
||||
String.class.getSimpleName(), new ArrayList<String>(), "Sail ID", true, 0);
|
||||
break;
|
||||
case Year:
|
||||
functionDTO = new FunctionDTOImpl("getYear", HasTrackedRaceContext.class.getSimpleName(),
|
||||
"Integer", new ArrayList<String>(), "Year", true);
|
||||
"Integer", new ArrayList<String>(), "Year", true, 0);
|
||||
break;
|
||||
}
|
||||
if (functionDTO != null) {
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@ public interface HasTrackedLegContext extends HasTrackedRaceContext {
|
||||
|
||||
public TrackedLeg getTrackedLeg();
|
||||
|
||||
@Dimension(messageKey="LegType")
|
||||
@Dimension(messageKey="LegType", ordinal=5)
|
||||
public LegType getLegType();
|
||||
@Dimension(messageKey="LegNumber")
|
||||
@Dimension(messageKey="LegNumber", ordinal=6)
|
||||
public int getLegNumber();
|
||||
|
||||
}
|
||||
+1
-1
@@ -13,7 +13,7 @@ public interface HasTrackedLegOfCompetitorContext extends HasTrackedLegContext {
|
||||
@Connector(messageKey="Competitor")
|
||||
public Competitor getCompetitor();
|
||||
|
||||
@Statistic(messageKey="DistanceTraveled", resultUnit=Unit.Meters, resultDecimals=0)
|
||||
@Statistic(messageKey="DistanceTraveled", resultUnit=Unit.Meters, resultDecimals=0, ordinal=0)
|
||||
public Double getDistanceTraveled();
|
||||
|
||||
}
|
||||
+6
-6
@@ -13,22 +13,22 @@ public interface HasTrackedRaceContext {
|
||||
|
||||
public TrackedRace getTrackedRace();
|
||||
|
||||
@Connector(messageKey="Regatta")
|
||||
@Connector(messageKey="Regatta", ordinal=0)
|
||||
public Regatta getRegatta();
|
||||
|
||||
@Connector(messageKey="CourseArea")
|
||||
@Connector(messageKey="CourseArea", ordinal=2)
|
||||
public CourseArea getCourseArea();
|
||||
|
||||
@Connector(messageKey="BoatClass")
|
||||
@Connector(messageKey="BoatClass", ordinal=1)
|
||||
public BoatClass getBoatClass();
|
||||
|
||||
@Connector(messageKey="Fleet")
|
||||
@Connector(messageKey="Fleet", ordinal=3)
|
||||
public Fleet getFleet();
|
||||
|
||||
@Connector(messageKey="Race")
|
||||
@Connector(messageKey="Race", ordinal=4)
|
||||
public RaceDefinition getRace();
|
||||
|
||||
@Dimension(messageKey="Year")
|
||||
@Dimension(messageKey="Year", ordinal=10)
|
||||
public Integer getYear();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user