Merge branch 'racecommittee_integrated' of ssh://sapsailing.com/home/trac/git into racecommittee_integrated

This commit is contained in:
Armin Zamani committed 2013-05-02 00:59:12 +02:00
commit 6eec1d8efd
4 files changed
+52 -31

No files matched your search

+16 -13
View File
@@ -53,6 +53,7 @@ MAVEN_SETTINGS_PROXY=$PROJECT_HOME/configuration/maven-settings-proxy.xml
p2PluginRepository=$PROJECT_HOME/java/com.sap.sailing.feature.p2build/bin/products/raceanalysis.product.id/linux/gtk/$ARCH
HAS_OVERWRITTEN_TARGET=0
TARGET_SERVER_NAME=$active_branch
gwtcompile=1
@@ -104,7 +105,8 @@ do
m) MAVEN_SETTINGS=$OPTARG;;
n) OSGI_BUNDLE_NAME=$OPTARG;;
l) OSGI_TELNET_PORT=$OPTARG;;
s) TARGET_SERVER_NAME=$OPTARG;;
s) TARGET_SERVER_NAME=$OPTARG
HAS_OVERWRITTEN_TARGET=1;;
\?) echo "Invalid option"
exit 2;;
esac
@@ -331,27 +333,28 @@ if [[ "$@" == "install" ]] || [[ "$@" == "all" ]]; then
rm -rf $ACDIR/org.eclipse.*
rm -rf $ACDIR/configuration/org.eclipse.*
rm -rf $ACDIR/start
rm -rf $ACDIR/stop
if [[ $HAS_OVERWRITTEN_TARGET -eq 0 ]]; then
rm -rf $ACDIR/start
rm -rf $ACDIR/stop
cp -v $p2PluginRepository/configuration/config.ini configuration/
mkdir -p configuration/jetty/etc
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty.xml configuration/jetty/etc
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/realm.properties configuration/jetty/etc
cp -v $PROJECT_HOME/java/target/configuration/monitoring.properties configuration/
cp -v $PROJECT_HOME/configuration/mongodb.cfg $ACDIR/
cp -v $PROJECT_HOME/java/target/start $ACDIR/
cp -v $PROJECT_HOME/java/target/stop $ACDIR/
fi
cp -v $p2PluginRepository/configuration/config.ini configuration/
cp -r -v $p2PluginRepository/configuration/org.eclipse.equinox.simpleconfigurator configuration/
cp -v $p2PluginRepository/plugins/*.jar plugins/
mkdir -p configuration/jetty/etc
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty.xml configuration/jetty/etc
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/realm.properties configuration/jetty/etc
cp -v $PROJECT_HOME/java/target/configuration/monitoring.properties configuration/
# Make sure mongodb configuration is active
cp -v $PROJECT_HOME/configuration/mongodb.cfg $ACDIR/
cp -rv $PROJECT_HOME/configuration/native-libraries $ACDIR/
# Make sure this script is up2date at least for the next run
cp -v $PROJECT_HOME/configuration/buildAndUpdateProduct.sh $ACDIR/
cp -v $PROJECT_HOME/java/target/start $ACDIR/
cp -v $PROJECT_HOME/java/target/stop $ACDIR/
cp -v $PROJECT_HOME/java/target/udpmirror $ACDIR/
echo "Installation complete. You may now start the server using ./start"
@@ -10,6 +10,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -85,11 +86,17 @@ public class RaceRecord {
String technicalEventName = jsonURLAsString.substring(indexOfLastButOneSlash+1, indexOfLastSlash);
paramURL = new URL(jsonURLAsString.substring(0, indexOfLastSlash)+"/clientparams.php?event="+
technicalEventName+"&race="+ID);
Map<String, String> paramURLContents = parseParams(paramURL);
String liveURIAsString = paramURLContents.get(LIVE_URI_PROPERTY);
liveURI = liveURIAsString == null ? null : new URI(liveURIAsString);
String storedURIAsString = paramURLContents.get(STORED_URI_PROPERTY);
storedURI = storedURIAsString == null ? null : new URI(storedURIAsString);
try {
Map<String, String> paramURLContents = parseParams(paramURL);
String liveURIAsString = paramURLContents.get(LIVE_URI_PROPERTY);
liveURI = liveURIAsString == null ? null : new URI(liveURIAsString);
String storedURIAsString = paramURLContents.get(STORED_URI_PROPERTY);
storedURI = storedURIAsString == null ? null : new URI(storedURIAsString);
} catch (Exception e) {
logger.info("Couldn't parse TracTrac paramURL " + paramURL + " for race record " + getName());
logger.log(Level.INFO, "The exception was:", e);
throw e;
}
}
private Map<String, String> parseParams(URL paramURL) throws IOException {
@@ -45,7 +45,12 @@ public class TVViewController implements RaceTimesInfoProviderListener {
private final LogoAndTitlePanel logoAndTitlePanel;
private final DockLayoutPanel dockPanel;
private final Timer timer;
/**
* We use two timers: one for the leaderboard, one for the race board. This way, we can stop one while the other continues.
* This way, the other component stops its auto-updates.
*/
private final Timer leaderboardTimer;
private final Timer raceboardTimer;
private final RaceTimesInfoProvider raceTimesInfoProvider;
private TVViews activeTvView;
@@ -92,9 +97,14 @@ public class TVViewController implements RaceTimesInfoProviderListener {
leaderboardSettings = LeaderboardSettingsFactory.getInstance().createNewDefaultSettings(null, null, null, /* autoExpandFirstRace */ false,
/* showMetaLeaderboardsOnSamePage */ false);
timer = new Timer(PlayModes.Live, /* delayBetweenAutoAdvancesInMilliseconds */1000l);
timer.setLivePlayDelayInMillis(delayToLiveInMillis);
timer.play();
leaderboardTimer = new Timer(PlayModes.Live, /* delayBetweenAutoAdvancesInMilliseconds */1000l);
leaderboardTimer.setLivePlayDelayInMillis(delayToLiveInMillis);
leaderboardTimer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_LEADERBOARD);
leaderboardTimer.play();
raceboardTimer = new Timer(PlayModes.Live, /* delayBetweenAutoAdvancesInMilliseconds */1000l);
raceboardTimer.setLivePlayDelayInMillis(delayToLiveInMillis);
raceboardTimer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_RACEBOARD);
raceboardTimer.play();
raceTimesInfoProvider = new RaceTimesInfoProvider(sailingService, errorReporter, new ArrayList<RegattaAndRaceIdentifier>(), 3000l);
raceTimesInfoProvider.addRaceTimesInfoProviderListener(this);
@@ -103,7 +113,7 @@ public class TVViewController implements RaceTimesInfoProviderListener {
private LeaderboardPanel createLeaderboardPanel(String leaderboardGroupName, String leaderboardName, boolean showRaceDetails) {
CompetitorSelectionModel selectionModel = new CompetitorSelectionModel(/* hasMultiSelection */ true);
LeaderboardPanel leaderboardPanel = new LeaderboardPanel(sailingService, new AsyncActionsExecutor(), leaderboardSettings,
/* preSelectedRace */null, selectionModel, timer, leaderboardGroupName, leaderboardName, errorReporter, stringMessages,
/* preSelectedRace */null, selectionModel, leaderboardTimer, leaderboardGroupName, leaderboardName, errorReporter, stringMessages,
userAgent, showRaceDetails, /* raceTimesInfoProvider */ null, /* autoExpandLastRaceColumn */ false) {
@Override
protected void setLeaderboard(LeaderboardDTO leaderboard) {
@@ -136,7 +146,7 @@ public class TVViewController implements RaceTimesInfoProviderListener {
RaceSelectionModel raceSelectionModel = new RaceSelectionModel();
List<RegattaAndRaceIdentifier> singletonList = Collections.singletonList(raceToShow);
raceSelectionModel.setSelection(singletonList);
RaceBoardPanel raceBoardPanel = new RaceBoardPanel(sailingService, mediaService, null, timer,
RaceBoardPanel raceBoardPanel = new RaceBoardPanel(sailingService, mediaService, null, raceboardTimer,
/* canReplayWhileLiveIsPossible */ false, raceSelectionModel, leaderboardName,
null, raceboardViewConfig, errorReporter, stringMessages, userAgent, raceTimesInfoProvider);
return raceBoardPanel;
@@ -144,9 +154,8 @@ public class TVViewController implements RaceTimesInfoProviderListener {
private void clearContentPanels() {
int childWidgetCount = dockPanel.getWidgetCount();
for(int i = 0; i < childWidgetCount; i++) {
for(int i = childWidgetCount-1; i >=0; i--) {
Widget widget = dockPanel.getWidget(i);
// don't remove the logoAndTitlePanel if exist
if(logoAndTitlePanel == null || widget != logoAndTitlePanel) {
dockPanel.remove(widget);
@@ -166,7 +175,8 @@ public class TVViewController implements RaceTimesInfoProviderListener {
}
currentLiveRace = null;
activeTvView = TVViews.Leaderboard;
timer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_LEADERBOARD);
raceboardTimer.pause();
leaderboardTimer.setPlayMode(PlayModes.Live);
}
}
@@ -190,7 +200,8 @@ public class TVViewController implements RaceTimesInfoProviderListener {
logoAndTitlePanel.setSubTitle(currentLiveRace.getRaceName());
}
activeTvView = TVViews.Raceboard;
timer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_RACEBOARD);
leaderboardTimer.pause();
raceboardTimer.setPlayMode(PlayModes.Live);
}
}
@@ -228,8 +239,8 @@ public class TVViewController implements RaceTimesInfoProviderListener {
Date endOfRace = currentRaceTimes.endOfRace;
long waitTimeAfterEndOfRace = 60 * 1000; // 1 min
if (endOfRace != null && timer.getTime().getTime() > endOfRace.getTime() + waitTimeAfterEndOfRace
&& timer.getPlayMode() == PlayModes.Live) {
if (endOfRace != null && raceboardTimer.getTime().getTime() > endOfRace.getTime() + waitTimeAfterEndOfRace
&& raceboardTimer.getPlayMode() == PlayModes.Live) {
updateTvView(TVViews.Leaderboard);
}
} else {
@@ -217,7 +217,7 @@ public class RegattaDataPerLegAction extends HttpAction {
int posGL = 0;
if (previousLeg != null) {
posGL = rankAtWaypoint.get(competitor).get(trackedLeg.getLeg().getTo()) -
- rankAtWaypoint.get(competitor).get(trackedLeg.getLeg().getFrom());
rankAtWaypoint.get(competitor).get(trackedLeg.getLeg().getFrom());
}
final Element competitor_node = addNamedElement(competitor_data_node, "competitor");