mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
Merge remote-tracking branch 'origin/master' into simulator_dev
This commit is contained in:
commit
84aaa062f3
6 files changed
+108
-80
No files matched your search
+1
-1
@@ -124,7 +124,7 @@ public class LeaderboardDTO extends AbstractLeaderboardDTO implements Serializab
|
||||
return competitorOrderingPerRaceColumnName.get(raceColumn.getName());
|
||||
}
|
||||
|
||||
public int getRank(CompetitorDTO competitor) {
|
||||
public int getTotalRank(CompetitorDTO competitor) {
|
||||
return competitors.indexOf(competitor) + 1;
|
||||
};
|
||||
|
||||
|
||||
+13
-12
@@ -95,11 +95,12 @@ public class DynamicGPSFixMovingTrackImpl<ItemType> extends DynamicTrackImpl<Ite
|
||||
}
|
||||
|
||||
/**
|
||||
* In addition to the base class implementation, we additionally have the speed and bearing as
|
||||
* measured by the device. We use the device-measured speed and compare it with the speed computed
|
||||
* based on the timestamp and distance between previous and next fix. If the latter speed exceeds the
|
||||
* measured speed by more than a factor of {@link #MAX_SPEED_FACTOR_COMPARED_TO_MEASURED_SPEED_FOR_FILTERING},
|
||||
* the fix is considered invalid.
|
||||
* In addition to the base class implementation, we additionally have the speed and bearing as measured by the
|
||||
* device. If the adjacent fixes are within the averaging interval defined by
|
||||
* {@link GPSFixTrackImpl#getMillisecondsOverWhichToAverageSpeed()}, we use the device-measured speed and compare it
|
||||
* with the speed computed based on the timestamp and distance between previous and next fix. If the latter speed
|
||||
* exceeds the measured speed by more than a factor of
|
||||
* {@link #MAX_SPEED_FACTOR_COMPARED_TO_MEASURED_SPEED_FOR_FILTERING}, the fix is considered invalid.
|
||||
*/
|
||||
@Override
|
||||
protected boolean isValid(NavigableSet<GPSFixMoving> rawFixes, GPSFixMoving e) {
|
||||
@@ -111,22 +112,22 @@ public class DynamicGPSFixMovingTrackImpl<ItemType> extends DynamicTrackImpl<Ite
|
||||
boolean fixHasValidSogAndCog = (e.getSpeed().getMetersPerSecond() != 0.0 && e.getSpeed().getBearing().getDegrees() != 0.0);
|
||||
GPSFixMoving previous = rawFixes.lower(e);
|
||||
GPSFixMoving next = rawFixes.higher(e);
|
||||
Speed speedToPrevious = Speed.NULL;
|
||||
if (previous != null) {
|
||||
Speed speedToPrevious = null;
|
||||
if (previous != null && Math.abs(previous.getTimePoint().asMillis() - e.getTimePoint().asMillis()) <= getMillisecondsOverWhichToAverageSpeed()) {
|
||||
speedToPrevious = previous.getPosition().getDistance(e.getPosition())
|
||||
.inTime(e.getTimePoint().asMillis() - previous.getTimePoint().asMillis());
|
||||
}
|
||||
Speed speedToNext = Speed.NULL;
|
||||
if (next != null) {
|
||||
Speed speedToNext = null;
|
||||
if (next != null && Math.abs(next.getTimePoint().asMillis() - e.getTimePoint().asMillis()) <= getMillisecondsOverWhichToAverageSpeed()) {
|
||||
speedToNext = e.getPosition().getDistance(next.getPosition())
|
||||
.inTime(next.getTimePoint().asMillis() - e.getTimePoint().asMillis());
|
||||
}
|
||||
result = (!fixHasValidSogAndCog || ((previous == null || speedToPrevious.getMetersPerSecond() <= MAX_SPEED_FACTOR_COMPARED_TO_MEASURED_SPEED_FOR_FILTERING
|
||||
result = (!fixHasValidSogAndCog || ((speedToPrevious == null || speedToPrevious.getMetersPerSecond() <= MAX_SPEED_FACTOR_COMPARED_TO_MEASURED_SPEED_FOR_FILTERING
|
||||
* e.getSpeed().getMetersPerSecond())
|
||||
&& (next == null || speedToNext.getMetersPerSecond() <= MAX_SPEED_FACTOR_COMPARED_TO_MEASURED_SPEED_FOR_FILTERING
|
||||
&& (speedToNext == null || speedToNext.getMetersPerSecond() <= MAX_SPEED_FACTOR_COMPARED_TO_MEASURED_SPEED_FOR_FILTERING
|
||||
* e.getSpeed().getMetersPerSecond())))
|
||||
&& (maxSpeedForSmoothing == null
|
||||
|| (previous == null || speedToPrevious.compareTo(maxSpeedForSmoothing) <= 0) || (next == null || speedToNext
|
||||
|| (speedToPrevious == null || speedToPrevious.compareTo(maxSpeedForSmoothing) <= 0) || (speedToNext == null || speedToNext
|
||||
.compareTo(maxSpeedForSmoothing) <= 0));
|
||||
e.cacheValidity(result);
|
||||
}
|
||||
|
||||
+10
-3
@@ -31,6 +31,13 @@ public class YoutubeEmbeddedPlayer extends AbstractMediaPlayer implements VideoP
|
||||
private final YoutubeVideoControl videoControl;
|
||||
private final PopoutListener popoutListener;
|
||||
|
||||
/**
|
||||
* Required to indicate whether this control has been requested to close.
|
||||
* Then, it must not call any player functions anymore
|
||||
* not to cause null-access error due to missing DOM elements.
|
||||
*/
|
||||
private boolean closing = false;
|
||||
|
||||
public YoutubeEmbeddedPlayer(final MediaTrack videoTrack, long raceStartTimeMillis, boolean showSynchControls, Timer raceTimer, MediaServiceAsync mediaService, ErrorReporter errorReporter, PopupCloseListener popupCloseListener, PopoutListener popoutListener) {
|
||||
super(videoTrack);
|
||||
this.raceTimer = raceTimer;
|
||||
@@ -84,7 +91,7 @@ public class YoutubeEmbeddedPlayer extends AbstractMediaPlayer implements VideoP
|
||||
|
||||
@Override
|
||||
public void onClose(CloseEvent<PopupPanel> event) {
|
||||
// pauseMedia();
|
||||
this.closing = true;
|
||||
this.popupCloseListener.popupClosed();
|
||||
}
|
||||
|
||||
@@ -126,14 +133,14 @@ public class YoutubeEmbeddedPlayer extends AbstractMediaPlayer implements VideoP
|
||||
|
||||
@Override
|
||||
public void pauseMedia() {
|
||||
if (!isEdited()) {
|
||||
if (!isEdited() && !this.closing) {
|
||||
videoControl.pause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playMedia() {
|
||||
if (!isEdited()) {
|
||||
if (!isEdited() && !this.closing) {
|
||||
videoControl.play();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class CompetitorTotalRankFilter extends AbstractNumberFilter<CompetitorDT
|
||||
boolean result = false;
|
||||
|
||||
if (value > 0 && operator != null && getLeaderboard() != null) {
|
||||
int totalRank = getLeaderboard().getRank(competitorDTO);
|
||||
int totalRank = getLeaderboard().getTotalRank(competitorDTO);
|
||||
result = operator.matchValues(value, totalRank);
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -151,7 +151,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
|
||||
private LeaderboardDTO leaderboard;
|
||||
|
||||
private final RankColumn rankColumn;
|
||||
private final TotalRankColumn totalRankColumn;
|
||||
|
||||
/**
|
||||
* Passed to the {@link ManeuverCountRaceColumn}. Modifications to this list will modify the column's children list
|
||||
@@ -1293,8 +1293,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
}
|
||||
|
||||
private class RankColumn extends SortableColumn<LeaderboardRowDTO, String> {
|
||||
public RankColumn() {
|
||||
private class TotalRankColumn extends SortableColumn<LeaderboardRowDTO, String> {
|
||||
public TotalRankColumn() {
|
||||
super(new TextCell(), SortingOrder.ASCENDING);
|
||||
setHorizontalAlignment(ALIGN_CENTER);
|
||||
setSortable(true);
|
||||
@@ -1302,8 +1302,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
|
||||
@Override
|
||||
public String getValue(LeaderboardRowDTO object) {
|
||||
final int rank = getLeaderboard().getRank(object.competitor);
|
||||
return "" + (rank == 0 ? "" : rank);
|
||||
final int totalRank = getLeaderboard().getTotalRank(object.competitor);
|
||||
return "" + (totalRank == 0 ? "" : totalRank);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1311,9 +1311,9 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
return new InvertibleComparatorAdapter<LeaderboardRowDTO>() {
|
||||
@Override
|
||||
public int compare(LeaderboardRowDTO o1, LeaderboardRowDTO o2) {
|
||||
final int rank1 = getLeaderboard().getRank(o1.competitor);
|
||||
final int rank2 = getLeaderboard().getRank(o2.competitor);
|
||||
return rank1 == 0 ? rank2 == 0 ? 0 : 1 : rank2 == 0 ? -1 : rank1 - rank2;
|
||||
final int totalRank1 = getLeaderboard().getTotalRank(o1.competitor);
|
||||
final int totalRank2 = getLeaderboard().getTotalRank(o2.competitor);
|
||||
return totalRank1 == 0 ? totalRank2 == 0 ? 0 : 1 : totalRank2 == 0 ? -1 : totalRank1 - totalRank2;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1411,7 +1411,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
setRaceColumnSelectionToLastNStrategy(settings.getNumberOfLastRacesToShow());
|
||||
break;
|
||||
}
|
||||
rankColumn = new RankColumn();
|
||||
totalRankColumn = new TotalRankColumn();
|
||||
RACE_COLUMN_HEADER_STYLE = tableResources.cellTableStyle().cellTableRaceColumnHeader();
|
||||
LEG_COLUMN_HEADER_STYLE = tableResources.cellTableStyle().cellTableLegColumnHeader();
|
||||
LEG_DETAIL_COLUMN_HEADER_STYLE = tableResources.cellTableStyle().cellTableLegDetailColumnHeader();
|
||||
@@ -2057,8 +2057,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
}
|
||||
|
||||
private RankColumn getRankColumn() {
|
||||
return rankColumn;
|
||||
private TotalRankColumn getRankColumn() {
|
||||
return totalRankColumn;
|
||||
}
|
||||
|
||||
protected void setLeaderboard(LeaderboardDTO leaderboard) {
|
||||
@@ -2318,7 +2318,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
if (getLeaderboardTable().getColumnCount() == RANK_COLUMN_INDEX) {
|
||||
addColumn(getDefaultSortColumn());
|
||||
} else {
|
||||
if (!(getLeaderboardTable().getColumn(RANK_COLUMN_INDEX) instanceof RankColumn)) {
|
||||
if (!(getLeaderboardTable().getColumn(RANK_COLUMN_INDEX) instanceof TotalRankColumn)) {
|
||||
throw new RuntimeException("The first column must always be the rank column but it was of type "
|
||||
+ getLeaderboardTable().getColumn(RANK_COLUMN_INDEX).getClass().getName());
|
||||
}
|
||||
|
||||
@@ -32,38 +32,15 @@
|
||||
<h2 class='articleHeadline'>Sailing Events</h2>
|
||||
|
||||
<div class='innerContent'>
|
||||
|
||||
<!-- Uncomment the following in case there are events in live state and add the timeBar plus raceSection -->
|
||||
<!--
|
||||
<h2 class='articleSubheadline'>Live</h2>
|
||||
<br/>
|
||||
|
||||
<div class='timeBar'>
|
||||
Put a raceSection here
|
||||
</div>-->
|
||||
|
||||
<h2 class='articleSubheadline'>2013</h2>
|
||||
-->
|
||||
|
||||
<!-- Uncomment the following in case there are upcoming and add the timeBar plus raceSection -->
|
||||
<h2 class='articleSubheadline'>Upcoming</h2>
|
||||
<div class="timeBar">
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
July 25 - 28
|
||||
</h5>
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://ess40-2013.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
<li class='raceName'>
|
||||
Extreme Sailing Series 2013
|
||||
</li>
|
||||
<li class='raceLocation'>
|
||||
Porto, Portugal
|
||||
</li>
|
||||
</ul>
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>Extreme Sailing Series 2013</p>
|
||||
<a href='http://ess40-2013.sapsailing.com' target='_blank'>SAP Sailing Analytics</a><br/>
|
||||
<a href='http://www.extremesailingseries.com' target='_blank'>Official website</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
July 19 - 28
|
||||
@@ -85,6 +62,34 @@
|
||||
<a href='http://www.travemuender-woche.com/' target='_blank'>Official website</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<h2 class='articleSubheadline'>2013</h2>
|
||||
<div class="timeBar">
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
July 3 - 7
|
||||
</h5>
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://49er-euros2013.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
<li class='raceName'>
|
||||
49er European Championship 2013
|
||||
</li>
|
||||
<li class='raceLocation'>
|
||||
Aarhus, Denmark
|
||||
</li>
|
||||
</ul>
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>49er European Championship 2013</p>
|
||||
<a href='http://49er-euros2013.sapsailing.com' target='_blank'>SAP Sailing Analytics</a><br/>
|
||||
<a href='http://www.sportaarhusevents.dk/en/events/2013/49er-european-championship' target='_blank'>Official website</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
June 21 - 30
|
||||
@@ -102,11 +107,33 @@
|
||||
<a href='http://livecenter.kieler-woche.de/' target='_blank'>Official website</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
July 25 - 28
|
||||
</h5>
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://ess40-2013.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
<li class='raceName'>
|
||||
Extreme Sailing Series 2013
|
||||
</li>
|
||||
<li class='raceLocation'>
|
||||
Porto, Portugal
|
||||
</li>
|
||||
</ul>
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>Extreme Sailing Series 2013</p>
|
||||
<a href='http://ess40-2013.sapsailing.com' target='_blank'>SAP Sailing Analytics</a><br/>
|
||||
<a href='http://www.extremesailingseries.com' target='_blank'>Official website</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
May 1 - 5
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://staridm2013.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -120,11 +147,11 @@
|
||||
<a href='http://www.starclass.de/termine-detail/events/int-deutsche-meisterschaft-2013.html' target='_blank'>Official website</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
April 29 - May 4
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://505worlds2013.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -139,7 +166,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class='articleSubheadline'>2012</h2>
|
||||
|
||||
<h2 class='articleSubheadline'>2012</h2>
|
||||
|
||||
<h4>Championships</h4>
|
||||
|
||||
@@ -148,7 +176,6 @@
|
||||
<h5 class='date'>
|
||||
September 9 - 15
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://49er-euros2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -158,14 +185,13 @@
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>49er Europeans 2012</p> <a href='http://2012euros.49er.org/' target='_blank'>Official website</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
July 31 - August 4
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://drachenidm2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -175,14 +201,13 @@
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>Internationale Deutsche Meisterschaft Drachen 2012</p> <a href='http://www.vsaw.de/index.php?id=79&tx_ttnews[tt_news]=2024&cHash=dde51ae4707f18e0cdbbc13979ad6667' target='_blank'>Official website</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
July 15 - 27
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://505Worlds2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -192,18 +217,17 @@
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>505 World Championships 2012</p> <a href='http://www.sap505worlds.com/2012/' target='_blank'>Official website</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Other events</h4>
|
||||
|
||||
<h4>Other events</h4>
|
||||
|
||||
<div class='timeBar'>
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
November 2 - 4
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://obmr2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -214,14 +238,13 @@
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>Audi Sailing Team Germany meets 'Berlin Match Race' 2012</p> <a href='http://obmr2012.de' target='_blank'>Official website</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://ess40-2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -231,14 +254,13 @@
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>Extreme Sailing Series 2012</p> <a href='http://www.extremesailingseries.com' target='_blank'>Official website</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
August 4 - 5
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://bmwsailingcup2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -249,11 +271,11 @@
|
||||
<div class='raceDescription'>
|
||||
<p>BMW Sailing Cup 2012</p> </div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
June 16 - 24
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://kielerwoche2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -263,14 +285,13 @@
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>Kieler Woche 2012</p> <a href='http://www.kieler-woche.de/segeln/index.php' target='_blank'>Official website</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
May 25 - 27
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://yes2012.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -280,11 +301,11 @@
|
||||
</a>
|
||||
<div class='raceDescription'>
|
||||
<p>Young Europeans Sailing 2012</p> <a href='http://www.kyc.de/regatten/yes.html' target='_blank'>Official website</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class='articleSubheadline'>2011</h2>
|
||||
|
||||
<h2 class='articleSubheadline'>2011</h2>
|
||||
|
||||
<h4>Championships</h4>
|
||||
|
||||
@@ -293,7 +314,6 @@
|
||||
<h5 class='date'>
|
||||
2011
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://505.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -304,11 +324,11 @@
|
||||
<div class='raceDescription'>
|
||||
<p>505 World Championships 2011</p> </div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
2011
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://idm2011.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
@@ -319,11 +339,11 @@
|
||||
<div class='raceDescription'>
|
||||
<p>International German Championships 2011</p> </div>
|
||||
</div>
|
||||
|
||||
<div class='raceSection'>
|
||||
<h5 class='date'>
|
||||
2011
|
||||
</h5>
|
||||
|
||||
<div class='raceTimepoint'></div>
|
||||
<a href='http://mdm2011.sapsailing.com' target='_blank'>
|
||||
<ul class='racePanel'>
|
||||
|
||||
Reference in new issue
Block a user