mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 06:17:27 +00:00
Implemented calculation of wind source count for finished races
This commit is contained in:
1 parent
65ffb79543
commit
e0e426acbd
4 files changed
+15
-7
No files matched your search
+1
-1
@@ -383,7 +383,7 @@ public class RaceListColumnFactory {
|
||||
return new DataCountColumn<T>(DataCountColumn.ICON_WIND) {
|
||||
@Override
|
||||
public Number getValue(T object) {
|
||||
return object.getWindFixesCount();
|
||||
return object.getWindSourcesCount();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class RaceListDataUtil {
|
||||
return hasNumberValues(data, new ValueProvider<T, Number>() {
|
||||
@Override
|
||||
public Number getValue(T object) {
|
||||
return object.getWindFixesCount();
|
||||
return object.getWindSourcesCount();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+8
@@ -304,12 +304,20 @@ public class RaceContext {
|
||||
fillRaceData(liveRaceDTO);
|
||||
liveRaceDTO.setDuration(getDurationOrNull());
|
||||
liveRaceDTO.setWinner(getWinnerOrNull());
|
||||
liveRaceDTO.setWindSourcesCount(getWindSourceCount());
|
||||
|
||||
return liveRaceDTO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private int getWindSourceCount() {
|
||||
if(trackedRace != null) {
|
||||
return trackedRace.getWindSources().size() - trackedRace.getWindSourcesToExclude().size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private SimpleCompetitorDTO getWinnerOrNull() {
|
||||
// TODO calculate winner from score correction
|
||||
if(trackedRace != null) {
|
||||
|
||||
+5
-5
@@ -7,7 +7,7 @@ public class RaceListRaceDTO extends RaceMetadataDTO {
|
||||
|
||||
private Duration duration;
|
||||
private SimpleCompetitorDTO winner;
|
||||
private int windFixesCount;
|
||||
private int windSourcesCount;
|
||||
private int videoCount;
|
||||
private int audioCount;
|
||||
|
||||
@@ -31,11 +31,11 @@ public class RaceListRaceDTO extends RaceMetadataDTO {
|
||||
public void setWinner(SimpleCompetitorDTO winner) {
|
||||
this.winner = winner;
|
||||
}
|
||||
public int getWindFixesCount() {
|
||||
return windFixesCount;
|
||||
public int getWindSourcesCount() {
|
||||
return windSourcesCount;
|
||||
}
|
||||
public void setWindFixesCount(int windFixesCount) {
|
||||
this.windFixesCount = windFixesCount;
|
||||
public void setWindSourcesCount(int windFixesCount) {
|
||||
this.windSourcesCount = windFixesCount;
|
||||
}
|
||||
public int getVideoCount() {
|
||||
return videoCount;
|
||||
|
||||
Reference in new issue
Block a user