Merge branch 'master' into mark-rounding-inference
Conflicts: java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/impl/MongoObjectFactoryImpl.java java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/WindTest.java java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/markpassing/AbstractMockedRaceMarkPassingTest.java java/com.sap.sailing.domain/META-INF/MANIFEST.MF java/com.sap.sailing.domain/src/com/sap/sailing/domain/markpassingcalculation/CandidateFinder.java java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/TrackedRace.java java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/DynamicTrackedRaceImpl.java java/com.sap.sailing.gwt.ui.test/src/com/sap/sailing/gwt/ui/test/MockedTrackedRace.java java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/client/place/event/regattaanalytics/RegattaAnalyticsDataManager.java java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/client/place/event/seriesanalytics/EventSeriesAnalyticsDataManager.java java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/SailingServiceAsync.java java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_ru.properties java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java
No files matched your search
@@ -95,7 +95,7 @@ parallelexecution=0
|
||||
p2local=0
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "buildAndUpdateProduct [-b -u -g -t -a -r -o -c -p -v -m <config> -n <package> -l <port> -x <gwt-workers>] [build|install|all|hot-deploy|remote-deploy|local-deploy|release]"
|
||||
echo "buildAndUpdateProduct [-b -u -g -t -a -r -o -c -p -v -m <config> -n <package> -l <port> -x <gwt-workers> -j <test-package>] [build|install|all|hot-deploy|remote-deploy|local-deploy|release]"
|
||||
echo ""
|
||||
echo "-g Disable GWT compile, no gwt files will be generated, old ones will be preserved."
|
||||
echo "-b Build GWT permutation only for one browser and English language."
|
||||
@@ -115,6 +115,7 @@ if [ $# -eq 0 ]; then
|
||||
echo "-u Run without confirmation messages. Use with extreme care."
|
||||
echo "-v Build local p2 respository, and use this instead of p2.sapsailing.com"
|
||||
echo "-x <number-of-workers> use this many worker threads for building GWT permutations (default: 2)."
|
||||
echo "-j <test-package> only execute the provided test package during tests"
|
||||
echo ""
|
||||
echo "build: builds the server code using Maven to $PROJECT_HOME (log to $START_DIR/build.log)"
|
||||
echo ""
|
||||
@@ -133,7 +134,7 @@ if [ $# -eq 0 ]; then
|
||||
echo "local-deploy: performs deployment of one or more bundles into a local directory"
|
||||
echo "Example: $0 -n com.sap.sailing.www -s /home/user/myserver local-deploy"
|
||||
echo ""
|
||||
echo "remote-deploy: performs hot deployment of the java code to a remote server"
|
||||
echo "remote-deploy: deploys the last build results to a remote server and optionally re-starts it"
|
||||
echo "Example: $0 -s dev -w trac@sapsailing.com remote-deploy"
|
||||
echo ""
|
||||
echo "clean: cleans all code and GWT files"
|
||||
@@ -151,7 +152,7 @@ echo SERVERS_HOME is $SERVERS_HOME
|
||||
echo BRANCH is $active_branch
|
||||
echo VERSION is $VERSION_INFO
|
||||
|
||||
options=':bgtocparvm:n:l:s:w:x:u'
|
||||
options=':bgtocparvm:n:l:s:w:x:j:u'
|
||||
while getopts $options option
|
||||
do
|
||||
case $option in
|
||||
@@ -172,6 +173,7 @@ do
|
||||
u) suppress_confirmation=1;;
|
||||
v) p2local=1;;
|
||||
x) GWT_WORKERS=$OPTARG;;
|
||||
j) TESTCASE_TO_EXECUTE=$OPTARG;;
|
||||
\?) echo "Invalid option"
|
||||
exit 4;;
|
||||
esac
|
||||
@@ -230,6 +232,7 @@ if [[ "$@" == "release" ]]; then
|
||||
fi
|
||||
|
||||
mkdir -p $PROJECT_HOME/dist
|
||||
rm -rf $PROJECT_HOME/dist/*
|
||||
mkdir -p $PROJECT_HOME/build
|
||||
|
||||
RELEASE_NOTES="Release $VERSION_INFO\n$RELEASE_NOTES"
|
||||
@@ -259,7 +262,7 @@ if [[ "$@" == "release" ]]; then
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deployer.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/java/target/configuration/security.properties configuration/
|
||||
cp -v $PROJECT_HOME/java/target/configuration/mail.properties configuration/
|
||||
cp -v $PROJECT_HOME/configuration/mongodb.cfg $ACDIR/
|
||||
cp -v $PROJECT_HOME/java/target/udpmirror $ACDIR/
|
||||
cp -v $PROJECT_HOME/java/target/http2udpmirror $ACDIR
|
||||
@@ -535,7 +538,7 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
||||
fi
|
||||
|
||||
cd $PROJECT_HOME/java
|
||||
if [ $gwtcompile -eq 1 ]; then
|
||||
if [ $gwtcompile -eq 1 ] && [[ "$clean" == "clean" ]]; then
|
||||
echo "INFO: Compiling GWT (rm -rf com.sap.$PROJECT_TYPE.gwt.ui/com.sap.$PROJECT_TYPE.*)"
|
||||
rm -rf com.sap.$PROJECT_TYPE.gwt.ui/com.sap.$PROJECT_TYPE.*
|
||||
GWT_XML_FILES=`find com.sap.$PROJECT_TYPE.gwt.ui/src/main/resources -name '*.gwt.xml'`
|
||||
@@ -587,6 +590,11 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
||||
else
|
||||
extra="$extra -DskipTests=false"
|
||||
# TODO: Think about http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html
|
||||
if [[ "$TESTCASE_TO_EXECUTE" != "" ]]; then
|
||||
# http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
|
||||
echo "Running only testcase $TESTCASE_TO_EXECUTE"
|
||||
extra="$extra -Dtest=$TESTCASE_TO_EXECUTE"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $android -eq 0 ] && [ $gwtcompile -eq 0 ] && [ $testing -eq 0 ]; then
|
||||
@@ -728,7 +736,7 @@ if [[ "$@" == "install" ]] || [[ "$@" == "all" ]]; then
|
||||
if [ ! -f "$ACDIR/env.sh" ]; then
|
||||
cp -v $PROJECT_HOME/java/target/env.sh $ACDIR/
|
||||
cp -v $PROJECT_HOME/java/target/configuration/monitoring.properties $ACDIR/configuration/
|
||||
cp -v $PROJECT_HOME/java/target/configuration/security.properties $ACDIR/configuration/
|
||||
cp -v $PROJECT_HOME/java/target/configuration/mail.properties $ACDIR/configuration/
|
||||
cp -v $PROJECT_HOME/java/target/configuration/logging.properties $ACDIR/configuration/
|
||||
fi
|
||||
|
||||
@@ -809,7 +817,7 @@ if [[ "$@" == "remote-deploy" ]]; then
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deployer.xml $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/realm.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/monitoring.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/security.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/mail.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
|
||||
|
||||
$SCP_CMD $PROJECT_HOME/java/target/env.sh $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
|
||||
$SCP_CMD $PROJECT_HOME/java/target/start $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/python2.7
|
||||
|
||||
import re
|
||||
import sys
|
||||
import pymongo
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 7:
|
||||
print '%s <host> <port> <database> <prefix> <exportfile> <interval in millis>' % sys.argv[0]
|
||||
print 'Example: 127.0.0.1 27017 winddb "ESS 2014" /tmp/wind-data-ess.csv 5000'
|
||||
sys.exit(0)
|
||||
|
||||
program, host, port, database, prefix, exportfile, interval = sys.argv
|
||||
print 'Connecting to server %s:%s with database %s and searching for tracks with prefix %s and exporting to %s' % (host, port, database, prefix, exportfile)
|
||||
client = pymongo.MongoClient(host, int(port))
|
||||
db = client[database]
|
||||
wind_tracks = db['WIND_TRACKS']
|
||||
csv = open(exportfile, 'w')
|
||||
csv.write('Event Name;Latitude;Longitude;MeasurementTimePointAsMillisSince01011970;KnotSpeed;BearingDegreeFrom;SourceName\n')
|
||||
counter = 0
|
||||
print 'Storing all wind track data in memory in order to overcome MongoDB 32MB sort limit...'
|
||||
data_container = []; regattas = {}
|
||||
# anchored regexp runs pretty fast compared to iterating over all fixes. but beware:
|
||||
# using options like re.IGNORECASE will render the search almost unusable
|
||||
prefix_pattern = re.compile('^%s' % prefix)
|
||||
for fix in wind_tracks.find({'REGATTA_NAME' : prefix_pattern}):
|
||||
data = {}
|
||||
try:
|
||||
data = (fix['REGATTA_NAME'], str(fix['WIND']['LAT_DEG']),
|
||||
str(fix['WIND']['LNG_DEG']), str(fix['WIND']['TIME_AS_MILLIS']), str(fix['WIND']['KNOT_SPEED']),
|
||||
str(fix['WIND']['DEGREE_BEARING']))
|
||||
except:
|
||||
print 'Exception for dataset %s' % data
|
||||
continue
|
||||
wind_source_id = fix['WIND_SOURCE_NAME']
|
||||
if hasattr(fix, 'WIND_SOURCE_ID'):
|
||||
wind_source_id += '-'+fix['WIND_SOURCE_ID']
|
||||
data += (wind_source_id, )
|
||||
counter += 1
|
||||
if data[0].startswith(prefix):
|
||||
regattas[fix['REGATTA_NAME']] = regattas.get(fix['REGATTA_NAME'], 0)+1
|
||||
data_container.append(data)
|
||||
if counter % 1000 == 0:
|
||||
sys.stdout.write('.')
|
||||
sys.stdout.flush()
|
||||
if counter % 100000 == 0:
|
||||
sys.stdout.write(str(counter))
|
||||
print '\nFlushing to store, sorting %s fixes in memory for regattas %s' % (len(data_container), regattas)
|
||||
sorted_fixes = sorted(data_container, key=lambda windfix: windfix[3], reverse=True)
|
||||
counter = 0; last_timepoint = {}
|
||||
print 'Starting export of %s wind fixes in interval %sms to %s' % (len(sorted_fixes), long(interval), exportfile)
|
||||
for cached_fix in sorted_fixes:
|
||||
if last_timepoint.get(cached_fix[0])==None or ((long(last_timepoint.get(cached_fix[0]))-long(cached_fix[3])) >= long(interval)):
|
||||
counter += 1
|
||||
csv.write(';'.join(cached_fix))
|
||||
csv.write('\n')
|
||||
last_timepoint[cached_fix[0]] = cached_fix[3]
|
||||
if counter % 1000 == 0:
|
||||
sys.stdout.write('#')
|
||||
sys.stdout.flush()
|
||||
# free memory
|
||||
data_container = []
|
||||
|
||||
print '\nExported %s fix(es) that have a minimum time distance of %s milliseconds' % (counter, interval)
|
||||
csv.close()
|
||||
@@ -20,7 +20,7 @@ start_tmux() {
|
||||
|
||||
start_servers() {
|
||||
NUMBER_OF_INSTANCES=`echo "$JAVA_START_INSTANCES" | wc -w`
|
||||
MEMORY_PER_INSTANCE_IN_MB=`cat /proc/meminfo | grep MemTotal | awk '{printf("%i\n", ($2 / 1024 - 1500) / '$NUMBER_OF_INSTANCES' );}'`
|
||||
MEMORY_PER_INSTANCE_IN_MB=`cat /proc/meminfo | grep MemTotal | awk '{printf("%i\n", ($2 / 1024 * 0.75 - 1500) / '$NUMBER_OF_INSTANCES' );}'`
|
||||
echo "Using ${MEMORY_PER_INSTANCE_IN_MB}MB as default heap size per instance."
|
||||
for conf in $JAVA_START_INSTANCES; do
|
||||
echo "Checking for amazon update..."
|
||||
|
||||
@@ -54,14 +54,16 @@ SAP is at the center of today’s technology revolution, developing innovations
|
||||
* [[Create boat graphics for the 2D race viewer|wiki/boatGraphicsSVG]]
|
||||
* [[Create clickable UI prototypes with Axure|wiki/ui-clickable-prototypes]]
|
||||
* [[Uploading Media Content|wiki/uploading-media-content]]
|
||||
* Information for Event Managers
|
||||
* [[Operating Igtimi WindBots/windbot-operations]]
|
||||
* [[Linking Race Videos|wiki/linking-race-videos]]
|
||||
* [[Import official results|wiki/results-import]]
|
||||
* Planning and Event Information
|
||||
* [[Project Planning (bigger development)|wiki/planning]]
|
||||
* [[General Event Planning|wiki/general-event-planning]]
|
||||
* [[Information about Extreme Sailing Series|wiki/extreme-sailing-series]]
|
||||
* [[Travemünder Woche 2014 event page|wiki/tw2014]]
|
||||
* [[505 worlds Kiel 2014 event page|wiki/505-worlds-kiel-2014]]
|
||||
* Event Content Management
|
||||
* [[Link Race Videos|wiki/linking-race-videos]]
|
||||
|
||||
### Internal services (not related to wiki but useful)
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/mongo-2.6.2.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="http://api.mongodb.org/java/2.6.2/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry exported="true" kind="lib" path="lib/gwt-dev.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.mongodb.driver</name>
|
||||
<name>com.google.gwt.dev</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
@@ -1,12 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -1,4 +1,3 @@
|
||||
#Wed Jun 08 13:41:06 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
||||
@@ -0,0 +1,523 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Dev
|
||||
Bundle-SymbolicName: com.google.gwt.dev
|
||||
Bundle-Version: 2.7.0
|
||||
Bundle-Vendor: GOOGLE
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-ClassPath: lib/gwt-dev.jar,
|
||||
.
|
||||
Export-Package: com.gargoylesoftware.htmlunit,
|
||||
com.gargoylesoftware.htmlunit.attachment,
|
||||
com.gargoylesoftware.htmlunit.gae,
|
||||
com.gargoylesoftware.htmlunit.html,
|
||||
com.gargoylesoftware.htmlunit.html.applets,
|
||||
com.gargoylesoftware.htmlunit.html.impl,
|
||||
com.gargoylesoftware.htmlunit.html.xpath,
|
||||
com.gargoylesoftware.htmlunit.javascript,
|
||||
com.gargoylesoftware.htmlunit.javascript.background,
|
||||
com.gargoylesoftware.htmlunit.javascript.configuration,
|
||||
com.gargoylesoftware.htmlunit.javascript.host,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.arrays,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.canvas,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.css,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.dom,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.geo,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.html,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.svg,
|
||||
com.gargoylesoftware.htmlunit.javascript.host.xml,
|
||||
com.gargoylesoftware.htmlunit.javascript.regexp,
|
||||
com.gargoylesoftware.htmlunit.protocol.about,
|
||||
com.gargoylesoftware.htmlunit.protocol.data,
|
||||
com.gargoylesoftware.htmlunit.protocol.javascript,
|
||||
com.gargoylesoftware.htmlunit.svg,
|
||||
com.gargoylesoftware.htmlunit.util,
|
||||
com.gargoylesoftware.htmlunit.xml,
|
||||
com.google.gwt.core.client,
|
||||
com.google.gwt.core.client.impl,
|
||||
com.google.gwt.core.ext,
|
||||
com.google.gwt.core.ext.debug,
|
||||
com.google.gwt.core.ext.impl,
|
||||
com.google.gwt.core.ext.linker,
|
||||
com.google.gwt.core.ext.linker.impl,
|
||||
com.google.gwt.core.ext.soyc,
|
||||
com.google.gwt.core.ext.soyc.coderef,
|
||||
com.google.gwt.core.ext.soyc.impl,
|
||||
com.google.gwt.core.ext.typeinfo,
|
||||
com.google.gwt.core.linker,
|
||||
com.google.gwt.core.shared,
|
||||
com.google.gwt.dev,
|
||||
com.google.gwt.dev.cfg,
|
||||
com.google.gwt.dev.codeserver,
|
||||
com.google.gwt.dev.generator,
|
||||
com.google.gwt.dev.generator.ast,
|
||||
com.google.gwt.dev.javac,
|
||||
com.google.gwt.dev.javac.asm,
|
||||
com.google.gwt.dev.javac.asmbridge,
|
||||
com.google.gwt.dev.javac.testing,
|
||||
com.google.gwt.dev.javac.testing.impl,
|
||||
com.google.gwt.dev.javac.typemodel,
|
||||
com.google.gwt.dev.jdt,
|
||||
com.google.gwt.dev.jjs,
|
||||
com.google.gwt.dev.jjs.ast,
|
||||
com.google.gwt.dev.jjs.ast.js,
|
||||
com.google.gwt.dev.jjs.impl,
|
||||
com.google.gwt.dev.jjs.impl.codesplitter,
|
||||
com.google.gwt.dev.jjs.impl.gflow,
|
||||
com.google.gwt.dev.jjs.impl.gflow.cfg,
|
||||
com.google.gwt.dev.jjs.impl.gflow.constants,
|
||||
com.google.gwt.dev.jjs.impl.gflow.copy,
|
||||
com.google.gwt.dev.jjs.impl.gflow.liveness,
|
||||
com.google.gwt.dev.jjs.impl.gflow.unreachable,
|
||||
com.google.gwt.dev.js,
|
||||
com.google.gwt.dev.js.ast,
|
||||
com.google.gwt.dev.js.rhino,
|
||||
com.google.gwt.dev.json,
|
||||
com.google.gwt.dev.protobuf,
|
||||
com.google.gwt.dev.resource,
|
||||
com.google.gwt.dev.resource.impl,
|
||||
com.google.gwt.dev.shell,
|
||||
com.google.gwt.dev.shell.ie,
|
||||
com.google.gwt.dev.shell.jetty,
|
||||
com.google.gwt.dev.shell.log,
|
||||
com.google.gwt.dev.shell.remoteui,
|
||||
com.google.gwt.dev.shell.rewrite,
|
||||
com.google.gwt.dev.ui,
|
||||
com.google.gwt.dev.url,
|
||||
com.google.gwt.dev.util,
|
||||
com.google.gwt.dev.util.arg,
|
||||
com.google.gwt.dev.util.collect,
|
||||
com.google.gwt.dev.util.editdistance,
|
||||
com.google.gwt.dev.util.log,
|
||||
com.google.gwt.dev.util.log.dashboard,
|
||||
com.google.gwt.dev.util.log.speedtracer,
|
||||
com.google.gwt.dev.util.msg,
|
||||
com.google.gwt.dev.util.transitiveclosure,
|
||||
com.google.gwt.dev.util.xml,
|
||||
com.google.gwt.lang,
|
||||
com.google.gwt.soyc,
|
||||
com.google.gwt.soyc.io,
|
||||
com.google.gwt.thirdparty.debugging.sourcemap,
|
||||
com.google.gwt.thirdparty.debugging.sourcemap.proto,
|
||||
com.google.gwt.thirdparty.guava.common.annotations,
|
||||
com.google.gwt.thirdparty.guava.common.base,
|
||||
com.google.gwt.thirdparty.guava.common.base.internal,
|
||||
com.google.gwt.thirdparty.guava.common.cache,
|
||||
com.google.gwt.thirdparty.guava.common.collect,
|
||||
com.google.gwt.thirdparty.guava.common.escape,
|
||||
com.google.gwt.thirdparty.guava.common.eventbus,
|
||||
com.google.gwt.thirdparty.guava.common.hash,
|
||||
com.google.gwt.thirdparty.guava.common.html,
|
||||
com.google.gwt.thirdparty.guava.common.io,
|
||||
com.google.gwt.thirdparty.guava.common.math,
|
||||
com.google.gwt.thirdparty.guava.common.net,
|
||||
com.google.gwt.thirdparty.guava.common.primitives,
|
||||
com.google.gwt.thirdparty.guava.common.reflect,
|
||||
com.google.gwt.thirdparty.guava.common.util.concurrent,
|
||||
com.google.gwt.thirdparty.guava.common.xml,
|
||||
com.google.gwt.thirdparty.javascript.jscomp,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.ant,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.deps,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.fuzzing,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.graph,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.parsing,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.parsing.parser,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.parsing.parser.codegeneration,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.parsing.parser.trees,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.parsing.parser.util,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.parsing.parser.util.format,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.regex,
|
||||
com.google.gwt.thirdparty.javascript.jscomp.type,
|
||||
com.google.gwt.thirdparty.javascript.rhino,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.annotations,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.ast,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.commonjs.module,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.commonjs.module.provider,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.debug,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.jdk13,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.jdk15,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.json,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.optimizer,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.regexp,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.serialize,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.tools,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.tools.debugger,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.tools.debugger.treetable,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.tools.idswitch,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.tools.jsc,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.tools.shell,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.v8dtoa,
|
||||
com.google.gwt.thirdparty.javascript.rhino.head.xml,
|
||||
com.google.gwt.thirdparty.javascript.rhino.jstype,
|
||||
com.google.gwt.thirdparty.json,
|
||||
com.google.gwt.util,
|
||||
com.google.gwt.util.tools,
|
||||
com.google.gwt.util.tools.shared,
|
||||
com.ibm.icu.impl,
|
||||
com.ibm.icu.impl.data,
|
||||
com.ibm.icu.impl.duration,
|
||||
com.ibm.icu.impl.duration.impl,
|
||||
com.ibm.icu.impl.locale,
|
||||
com.ibm.icu.lang,
|
||||
com.ibm.icu.math,
|
||||
com.ibm.icu.text,
|
||||
com.ibm.icu.util,
|
||||
com.steadystate.css.dom,
|
||||
com.steadystate.css.parser,
|
||||
com.steadystate.css.parser.selectors,
|
||||
com.steadystate.css.sac,
|
||||
com.steadystate.css.userdata,
|
||||
com.steadystate.css.util,
|
||||
java_cup,
|
||||
java_cup.anttask,
|
||||
java_cup.runtime,
|
||||
javax.annotation,
|
||||
javax.annotation.concurrent,
|
||||
javax.annotation.meta,
|
||||
javax.servlet,
|
||||
javax.servlet.annotation,
|
||||
javax.servlet.descriptor,
|
||||
javax.servlet.http,
|
||||
javax.servlet.jsp,
|
||||
javax.servlet.jsp.el,
|
||||
javax.servlet.jsp.tagext,
|
||||
javax.xml,
|
||||
javax.xml.datatype,
|
||||
javax.xml.namespace,
|
||||
javax.xml.parsers,
|
||||
javax.xml.stream,
|
||||
javax.xml.stream.events,
|
||||
javax.xml.stream.util,
|
||||
javax.xml.transform,
|
||||
javax.xml.transform.dom,
|
||||
javax.xml.transform.sax,
|
||||
javax.xml.transform.stax,
|
||||
javax.xml.transform.stream,
|
||||
javax.xml.validation,
|
||||
javax.xml.xpath,
|
||||
net.sourceforge.htmlunit.corejs.classfile,
|
||||
net.sourceforge.htmlunit.corejs.javascript,
|
||||
net.sourceforge.htmlunit.corejs.javascript.annotations,
|
||||
net.sourceforge.htmlunit.corejs.javascript.ast,
|
||||
net.sourceforge.htmlunit.corejs.javascript.commonjs.module,
|
||||
net.sourceforge.htmlunit.corejs.javascript.commonjs.module.provider,
|
||||
net.sourceforge.htmlunit.corejs.javascript.debug,
|
||||
net.sourceforge.htmlunit.corejs.javascript.jdk13,
|
||||
net.sourceforge.htmlunit.corejs.javascript.jdk15,
|
||||
net.sourceforge.htmlunit.corejs.javascript.json,
|
||||
net.sourceforge.htmlunit.corejs.javascript.optimizer,
|
||||
net.sourceforge.htmlunit.corejs.javascript.regexp,
|
||||
net.sourceforge.htmlunit.corejs.javascript.serialize,
|
||||
net.sourceforge.htmlunit.corejs.javascript.tools,
|
||||
net.sourceforge.htmlunit.corejs.javascript.tools.debugger,
|
||||
net.sourceforge.htmlunit.corejs.javascript.tools.debugger.treetable,
|
||||
net.sourceforge.htmlunit.corejs.javascript.tools.shell,
|
||||
net.sourceforge.htmlunit.corejs.javascript.v8dtoa,
|
||||
net.sourceforge.htmlunit.corejs.javascript.xml,
|
||||
netscape.javascript,
|
||||
org.apache.bcel,
|
||||
org.apache.bcel.classfile,
|
||||
org.apache.bcel.generic,
|
||||
org.apache.bcel.util,
|
||||
org.apache.bcel.verifier,
|
||||
org.apache.bcel.verifier.exc,
|
||||
org.apache.bcel.verifier.statics,
|
||||
org.apache.bcel.verifier.structurals,
|
||||
org.apache.commons.codec,
|
||||
org.apache.commons.codec.binary,
|
||||
org.apache.commons.codec.digest,
|
||||
org.apache.commons.codec.language,
|
||||
org.apache.commons.codec.language.bm,
|
||||
org.apache.commons.codec.net,
|
||||
org.apache.commons.collections,
|
||||
org.apache.commons.collections.bag,
|
||||
org.apache.commons.collections.bidimap,
|
||||
org.apache.commons.collections.buffer,
|
||||
org.apache.commons.collections.collection,
|
||||
org.apache.commons.collections.comparators,
|
||||
org.apache.commons.collections.functors,
|
||||
org.apache.commons.collections.iterators,
|
||||
org.apache.commons.collections.keyvalue,
|
||||
org.apache.commons.collections.list,
|
||||
org.apache.commons.collections.map,
|
||||
org.apache.commons.collections.set,
|
||||
org.apache.commons.el,
|
||||
org.apache.commons.el.parser,
|
||||
org.apache.commons.io,
|
||||
org.apache.commons.io.comparator,
|
||||
org.apache.commons.io.filefilter,
|
||||
org.apache.commons.io.input,
|
||||
org.apache.commons.io.monitor,
|
||||
org.apache.commons.io.output,
|
||||
org.apache.commons.lang3,
|
||||
org.apache.commons.lang3.builder,
|
||||
org.apache.commons.lang3.concurrent,
|
||||
org.apache.commons.lang3.event,
|
||||
org.apache.commons.lang3.exception,
|
||||
org.apache.commons.lang3.math,
|
||||
org.apache.commons.lang3.mutable,
|
||||
org.apache.commons.lang3.reflect,
|
||||
org.apache.commons.lang3.text,
|
||||
org.apache.commons.lang3.text.translate,
|
||||
org.apache.commons.lang3.time,
|
||||
org.apache.commons.lang3.tuple,
|
||||
org.apache.commons.logging,
|
||||
org.apache.commons.logging.impl,
|
||||
org.apache.html.dom,
|
||||
org.apache.http,
|
||||
org.apache.http.annotation,
|
||||
org.apache.http.auth,
|
||||
org.apache.http.auth.params,
|
||||
org.apache.http.client,
|
||||
org.apache.http.client.config,
|
||||
org.apache.http.client.entity,
|
||||
org.apache.http.client.methods,
|
||||
org.apache.http.client.params,
|
||||
org.apache.http.client.protocol,
|
||||
org.apache.http.client.utils,
|
||||
org.apache.http.concurrent,
|
||||
org.apache.http.config,
|
||||
org.apache.http.conn,
|
||||
org.apache.http.conn.params,
|
||||
org.apache.http.conn.routing,
|
||||
org.apache.http.conn.scheme,
|
||||
org.apache.http.conn.socket,
|
||||
org.apache.http.conn.ssl,
|
||||
org.apache.http.conn.util,
|
||||
org.apache.http.cookie,
|
||||
org.apache.http.cookie.params,
|
||||
org.apache.http.entity,
|
||||
org.apache.http.entity.mime,
|
||||
org.apache.http.entity.mime.content,
|
||||
org.apache.http.impl,
|
||||
org.apache.http.impl.auth,
|
||||
org.apache.http.impl.client,
|
||||
org.apache.http.impl.conn,
|
||||
org.apache.http.impl.conn.tsccm,
|
||||
org.apache.http.impl.cookie,
|
||||
org.apache.http.impl.entity,
|
||||
org.apache.http.impl.execchain,
|
||||
org.apache.http.impl.io,
|
||||
org.apache.http.impl.pool,
|
||||
org.apache.http.io,
|
||||
org.apache.http.message,
|
||||
org.apache.http.params,
|
||||
org.apache.http.pool,
|
||||
org.apache.http.protocol,
|
||||
org.apache.http.util,
|
||||
org.apache.james.mime4j,
|
||||
org.apache.james.mime4j.codec,
|
||||
org.apache.james.mime4j.descriptor,
|
||||
org.apache.james.mime4j.field,
|
||||
org.apache.james.mime4j.field.address,
|
||||
org.apache.james.mime4j.field.address.parser,
|
||||
org.apache.james.mime4j.field.contentdisposition.parser,
|
||||
org.apache.james.mime4j.field.contenttype.parser,
|
||||
org.apache.james.mime4j.field.datetime,
|
||||
org.apache.james.mime4j.field.datetime.parser,
|
||||
org.apache.james.mime4j.field.language.parser,
|
||||
org.apache.james.mime4j.field.mimeversion.parser,
|
||||
org.apache.james.mime4j.field.structured.parser,
|
||||
org.apache.james.mime4j.io,
|
||||
org.apache.james.mime4j.message,
|
||||
org.apache.james.mime4j.parser,
|
||||
org.apache.james.mime4j.storage,
|
||||
org.apache.james.mime4j.util,
|
||||
org.apache.jasper,
|
||||
org.apache.jasper.compiler,
|
||||
org.apache.jasper.compiler.tagplugin,
|
||||
org.apache.jasper.runtime,
|
||||
org.apache.jasper.security,
|
||||
org.apache.jasper.servlet,
|
||||
org.apache.jasper.tagplugins.jstl,
|
||||
org.apache.jasper.util,
|
||||
org.apache.jasper.xmlparser,
|
||||
org.apache.regexp,
|
||||
org.apache.tapestry.util.text,
|
||||
org.apache.tools.ant,
|
||||
org.apache.tools.ant.filters,
|
||||
org.apache.tools.ant.filters.util,
|
||||
org.apache.tools.ant.helper,
|
||||
org.apache.tools.ant.input,
|
||||
org.apache.tools.ant.listener,
|
||||
org.apache.tools.ant.loader,
|
||||
org.apache.tools.ant.taskdefs,
|
||||
org.apache.tools.ant.taskdefs.compilers,
|
||||
org.apache.tools.ant.taskdefs.condition,
|
||||
org.apache.tools.ant.taskdefs.cvslib,
|
||||
org.apache.tools.ant.taskdefs.email,
|
||||
org.apache.tools.ant.taskdefs.rmic,
|
||||
org.apache.tools.ant.types,
|
||||
org.apache.tools.ant.types.mappers,
|
||||
org.apache.tools.ant.types.resolver,
|
||||
org.apache.tools.ant.types.selectors,
|
||||
org.apache.tools.ant.types.selectors.modifiedselector,
|
||||
org.apache.tools.ant.util,
|
||||
org.apache.tools.ant.util.facade,
|
||||
org.apache.tools.ant.util.regexp,
|
||||
org.apache.tools.bzip2,
|
||||
org.apache.tools.mail,
|
||||
org.apache.tools.tar,
|
||||
org.apache.tools.zip,
|
||||
org.apache.wml,
|
||||
org.apache.wml.dom,
|
||||
org.apache.xalan,
|
||||
org.apache.xalan.client,
|
||||
org.apache.xalan.extensions,
|
||||
org.apache.xalan.lib,
|
||||
org.apache.xalan.lib.sql,
|
||||
org.apache.xalan.processor,
|
||||
org.apache.xalan.res,
|
||||
org.apache.xalan.serialize,
|
||||
org.apache.xalan.templates,
|
||||
org.apache.xalan.trace,
|
||||
org.apache.xalan.transformer,
|
||||
org.apache.xalan.xslt,
|
||||
org.apache.xalan.xsltc,
|
||||
org.apache.xalan.xsltc.cmdline,
|
||||
org.apache.xalan.xsltc.cmdline.getopt,
|
||||
org.apache.xalan.xsltc.compiler,
|
||||
org.apache.xalan.xsltc.compiler.util,
|
||||
org.apache.xalan.xsltc.dom,
|
||||
org.apache.xalan.xsltc.runtime,
|
||||
org.apache.xalan.xsltc.runtime.output,
|
||||
org.apache.xalan.xsltc.trax,
|
||||
org.apache.xalan.xsltc.util,
|
||||
org.apache.xerces.dom,
|
||||
org.apache.xerces.dom.events,
|
||||
org.apache.xerces.dom3.as,
|
||||
org.apache.xerces.impl,
|
||||
org.apache.xerces.impl.dtd,
|
||||
org.apache.xerces.impl.dtd.models,
|
||||
org.apache.xerces.impl.dv,
|
||||
org.apache.xerces.impl.dv.dtd,
|
||||
org.apache.xerces.impl.dv.util,
|
||||
org.apache.xerces.impl.dv.xs,
|
||||
org.apache.xerces.impl.io,
|
||||
org.apache.xerces.impl.msg,
|
||||
org.apache.xerces.impl.validation,
|
||||
org.apache.xerces.impl.xpath,
|
||||
org.apache.xerces.impl.xpath.regex,
|
||||
org.apache.xerces.impl.xs,
|
||||
org.apache.xerces.impl.xs.identity,
|
||||
org.apache.xerces.impl.xs.models,
|
||||
org.apache.xerces.impl.xs.opti,
|
||||
org.apache.xerces.impl.xs.traversers,
|
||||
org.apache.xerces.impl.xs.util,
|
||||
org.apache.xerces.jaxp,
|
||||
org.apache.xerces.jaxp.datatype,
|
||||
org.apache.xerces.jaxp.validation,
|
||||
org.apache.xerces.parsers,
|
||||
org.apache.xerces.stax,
|
||||
org.apache.xerces.stax.events,
|
||||
org.apache.xerces.util,
|
||||
org.apache.xerces.xinclude,
|
||||
org.apache.xerces.xni,
|
||||
org.apache.xerces.xni.grammars,
|
||||
org.apache.xerces.xni.parser,
|
||||
org.apache.xerces.xpointer,
|
||||
org.apache.xerces.xs,
|
||||
org.apache.xerces.xs.datatypes,
|
||||
org.apache.xml.dtm,
|
||||
org.apache.xml.dtm.ref,
|
||||
org.apache.xml.dtm.ref.dom2dtm,
|
||||
org.apache.xml.dtm.ref.sax2dtm,
|
||||
org.apache.xml.res,
|
||||
org.apache.xml.serialize,
|
||||
org.apache.xml.serializer,
|
||||
org.apache.xml.serializer.dom3,
|
||||
org.apache.xml.serializer.utils,
|
||||
org.apache.xml.utils,
|
||||
org.apache.xml.utils.res,
|
||||
org.apache.xmlcommons,
|
||||
org.apache.xpath,
|
||||
org.apache.xpath.axes,
|
||||
org.apache.xpath.compiler,
|
||||
org.apache.xpath.domapi,
|
||||
org.apache.xpath.functions,
|
||||
org.apache.xpath.jaxp,
|
||||
org.apache.xpath.objects,
|
||||
org.apache.xpath.operations,
|
||||
org.apache.xpath.patterns,
|
||||
org.apache.xpath.res,
|
||||
org.cyberneko.html,
|
||||
org.cyberneko.html.filters,
|
||||
org.cyberneko.html.parsers,
|
||||
org.cyberneko.html.xercesbridge,
|
||||
org.eclipse.jdt.core,
|
||||
org.eclipse.jdt.core.compiler,
|
||||
org.eclipse.jdt.core.compiler.batch,
|
||||
org.eclipse.jdt.internal.antadapter,
|
||||
org.eclipse.jdt.internal.compiler,
|
||||
org.eclipse.jdt.internal.compiler.ast,
|
||||
org.eclipse.jdt.internal.compiler.batch,
|
||||
org.eclipse.jdt.internal.compiler.classfmt,
|
||||
org.eclipse.jdt.internal.compiler.codegen,
|
||||
org.eclipse.jdt.internal.compiler.env,
|
||||
org.eclipse.jdt.internal.compiler.flow,
|
||||
org.eclipse.jdt.internal.compiler.impl,
|
||||
org.eclipse.jdt.internal.compiler.lookup,
|
||||
org.eclipse.jdt.internal.compiler.parser,
|
||||
org.eclipse.jdt.internal.compiler.parser.diagnose,
|
||||
org.eclipse.jdt.internal.compiler.problem,
|
||||
org.eclipse.jdt.internal.compiler.util,
|
||||
org.eclipse.jdt.internal.core.util,
|
||||
org.eclipse.jetty.continuation,
|
||||
org.eclipse.jetty.http,
|
||||
org.eclipse.jetty.http.gzip,
|
||||
org.eclipse.jetty.http.ssl,
|
||||
org.eclipse.jetty.io,
|
||||
org.eclipse.jetty.io.bio,
|
||||
org.eclipse.jetty.io.nio,
|
||||
org.eclipse.jetty.security,
|
||||
org.eclipse.jetty.security.authentication,
|
||||
org.eclipse.jetty.server,
|
||||
org.eclipse.jetty.server.bio,
|
||||
org.eclipse.jetty.server.handler,
|
||||
org.eclipse.jetty.server.handler.jmx,
|
||||
org.eclipse.jetty.server.jmx,
|
||||
org.eclipse.jetty.server.nio,
|
||||
org.eclipse.jetty.server.session,
|
||||
org.eclipse.jetty.server.session.jmx,
|
||||
org.eclipse.jetty.server.ssl,
|
||||
org.eclipse.jetty.servlet,
|
||||
org.eclipse.jetty.servlet.jmx,
|
||||
org.eclipse.jetty.servlet.listener,
|
||||
org.eclipse.jetty.servlets,
|
||||
org.eclipse.jetty.util,
|
||||
org.eclipse.jetty.util.ajax,
|
||||
org.eclipse.jetty.util.component,
|
||||
org.eclipse.jetty.util.log,
|
||||
org.eclipse.jetty.util.preventers,
|
||||
org.eclipse.jetty.util.resource,
|
||||
org.eclipse.jetty.util.security,
|
||||
org.eclipse.jetty.util.ssl,
|
||||
org.eclipse.jetty.util.statistic,
|
||||
org.eclipse.jetty.util.thread,
|
||||
org.eclipse.jetty.webapp,
|
||||
org.eclipse.jetty.websocket,
|
||||
org.eclipse.jetty.xml,
|
||||
org.objectweb.asm,
|
||||
org.objectweb.asm.commons,
|
||||
org.objectweb.asm.signature,
|
||||
org.objectweb.asm.tree,
|
||||
org.objectweb.asm.tree.analysis,
|
||||
org.objectweb.asm.util,
|
||||
org.objectweb.asm.xml,
|
||||
org.w3c.css.sac,
|
||||
org.w3c.css.sac.helpers,
|
||||
org.w3c.dom,
|
||||
org.w3c.dom.bootstrap,
|
||||
org.w3c.dom.css,
|
||||
org.w3c.dom.events,
|
||||
org.w3c.dom.html,
|
||||
org.w3c.dom.ls,
|
||||
org.w3c.dom.ranges,
|
||||
org.w3c.dom.stylesheets,
|
||||
org.w3c.dom.traversal,
|
||||
org.w3c.dom.views,
|
||||
org.w3c.dom.xpath,
|
||||
org.xml.sax,
|
||||
org.xml.sax.ext,
|
||||
org.xml.sax.helpers
|
||||
@@ -1,3 +1,3 @@
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/mongo-2.6.2.jar
|
||||
lib/gwt-dev.jar
|
||||
@@ -7,7 +7,7 @@
|
||||
<groupId>com.sap.sailing</groupId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.mongodb.driver</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<artifactId>com.google.gwt.dev</artifactId>
|
||||
<version>2.7.0</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
@@ -172,6 +172,22 @@ Export-Package: com.google.gwt.activity.shared,
|
||||
com.google.web.bindery.requestfactory.vm.testing,
|
||||
org.hibernate.validator,
|
||||
org.hibernate.validator.engine
|
||||
Require-Bundle: javax.validation;bundle-version="1.0.0"
|
||||
Import-Package: javax.servlet;version="2.6.0",
|
||||
javax.servlet.http;version="2.6.0"
|
||||
Require-Bundle: javax.validation;bundle-version="1.0.0";resolution:=optional,
|
||||
org.junit4;bundle-version="4.8.2";resolution:=optional
|
||||
Import-Package: com.gargoylesoftware.htmlunit;resolution:=optional,
|
||||
com.google.gwt.core.ext;resolution:=optional,
|
||||
com.google.gwt.core.ext.typeinfo;resolution:=optional,
|
||||
com.google.gwt.dev;resolution:=optional,
|
||||
com.google.gwt.dev.cfg;resolution:=optional,
|
||||
com.google.gwt.dev.javac.typemodel;resolution:=optional,
|
||||
com.google.gwt.dev.shell;resolution:=optional,
|
||||
com.google.gwt.dev.shell.jetty;resolution:=optional,
|
||||
com.google.gwt.dev.util.arg;resolution:=optional,
|
||||
com.google.gwt.dev.util.collect;resolution:=optional,
|
||||
com.google.gwt.junit;resolution:=optional,
|
||||
com.google.gwt.thirdparty.guava.common.collect;resolution:=optional,
|
||||
com.google.gwt.util.tools;resolution:=optional,
|
||||
javax.servlet;version="2.6.0";resolution:=optional,
|
||||
javax.servlet.http;version="2.6.0";resolution:=optional,
|
||||
org.eclipse.jetty.server;resolution:=optional,
|
||||
org.eclipse.jetty.webapp;resolution:=optional
|
||||
@@ -1 +0,0 @@
|
||||
bin/
|
||||
@@ -1,5 +0,0 @@
|
||||
#Fri Jul 29 09:33:56 CEST 2011
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -1,18 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Driver
|
||||
Bundle-SymbolicName: com.mongodb.driver
|
||||
Bundle-Version: 2.6.2
|
||||
Bundle-Vendor: MONGODB
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: lib/mongo-2.6.2.jar,
|
||||
.
|
||||
Export-Package: com.mongodb,
|
||||
com.mongodb.gridfs,
|
||||
com.mongodb.io,
|
||||
com.mongodb.util,
|
||||
org.bson,
|
||||
org.bson.io,
|
||||
org.bson.types,
|
||||
org.bson.util
|
||||
@@ -21,7 +21,8 @@ Require-Bundle: com.sap.sailing.domain,
|
||||
com.sap.sailing.declination,
|
||||
org.json.simple;bundle-version="1.1.0",
|
||||
com.sap.sailing.udpconnector,
|
||||
com.googlecode.mgwt;bundle-version="2.0.0"
|
||||
com.googlecode.mgwt;bundle-version="2.0.0",
|
||||
com.sap.sse.gwt.adminconsole
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: org.osgi.framework;version="1.5.0",
|
||||
org.osgi.util.tracker
|
||||
|
||||
@@ -70,22 +70,11 @@
|
||||
line-height: 0pt;
|
||||
}
|
||||
|
||||
.competitorEditButton {
|
||||
.eventLogo {
|
||||
position: absolute;
|
||||
height: 23.5pt;
|
||||
width: 23.5pt;
|
||||
right: 10pt;
|
||||
top: 17.5pt;
|
||||
right: 12.5px;
|
||||
bottom: 10px;
|
||||
height: 22.5pt;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.competitorLabel{
|
||||
position: absolute;
|
||||
width: 200pt;
|
||||
height: 23.5pt;
|
||||
margin-top: 17.5pt;
|
||||
right: 43.5pt;
|
||||
font-size: 12pt;
|
||||
font-color: black;
|
||||
text-align: right;
|
||||
line-height: 23.5pt;
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
<!doctype html>
|
||||
<!-- The DOCTYPE declaration above will set the -->
|
||||
<!-- browser's rendering engine into -->
|
||||
<!-- "Standards Mode". Replacing this declaration -->
|
||||
<!-- with a "Quirks Mode" doctype may lead to some -->
|
||||
<!-- differences in layout. -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="REFRESH" content="0; url=http://www.sapsailing.com/browser-info.html">
|
||||
<![endif]-->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<link href='src/main/resources/images/dashboardicon.png'
|
||||
rel='apple-touch-startup-image'>
|
||||
<link href='src/main/resources/images/dashboardicon.png' rel='apple-touch-icon'>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="src/main/resources/images/dashboardicon.png" />
|
||||
|
||||
<link href='images/dashboardicon.png' rel='apple-touch-icon'>
|
||||
|
||||
<title>ESS Dashboard</title>
|
||||
|
||||
@@ -19,7 +21,7 @@
|
||||
<script type="text/javascript"
|
||||
src="com.sap.sailing.dashboards.gwt.RibDashboard/com.sap.sailing.dashboards.gwt.RibDashboard.nocache.js"></script>
|
||||
|
||||
<!-- Disables vertical scrolling whole website over edge on apple browsers -->
|
||||
<!-- Disables scrolling whole website vertically over edge on apple browsers -->
|
||||
<script type="text/javascript">
|
||||
document.ontouchmove = function(event){
|
||||
event.preventDefault();
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="false"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
|
||||
@@ -18,6 +22,8 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
@@ -28,13 +34,14 @@
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-servlet.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XstartOnFirstThread -Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,55 @@
|
||||
package com.sap.sailing.dashboards.gwt.client;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.dom.client.Style.Visibility;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
|
||||
public class EventLogo extends Image {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RibDashboardPanel.class.getName());
|
||||
|
||||
protected EventLogo() {
|
||||
super();
|
||||
this.getElement().addClassName("eventLogo");
|
||||
}
|
||||
|
||||
public static EventLogo getEventLogoFromEventId(SailingServiceAsync sailingServiceAsync, String eventId) {
|
||||
final EventLogo eventLogo = new EventLogo();
|
||||
eventLogo.getElement().setAttribute("src", "someURL");
|
||||
try {
|
||||
final UUID eventUUID = UUID.fromString(eventId);
|
||||
sailingServiceAsync.getEventById(eventUUID, true, new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final EventDTO event) {
|
||||
logger.log(Level.INFO, "GOT EVENT: ");
|
||||
final String logoUrl = event.getLogoImageURL();
|
||||
// Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
//
|
||||
// @Override
|
||||
// public void execute() {
|
||||
if (logoUrl != null) {
|
||||
eventLogo.getElement().setAttribute("src", logoUrl);
|
||||
} else {
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
});
|
||||
} catch (IllegalArgumentException e) {
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
return eventLogo;
|
||||
}
|
||||
}
|
||||
@@ -5,26 +5,10 @@ import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.dom.client.Document;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.user.client.Cookies;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.sap.sailing.dashboards.gwt.client.actions.GetRibDashboardRaceInfoAction;
|
||||
import com.sap.sailing.dashboards.gwt.client.bottomnotification.BottomNotification;
|
||||
import com.sap.sailing.dashboards.gwt.client.device.Location;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.RacingNotYetStartedPopup;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.RacingNotYetStartedPopupListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionPopup;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionPopupListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.NewStartAnalysisListener;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RibDashboardRaceInfoDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.gwt.ui.client.RaceSelectionChangeListener;
|
||||
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
||||
@@ -39,126 +23,48 @@ import com.sap.sse.gwt.client.player.TimeListener;
|
||||
* @author Alexander Ries
|
||||
*
|
||||
*/
|
||||
public class RibDashboardDataRetriever implements RacingNotYetStartedPopupListener, CompetitorSelectionPopupListener,
|
||||
TimeListener, RaceSelectionProvider {
|
||||
public class RibDashboardDataRetriever implements TimeListener, RaceSelectionProvider {
|
||||
|
||||
private int numberOfCachedStartAnalysisDTOs;
|
||||
private String leaderboardName;
|
||||
private ArrayList<RibDashboardDataRetrieverListener> dataRetrieverListener;
|
||||
private ArrayList<NewStartAnalysisListener> newStartAnalysisListeners;
|
||||
private ArrayList<RaceSelectionChangeListener> raceSelectionChangeListener;
|
||||
|
||||
private String selectedCompetitorName;
|
||||
|
||||
private CompetitorSelectionPopup competitorSelectionPopup;
|
||||
private RacingNotYetStartedPopup popupRacingNotYetStarted;
|
||||
private BottomNotification bottomNotification;
|
||||
private FocusPanel competitorEditButton;
|
||||
private Label competitorLabel;
|
||||
private boolean shouldReloadStartAnalysis;
|
||||
|
||||
private AsyncActionsExecutor asyncActionsExecutor;
|
||||
|
||||
private final RibDashboardServiceAsync ribDashboardService;
|
||||
|
||||
private final Object MUTEX;
|
||||
|
||||
private static RibDashboardDataRetriever INSTANCE = null;
|
||||
|
||||
private static final String PARAM_LEADERBOARD_NAME = "leaderboardName";
|
||||
private static final String KEY_SLECTED_TEAM_COOKIE = "selectedTeam";
|
||||
private static final int SLECTED_TEAM_COOKIE_EXPIRE_TIME_IN_MILLIS = 60 * 1000 * 60 * 5;
|
||||
|
||||
public RibDashboardDataRetriever(RibDashboardServiceAsync ribDashboardService) {
|
||||
initNonFinalMemberVariablesWithNoArgumentConstructor();
|
||||
initRacingNotYetStartedPopup();
|
||||
MUTEX = new Object();
|
||||
this.ribDashboardService = ribDashboardService;
|
||||
this.leaderboardName = Window.Location.getParameter(PARAM_LEADERBOARD_NAME);
|
||||
numberOfCachedStartAnalysisDTOs = 0;
|
||||
competitorSelectionPopup = new CompetitorSelectionPopup();
|
||||
selectedCompetitorName = Cookies.getCookie(KEY_SLECTED_TEAM_COOKIE);
|
||||
asyncActionsExecutor = new AsyncActionsExecutor();
|
||||
initCompetitorLabelAndAddToRootPanel();
|
||||
initBottomNotification();
|
||||
}
|
||||
|
||||
public static RibDashboardDataRetriever getInstance(RibDashboardServiceAsync ribDashboardService) {
|
||||
synchronized (Location.class) {
|
||||
if (INSTANCE == null) {
|
||||
if (ribDashboardService == null) {
|
||||
throw new RuntimeException("Can not initialize data retriever without reference to ribdashboard service");
|
||||
}
|
||||
INSTANCE = new RibDashboardDataRetriever(ribDashboardService);
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private void initRacingNotYetStartedPopup() {
|
||||
popupRacingNotYetStarted = new RacingNotYetStartedPopup();
|
||||
popupRacingNotYetStarted.addListener(this);
|
||||
}
|
||||
|
||||
private void initBottomNotification() {
|
||||
bottomNotification = new BottomNotification();
|
||||
RootPanel.get().add(bottomNotification);
|
||||
}
|
||||
|
||||
private void initNonFinalMemberVariablesWithNoArgumentConstructor() {
|
||||
dataRetrieverListener = new ArrayList<RibDashboardDataRetrieverListener>();
|
||||
newStartAnalysisListeners = new ArrayList<NewStartAnalysisListener>();
|
||||
raceSelectionChangeListener = new ArrayList<RaceSelectionChangeListener>();
|
||||
}
|
||||
|
||||
private void loadLiveRaceInfoFromRibDashboadService() {
|
||||
GetRibDashboardRaceInfoAction getRibDashboardRaceInfoAction = new GetRibDashboardRaceInfoAction(ribDashboardService, leaderboardName, selectedCompetitorName);
|
||||
|
||||
GetRibDashboardRaceInfoAction getRibDashboardRaceInfoAction = new GetRibDashboardRaceInfoAction(ribDashboardService, leaderboardName);
|
||||
|
||||
asyncActionsExecutor.execute(getRibDashboardRaceInfoAction, new AsyncCallback<RibDashboardRaceInfoDTO>() {
|
||||
@Override
|
||||
public void onSuccess(RibDashboardRaceInfoDTO result) {
|
||||
switch (result.responseMessage) {
|
||||
case OK:
|
||||
popupRacingNotYetStarted.hide(/* remove blur effect */true);
|
||||
case RACE_LIVE:
|
||||
List<RegattaAndRaceIdentifier> singletonList = Collections
|
||||
.singletonList(result.idOfLastTrackedRace);
|
||||
setSelection(singletonList);
|
||||
if (result.startAnalysisDTOList != null) {
|
||||
int numberOfReceivedStartAnalysisDTOs = result.startAnalysisDTOList.size();
|
||||
if (numberOfCachedStartAnalysisDTOs != numberOfReceivedStartAnalysisDTOs || shouldReloadStartAnalysis == true) {
|
||||
shouldReloadStartAnalysis = false;
|
||||
numberOfCachedStartAnalysisDTOs = numberOfReceivedStartAnalysisDTOs;
|
||||
notifyNewStartAnalysisListener(result.startAnalysisDTOList, selectedCompetitorName);
|
||||
}
|
||||
}
|
||||
if(competitorEditButton == null){
|
||||
initCompetitorChangeButtonAndAddToRootPanel();
|
||||
setCompetitorLabelText(selectedCompetitorName);
|
||||
}
|
||||
if (result.competitorNamesFromLastTrackedRace != null
|
||||
&& result.competitorNamesFromLastTrackedRace.size() > 0
|
||||
&& !competitorSelectionPopup.isShown()) {
|
||||
competitorSelectionPopup.setCompetitorList(result.competitorNamesFromLastTrackedRace);
|
||||
competitorSelectionPopup.addListener(RibDashboardDataRetriever.this);
|
||||
}
|
||||
notifyDataObservers(result);
|
||||
break;
|
||||
case NO_COMPETITOR_SELECTED:
|
||||
popupRacingNotYetStarted.hide(true);
|
||||
if (result.competitorNamesFromLastTrackedRace != null
|
||||
&& result.competitorNamesFromLastTrackedRace.size() > 0
|
||||
&& !competitorSelectionPopup.isShown()) {
|
||||
competitorSelectionPopup.setCompetitorList(result.competitorNamesFromLastTrackedRace);
|
||||
competitorSelectionPopup.addListener(RibDashboardDataRetriever.this);
|
||||
competitorSelectionPopup.show();
|
||||
}
|
||||
break;
|
||||
case NO_RACE_LIVE:
|
||||
if (numberOfCachedStartAnalysisDTOs == 0) {
|
||||
popupRacingNotYetStarted.showWithMessageAndImageAndButtonText("Racing not yet started",
|
||||
RibDashboardImageResources.INSTANCE.watch(), "Retry");
|
||||
} else {
|
||||
setSelection(null);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -195,68 +101,6 @@ public class RibDashboardDataRetriever implements RacingNotYetStartedPopupListen
|
||||
}
|
||||
}
|
||||
|
||||
public void addNewStartAnalysisListener(NewStartAnalysisListener o) {
|
||||
synchronized (MUTEX) {
|
||||
if (o != null && !newStartAnalysisListeners.contains(o)) {
|
||||
this.newStartAnalysisListeners.add(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeNewStartAnalysisListener(NewStartAnalysisListener o) {
|
||||
synchronized (MUTEX) {
|
||||
this.newStartAnalysisListeners.remove(o);
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyNewStartAnalysisListener(List<StartAnalysisDTO> startAnalysisDTOs, String selectedCompetitor) {
|
||||
synchronized (MUTEX) {
|
||||
for (NewStartAnalysisListener newStartAnalysisListener : newStartAnalysisListeners) {
|
||||
newStartAnalysisListener.addNewStartAnalysisCardForCompetitor(startAnalysisDTOs, selectedCompetitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initCompetitorChangeButtonAndAddToRootPanel() {
|
||||
if (competitorEditButton == null) {
|
||||
competitorEditButton = new FocusPanel();
|
||||
competitorEditButton.addStyleName("competitorEditButton");
|
||||
Image settingsImage = new Image();
|
||||
settingsImage.setResource(RibDashboardImageResources.INSTANCE.settings());
|
||||
competitorEditButton.add(settingsImage);
|
||||
competitorEditButton.addDomHandler(new ClickHandler() {
|
||||
public void onClick(ClickEvent event) {
|
||||
competitorSelectionPopup.show();
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
RootPanel.get().add(competitorEditButton);
|
||||
}
|
||||
}
|
||||
|
||||
private void initCompetitorLabelAndAddToRootPanel() {
|
||||
competitorLabel = new Label();
|
||||
competitorLabel.addStyleName("competitorLabel");
|
||||
Document.get().getBody().appendChild(competitorLabel.getElement());
|
||||
}
|
||||
|
||||
private void setCompetitorLabelText(String slectedCompetitor) {
|
||||
competitorLabel.setText(slectedCompetitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void popupButtonClicked() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didClickedOKWithCompetitorName(String competitorName) {
|
||||
this.selectedCompetitorName = competitorName;
|
||||
Cookies.setCookie(KEY_SLECTED_TEAM_COOKIE, competitorName, new Date(new Date().getTime()
|
||||
+ SLECTED_TEAM_COOKIE_EXPIRE_TIME_IN_MILLIS));
|
||||
initCompetitorChangeButtonAndAddToRootPanel();
|
||||
setCompetitorLabelText(competitorName);
|
||||
shouldReloadStartAnalysis = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void timeChanged(Date newTime, Date oldTime) {
|
||||
loadLiveRaceInfoFromRibDashboadService();
|
||||
|
||||
@@ -33,10 +33,10 @@ public class RibDashboardEntryPoint extends AbstractEntryPoint<StringMessages> {
|
||||
RibDashboardServiceAsync ribdashboardService = GWT.create(RibDashboardService.class);
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) ribdashboardService, RemoteServiceMappingConstants.WEB_CONTEXT_PATH, RemoteServiceMappingConstants.ribdashboardServiceRemotePath);
|
||||
|
||||
RibDashboardDataRetriever dataRetriever = RibDashboardDataRetriever.getInstance(ribdashboardService);
|
||||
RibDashboardDataRetriever dataRetriever = new RibDashboardDataRetriever(ribdashboardService);
|
||||
|
||||
applyMGWTSettings();
|
||||
RibDashboardPanel ribDashboardPanel = new RibDashboardPanel(ribdashboardService);
|
||||
RibDashboardPanel ribDashboardPanel = new RibDashboardPanel(ribdashboardService, sailingService, dataRetriever);
|
||||
RootLayoutPanel.get().add(ribDashboardPanel);
|
||||
WindBotDataRetriever windBotDataRetriever = new WindBotDataRetriever(sailingService);
|
||||
windBotDataRetriever.addNumberOfWindBotsChangeListeners(ribDashboardPanel);
|
||||
|
||||
@@ -33,9 +33,6 @@ public interface RibDashboardImageResources extends ClientBundle {
|
||||
@Source("images/rightarrow_disabled.png")
|
||||
ImageResource rightdisabled();
|
||||
|
||||
@Source("images/windarrow.png")
|
||||
ImageResource windarrow();
|
||||
|
||||
@Source("images/compass.png")
|
||||
ImageResource compass();
|
||||
|
||||
|
||||
@@ -10,18 +10,19 @@ import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Document;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.LayoutPanel;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.googlecode.mgwt.ui.client.widget.carousel.Carousel;
|
||||
import com.sap.sailing.dashboards.gwt.client.bottomnotification.BottomNotification;
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.StartlineAnalysisComponent;
|
||||
import com.sap.sailing.dashboards.gwt.client.startlineadvantage.StartLineAdvantageComponent;
|
||||
import com.sap.sailing.dashboards.gwt.client.windchart.WindBotComponent;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RibDashboardRaceInfoDTO;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* This class contains all components of the Dashboard and the basic UI Elements of the Dashboard, like top and bottom
|
||||
@@ -57,7 +58,7 @@ public class RibDashboardPanel extends Composite implements RibDashboardDataRetr
|
||||
@UiField
|
||||
HTMLPanel rightwindbotcontainer;
|
||||
|
||||
@UiField
|
||||
@UiField(provided = true)
|
||||
public StartLineAdvantageComponent startLineCAComponent;
|
||||
|
||||
@UiField
|
||||
@@ -69,19 +70,34 @@ public class RibDashboardPanel extends Composite implements RibDashboardDataRetr
|
||||
@UiField
|
||||
public HTMLPanel bottombar;
|
||||
|
||||
@UiField
|
||||
public HTMLPanel windcharthint;
|
||||
|
||||
@UiField(provided = true)
|
||||
public StartlineAnalysisComponent startanalysisComponent;
|
||||
|
||||
private BottomNotification bottomNotification;
|
||||
private List<WindBotComponent> windBotComponents;
|
||||
private StringMessages stringConstants;
|
||||
private final String EVENT_ID_PARAMETER = "eventId";
|
||||
|
||||
public RibDashboardPanel(RibDashboardServiceAsync ribDashboardService) {
|
||||
public RibDashboardPanel(RibDashboardServiceAsync ribDashboardService, SailingServiceAsync sailingServiceAsync, RibDashboardDataRetriever ribDashboardDataRetriever) {
|
||||
windBotComponents = new ArrayList<WindBotComponent>();
|
||||
RibDashboardDataRetriever.getInstance(ribDashboardService).addDataObserver(this);
|
||||
initBottomNotification();
|
||||
startanalysisComponent = new StartlineAnalysisComponent(bottomNotification, ribDashboardService);
|
||||
ribDashboardDataRetriever.addDataObserver(this);
|
||||
startanalysisComponent = new StartlineAnalysisComponent(ribDashboardService, sailingServiceAsync);
|
||||
startLineCAComponent = new StartLineAdvantageComponent(ribDashboardDataRetriever);
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
initLogos();
|
||||
windcharthint.getElement().setInnerText(stringConstants.dashboardWindChartHint());
|
||||
windloadinghintleft.setInnerText(stringConstants.dashboardWindBotLoading());
|
||||
windloadinghintright.setInnerText(stringConstants.dashboardWindBotLoading());
|
||||
|
||||
String eventId = Window.Location.getParameter(EVENT_ID_PARAMETER);
|
||||
EventLogo eventLogo = EventLogo.getEventLogoFromEventId(sailingServiceAsync, eventId);
|
||||
if(eventLogo != null){
|
||||
Document.get().getBody().appendChild(eventLogo.getElement());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initLogos() {
|
||||
@@ -89,16 +105,6 @@ public class RibDashboardPanel extends Composite implements RibDashboardDataRetr
|
||||
logo.setResource(RibDashboardImageResources.INSTANCE.logo_sap());
|
||||
logo.getElement().addClassName(style.logo());
|
||||
Document.get().getBody().appendChild(logo.getElement());
|
||||
|
||||
Image esslogo = new Image();
|
||||
esslogo.setResource(RibDashboardImageResources.INSTANCE.logoess());
|
||||
esslogo.getElement().addClassName(style.extremelogo());
|
||||
Document.get().getBody().appendChild(esslogo.getElement());
|
||||
}
|
||||
|
||||
private void initBottomNotification() {
|
||||
bottomNotification = new BottomNotification();
|
||||
RootPanel.get().add(bottomNotification);
|
||||
}
|
||||
|
||||
private void initWindBotComponents(List<String> windBotIDs,
|
||||
@@ -122,8 +128,8 @@ public class RibDashboardPanel extends Composite implements RibDashboardDataRetr
|
||||
windBotAddedCounterTOConsiderForPanels++;
|
||||
if (windloadinghintleft.getStyle().getOpacity() != "0.0"
|
||||
|| windloadinghintright.getStyle().getOpacity() != "0.0") {
|
||||
windloadinghintleft.setInnerHTML("Wind bot not available.");
|
||||
windloadinghintright.setInnerHTML("Wind bot not available.");
|
||||
windloadinghintleft.setInnerHTML(stringConstants.dashboardWindBotNotAvailable());
|
||||
windloadinghintright.setInnerHTML(stringConstants.dashboardWindBotNotAvailable());
|
||||
}
|
||||
}
|
||||
addWindBotComponentsAsDataRetrieverListener(windBotDataRetrieverProvider);
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
<mgwtcarousel:Carousel ui:field="carousel">
|
||||
<mgwtpanel:Panel styleName="{style.page}">
|
||||
<g:HTMLPanel ui:field="leftwindbotcontainer" styleName="{style.collumn} {style.left}">
|
||||
<div class="{style.windloadinghint}"><div ui:field="windloadinghintleft" class="{style.windloadinghinttext}">Loading Wind Bot Data...</div></div>
|
||||
<div class="{style.windloadinghint}"><div ui:field="windloadinghintleft" class="{style.windloadinghinttext}"></div></div>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="rightwindbotcontainer"
|
||||
styleName="{style.collumn} {style.right}">
|
||||
<div class="{style.windloadinghint}"><div ui:field="windloadinghintright" class="{style.windloadinghinttext}">Loading Wind Bot Data...</div></div>
|
||||
<div class="{style.windloadinghint}"><div ui:field="windloadinghintright" class="{style.windloadinghinttext}"></div></div>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{style.windcharthint}">Tap on chart to change interval.</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="windcharthint" styleName="{style.windcharthint}"></g:HTMLPanel>
|
||||
</mgwtpanel:Panel>
|
||||
<mgwtpanel:Panel styleName="{style.page}">
|
||||
<g:HTMLPanel styleName="{style.collumn} {style.startanalysiscollumn}">
|
||||
|
||||
@@ -4,6 +4,5 @@ import com.google.gwt.resources.client.CssResource;
|
||||
|
||||
public interface RibDashboardPanelStyle extends CssResource {
|
||||
String logo();
|
||||
String extremelogo();
|
||||
String start();
|
||||
}
|
||||
@@ -1,9 +1,17 @@
|
||||
package com.sap.sailing.dashboards.gwt.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RibDashboardRaceInfoDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.domain.common.NoWindException;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public interface RibDashboardService extends RemoteService {
|
||||
RibDashboardRaceInfoDTO getLiveRaceInfo(String leaderboardName, String competitorName) throws NoWindException;
|
||||
RibDashboardRaceInfoDTO getLiveRaceInfo(String leaderboardName) throws NoWindException;
|
||||
|
||||
List<StartAnalysisDTO> getStartAnalysisListForCompetitorIDAndLeaderboardName(String competitorIdAsString, String leaderboardName);
|
||||
|
||||
List<CompetitorDTO> getCompetitorsInLeaderboard(String leaderboardName);
|
||||
}
|
||||
@@ -1,10 +1,18 @@
|
||||
package com.sap.sailing.dashboards.gwt.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RibDashboardRaceInfoDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public interface RibDashboardServiceAsync {
|
||||
|
||||
void getLiveRaceInfo(String leaderboardName, String competitorName, AsyncCallback<RibDashboardRaceInfoDTO> callback);
|
||||
void getLiveRaceInfo(String leaderboardName, AsyncCallback<RibDashboardRaceInfoDTO> callback);
|
||||
|
||||
void getStartAnalysisListForCompetitorIDAndLeaderboardName(String competitorIdAsString, String leaderboardName, AsyncCallback<List<StartAnalysisDTO>> callback);
|
||||
|
||||
void getCompetitorsInLeaderboard(String leaderboardName, AsyncCallback<List<CompetitorDTO>> callback);
|
||||
|
||||
}
|
||||
@@ -34,17 +34,6 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.extremelogo {
|
||||
position: absolute;
|
||||
left: 100%;
|
||||
top: 100%;
|
||||
width: 90pt;
|
||||
height: 22.5pt;
|
||||
margin-top: -31pt;
|
||||
margin-left: -100pt;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.collumn {
|
||||
position: absolute;
|
||||
top: 5pt;
|
||||
@@ -161,32 +150,6 @@
|
||||
bottom: 0pt;
|
||||
}
|
||||
|
||||
.windloadinghint {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
opacity: 0.4;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.windloadinghinttext {
|
||||
position: absolute;
|
||||
bottom: 0pt;
|
||||
height: 15pt;
|
||||
line-height: 15pt;
|
||||
margin-top: 0pt;
|
||||
vertical-align: middle;
|
||||
font-size: 12pt;
|
||||
font-family: "Arial";
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
top: 50%;
|
||||
margin-top: -7pt;
|
||||
}
|
||||
|
||||
.leaderboardpanel {
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
@@ -329,3 +292,29 @@ windchartcontainer {
|
||||
left: 260%;
|
||||
background-color: #0DBFFF;
|
||||
}
|
||||
|
||||
.windloadinghint {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
opacity: 0.4;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.windloadinghinttext {
|
||||
position: absolute;
|
||||
bottom: 0pt;
|
||||
height: 15pt;
|
||||
line-height: 15pt;
|
||||
margin-top: 0pt;
|
||||
vertical-align: middle;
|
||||
font-size: 12pt;
|
||||
font-family: "Arial";
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
top: 50%;
|
||||
margin-top: -7pt;
|
||||
}
|
||||
@@ -9,16 +9,14 @@ public class GetRibDashboardRaceInfoAction implements AsyncAction<RibDashboardRa
|
||||
|
||||
private final RibDashboardServiceAsync ribDashboardService;
|
||||
private final String leaderboardName;
|
||||
private final String competitorName;
|
||||
|
||||
public GetRibDashboardRaceInfoAction(RibDashboardServiceAsync ribDashboardService, String leaderboardName, String competitorName) {
|
||||
public GetRibDashboardRaceInfoAction(RibDashboardServiceAsync ribDashboardService, String leaderboardName) {
|
||||
this.ribDashboardService = ribDashboardService;
|
||||
this.leaderboardName = leaderboardName;
|
||||
this.competitorName = competitorName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(AsyncCallback<RibDashboardRaceInfoDTO> callback) {
|
||||
ribDashboardService.getLiveRaceInfo(leaderboardName, competitorName, callback);
|
||||
ribDashboardService.getLiveRaceInfo(leaderboardName, callback);
|
||||
}
|
||||
}
|
||||
@@ -39,18 +39,14 @@ public class BottomNotification extends FocusPanel {
|
||||
bottomNotificationClickListeners = new ArrayList<BottomNotificationClickListener>();
|
||||
}
|
||||
|
||||
public void initClickHander() {
|
||||
|
||||
}
|
||||
|
||||
public void show(String message, String backgroundColorAsHex, String textcolorAsHex, boolean dismissAfter20Seconds) {
|
||||
public void show(BottomNotificationType bottomNotificationType) {
|
||||
shown = true;
|
||||
this.removeStyleName("bottomnotificationhidden");
|
||||
this.addStyleName("bottomnotificationshow");
|
||||
this.getElement().setInnerHTML(message);
|
||||
this.getElement().getStyle().setBackgroundColor(backgroundColorAsHex);
|
||||
this.getElement().getStyle().setColor(textcolorAsHex);
|
||||
if (dismissAfter20Seconds) {
|
||||
this.getElement().setInnerHTML(bottomNotificationType.getMessage());
|
||||
this.getElement().getStyle().setBackgroundColor(bottomNotificationType.getBackgroundColorAsHex());
|
||||
this.getElement().getStyle().setColor(bottomNotificationType.getTextColorAsHex());
|
||||
if (bottomNotificationType.isShouldDisappearAfter20Seconds()) {
|
||||
Timer timer = new Timer() {
|
||||
public void run() {
|
||||
hide();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.bottomnotification;
|
||||
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
public enum BottomNotificationType {
|
||||
|
||||
NEW_STARTANALYSIS_AVAILABLE(StringMessages.INSTANCE.dashboardNewStartAnalysisAvailable(), "#F0AB00", "#000000", true);
|
||||
|
||||
private String message;
|
||||
private String backgroundColorAsHex;
|
||||
private String textColorAsHex;
|
||||
private boolean shouldDisappearAfter20Seconds;
|
||||
|
||||
private BottomNotificationType(String message, String backgroundColorAsHex, String textColorAsHex, boolean shouldDisappearAfter20Seconds) {
|
||||
this.message = message;
|
||||
this.backgroundColorAsHex = backgroundColorAsHex;
|
||||
this.textColorAsHex = textColorAsHex;
|
||||
this.shouldDisappearAfter20Seconds = shouldDisappearAfter20Seconds;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public String getBackgroundColorAsHex() {
|
||||
return backgroundColorAsHex;
|
||||
}
|
||||
|
||||
public String getTextColorAsHex() {
|
||||
return textColorAsHex;
|
||||
}
|
||||
|
||||
public boolean isShouldDisappearAfter20Seconds() {
|
||||
return shouldDisappearAfter20Seconds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public interface CompetitorSelectionListener {
|
||||
|
||||
public void didClickOKWithSelectedCompetitor(CompetitorDTO competitor);
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public class CompetitorSelectionPopup extends Composite implements HasWidgets, CompetitorTableRowSelectionListener {
|
||||
|
||||
@@ -44,10 +45,10 @@ public class CompetitorSelectionPopup extends Composite implements HasWidgets, C
|
||||
@UiField
|
||||
Button button;
|
||||
|
||||
private String currentCompetitorSelected;
|
||||
private CompetitorDTO currentCompetitorSelected;
|
||||
private boolean isVisible;
|
||||
|
||||
private List<CompetitorSelectionPopupListener> competitorSelectionPopupListener;
|
||||
private List<CompetitorSelectionListener> competitorSelectionPopupListener;
|
||||
|
||||
private static CompetitorSelectionPopupUiBinder uiBinder = GWT.create(CompetitorSelectionPopupUiBinder.class);
|
||||
|
||||
@@ -55,17 +56,14 @@ public class CompetitorSelectionPopup extends Composite implements HasWidgets, C
|
||||
}
|
||||
|
||||
public CompetitorSelectionPopup() {
|
||||
competitorSelectionPopupListener = new ArrayList<CompetitorSelectionPopupListener>();
|
||||
competitorSelectionPopupListener = new ArrayList<CompetitorSelectionListener>();
|
||||
competitortable = new CompetitorTable(this);
|
||||
isVisible = false;
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
public void setCompetitorList(List<String> competitorList){
|
||||
public void show(List<CompetitorDTO> competitorList) {
|
||||
competitortable.setTableContent(competitorList);
|
||||
}
|
||||
|
||||
public void show() {
|
||||
RootPanel.get().add(this);
|
||||
this.button.setText("OK");
|
||||
this.getElement().addClassName(style.popupshow());
|
||||
@@ -84,19 +82,19 @@ public class CompetitorSelectionPopup extends Composite implements HasWidgets, C
|
||||
isVisible = false;
|
||||
}
|
||||
|
||||
public void addListener(CompetitorSelectionPopupListener o) {
|
||||
public void addListener(CompetitorSelectionListener o) {
|
||||
if (o != null && !competitorSelectionPopupListener.contains(o)) {
|
||||
this.competitorSelectionPopupListener.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeListener(CompetitorSelectionPopupListener o) {
|
||||
public void removeListener(CompetitorSelectionListener o) {
|
||||
this.competitorSelectionPopupListener.remove(o);
|
||||
}
|
||||
|
||||
public void notifyListenerAboutOKButtonClickedWithSelectedCompetitorName(String competitorName) {
|
||||
for (CompetitorSelectionPopupListener newStartAnalysisListener : competitorSelectionPopupListener) {
|
||||
newStartAnalysisListener.didClickedOKWithCompetitorName(competitorName);
|
||||
public void notifyListenerAboutOKButtonClickedWithSelectedCompetitorName(CompetitorDTO competitor) {
|
||||
for (CompetitorSelectionListener newStartAnalysisListener : competitorSelectionPopupListener) {
|
||||
newStartAnalysisListener.didClickOKWithSelectedCompetitor(competitor);
|
||||
}
|
||||
hide();
|
||||
}
|
||||
@@ -113,6 +111,12 @@ public class CompetitorSelectionPopup extends Composite implements HasWidgets, C
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didSelectedRowWithCompetitorName(CompetitorDTO competitor) {
|
||||
button.getElement().addClassName(style.buttonshow());
|
||||
currentCompetitorSelected = competitor;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
@@ -133,10 +137,4 @@ public class CompetitorSelectionPopup extends Composite implements HasWidgets, C
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didSelectedRowWithCompetitorName(String competitorName) {
|
||||
button.getElement().addClassName(style.buttonshow());
|
||||
currentCompetitorSelected = competitorName;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
|
||||
public interface CompetitorSelectionPopupListener {
|
||||
|
||||
public void didClickedOKWithCompetitorName(String competitorName);
|
||||
}
|
||||
@@ -10,45 +10,46 @@ import com.google.gwt.user.cellview.client.TextColumn;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent;
|
||||
import com.google.gwt.view.client.SingleSelectionModel;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public class CompetitorTable extends AbsolutePanel {
|
||||
|
||||
private CellTable<String> table;
|
||||
private CellTable<CompetitorDTO> table;
|
||||
private CompetitorTableRowSelectionListener competitorTableRowSelectionListener;
|
||||
|
||||
public CompetitorTable(CompetitorTableRowSelectionListener competitorTableRowSelectionListener) {
|
||||
this.competitorTableRowSelectionListener = competitorTableRowSelectionListener;
|
||||
}
|
||||
|
||||
public void setTableContent(List<String> competitorNames) {
|
||||
public void setTableContent(List<CompetitorDTO> competitorNames) {
|
||||
if (table == null) {
|
||||
initTable(competitorNames);
|
||||
}
|
||||
}
|
||||
|
||||
private void initTable(List<String> competitorNames) {
|
||||
private void initTable(List<CompetitorDTO> competitorNames) {
|
||||
CellTable.Resources tableRes = GWT.create(CompetitorTableStyleResource.class);
|
||||
|
||||
table = new CellTable<String>(15, tableRes);
|
||||
table = new CellTable<CompetitorDTO>(15, tableRes);
|
||||
table.getElement().getStyle().setWidth(100, Unit.PCT);
|
||||
table.setSkipRowHoverStyleUpdate(true);
|
||||
table.setSkipRowHoverCheck(true);
|
||||
table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
|
||||
final SingleSelectionModel<String> selectionModel = new SingleSelectionModel<String>();
|
||||
final SingleSelectionModel<CompetitorDTO> selectionModel = new SingleSelectionModel<CompetitorDTO>();
|
||||
table.setSelectionModel(selectionModel);
|
||||
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
|
||||
public void onSelectionChange(SelectionChangeEvent event) {
|
||||
String selected = selectionModel.getSelectedObject();
|
||||
CompetitorDTO selected = selectionModel.getSelectedObject();
|
||||
if (selected != null) {
|
||||
competitorTableRowSelectionListener.didSelectedRowWithCompetitorName(selected);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
TextColumn<String> competitorNameCollumn = new TextColumn<String>() {
|
||||
TextColumn<CompetitorDTO> competitorNameCollumn = new TextColumn<CompetitorDTO>() {
|
||||
@Override
|
||||
public String getValue(String competitorName) {
|
||||
return competitorName;
|
||||
public String getValue(CompetitorDTO competitor) {
|
||||
return competitor.getName();
|
||||
}
|
||||
};
|
||||
table.addColumn(competitorNameCollumn, "");
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public interface CompetitorTableRowSelectionListener {
|
||||
|
||||
public void didSelectedRowWithCompetitorName(String competitorName);
|
||||
public void didSelectedRowWithCompetitorName(CompetitorDTO competitor);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.settings_button {
|
||||
position: absolute !important;
|
||||
height: 23.5pt;
|
||||
width: 23.5pt;
|
||||
right: 10pt;
|
||||
top: 17.5pt;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.settings_button_image {
|
||||
position: absolute;
|
||||
height: 23.5pt;
|
||||
width: 23.5pt;
|
||||
right: 10pt;
|
||||
top: 17.5pt;
|
||||
}
|
||||
|
||||
.settings_indication_label {
|
||||
position: absolute;
|
||||
width: 200pt;
|
||||
height: 23.5pt;
|
||||
margin-top: 17.5pt;
|
||||
right: 43.5pt;
|
||||
font-size: 12pt;
|
||||
font-color: black;
|
||||
text-align: right;
|
||||
line-height: 23.5pt;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardImageResources;
|
||||
|
||||
public class SettingsButtonWithSelectionIndicationLabel extends Composite {
|
||||
|
||||
private static SettingsButtonWithSelectionIndicationLabelUiBinder uiBinder = GWT
|
||||
.create(SettingsButtonWithSelectionIndicationLabelUiBinder.class);
|
||||
|
||||
interface SettingsButtonWithSelectionIndicationLabelUiBinder extends
|
||||
UiBinder<Widget, SettingsButtonWithSelectionIndicationLabel> {
|
||||
}
|
||||
|
||||
interface SettingsButtonWithSelectionIndicationLabelStyle extends CssResource {
|
||||
}
|
||||
|
||||
@UiField
|
||||
SettingsButtonWithSelectionIndicationLabelStyle style;
|
||||
|
||||
@UiField
|
||||
FocusPanel settingsButton;
|
||||
|
||||
@UiField
|
||||
Image settingsButtonImage;
|
||||
|
||||
@UiField
|
||||
Label settingsIndicationLabel;
|
||||
|
||||
public SettingsButtonWithSelectionIndicationLabel() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
settingsButtonImage.setResource(RibDashboardImageResources.INSTANCE.settings());
|
||||
}
|
||||
|
||||
public void addClickHandlerToSettingsButton(ClickHandler clickHandler){
|
||||
settingsButton.addClickHandler(clickHandler);
|
||||
}
|
||||
|
||||
public void setSelectionIndicationTextOnLabel(String selectionIndicationText) {
|
||||
settingsIndicationLabel.setText(selectionIndicationText);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
<ui:style
|
||||
type='com.sap.sailing.dashboards.gwt.client.popups.competitorselection.SettingsButtonWithSelectionIndicationLabel.SettingsButtonWithSelectionIndicationLabelStyle'
|
||||
src='SettingsButtonWithSelectionIndicationLabel.css'></ui:style>
|
||||
<g:HTMLPanel>
|
||||
<g:FocusPanel ui:field="settingsButton" styleName="{style.settings_button}"></g:FocusPanel>
|
||||
<g:Image ui:field="settingsButtonImage" styleName="{style.settings_button_image}"></g:Image>
|
||||
<g:Label ui:field="settingsIndicationLabel" styleName="{style.settings_indication_label}"></g:Label>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.startanalysis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RibDashboardRaceInfoDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
|
||||
/**
|
||||
* classes implementing this interface get usually notified, if there is a new {@link StartAnalysisDTO}
|
||||
* in {@link RibDashboardRaceInfoDTO} variable <code>startAnalysisDTOList</code>.
|
||||
*
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public interface NewStartAnalysisListener {
|
||||
|
||||
public void addNewStartAnalysisCardForCompetitor(List<StartAnalysisDTO> startAnalysisDTOs, String selectedCompetitor);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.combinedWindPanel {
|
||||
margin-top: 10pt;
|
||||
margin-left: 10pt;
|
||||
right: 0pt;
|
||||
width: 45pt;
|
||||
height: 45pt;
|
||||
border-radius: 22.5pt;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.combinedWindPanelTextLabel {
|
||||
margin-top: 15pt;
|
||||
width: 45pt;
|
||||
height: 25pt;
|
||||
background-color: white;
|
||||
line-height: 25pt;
|
||||
vertical-align: middle;
|
||||
font-size: 11pt;
|
||||
font-family: "Arial";
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.combinedWindPanelCanvas{
|
||||
width: 35pt;
|
||||
height: 35pt;
|
||||
margin-top: 5pt;
|
||||
margin-left: 5pt;
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.startanalysis;
|
||||
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
|
||||
public interface StartAnalysisPageChangeListener {
|
||||
|
||||
public void loadMapAndContent(int newPageIndex, String someDataDTO);
|
||||
public void startAnalysisComponentPageChangedToIndexAndStartAnalysis(int newPageIndex, StartAnalysisDTO startAnalysisDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.startanalysis;
|
||||
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.CombinedWindPanelStyle;
|
||||
|
||||
interface StartAnalysisResources extends ClientBundle {
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/windarrow.png")
|
||||
ImageResource combinedWindIcon();
|
||||
|
||||
@Source("StartAnalysisCombinedWindPanel.css")
|
||||
CombinedWindPanelStyle combinedWindPanelStyle();
|
||||
}
|
||||
@@ -1,326 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.startanalysis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gwt.dom.client.Style.Position;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.maps.client.LoadApi;
|
||||
import com.google.gwt.maps.client.LoadApi.LoadLibrary;
|
||||
import com.google.gwt.maps.client.MapOptions;
|
||||
import com.google.gwt.maps.client.MapWidget;
|
||||
import com.google.gwt.maps.client.base.LatLng;
|
||||
import com.google.gwt.maps.client.base.LatLngBounds;
|
||||
import com.google.gwt.maps.client.controls.ControlPosition;
|
||||
import com.google.gwt.maps.client.controls.MapTypeStyle;
|
||||
import com.google.gwt.maps.client.controls.ScaleControlOptions;
|
||||
import com.google.gwt.maps.client.maptypes.MapTypeStyleFeatureType;
|
||||
import com.google.gwt.maps.client.mvc.MVCArray;
|
||||
import com.google.gwt.maps.client.overlays.Polyline;
|
||||
import com.google.gwt.maps.client.overlays.PolylineOptions;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisCompetitorDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.PositionDTO;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.CourseMarkOverlay;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapOverlaysZIndexes;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.TailFactory;
|
||||
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.MarkDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.racemap.GoogleMapStyleHelper;
|
||||
import com.sap.sse.common.impl.RGBColor;
|
||||
|
||||
public class StartAnalysisSimpleMap extends AbsolutePanel implements TailFactory {
|
||||
|
||||
private MapWidget map;
|
||||
private StartAnalysisDTO startAnalysisDTO;
|
||||
|
||||
public StartAnalysisSimpleMap(int containerID, StartAnalysisDTO startAnalysisDTO) {
|
||||
|
||||
this.startAnalysisDTO = startAnalysisDTO;
|
||||
|
||||
this.getElement().getStyle().setPosition(Position.ABSOLUTE);
|
||||
this.getElement().getStyle().setWidth(100, Unit.PCT);
|
||||
this.getElement().getStyle().setHeight(100, Unit.PCT);
|
||||
loadMapsAPIV3();
|
||||
}
|
||||
|
||||
private void loadMapsAPIV3() {
|
||||
boolean sensor = true;
|
||||
// load all the libs for use in the maps
|
||||
ArrayList<LoadLibrary> loadLibraries = new ArrayList<LoadApi.LoadLibrary>();
|
||||
loadLibraries.add(LoadLibrary.DRAWING);
|
||||
loadLibraries.add(LoadLibrary.GEOMETRY);
|
||||
|
||||
Runnable onLoad = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MapOptions mapOptions = MapOptions.newInstance();
|
||||
mapOptions.setScrollWheel(true);
|
||||
mapOptions.setMapTypeControl(false);
|
||||
mapOptions.setPanControl(false);
|
||||
mapOptions.setZoomControl(false);
|
||||
mapOptions.setScaleControl(true);
|
||||
mapOptions.setDraggable(false);
|
||||
mapOptions.setPanControl(false);
|
||||
MapTypeStyle[] mapTypeStyles = new MapTypeStyle[4];
|
||||
|
||||
// hide all transit lines including ferry lines
|
||||
mapTypeStyles[0] = GoogleMapStyleHelper.createHiddenStyle(MapTypeStyleFeatureType.TRANSIT);
|
||||
// hide points of interest
|
||||
mapTypeStyles[1] = GoogleMapStyleHelper.createHiddenStyle(MapTypeStyleFeatureType.POI);
|
||||
// simplify road display
|
||||
mapTypeStyles[2] = GoogleMapStyleHelper.createSimplifiedStyle(MapTypeStyleFeatureType.ROAD);
|
||||
// set water color
|
||||
mapTypeStyles[3] = GoogleMapStyleHelper.createColorStyle(MapTypeStyleFeatureType.WATER, new RGBColor(0,
|
||||
136, 255), -35, -34);
|
||||
|
||||
mapOptions.setMapTypeStyles(mapTypeStyles);
|
||||
ScaleControlOptions scaleControlOptions = ScaleControlOptions.newInstance();
|
||||
scaleControlOptions.setPosition(ControlPosition.BOTTOM_RIGHT);
|
||||
mapOptions.setScaleControlOptions(scaleControlOptions);
|
||||
mapOptions.setStreetViewControl(false);
|
||||
map = new MapWidget(mapOptions);
|
||||
StartAnalysisSimpleMap.this.add(map, 0, 0);
|
||||
map.setSize("100%", "100%");
|
||||
map.getElement().getStyle().setBackgroundColor("#4293DB");
|
||||
map.triggerResize();
|
||||
drawStartLine(startAnalysisDTO.startLineMarks);
|
||||
drawLinesFromStartLineToFirstMark(startAnalysisDTO.startLineMarks, startAnalysisDTO.firstMark);
|
||||
drawStartlineMarks(startAnalysisDTO.startLineMarks);
|
||||
drawFirstMark(startAnalysisDTO.firstMark);
|
||||
drawTails(createGPSFixesForCompetitors(startAnalysisDTO));
|
||||
drawBoats(createGPSPositionForCompetitors(startAnalysisDTO));
|
||||
zoomMapToNewBounds(calculateNewBounds(startAnalysisDTO.startLineMarkPositions));
|
||||
}
|
||||
};
|
||||
LoadApi.go(onLoad, loadLibraries, sensor);
|
||||
}
|
||||
|
||||
private Map<CompetitorDTO, List<GPSFixDTO>> createGPSFixesForCompetitors(StartAnalysisDTO startAnalysisDTO) {
|
||||
|
||||
Map<CompetitorDTO, List<GPSFixDTO>> gpsFixesForCompetitors = new HashMap<CompetitorDTO, List<GPSFixDTO>>();
|
||||
for (StartAnalysisCompetitorDTO startAnalysisCompetitorDTO : startAnalysisDTO.startAnalysisCompetitorDTOs) {
|
||||
gpsFixesForCompetitors.put(startAnalysisCompetitorDTO.competitorDTO,
|
||||
startAnalysisCompetitorDTO.gpsFixDTOs);
|
||||
}
|
||||
return gpsFixesForCompetitors;
|
||||
}
|
||||
|
||||
private Map<CompetitorDTO, GPSFixDTO> createGPSPositionForCompetitors(StartAnalysisDTO startAnalysisDTO) {
|
||||
Map<CompetitorDTO, GPSFixDTO> gpsPositionForCompetitors = new HashMap<CompetitorDTO, GPSFixDTO>();
|
||||
for (StartAnalysisCompetitorDTO startAnalysisCompetitorDTO : startAnalysisDTO.startAnalysisCompetitorDTOs) {
|
||||
gpsPositionForCompetitors.put(startAnalysisCompetitorDTO.competitorDTO,
|
||||
startAnalysisCompetitorDTO.gpsFixDTOs.get(startAnalysisCompetitorDTO.gpsFixDTOs.size()-1));
|
||||
}
|
||||
return gpsPositionForCompetitors;
|
||||
}
|
||||
|
||||
private void drawStartLine(List<MarkDTO> startlineMarks) {
|
||||
if (map != null && startlineMarks != null) {
|
||||
|
||||
if (startlineMarks.size() == 2) {
|
||||
LatLng startLinePoint1 = LatLng.newInstance(startlineMarks.get(0).position.latDeg,
|
||||
startlineMarks.get(0).position.lngDeg);
|
||||
LatLng startLinePoint2 = LatLng.newInstance(startlineMarks.get(1).position.latDeg,
|
||||
startlineMarks.get(1).position.lngDeg);
|
||||
|
||||
PolylineOptions options = PolylineOptions.newInstance();
|
||||
options.setGeodesic(true);
|
||||
options.setStrokeColor("#FFFFFF");
|
||||
options.setStrokeWeight(2);
|
||||
options.setStrokeOpacity(1.0);
|
||||
|
||||
MVCArray<LatLng> pointsAsArray = MVCArray.newInstance();
|
||||
pointsAsArray.insertAt(0, startLinePoint1);
|
||||
pointsAsArray.insertAt(1, startLinePoint2);
|
||||
|
||||
Polyline startLine = Polyline.newInstance(options);
|
||||
startLine.setPath(pointsAsArray);
|
||||
|
||||
startLine.setMap(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawLinesFromStartLineToFirstMark(List<MarkDTO> startlineMarks, MarkDTO firstMark){
|
||||
if (map != null && startlineMarks != null && firstMark != null) {
|
||||
if (startlineMarks.size() == 2) {
|
||||
LatLng startLinePoint1 = LatLng.newInstance(startlineMarks.get(0).position.latDeg,
|
||||
startlineMarks.get(0).position.lngDeg);
|
||||
LatLng startLinePoint2 = LatLng.newInstance(startlineMarks.get(1).position.latDeg,
|
||||
startlineMarks.get(1).position.lngDeg);
|
||||
LatLng firstMarkPoint = LatLng.newInstance(firstMark.position.latDeg,
|
||||
firstMark.position.lngDeg);
|
||||
|
||||
PolylineOptions options = PolylineOptions.newInstance();
|
||||
options.setGeodesic(true);
|
||||
options.setStrokeColor("#A3A3A3");
|
||||
options.setStrokeWeight(2);
|
||||
options.setStrokeOpacity(1.0);
|
||||
|
||||
MVCArray<LatLng> pointsAsArray1 = MVCArray.newInstance();
|
||||
pointsAsArray1.insertAt(0, startLinePoint1);
|
||||
pointsAsArray1.insertAt(1, firstMarkPoint);
|
||||
|
||||
MVCArray<LatLng> pointsAsArray2 = MVCArray.newInstance();
|
||||
pointsAsArray2.insertAt(0, startLinePoint2);
|
||||
pointsAsArray2.insertAt(1, firstMarkPoint);
|
||||
|
||||
Polyline startMarkFirstMark1 = Polyline.newInstance(options);
|
||||
Polyline startMarkFirstMark2 = Polyline.newInstance(options);
|
||||
|
||||
startMarkFirstMark1.setPath(pointsAsArray1);
|
||||
startMarkFirstMark2.setPath(pointsAsArray2);
|
||||
|
||||
startMarkFirstMark1.setMap(map);
|
||||
startMarkFirstMark2.setMap(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawStartlineMarks(List<MarkDTO> startlineMarks) {
|
||||
if (map != null) {
|
||||
for (MarkDTO markDTO : startlineMarks) {
|
||||
CourseMarkOverlay courseMarkOverlay = createCourseMarkOverlay(
|
||||
RaceMapOverlaysZIndexes.COURSEMARK_ZINDEX, markDTO);
|
||||
courseMarkOverlay.addToMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawFirstMark(MarkDTO firstMark){
|
||||
CourseMarkOverlay courseMarkOverlay = createCourseMarkOverlay(
|
||||
RaceMapOverlaysZIndexes.COURSEMARK_ZINDEX, firstMark);
|
||||
courseMarkOverlay.addToMap();
|
||||
}
|
||||
|
||||
private CourseMarkOverlay createCourseMarkOverlay(int zIndex, final MarkDTO markDTO) {
|
||||
markDTO.position.latDeg = markDTO.position.latDeg;
|
||||
final CourseMarkOverlay courseMarkOverlay = new CourseMarkOverlay(map, zIndex, markDTO);
|
||||
return courseMarkOverlay;
|
||||
}
|
||||
|
||||
private LatLngBounds calculateNewBounds(List<PositionDTO> startLinePositions) {
|
||||
LatLngBounds newBounds = null;
|
||||
List<PositionDTO> newStartLinePositionDTOs = new ArrayList<PositionDTO>(startLinePositions);
|
||||
Iterable<PositionDTO> positionsToZoom = newStartLinePositionDTOs;
|
||||
|
||||
if (positionsToZoom != null) {
|
||||
for (PositionDTO position : positionsToZoom) {
|
||||
PositionDTO positionMoovedToNorth = position;
|
||||
positionMoovedToNorth.latDeg = positionMoovedToNorth.latDeg - 0.0009;
|
||||
|
||||
LatLng markLatLng = LatLng.newInstance(positionMoovedToNorth.latDeg, positionMoovedToNorth.lngDeg);
|
||||
LatLngBounds bounds = LatLngBounds.newInstance(markLatLng, markLatLng);
|
||||
if (newBounds == null) {
|
||||
newBounds = bounds;
|
||||
} else {
|
||||
newBounds.extend(markLatLng);
|
||||
}
|
||||
markLatLng = null;
|
||||
position = null;
|
||||
positionMoovedToNorth.latDeg = positionMoovedToNorth.latDeg + 0.0009;
|
||||
}
|
||||
}
|
||||
// }
|
||||
positionsToZoom = null;
|
||||
return newBounds;
|
||||
}
|
||||
|
||||
private void zoomMapToNewBounds(LatLngBounds newBounds) {
|
||||
if (newBounds != null) {
|
||||
map.setCenter(newBounds.getCenter());
|
||||
map.setZoom(17);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawBoats(Map<CompetitorDTO, GPSFixDTO> competitorAndLastFix) {
|
||||
|
||||
Set<CompetitorDTO> competitors = competitorAndLastFix.keySet();
|
||||
|
||||
for (CompetitorDTO competitorDTO : competitors) {
|
||||
BoatOverlay boatOverlay = createBoatOverlay(RaceMapOverlaysZIndexes.BOATS_ZINDEX, competitorDTO, false);
|
||||
boatOverlay.setSelected(false);
|
||||
boatOverlay.setBoatFix(competitorAndLastFix.get(competitorDTO), 10);
|
||||
boatOverlay.addToMap();
|
||||
}
|
||||
}
|
||||
|
||||
private BoatOverlay createBoatOverlay(int zIndex, final CompetitorDTO competitorDTO, boolean highlighted) {
|
||||
final BoatOverlay boatCanvas = new BoatOverlay(map, zIndex, competitorDTO, competitorDTO.getColor());
|
||||
boatCanvas.setSelected(false);
|
||||
return boatCanvas;
|
||||
}
|
||||
|
||||
private void drawTails(Map<CompetitorDTO, List<GPSFixDTO>> competitorFixes) {
|
||||
|
||||
Set<CompetitorDTO> competitors = competitorFixes.keySet();
|
||||
for (CompetitorDTO competitor : competitors) {
|
||||
Polyline competitorPolyline = createPolylineFromGPSFixDTOs(competitor, competitorFixes.get(competitor));
|
||||
competitorPolyline.setMap(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Polyline createPolylineFromGPSFixDTOs(CompetitorDTO competitorDTO, List<GPSFixDTO> fixes) {
|
||||
List<LatLng> points = new ArrayList<LatLng>();
|
||||
int indexOfFirst = -1;
|
||||
int indexOfLast = -1;
|
||||
int i = 0;
|
||||
for (Iterator<GPSFixDTO> fixIter = fixes.iterator(); fixIter.hasNext() && indexOfLast == -1;) {
|
||||
GPSFixDTO fix = fixIter.next();
|
||||
if (!fix.timepoint.before(fixes.get(fixes.size() - 1).timepoint)) {
|
||||
indexOfLast = i - 1;
|
||||
} else {
|
||||
LatLng point = null;
|
||||
if (indexOfFirst == -1) {
|
||||
if (!fix.timepoint.before(fixes.get(0).timepoint)) {
|
||||
indexOfFirst = i;
|
||||
point = LatLng.newInstance(fix.position.latDeg, fix.position.lngDeg);
|
||||
}
|
||||
} else {
|
||||
point = LatLng.newInstance(fix.position.latDeg, fix.position.lngDeg);
|
||||
}
|
||||
if (point != null) {
|
||||
points.add(point);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (indexOfLast == -1) {
|
||||
indexOfLast = i - 1;
|
||||
}
|
||||
Polyline result = createTail(competitorDTO, points);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Polyline createTail(CompetitorDTO competitor, List<LatLng> points) {
|
||||
PolylineOptions options = createTailStyle(competitor, false);
|
||||
Polyline result = Polyline.newInstance(options);
|
||||
|
||||
MVCArray<LatLng> pointsAsArray = MVCArray.newInstance(points.toArray(new LatLng[0]));
|
||||
result.setPath(pointsAsArray);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PolylineOptions createTailStyle(CompetitorDTO competitor, boolean isHighlighted) {
|
||||
PolylineOptions options = PolylineOptions.newInstance();
|
||||
options.setClickable(true);
|
||||
options.setGeodesic(true);
|
||||
options.setStrokeOpacity(1.0);
|
||||
options.setStrokeColor(competitor.getColor().getAsHtml());
|
||||
options.setStrokeWeight(1);
|
||||
options.setZindex(RaceMapOverlaysZIndexes.BOATTAILS_ZINDEX);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
@@ -56,19 +56,12 @@
|
||||
display: inline;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
background-color: #4293DB;
|
||||
margin-top: 1px; /*Zeigt sonst Linie am oberen Rand*/
|
||||
/*#4293DB old water color*/
|
||||
background-color: #004384;
|
||||
margin-top: 1px; /*Shows otherwise small line at top edge*/
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.startanalysis_google_map {
|
||||
position: absolute;
|
||||
bottom: -20pt;
|
||||
right: -20pt;
|
||||
left: -20pt;
|
||||
top: -20pt;
|
||||
}
|
||||
|
||||
.startanalysis_card_table {
|
||||
position: absolute;
|
||||
bottom: 10pt;
|
||||
@@ -87,30 +80,6 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.startanalysis_card_wind_direction_image {
|
||||
position: absolute;
|
||||
top: 0pt;
|
||||
right: 0pt;
|
||||
width: 45pt;
|
||||
height: 45pt;
|
||||
border-radius: 22.5pt;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.startanalysis_card_wind_arrow {
|
||||
width: 25pt;
|
||||
height: 25pt;
|
||||
margin-top: 10pt;
|
||||
margin-left: 10pt;
|
||||
}
|
||||
|
||||
.startanalysis_card_wind_canvas {
|
||||
width: 25pt;
|
||||
height: 25pt;
|
||||
margin-top: 10pt;
|
||||
margin-left: 10pt;
|
||||
}
|
||||
|
||||
.startanalysis_card_data {
|
||||
position: absolute;
|
||||
right: 0pt;
|
||||
@@ -124,14 +93,6 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.startanalysis_card_wind_data_direction {
|
||||
top: 55pt;
|
||||
}
|
||||
|
||||
.startanalysis_card_wind_data_speed {
|
||||
top: 85pt;
|
||||
}
|
||||
|
||||
.startanalysis_card_line_advantage {
|
||||
top: 0pt;
|
||||
left: 55pt;
|
||||
|
||||
@@ -1,37 +1,45 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.startanalysis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.google.gwt.canvas.client.Canvas;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Timer;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardImageResources;
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.rankingtable.StartAnalysisStartRankTable;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
|
||||
import com.sap.sailing.gwt.ui.client.RaceTimesInfoProvider;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMap;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapHelpLinesSettings;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapHelpLinesSettings.HelpLineTypes;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapZoomSettings;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapZoomSettings.ZoomTypes;
|
||||
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
import com.sap.sse.gwt.client.player.Timer.PlayModes;
|
||||
|
||||
public class StartlineAnalysisCard extends Composite implements HasWidgets, StartAnalysisPageChangeListener {
|
||||
|
||||
private StartAnalysisSimpleMap simpleMap;
|
||||
|
||||
private static StartlineAnalysisCardUiBinder uiBinder = GWT.create(StartlineAnalysisCardUiBinder.class);
|
||||
|
||||
interface StartlineAnalysisCardUiBinder extends UiBinder<Widget, StartlineAnalysisCard> {
|
||||
}
|
||||
|
||||
interface StartlineAnalysis extends CssResource {
|
||||
public String startanalysis_card_wind_canvas();
|
||||
public String startanalysis_card_wind_arrow();
|
||||
}
|
||||
|
||||
@UiField
|
||||
@@ -40,100 +48,135 @@ public class StartlineAnalysisCard extends Composite implements HasWidgets, Star
|
||||
@UiField
|
||||
HTMLPanel startanalysis_card;
|
||||
|
||||
@UiField
|
||||
HTMLPanel winddirection;
|
||||
|
||||
@UiField
|
||||
HTMLPanel startanalysis_card_table;
|
||||
|
||||
@UiField
|
||||
DivElement startanalysis_card_wind_data_direction;
|
||||
|
||||
@UiField
|
||||
DivElement startanalysis_card_wind_data_speed;
|
||||
|
||||
@UiField
|
||||
DivElement startanalysis_card_line_advantage;
|
||||
|
||||
Canvas winddirectionContainer;
|
||||
Image windarrow;
|
||||
|
||||
private int cardid;
|
||||
private boolean containsMap = false;
|
||||
private StartAnalysisDTO startAnalysisDTO;
|
||||
private RaceMap raceMap;
|
||||
|
||||
public StartlineAnalysisCard(double leftCSSProperty, int cardID, StartAnalysisDTO startAnalysisDTO) {
|
||||
private SailingServiceAsync sailingServiceAsync;
|
||||
private StringMessages stringMessages;
|
||||
private final CompetitorSelectionModel competitorSelectionModel;
|
||||
|
||||
private final double WIND_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 185;
|
||||
private final double GEOMETRIC_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 210;
|
||||
private final int TAIL_LENGHT_IN_MILLISECONDS = 900000;
|
||||
|
||||
|
||||
private static StartAnalysisResources resources = GWT.create(StartAnalysisResources.class);
|
||||
public StartlineAnalysisCard(double leftCSSProperty, int cardId, StartAnalysisDTO startAnalysisDTO,
|
||||
SailingServiceAsync sailingServiceAsync) {
|
||||
stringMessages = StringMessages.INSTANCE;
|
||||
resources.combinedWindPanelStyle().ensureInjected();
|
||||
this.sailingServiceAsync = sailingServiceAsync;
|
||||
competitorSelectionModel = new CompetitorSelectionModel(/* hasMultiSelection */true);
|
||||
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
startanalysis_card.getElement().getStyle().setLeft(leftCSSProperty, Unit.PCT);
|
||||
|
||||
winddirectionContainer = Canvas.createIfSupported();
|
||||
this.startAnalysisDTO = startAnalysisDTO;
|
||||
|
||||
winddirectionContainer.setStyleName(style.startanalysis_card_wind_canvas());
|
||||
|
||||
windarrow = new Image();
|
||||
windarrow.setResource(RibDashboardImageResources.INSTANCE.windarrow());
|
||||
windarrow.setStyleName(style.startanalysis_card_wind_arrow());
|
||||
winddirection.add(windarrow);
|
||||
|
||||
cardid = cardID;
|
||||
|
||||
if (cardID == 0) {
|
||||
addMap(cardID);
|
||||
}
|
||||
|
||||
this.cardid = cardId;
|
||||
startanalysis_card_table.add(new StartAnalysisStartRankTable(startAnalysisDTO.startAnalysisCompetitorDTOs));
|
||||
fillWindAndStartLineData(this.startAnalysisDTO);
|
||||
|
||||
this.onLoad();
|
||||
}
|
||||
|
||||
private void fillWindAndStartLineData(StartAnalysisDTO startAnalysisDTO) {
|
||||
|
||||
if (startAnalysisDTO.startAnalysisWindLineInfoDTO != null) {
|
||||
String winddirectionformatted = NumberFormat.getFormat("#0").format(
|
||||
startAnalysisDTO.startAnalysisWindLineInfoDTO.windDirectionInDegrees-90);
|
||||
windarrow.getElement().getStyle()
|
||||
.setProperty("transform", "rotate(" + winddirectionformatted + "deg)");
|
||||
windarrow.getElement().getStyle().setProperty("webkitTransform", "rotate(" + winddirectionformatted + "deg)");
|
||||
startanalysis_card_wind_data_direction
|
||||
.setInnerHTML(NumberFormat.getFormat("#0.0").format(startAnalysisDTO.startAnalysisWindLineInfoDTO.windDirectionInDegrees) + "°");
|
||||
startanalysis_card_wind_data_speed
|
||||
.setInnerHTML(NumberFormat.getFormat("#0.0").format(startAnalysisDTO.startAnalysisWindLineInfoDTO.windSpeedInKnots) + " kts");
|
||||
startanalysis_card_line_advantage.setInnerHTML(startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType.getDisplayName()+": "+NumberFormat.getFormat("#0.0").format(startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvantage)+" m");
|
||||
setLineAdvantageDivWidth(startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType);
|
||||
String startLineAdvantageType;
|
||||
if (startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType
|
||||
.equals(StartlineAdvantageType.GEOMETRIC)) {
|
||||
startLineAdvantageType = stringMessages.dashboardStartlineAdvantageByGeometry();
|
||||
}else{
|
||||
startLineAdvantageType = stringMessages.dashboardStartlineAdvantageByWind();
|
||||
}
|
||||
startanalysis_card_line_advantage
|
||||
.setInnerHTML(startLineAdvantageType
|
||||
+ ": "
|
||||
+ NumberFormat
|
||||
.getFormat("#0.0")
|
||||
.format(startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvantage)
|
||||
+ " m");
|
||||
}
|
||||
}
|
||||
|
||||
private void addMap(final int cardID) {
|
||||
Timer timer = new Timer()
|
||||
{
|
||||
private void setLineAdvantageDivWidth(StartlineAdvantageType startlineAdvantageType) {
|
||||
if (startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType
|
||||
.equals(StartlineAdvantageType.GEOMETRIC)) {
|
||||
startanalysis_card_line_advantage.getStyle().setWidth(GEOMETRIC_LINE_ADVANTAGE_DIV_WIDTH_IN_PT, Unit.PT);
|
||||
} else {
|
||||
startanalysis_card_line_advantage.getStyle().setWidth(WIND_LINE_ADVANTAGE_DIV_WIDTH_IN_PT, Unit.PT);
|
||||
}
|
||||
}
|
||||
|
||||
private void addMap(final int cardID, final StartAnalysisDTO startAnalysisDTO) {
|
||||
AsyncActionsExecutor asyncActionsExecutor = new AsyncActionsExecutor();
|
||||
com.sap.sse.gwt.client.player.Timer timer = new com.sap.sse.gwt.client.player.Timer(PlayModes.Live, 1000l);
|
||||
timer.setTime(startAnalysisDTO.timeOfStartInMilliSeconds);
|
||||
timer.pause();
|
||||
|
||||
RaceTimesInfoProvider raceTimesInfoProvider = new RaceTimesInfoProvider(sailingServiceAsync,
|
||||
asyncActionsExecutor, null, Collections.singletonList(startAnalysisDTO.regattaAndRaceIdentifier), 5000l /* requestInterval */);
|
||||
|
||||
raceMap = new RaceMap(sailingServiceAsync, asyncActionsExecutor, null, timer, competitorSelectionModel,
|
||||
StringMessages.INSTANCE, false, false, false, startAnalysisDTO.regattaAndRaceIdentifier,
|
||||
resources.combinedWindPanelStyle());
|
||||
competitorSelectionModel.setCompetitors(startAnalysisDTO.getCompetitorDTOsFromStartAnaylsisCompetitorDTOs(),
|
||||
raceMap);
|
||||
raceMap.onRaceSelectionChange(Collections.singletonList(startAnalysisDTO.regattaAndRaceIdentifier));
|
||||
ArrayList<ZoomTypes> zoomTypes = new ArrayList<ZoomTypes>();
|
||||
zoomTypes.add(ZoomTypes.TAILS);
|
||||
raceMap.getSettings().setZoomSettings(new RaceMapZoomSettings(zoomTypes, false));
|
||||
raceMap.getSettings().setHelpLinesSettings(getHelpLineSettings());
|
||||
raceMap.getSettings().setTailLengthInMilliseconds(TAIL_LENGHT_IN_MILLISECONDS);
|
||||
raceTimesInfoProvider.addRaceTimesInfoProviderListener(raceMap);
|
||||
startanalysis_card.add(raceMap);
|
||||
/**
|
||||
* Executes onResize() after the reflow of the DOM. Otherwise it has no effect.
|
||||
* Needs to resize the map because google maps are not shown loaded fully when they are hidden.
|
||||
* */
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
simpleMap = new StartAnalysisSimpleMap(cardID, startAnalysisDTO);
|
||||
startanalysis_card.add(simpleMap);
|
||||
public void execute() {
|
||||
raceMap.onResize();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
timer.schedule(800);
|
||||
containsMap = true;
|
||||
private RaceMapHelpLinesSettings getHelpLineSettings() {
|
||||
HashSet<HelpLineTypes> visibleHelpLines = new HashSet<HelpLineTypes>();
|
||||
visibleHelpLines.add(HelpLineTypes.STARTLINE);
|
||||
visibleHelpLines.add(HelpLineTypes.BOATTAILS);
|
||||
visibleHelpLines.add(HelpLineTypes.STARTLINETOFIRSTMARKTRIANGLE);
|
||||
return new RaceMapHelpLinesSettings(visibleHelpLines);
|
||||
}
|
||||
|
||||
private void removeMap() {
|
||||
if(simpleMap.isAttached()){
|
||||
startanalysis_card.remove(simpleMap);
|
||||
containsMap = false;
|
||||
if (raceMap != null && raceMap.isAttached() == true) {
|
||||
startanalysis_card.remove(raceMap);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadMapAndContent(int newPageIndex, String someDataDTO) {
|
||||
if (cardid == newPageIndex && containsMap == false) {
|
||||
addMap(newPageIndex);
|
||||
} else if (containsMap == true) {
|
||||
public void startAnalysisComponentPageChangedToIndexAndStartAnalysis(final int newPageIndex,
|
||||
final StartAnalysisDTO startAnalysisDTO) {
|
||||
removeMap();
|
||||
if (cardid == newPageIndex) {
|
||||
/**
|
||||
* Prevents UI to animate startanalysis card animation with small interruptions.
|
||||
* The map gets added just after the DOM manipulation was executed.
|
||||
* */
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
addMap(newPageIndex, startAnalysisDTO);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,15 +7,7 @@
|
||||
src='StartlineAnalysis.css'></ui:style>
|
||||
|
||||
<g:HTMLPanel ui:field="startanalysis_card" styleName="{style.startanalysis_card}">
|
||||
<!-- <maps:MapWidget></maps:MapWidget> -->
|
||||
<div class="{style.startanalysis_card_wind_line_data_container}">
|
||||
<g:HTMLPanel ui:field="winddirection"
|
||||
styleName="{style.startanalysis_card_wind_direction_image}">
|
||||
</g:HTMLPanel>
|
||||
<div ui:field="startanalysis_card_wind_data_direction"
|
||||
class="{style.startanalysis_card_data} {style.startanalysis_card_wind_data_direction}"></div>
|
||||
<div ui:field="startanalysis_card_wind_data_speed"
|
||||
class="{style.startanalysis_card_data} {style.startanalysis_card_wind_data_speed}"></div>
|
||||
<div ui:field="startanalysis_card_line_advantage"
|
||||
class="{style.startanalysis_card_data} {style.startanalysis_card_line_advantage}"></div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.startanalysis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,18 +12,30 @@ import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Cookies;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardDataRetriever;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardImageResources;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardServiceAsync;
|
||||
import com.sap.sailing.dashboards.gwt.client.bottomnotification.BottomNotification;
|
||||
import com.sap.sailing.dashboards.gwt.client.bottomnotification.BottomNotificationClickListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.bottomnotification.BottomNotificationType;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionPopup;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.SettingsButtonWithSelectionIndicationLabel;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sse.gwt.client.player.TimeListener;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.player.Timer.PlayModes;
|
||||
|
||||
/**
|
||||
* The class contains an collection of {@link StartlineAnalysisCard}s that are displayed in horizontal aligned pages. It
|
||||
@@ -34,8 +47,7 @@ import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class StartlineAnalysisComponent extends Composite implements HasWidgets, NewStartAnalysisListener,
|
||||
BottomNotificationClickListener {
|
||||
public class StartlineAnalysisComponent extends Composite implements HasWidgets {
|
||||
|
||||
private static StartlineAnalysisComponentUiBinder uiBinder = GWT.create(StartlineAnalysisComponentUiBinder.class);
|
||||
|
||||
@@ -71,7 +83,7 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
HTMLPanel startanalysis_card_container;
|
||||
|
||||
/**
|
||||
* The left property from the {@link #startanalysis_card_container}.
|
||||
* The CSS "left" property from the {@link #startanalysis_card_container}.
|
||||
* */
|
||||
private double currentScrollPosition = 0;
|
||||
|
||||
@@ -87,22 +99,42 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
|
||||
private boolean displaysCards;
|
||||
private List<StartAnalysisDTO> starts;
|
||||
private List<StartAnalysisPageChangeListener> pageChangeListener;
|
||||
private List<StartlineAnalysisCard> pageChangeListener;
|
||||
private BottomNotification bottomNotification;
|
||||
private String selectedCompetitor;
|
||||
private Timer timer;
|
||||
private RibDashboardServiceAsync ribDashboardServiceAsync;
|
||||
private SailingServiceAsync sailingServiceAsync;
|
||||
|
||||
private static final int RERFRESH_INTERVAL = 10000;
|
||||
|
||||
private CompetitorSelectionPopup competitorSelectionPopup;
|
||||
private SettingsButtonWithSelectionIndicationLabel settingsButtonWithSelectionIndicationLabel;
|
||||
|
||||
private String leaderboardName;
|
||||
|
||||
private static final String PARAM_LEADERBOARD_NAME = "leaderboardName";
|
||||
private static final String SELECTED_COMPETITOR_ID_COOKIE_KEY = "selectedCompetitorId";
|
||||
private static final int SELECTED_COMPETITOR_ID_COOKIE_KEY_EXPIRE_TIME_IN_MILLIS = 60 * 1000 * 60 * 5;
|
||||
private static final int SCROLL_OFFSET_STARTANALYSIS_CARDS = 83;
|
||||
|
||||
/**
|
||||
* The class requires a {@link BottomNotification} to inform the user when a new {@link StartlineAnalysisCard} gets
|
||||
* added.
|
||||
* Component that contains handles, displays and loads startanalysis cards.
|
||||
* */
|
||||
public StartlineAnalysisComponent(BottomNotification bottomNotification, RibDashboardServiceAsync ribDashboardService) {
|
||||
this.bottomNotification = bottomNotification;
|
||||
pageChangeListener = new ArrayList<StartAnalysisPageChangeListener>();
|
||||
bottomNotification.addBottomNotificationClickListener(this);
|
||||
RibDashboardDataRetriever.getInstance(ribDashboardService).addNewStartAnalysisListener(this);
|
||||
public StartlineAnalysisComponent(RibDashboardServiceAsync ribDashboardServiceAsync, SailingServiceAsync sailingServiceAsync) {
|
||||
this.ribDashboardServiceAsync = ribDashboardServiceAsync;
|
||||
this.sailingServiceAsync = sailingServiceAsync;
|
||||
pageChangeListener = new ArrayList<StartlineAnalysisCard>();
|
||||
starts = new ArrayList<StartAnalysisDTO>();
|
||||
this.leaderboardName = Window.Location.getParameter(PARAM_LEADERBOARD_NAME);
|
||||
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
initCompetitorSelectionPopupAndAddCompetitorSelectionListener();
|
||||
initLeftRightButtons();
|
||||
initTimer();
|
||||
initAndAddBottomNotification();
|
||||
getCachedSelectedCompetitorOrAskForWithPopup();
|
||||
initAndAddSettingsButtonWithSelectionIndicationLabel();
|
||||
}
|
||||
|
||||
private void initLeftRightButtons() {
|
||||
@@ -122,6 +154,114 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
});
|
||||
}
|
||||
|
||||
private void initTimer() {
|
||||
timer = new Timer(PlayModes.Live);
|
||||
timer.setRefreshInterval(RERFRESH_INTERVAL);
|
||||
timer.addTimeListener(new TimeListener() {
|
||||
|
||||
@Override
|
||||
public void timeChanged(Date newTime, Date oldTime) {
|
||||
String selectedCompetitorId = Cookies.getCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY);
|
||||
if (selectedCompetitorId != null) {
|
||||
loadStartAnalysisDTOsForCompetitorID(selectedCompetitorId);
|
||||
} else {
|
||||
loadCompetitorsAndShowCompetitorSelectionPopup();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void loadStartAnalysisDTOsForCompetitorID(String competitorIdAsString){
|
||||
ribDashboardServiceAsync.getStartAnalysisListForCompetitorIDAndLeaderboardName(
|
||||
competitorIdAsString, leaderboardName, new AsyncCallback<List<StartAnalysisDTO>>() {
|
||||
@Override
|
||||
public void onSuccess(List<StartAnalysisDTO> result) {
|
||||
if (!result.isEmpty()) {
|
||||
|
||||
if (displayedStartAnalysisCompetitorDifferentToRequestedOne()) {
|
||||
removeAllStartAnalysisCards();
|
||||
}
|
||||
|
||||
if (result.size() != starts.size()) {
|
||||
showNotificationForNewStartAnalysis();
|
||||
}
|
||||
addNewStartAnalysisCards(result);
|
||||
settingsButtonWithSelectionIndicationLabel
|
||||
.setSelectionIndicationTextOnLabel(result.get(0).competitor.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initAndAddBottomNotification() {
|
||||
bottomNotification = new BottomNotification();
|
||||
bottomNotification.addBottomNotificationClickListener(new BottomNotificationClickListener() {
|
||||
|
||||
@Override
|
||||
public void bottomNotificationClicked() {
|
||||
scrollToLast();
|
||||
}
|
||||
});
|
||||
RootPanel.get().add(bottomNotification);
|
||||
}
|
||||
|
||||
private void initCompetitorSelectionPopupAndAddCompetitorSelectionListener() {
|
||||
competitorSelectionPopup = new CompetitorSelectionPopup();
|
||||
competitorSelectionPopup.addListener(new CompetitorSelectionListener() {
|
||||
|
||||
@Override
|
||||
public void didClickOKWithSelectedCompetitor(CompetitorDTO competitor) {
|
||||
if (competitor != null) {
|
||||
Cookies.removeCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY);
|
||||
Cookies.setCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY, competitor.getIdAsString(), new Date(
|
||||
new Date().getTime() + SELECTED_COMPETITOR_ID_COOKIE_KEY_EXPIRE_TIME_IN_MILLIS));
|
||||
if (settingsButtonWithSelectionIndicationLabel != null) {
|
||||
settingsButtonWithSelectionIndicationLabel.setSelectionIndicationTextOnLabel(competitor
|
||||
.getName());
|
||||
}
|
||||
loadStartAnalysisDTOsForCompetitorID(competitor.getIdAsString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getCachedSelectedCompetitorOrAskForWithPopup() {
|
||||
String selectedCompetitorIdFromCookie = Cookies.getCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY);
|
||||
if (selectedCompetitorIdFromCookie == null) {
|
||||
loadCompetitorsAndShowCompetitorSelectionPopup();
|
||||
}
|
||||
}
|
||||
|
||||
private void loadCompetitorsAndShowCompetitorSelectionPopup() {
|
||||
ribDashboardServiceAsync.getCompetitorsInLeaderboard(leaderboardName, new AsyncCallback<List<CompetitorDTO>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CompetitorDTO> result) {
|
||||
if (!competitorSelectionPopup.isShown())
|
||||
competitorSelectionPopup.show(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initAndAddSettingsButtonWithSelectionIndicationLabel() {
|
||||
settingsButtonWithSelectionIndicationLabel = new SettingsButtonWithSelectionIndicationLabel();
|
||||
settingsButtonWithSelectionIndicationLabel.addClickHandlerToSettingsButton(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
loadCompetitorsAndShowCompetitorSelectionPopup();
|
||||
}
|
||||
});
|
||||
RootPanel.get().add(settingsButtonWithSelectionIndicationLabel);
|
||||
}
|
||||
|
||||
/**
|
||||
* <param>clickedLeft</param> if clicked left is true, the left arrow button was pressed, a false represent the
|
||||
* right button. The buttons are represented by the member variables {@link #left_focus_panel} and
|
||||
@@ -131,7 +271,7 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
if (displaysCards == true) {
|
||||
if (clickedLeft) {
|
||||
if (page != 0) {
|
||||
currentScrollPosition = currentScrollPosition + 83;
|
||||
currentScrollPosition = currentScrollPosition + SCROLL_OFFSET_STARTANALYSIS_CARDS;
|
||||
page--;
|
||||
startanalysis_card_container.getElement().getStyle().setLeft(currentScrollPosition, Unit.PCT);
|
||||
notifyStartAnalysisPageChangeListener(page);
|
||||
@@ -148,7 +288,7 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
}
|
||||
} else {
|
||||
if (page != numberOfStartAnalysisCards - 1) {
|
||||
currentScrollPosition -= 83;
|
||||
currentScrollPosition -= SCROLL_OFFSET_STARTANALYSIS_CARDS;
|
||||
page++;
|
||||
startanalysis_card_container.getElement().getStyle().setLeft(currentScrollPosition, Unit.PCT);
|
||||
notifyStartAnalysisPageChangeListener(page);
|
||||
@@ -169,7 +309,8 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
|
||||
private void scrollToLast() {
|
||||
if (numberOfStartAnalysisCards > 1) {
|
||||
currentScrollPosition = currentScrollPosition - (numberOfStartAnalysisCards - page - 1) * 83;
|
||||
currentScrollPosition = currentScrollPosition - (numberOfStartAnalysisCards - page - 1)
|
||||
* SCROLL_OFFSET_STARTANALYSIS_CARDS;
|
||||
page = numberOfStartAnalysisCards - 1;
|
||||
startanalysis_card_container.getElement().getStyle().setLeft(currentScrollPosition, Unit.PCT);
|
||||
header.getElement().setInnerHTML("Start " + starts.get(page).raceName);
|
||||
@@ -181,7 +322,7 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
}
|
||||
}
|
||||
|
||||
private void addStartAnalysisCard(StartAnalysisDTO startAnalysisDTO) {
|
||||
private void addStartAnalysisCard(final StartAnalysisDTO startAnalysisDTO) {
|
||||
|
||||
if (displaysCards == false) {
|
||||
displaysCards = true;
|
||||
@@ -190,20 +331,26 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
if (numberOfStartAnalysisCards > 0) {
|
||||
rightButton.setResource(RibDashboardImageResources.INSTANCE.right());
|
||||
}
|
||||
StartlineAnalysisCard sac = new StartlineAnalysisCard(numberOfStartAnalysisCards * 83 + 10,
|
||||
numberOfStartAnalysisCards, startAnalysisDTO);
|
||||
startanalysis_card_container.add(sac);
|
||||
registerPageChangeListener(sac);
|
||||
final StartlineAnalysisCard startlineAnalysisCard = new StartlineAnalysisCard(numberOfStartAnalysisCards
|
||||
* SCROLL_OFFSET_STARTANALYSIS_CARDS + 10, numberOfStartAnalysisCards, startAnalysisDTO,
|
||||
sailingServiceAsync);
|
||||
startanalysis_card_container.add(startlineAnalysisCard);
|
||||
startlineAnalysisCard.startAnalysisComponentPageChangedToIndexAndStartAnalysis(page, startAnalysisDTO);
|
||||
registerPageChangeListener(startlineAnalysisCard);
|
||||
numberOfStartAnalysisCards++;
|
||||
|
||||
}
|
||||
|
||||
private void removeAllStartAnalysisCards() {
|
||||
startanalysis_card_container.clear();
|
||||
numberOfStartAnalysisCards = 0;
|
||||
starts.clear();
|
||||
}
|
||||
|
||||
public void registerPageChangeListener(StartAnalysisPageChangeListener s) {
|
||||
private void showNotificationForNewStartAnalysis() {
|
||||
this.bottomNotification.show(BottomNotificationType.NEW_STARTANALYSIS_AVAILABLE);
|
||||
}
|
||||
|
||||
public void registerPageChangeListener(StartlineAnalysisCard s) {
|
||||
pageChangeListener.add(s);
|
||||
}
|
||||
|
||||
@@ -213,26 +360,37 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets,
|
||||
|
||||
public void notifyStartAnalysisPageChangeListener(int newPageIndex) {
|
||||
for (StartAnalysisPageChangeListener sO : pageChangeListener) {
|
||||
sO.loadMapAndContent(newPageIndex, "someData");
|
||||
if(starts.get(newPageIndex) != null)
|
||||
sO.startAnalysisComponentPageChangedToIndexAndStartAnalysis(newPageIndex, starts.get(newPageIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNewStartAnalysisCardForCompetitor(List<StartAnalysisDTO> startAnalysisDTOs, String selectedCompetitor) {
|
||||
this.bottomNotification.show("New Start Analysis available.", "#F0AB00", "#000000", true);
|
||||
if (!selectedCompetitor.equals(this.selectedCompetitor)) {
|
||||
removeAllStartAnalysisCards();
|
||||
}
|
||||
private void addNewStartAnalysisCards(List<StartAnalysisDTO> startAnalysisDTOs) {
|
||||
for (int i = numberOfStartAnalysisCards; i <= startAnalysisDTOs.size() - 1; i++) {
|
||||
addStartAnalysisCard(startAnalysisDTOs.get(i));
|
||||
starts.add(startAnalysisDTOs.get(i));
|
||||
}
|
||||
this.selectedCompetitor = selectedCompetitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bottomNotificationClicked() {
|
||||
scrollToLast();
|
||||
private String getCompetitorIdAsStringFromDisplayedStartAnalysisDTOs() {
|
||||
String result = "";
|
||||
if (starts != null && starts.size() > 0) {
|
||||
CompetitorDTO competitor = starts.get(0).competitor;
|
||||
if (competitor != null)
|
||||
result = starts.get(0).competitor.getIdAsString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean displayedStartAnalysisCompetitorDifferentToRequestedOne() {
|
||||
String competitorIDFromDispalyedStartAnalysisDTOs = getCompetitorIdAsStringFromDisplayedStartAnalysisDTOs();
|
||||
if (competitorIDFromDispalyedStartAnalysisDTOs != null
|
||||
&& !(competitorIDFromDispalyedStartAnalysisDTOs.equals(Cookies
|
||||
.getCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY)))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,14 +10,16 @@ import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSe
|
||||
import com.google.gwt.user.cellview.client.TextColumn;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisCompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
|
||||
public class StartAnalysisStartRankTable extends AbsolutePanel {
|
||||
|
||||
CellTable<StartAnalysisCompetitorDTO> table;
|
||||
private CellTable<StartAnalysisCompetitorDTO> table;
|
||||
private StringMessages stringConstants;
|
||||
|
||||
public StartAnalysisStartRankTable(List<StartAnalysisCompetitorDTO> saCompetitors) {
|
||||
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
initTable(saCompetitors);
|
||||
}
|
||||
|
||||
@@ -59,13 +61,13 @@ public class StartAnalysisStartRankTable extends AbsolutePanel {
|
||||
}
|
||||
};
|
||||
|
||||
table.addColumn(rankColumn, "Rank at first mark");
|
||||
table.addColumn(rankColumn, stringConstants.dashboardRankAtFirstMark());
|
||||
table.setColumnWidth(rankColumn, 18.0, Unit.PCT);
|
||||
table.addColumn(teamColumn, "Team");
|
||||
table.addColumn(teamColumn, stringConstants.dashboardTeam());
|
||||
table.setColumnWidth(teamColumn, 42.0, Unit.PCT);
|
||||
table.addColumn(speedColumn, "Speed in kts");
|
||||
table.addColumn(speedColumn, stringConstants.dashboardSpeedInKts());
|
||||
table.setColumnWidth(speedColumn, 15.0, Unit.PCT);
|
||||
table.addColumn(distanceColumn, "Distance to line in m");
|
||||
table.addColumn(distanceColumn, stringConstants.dashboardDistanceToLineInM());
|
||||
table.setColumnWidth(distanceColumn, 25.0, Unit.PCT);
|
||||
|
||||
table.setRowCount(4, true);
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.google.gwt.dom.client.Style;
|
||||
import com.google.gwt.dom.client.Style.Position;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiConstructor;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
@@ -17,6 +16,7 @@ import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.windchart.VerticalWindChartClickListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.windchart.WindBotComponent;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* The purpose of the class is to display a live and an average value of a continuously updating data source.
|
||||
@@ -66,8 +66,7 @@ public class LiveAverageComponent extends Composite implements HasWidgets, Verti
|
||||
@UiField
|
||||
HTMLPanel averagePanel;
|
||||
|
||||
int sizeForUnit;
|
||||
|
||||
private StringMessages stringConstants;
|
||||
public LiveAverageComponent() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
@@ -79,7 +78,8 @@ public class LiveAverageComponent extends Composite implements HasWidgets, Verti
|
||||
* sets a special size
|
||||
*
|
||||
* */
|
||||
public @UiConstructor LiveAverageComponent(String header, String unit) {
|
||||
public LiveAverageComponent(String header, String unit) {
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
liveAveragePanel.getElement().getStyle().setProperty("backgroundColor", "white");
|
||||
this.header.setInnerText(header);
|
||||
@@ -94,8 +94,8 @@ public class LiveAverageComponent extends Composite implements HasWidgets, Verti
|
||||
this.liveUnit.getStyle().setPosition(Position.ABSOLUTE);
|
||||
this.averageUnit.getStyle().setPosition(Position.ABSOLUTE);
|
||||
}
|
||||
this.liveLabel.setInnerHTML("live");
|
||||
this.averageLabel.setInnerHTML("average<br>(15 minutes)");
|
||||
this.liveLabel.setInnerHTML(stringConstants.dashboardLiveWind());
|
||||
this.averageLabel.setInnerHTML(stringConstants.dashboardAverageWind()+"<br>"+stringConstants.dashboardAverageWindMinutes(15));
|
||||
}
|
||||
|
||||
public void updateValues(String liveValue, String averageValue) {
|
||||
@@ -125,10 +125,6 @@ public class LiveAverageComponent extends Composite implements HasWidgets, Verti
|
||||
|
||||
@Override
|
||||
public void clickedWindChartWithNewIntervalChangeInMillis(int windChartIntervallInMillis) {
|
||||
if(windChartIntervallInMillis > 15){
|
||||
this.averageLabel.setInnerHTML("average<br>(1 hour)");
|
||||
}else{
|
||||
this.averageLabel.setInnerHTML("average<br>(15 minutes)");
|
||||
}
|
||||
this.averageLabel.setInnerHTML(stringConstants.dashboardAverageWind()+"<br>"+stringConstants.dashboardAverageWindMinutes(windChartIntervallInMillis));
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.sap.sailing.dashboards.gwt.client.RibDashboardDataRetriever;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardDataRetrieverListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.StartlineAdvantageType;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RibDashboardRaceInfoDTO;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* The purpose of the class is to display the live and average start line advantage either by wind or by geometry. There
|
||||
@@ -21,15 +22,14 @@ public class StartLineAdvantageComponent extends LiveAverageComponent implements
|
||||
private StartLineAdvantageComponentState startLineAdvantageComponentState;
|
||||
private StartLineAdvantageComponentStateShowsAdvantageByWind startLineAdvantageComponentStateShowsAdvantageByWind;
|
||||
private StartLineAdvantageComponentStateShowsAdvantageByGeometry startLineAdvantageComponentStateShowsAdvantageByGeometry;
|
||||
private StringMessages stringConstants;
|
||||
|
||||
private static final String HEADER_ADVANTAGE_BY_WIND = "Startline advantage by wind";
|
||||
private static final String HEADER_ADVANTAGE_BY_GEOMETRY = "Startline advantage by geometry";
|
||||
|
||||
public StartLineAdvantageComponent() {
|
||||
public StartLineAdvantageComponent(RibDashboardDataRetriever ribDashboardDataRetriever) {
|
||||
super();
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
initAndSetStartLineAdvantageStates();
|
||||
StartLineAdvantageComponentRessources.INSTANCE.css().ensureInjected();
|
||||
this.header.setInnerText(HEADER_ADVANTAGE_BY_WIND);
|
||||
this.header.setInnerText(stringConstants.dashboardStartlineAdvantageByWind());
|
||||
this.header.addClassName(StartLineAdvantageComponentRessources.INSTANCE.css()
|
||||
.startLineAdvantageComponent_header());
|
||||
liveAveragePanel.getElement().addClassName(
|
||||
@@ -40,9 +40,9 @@ public class StartLineAdvantageComponent extends LiveAverageComponent implements
|
||||
StartLineAdvantageComponentRessources.INSTANCE.css().startLineAdvantageComponent_middleLine());
|
||||
averagePanel.getElement().addClassName(
|
||||
StartLineAdvantageComponentRessources.INSTANCE.css().startLineAdvantageComponent_averagePanel());
|
||||
this.liveLabel.setInnerHTML("live");
|
||||
this.averageLabel.setInnerHTML("average<br>(1 hour)");
|
||||
RibDashboardDataRetriever.getInstance(null).addDataObserver(this);
|
||||
this.liveLabel.setInnerHTML(stringConstants.dashboardLiveWind());
|
||||
this.averageLabel.setInnerHTML(stringConstants.dashboardAverageWind()+"<br>"+stringConstants.dashboardAverageWindMinutes(60));
|
||||
ribDashboardDataRetriever.addDataObserver(this);
|
||||
}
|
||||
|
||||
private void initAndSetStartLineAdvantageStates() {
|
||||
@@ -116,7 +116,7 @@ public class StartLineAdvantageComponent extends LiveAverageComponent implements
|
||||
@Override
|
||||
public void changeStartLineAdvatageComponentsStateToOtherState(
|
||||
StartLineAdvantageComponent startLineAdvantageComponent) {
|
||||
startLineAdvantageComponent.header.setInnerText(HEADER_ADVANTAGE_BY_GEOMETRY);
|
||||
startLineAdvantageComponent.header.setInnerText(stringConstants.dashboardStartlineAdvantageByWind());
|
||||
startLineAdvantageComponent.startLineAdvantageComponentState = startLineAdvantageComponent.startLineAdvantageComponentStateShowsAdvantageByGeometry;
|
||||
startLineAdvantageComponent.liveNumber
|
||||
.setInnerText(startLineAdvantageComponent.startLineAdvantageComponentStateShowsAdvantageByGeometry
|
||||
@@ -149,7 +149,7 @@ public class StartLineAdvantageComponent extends LiveAverageComponent implements
|
||||
@Override
|
||||
public void changeStartLineAdvatageComponentsStateToOtherState(
|
||||
StartLineAdvantageComponent startLineAdvantageComponent) {
|
||||
startLineAdvantageComponent.header.setInnerText(HEADER_ADVANTAGE_BY_WIND);
|
||||
startLineAdvantageComponent.header.setInnerText(stringConstants.dashboardStartlineAdvantageByGeometry());
|
||||
startLineAdvantageComponent.startLineAdvantageComponentState = startLineAdvantageComponent.startLineAdvantageComponentStateShowsAdvantageByWind;
|
||||
startLineAdvantageComponent.liveNumber
|
||||
.setInnerText(startLineAdvantageComponent.startLineAdvantageComponentStateShowsAdvantageByWind
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.sap.sailing.dashboards.gwt.client.windchart;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.moxieapps.gwt.highcharts.client.Axis.Type;
|
||||
import org.moxieapps.gwt.highcharts.client.Chart;
|
||||
@@ -38,7 +36,6 @@ import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardEntryPoint;
|
||||
|
||||
/**
|
||||
* The class represents a wind chart that is displayed vertically. Because it is meant to be used to display wind fixes,
|
||||
@@ -71,8 +68,6 @@ public class VerticalWindChart extends Composite implements HasWidgets {
|
||||
|
||||
private static final int MAX_SERIES_POINTS = 100000000;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RibDashboardEntryPoint.class.getName());
|
||||
|
||||
private static VerticalWindChartUiBinder uiBinder = GWT.create(VerticalWindChartUiBinder.class);
|
||||
|
||||
interface VerticalWindChartUiBinder extends UiBinder<Widget, VerticalWindChart> {
|
||||
@@ -246,7 +241,6 @@ public class VerticalWindChart extends Composite implements HasWidgets {
|
||||
} else {
|
||||
pointRangeInMilliseconds = 0;
|
||||
}
|
||||
logger.log(Level.INFO, "Points Range " + pointRangeInMilliseconds);
|
||||
return pointRangeInMilliseconds;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,32 @@
|
||||
color: black;
|
||||
}
|
||||
|
||||
.windloadinghint {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
opacity: 0.4;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.windloadinghinttext {
|
||||
position: absolute;
|
||||
bottom: 0pt;
|
||||
height: 15pt;
|
||||
line-height: 15pt;
|
||||
margin-top: 0pt;
|
||||
vertical-align: middle;
|
||||
font-size: 12pt;
|
||||
font-family: "Arial";
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
top: 50%;
|
||||
margin-top: -7pt;
|
||||
}
|
||||
|
||||
.clickHintMinutesSpan{
|
||||
font-weight: bolder;
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import com.sap.sailing.dashboards.gwt.shared.SinWave;
|
||||
import com.sap.sailing.dashboards.gwt.shared.WindType;
|
||||
import com.sap.sailing.domain.common.WindSource;
|
||||
import com.sap.sailing.domain.common.WindSourceType;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.charts.ChartPointRecalculator;
|
||||
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
||||
@@ -57,6 +58,9 @@ public class WindBotComponent extends Composite implements HasWidgets, WindBotDa
|
||||
interface WindBotComponentStyle extends CssResource {
|
||||
}
|
||||
|
||||
@UiField
|
||||
public HTMLPanel windBotComponent;
|
||||
|
||||
/**
|
||||
* The header of the widget displaying the name of the wind bot.
|
||||
* */
|
||||
@@ -67,14 +71,14 @@ public class WindBotComponent extends Composite implements HasWidgets, WindBotDa
|
||||
* One of two {@link LiveAverageComponent}s that display in big font the live and the average value of the measured
|
||||
* wind speed.
|
||||
* */
|
||||
@UiField
|
||||
@UiField(provided = true)
|
||||
public LiveAverageComponent trueWindSpeedLiveAverageComponent;
|
||||
|
||||
/**
|
||||
* One of two {@link LiveAverageComponent}s that display in big font the live and the average value of the measured
|
||||
* wind direction.
|
||||
* */
|
||||
@UiField
|
||||
@UiField(provided = true)
|
||||
public LiveAverageComponent trueWindDirectionLiveAverageComponent;
|
||||
|
||||
/**
|
||||
@@ -99,9 +103,11 @@ public class WindBotComponent extends Composite implements HasWidgets, WindBotDa
|
||||
public LocationPointerCompass locationPointerCompass;
|
||||
|
||||
private String windBotId;
|
||||
private StringMessages stringConstants;
|
||||
|
||||
public WindBotComponent(String windBotId) {
|
||||
this.windBotId = windBotId;
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
String inSimulationModeParameter = Window.Location.getParameter(IN_SIMULATION_MODE);
|
||||
if (inSimulationModeParameter != null && inSimulationModeParameter.equals("true")) {
|
||||
inSimulationMode = true;
|
||||
@@ -112,8 +118,10 @@ public class WindBotComponent extends Composite implements HasWidgets, WindBotDa
|
||||
}
|
||||
movingAverageSpeed = new MovingAverage(500);
|
||||
movingAverageDirection = new MovingAverage(500);
|
||||
trueWindSpeedLiveAverageComponent = new LiveAverageComponent(stringConstants.dashboardTrueWindSpeed(), stringConstants.dashboardTrueWindSpeedUnit());
|
||||
trueWindDirectionLiveAverageComponent = new LiveAverageComponent(stringConstants.dashboardTrueWindDirection(), stringConstants.dashboardTrueWindDirectionUnit());
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
windBotNamePanel.getElement().setInnerText("Wind Bot " + windBotId);
|
||||
windBotNamePanel.getElement().setInnerText(stringConstants.dashboardWindBot()+" "+ windBotId);
|
||||
trueWindSpeedVerticalWindChart.addVerticalWindChartClickListener(trueWindSpeedLiveAverageComponent);
|
||||
trueWindDirectionVerticalWindChart.addVerticalWindChartClickListener(trueWindDirectionLiveAverageComponent);
|
||||
}
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
<ui:style type='com.sap.sailing.dashboards.gwt.client.windchart.WindBotComponent.WindBotComponentStyle'
|
||||
src='WindBotComponentStyle.css'></ui:style>
|
||||
|
||||
<g:HTMLPanel styleName="windBotComponent">
|
||||
<g:HTMLPanel ui:field="windBotNamePanel" styleName="{style.windBotNamePanel}">Wind Bot</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="windBotComponent" styleName="windBotComponent">
|
||||
<g:HTMLPanel ui:field="windBotNamePanel" styleName="{style.windBotNamePanel}"></g:HTMLPanel>
|
||||
<g:HTMLPanel
|
||||
styleName="{style.wind_bot_component_live_average_container} {style.wind_bot_component_left}">
|
||||
<startlineadvantage:LiveAverageComponent
|
||||
ui:field="trueWindSpeedLiveAverageComponent" header="TWS" unit="kts"></startlineadvantage:LiveAverageComponent>
|
||||
ui:field="trueWindSpeedLiveAverageComponent"></startlineadvantage:LiveAverageComponent>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel
|
||||
styleName="{style.wind_bot_component_live_average_container} {style.wind_bot_component_right}">
|
||||
<startlineadvantage:LiveAverageComponent
|
||||
ui:field="trueWindDirectionLiveAverageComponent" header="TWD" unit="°"></startlineadvantage:LiveAverageComponent>
|
||||
ui:field="trueWindDirectionLiveAverageComponent"></startlineadvantage:LiveAverageComponent>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel
|
||||
styleName="{style.wind_bot_component_windchart_container} {style.wind_bot_component_left}">
|
||||
|
||||
@@ -3,9 +3,7 @@ package com.sap.sailing.dashboards.gwt.server;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -15,6 +13,7 @@ import org.osgi.util.tracker.ServiceTracker;
|
||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardService;
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.StartlineAdvantageType;
|
||||
import com.sap.sailing.dashboards.gwt.server.startanalysis.StartAnalysisCreationController;
|
||||
import com.sap.sailing.dashboards.gwt.shared.MovingAverage;
|
||||
import com.sap.sailing.dashboards.gwt.shared.ResponseMessage;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RibDashboardRaceInfoDTO;
|
||||
@@ -25,7 +24,7 @@ import com.sap.sailing.domain.base.Fleet;
|
||||
import com.sap.sailing.domain.base.RaceColumn;
|
||||
import com.sap.sailing.domain.common.LegType;
|
||||
import com.sap.sailing.domain.common.NoWindException;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sailing.domain.tracking.TrackedLeg;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
@@ -39,10 +38,14 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class RibDashboardServiceImpl extends RemoteServiceServlet implements RibDashboardService,
|
||||
StartAnalysisRacesStoreListener {
|
||||
public class RibDashboardServiceImpl extends RemoteServiceServlet implements RibDashboardService {
|
||||
|
||||
private static final long serialVersionUID = 7710545186662632126L;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private StartAnalysisCreationController startAnalysisCreationController;
|
||||
|
||||
/**
|
||||
* Variable contains last {@link TrackedRace} that is or was live
|
||||
@@ -63,30 +66,18 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
|
||||
* */
|
||||
private MovingAverage averageStartLineAdvantageByGeometry;
|
||||
|
||||
/**
|
||||
* The map values contain a Pair, whose first value is a {@link MovingAverage} for the true wind speed and the
|
||||
* second one contains an average for the true wind direction for a wind bot.
|
||||
* */
|
||||
|
||||
private Map<String, List<StartAnalysisDTO>> startAnalysisDTOsForCompetitor;
|
||||
private StartAnalysisRacesStore startAnalysisRacesStore;
|
||||
|
||||
private final ServiceTracker<RacingEventService, RacingEventService> racingEventServiceTracker;
|
||||
private final com.sap.sailing.domain.base.DomainFactory baseDomainFactory;
|
||||
private final BundleContext context;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RibDashboardServiceImpl.class.getName());
|
||||
|
||||
|
||||
public RibDashboardServiceImpl() {
|
||||
context = Activator.getDefault();
|
||||
racingEventServiceTracker = createAndOpenRacingEventServiceTracker(context);
|
||||
baseDomainFactory = getRacingEventService().getBaseDomainFactory();
|
||||
startAnalysisCreationController = new StartAnalysisCreationController(getRacingEventService());
|
||||
|
||||
startAnalysisRacesStore = new StartAnalysisRacesStore(getRacingEventService());
|
||||
startAnalysisRacesStore.addStartAnalyisisRacesStoreListener(this);
|
||||
|
||||
startAnalysisDTOsForCompetitor = new HashMap<String, List<StartAnalysisDTO>>();
|
||||
averageStartLineAdvantageByWind = new MovingAverage(400);
|
||||
averageStartLineAdvantageByGeometry = new MovingAverage(400);
|
||||
}
|
||||
@@ -105,42 +96,31 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
|
||||
|
||||
/**
|
||||
* <param>leaderboardName</param> is used to retrieve the live running race with the method
|
||||
* {@link #getLiveRaceFromLeaderboardName(String)}. <param>competitorName</param> If competitorName is null, the
|
||||
* response contains only a list of competitors in the live race. Otherwise the parameter is used to return the
|
||||
* right startanalysis for a specific competitor with in the returned {@link RibDashboardRaceInfoDTO}.
|
||||
* {@link #getLiveRaceFromLeaderboardName(String)}.
|
||||
*
|
||||
* @throws NoWindException
|
||||
* */
|
||||
@Override
|
||||
public RibDashboardRaceInfoDTO getLiveRaceInfo(String leaderboardName, String competitorName) throws NoWindException {
|
||||
public RibDashboardRaceInfoDTO getLiveRaceInfo(String leaderboardName) throws NoWindException {
|
||||
RibDashboardRaceInfoDTO lRInfo = new RibDashboardRaceInfoDTO();
|
||||
if (leaderboardName != null) {
|
||||
TimePoint timePointOfRequest = MillisecondsTimePoint.now();
|
||||
if (checkIfRaceIsStillRunning(timePointOfRequest, leaderboardName)) {
|
||||
if (competitorName == null) {
|
||||
fillLiveRaceInfoDTOWithRaceData(lRInfo, timePointOfRequest);
|
||||
logger.log(Level.INFO, "No Competitor selected");
|
||||
lRInfo.responseMessage = ResponseMessage.NO_COMPETITOR_SELECTED;
|
||||
return lRInfo;
|
||||
} else {
|
||||
fillLiveRaceInfoDTOWithRaceData(lRInfo, timePointOfRequest);
|
||||
fillLiveRaceInfoDTOWithStartLineAdavantageData(lRInfo, timePointOfRequest);
|
||||
fillLiveRaceInfoDTOWithStartAnalysisData(lRInfo, competitorName);
|
||||
lRInfo.responseMessage = ResponseMessage.OK;
|
||||
lRInfo.responseMessage = ResponseMessage.RACE_LIVE;
|
||||
} else {
|
||||
lRInfo.responseMessage = ResponseMessage.NO_RACE_LIVE;
|
||||
}
|
||||
} else {
|
||||
lRInfo.responseMessage = ResponseMessage.NO_RACE_LIVE;
|
||||
}
|
||||
return lRInfo;
|
||||
} else {
|
||||
lRInfo.responseMessage = ResponseMessage.NO_RACE_LIVE;
|
||||
return lRInfo;
|
||||
}
|
||||
}
|
||||
|
||||
private void fillLiveRaceInfoDTOWithRaceData(RibDashboardRaceInfoDTO lRInfo, TimePoint now) {
|
||||
if (runningRace != null) {
|
||||
lRInfo.idOfLastTrackedRace = runningRace.getRaceIdentifier();
|
||||
try {
|
||||
List<Competitor> competitors = runningRace.getCompetitorsFromBestToWorst(now);
|
||||
List<String> competitorNames = new ArrayList<String>();
|
||||
for (Competitor competitor : competitors) {
|
||||
@@ -148,15 +128,8 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
|
||||
}
|
||||
Collections.sort(competitorNames);
|
||||
lRInfo.competitorNamesFromLastTrackedRace = competitorNames;
|
||||
} catch (NoWindException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fillLiveRaceInfoDTOWithStartAnalysisData(RibDashboardRaceInfoDTO lRInfo, String competiorName) {
|
||||
lRInfo.startAnalysisDTOList = startAnalysisDTOsForCompetitor.get(competiorName);
|
||||
}
|
||||
|
||||
// returns true if race is still live
|
||||
private boolean checkIfRaceIsStillRunning(TimePoint now, String leaderboardName) {
|
||||
@@ -165,7 +138,6 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
|
||||
if (runningRace == null) {
|
||||
return false;
|
||||
} else {
|
||||
startAnalysisRacesStore.addAsListener(runningRace);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@@ -189,17 +161,34 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
|
||||
return result;
|
||||
}
|
||||
|
||||
private void fillLiveRaceInfoDTOWithStartLineAdavantageData(RibDashboardRaceInfoDTO lRInfo, TimePoint timePoint) throws NoWindException {
|
||||
private List<TrackedRace> getTrackedRacesFromLeaderboard(String leaderboardName) {
|
||||
List<TrackedRace> result = new ArrayList<TrackedRace>();
|
||||
Leaderboard lb = getRacingEventService().getLeaderboardByName(leaderboardName);
|
||||
if (lb != null) {
|
||||
for (RaceColumn column : lb.getRaceColumns()) {
|
||||
for (Fleet fleet : column.getFleets()) {
|
||||
TrackedRace race = column.getTrackedRace(fleet);
|
||||
if (race != null) {
|
||||
result.add(race);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void fillLiveRaceInfoDTOWithStartLineAdavantageData(RibDashboardRaceInfoDTO lRInfo, TimePoint timePoint)
|
||||
throws NoWindException {
|
||||
if (runningRace != null && timePoint != null) {
|
||||
StartLineAdvantageDTO startLineAdvantageDTO = new StartLineAdvantageDTO();
|
||||
StartlineAdvantageType startlineAdvantageType = getStartlineAdvantageType(runningRace, timePoint);
|
||||
if(startlineAdvantageType == null || startlineAdvantageType == StartlineAdvantageType.WIND){
|
||||
if (startlineAdvantageType == null || startlineAdvantageType == StartlineAdvantageType.WIND) {
|
||||
startLineAdvantageDTO.startLineAdvatageType = StartlineAdvantageType.WIND;
|
||||
double startlineAdvantage = runningRace.getStartLine(timePoint).getAdvantage().getMeters();
|
||||
startLineAdvantageDTO.startLineAdvantage = startlineAdvantage;
|
||||
averageStartLineAdvantageByWind.add(startlineAdvantage);
|
||||
startLineAdvantageDTO.startlineAdvantageAverage = averageStartLineAdvantageByWind.getAverage();
|
||||
}else if(startlineAdvantageType == StartlineAdvantageType.GEOMETRIC){
|
||||
} else if (startlineAdvantageType == StartlineAdvantageType.GEOMETRIC) {
|
||||
startLineAdvantageDTO.startLineAdvatageType = StartlineAdvantageType.GEOMETRIC;
|
||||
double startlineAdvantage = runningRace.getStartLine(timePoint).getAdvantage().getMeters();
|
||||
startLineAdvantageDTO.startLineAdvantage = startlineAdvantage;
|
||||
@@ -228,12 +217,13 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
|
||||
}
|
||||
}
|
||||
|
||||
private LegType getFirstLegTypeOfTrackedRaceAtTimePoint(TrackedRace trackedRace, TimePoint timePoint) throws NoWindException{
|
||||
private LegType getFirstLegTypeOfTrackedRaceAtTimePoint(TrackedRace trackedRace, TimePoint timePoint)
|
||||
throws NoWindException {
|
||||
Iterable<TrackedLeg> trackedLegs = trackedRace.getTrackedLegs();
|
||||
if(trackedLegs != null && trackedLegs.iterator().hasNext()){
|
||||
if (trackedLegs != null && trackedLegs.iterator().hasNext()) {
|
||||
TrackedLeg firstLegInTrackedRace = trackedLegs.iterator().next();
|
||||
return firstLegInTrackedRace.getLegType(timePoint);
|
||||
}else{
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -242,12 +232,26 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
|
||||
return baseDomainFactory;
|
||||
}
|
||||
|
||||
public TrackedRace getExistingTrackedRace(RegattaAndRaceIdentifier regattaNameAndRaceName) {
|
||||
return null;
|
||||
@Override
|
||||
public List<StartAnalysisDTO> getStartAnalysisListForCompetitorIDAndLeaderboardName(String competitorIdAsString,
|
||||
String leaderboardName) {
|
||||
List<StartAnalysisDTO> startAnalysisDTOs = new ArrayList<StartAnalysisDTO>();
|
||||
Competitor competitor = baseDomainFactory.getCompetitorStore().getExistingCompetitorByIdAsString(
|
||||
competitorIdAsString);
|
||||
List<TrackedRace> trackedRacesForLeaderBoardName = getTrackedRacesFromLeaderboard(leaderboardName);
|
||||
for (TrackedRace trackedRace : trackedRacesForLeaderBoardName) {
|
||||
StartAnalysisDTO startAnalysisDTO = startAnalysisCreationController.checkStartAnalysisForCompetitorInTrackedRace(competitor, trackedRace);
|
||||
if (startAnalysisDTO != null)
|
||||
startAnalysisDTOs.add(startAnalysisDTO);
|
||||
}
|
||||
return startAnalysisDTOs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAnalyisisRacesChanged(Map<String, List<StartAnalysisDTO>> startAnalysisDTOCompetitorMap) {
|
||||
startAnalysisDTOsForCompetitor = startAnalysisDTOCompetitorMap;
|
||||
public List<CompetitorDTO> getCompetitorsInLeaderboard(String leaderboardName) {
|
||||
logger.log(Level.INFO, "getCompetitorsInLeaderboard(...) Request.");
|
||||
Leaderboard lb = getRacingEventService().getLeaderboardByName(leaderboardName);
|
||||
return baseDomainFactory.getCompetitorDTOList(lb.getCompetitorsFromBestToWorst(new MillisecondsTimePoint(
|
||||
new Date())));
|
||||
}
|
||||
}
|
||||
@@ -1,488 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sailing.dashboards.gwt.client.RibDashboardEntryPoint;
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.StartlineAdvantageType;
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.rankingtable.StartAnalysisStartRankTable;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartLineAdvantageDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisCompetitorDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisRankingTableEntryDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.WindAndAdvantagesInfoForStartLineDTO;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.common.LegType;
|
||||
import com.sap.sailing.domain.common.NoWindException;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.SpeedWithBearing;
|
||||
import com.sap.sailing.domain.common.Tack;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.PositionDTO;
|
||||
import com.sap.sailing.domain.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.tracking.GPSFixTrack;
|
||||
import com.sap.sailing.domain.tracking.LineDetails;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
import com.sap.sailing.domain.tracking.TrackedLeg;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sailing.domain.tracking.Wind;
|
||||
import com.sap.sailing.domain.tracking.impl.AbstractRaceChangeListener;
|
||||
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.MarkDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.SpeedWithBearingDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
/**
|
||||
* The task of StartAnalyisisRacesStore is to cache StartAnalysisDTOs for Competitors at one day. At initialization it
|
||||
* generates StartAnalysisDTOs for Competitors from races started before initialization time and generates
|
||||
* StartAnalysisDTOs for Competitors from races that are starting when the server is running. It achieves this basically
|
||||
* by registering as RaceChangeListener and receiving so markRoundings for competitors.
|
||||
*/
|
||||
public class StartAnalysisRacesStore {
|
||||
|
||||
private final com.sap.sailing.domain.base.DomainFactory baseDomainFactory;
|
||||
|
||||
/**
|
||||
* {@link StartAnalyisisRacesStoreListener} get notified at after initialization and after the change of
|
||||
* {@link #startAnalysisDTOListForCompetitorName}
|
||||
* */
|
||||
private List<StartAnalysisRacesStoreListener> listeners;
|
||||
|
||||
/**
|
||||
* Caches a list of chronologically sorted {@link StartAnalysisDTO} for names from Competitors. After any change of
|
||||
* this field {@link #notifyListernersAboutStartAnalysisDTOsChanges()} get called.
|
||||
* */
|
||||
private Map<String, List<StartAnalysisDTO>> startAnalysisDTOListForCompetitorName;
|
||||
|
||||
/**
|
||||
* Contains a ranking list of competitor at mark one for every race
|
||||
* */
|
||||
private Map<TrackedRace, List<Competitor>> rankingListAtMarkOneForTrackedRace;
|
||||
|
||||
/**
|
||||
* Like {@link startAnalysisCompetitorDTOsForCompetitorNameForTrackedRace} gpsFixesForCompetitorNameForTracedRace
|
||||
* contains the list of gps fixes for a competitor name at from 6 seconds at the start. Caching
|
||||
* {@link gpsFixesForCompetitorNameForTracedRace}s brings the advantage of faster code at creating finished
|
||||
* {@link #startAnalysisDTOListForCompetitorName}.
|
||||
* */
|
||||
private Map<TrackedRace, Map<String, List<GPSFixDTO>>> gpsFixesPathBeforeStartForCompetitor;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RibDashboardEntryPoint.class.getName());
|
||||
/**
|
||||
* Minimum number of competitors in {@link StartAnalysisStartRankTable}
|
||||
* */
|
||||
private final int MINIMUM_NUMBER_OF_COMPETITORS_IN_STARTANALYSISRANKINGTABLE = 3;
|
||||
private final int TAILLENGHT_IN_MILLISECONDS = 200000;
|
||||
|
||||
/**
|
||||
* Calls {@link #generateStartAnalysisDTOsForCompetitorNamesFromRacesStartedBeforeClassInitialization()} to create
|
||||
* startanalysisDTO for races that started before class initialization.
|
||||
*/
|
||||
public StartAnalysisRacesStore(RacingEventService racingEventService) {
|
||||
|
||||
baseDomainFactory = racingEventService.getBaseDomainFactory();
|
||||
this.listeners = new ArrayList<StartAnalysisRacesStoreListener>();
|
||||
|
||||
startAnalysisDTOListForCompetitorName = new HashMap<String, List<StartAnalysisDTO>>();
|
||||
rankingListAtMarkOneForTrackedRace = new HashMap<TrackedRace, List<Competitor>>();
|
||||
gpsFixesPathBeforeStartForCompetitor = new HashMap<TrackedRace, Map<String, List<GPSFixDTO>>>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Index of the Mark in the Race. Is used in
|
||||
* {@link #markPassingReceived(Competitor, Map, Iterable, TrackedRace)} to identify just markpassings at mark one,
|
||||
* because the position of a boat at mark one defines the performance/startingrank of the race
|
||||
*/
|
||||
private int getIndexOfMarkPassingMark(Iterable<MarkPassing> markPassings, TrackedRace trackedRace) {
|
||||
List<MarkPassing> markPassingsList = listFromIterator(markPassings.iterator());
|
||||
return trackedRace.getRace().getCourse()
|
||||
.getIndexOfWaypoint(markPassingsList.get(markPassingsList.size() - 1).getWaypoint());
|
||||
}
|
||||
|
||||
private List<Competitor> getOrCreateAndAddRankingListAtMarkOneForTrackedRace(TrackedRace trackedRace) {
|
||||
if (!rankingListAtMarkOneForTrackedRace.containsKey(trackedRace)) {
|
||||
List<Competitor> rankingListAtMarkOneForRace = new ArrayList<Competitor>();
|
||||
rankingListAtMarkOneForTrackedRace.put(trackedRace, rankingListAtMarkOneForRace);
|
||||
}
|
||||
return rankingListAtMarkOneForTrackedRace.get(trackedRace);
|
||||
}
|
||||
|
||||
private List<StartAnalysisDTO> getOrCreateAndAddStartAnalysisDTOListForCompetitorName(String competitorName) {
|
||||
if (!startAnalysisDTOListForCompetitorName.containsKey(competitorName)) {
|
||||
List<StartAnalysisDTO> startAnalysisDTOList = new ArrayList<StartAnalysisDTO>();
|
||||
startAnalysisDTOListForCompetitorName.put(competitorName, startAnalysisDTOList);
|
||||
}
|
||||
return startAnalysisDTOListForCompetitorName.get(competitorName);
|
||||
}
|
||||
|
||||
private StartAnalysisDTO createStartAnalysisDTOForCompetitor(Competitor competitor, TrackedRace trackedRace) {
|
||||
StartAnalysisDTO startAnalysisDTO = createStartAnalysisDTOWithOnlyStaticData(trackedRace);
|
||||
List<StartAnalysisCompetitorDTO> competitors = new ArrayList<StartAnalysisCompetitorDTO>();
|
||||
List<Competitor> rankingList = getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace);
|
||||
|
||||
boolean isCompetitorBetweenFirstThree = false;
|
||||
for (int i = 0; i < MINIMUM_NUMBER_OF_COMPETITORS_IN_STARTANALYSISRANKINGTABLE; i++) {
|
||||
competitors.add(createStartAnalysisCompetitorDTO(trackedRace, i + 1,
|
||||
getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace).get(i)));
|
||||
if (rankingList.get(i).equals(competitor)) {
|
||||
isCompetitorBetweenFirstThree = true;
|
||||
}
|
||||
}
|
||||
if (!isCompetitorBetweenFirstThree) {
|
||||
competitors.add(createStartAnalysisCompetitorDTO(trackedRace,
|
||||
getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace).size(), competitor));
|
||||
}
|
||||
startAnalysisDTO.startAnalysisCompetitorDTOs = competitors;
|
||||
return startAnalysisDTO;
|
||||
}
|
||||
|
||||
private List<MarkPassing> listFromIterator(Iterator<MarkPassing> iterator) {
|
||||
List<MarkPassing> result = new ArrayList<MarkPassing>();
|
||||
while (iterator.hasNext()) {
|
||||
result.add(iterator.next());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private StartAnalysisDTO createStartAnalysisDTOWithOnlyStaticData(TrackedRace trackedRace) {
|
||||
StartAnalysisDTO startAnalysisDTO = new StartAnalysisDTO();
|
||||
startAnalysisDTO.raceName = trackedRace.getRace().getName();
|
||||
startAnalysisDTO.startLineMarkPositions = getStartLineBoyPositions(trackedRace);
|
||||
startAnalysisDTO.firstMark = getMarksOfWayPoint(trackedRace, getFirstMarkWayPoint(trackedRace)).get(0);
|
||||
startAnalysisDTO.startAnalysisWindLineInfoDTO = createStartAnalysisWindAndLineData(trackedRace);
|
||||
startAnalysisDTO.startLineMarks = getMarksOfWayPoint(trackedRace,
|
||||
trackedRace.getStartLine(trackedRace.getStartTimeReceived()).getWaypoint());
|
||||
return startAnalysisDTO;
|
||||
}
|
||||
|
||||
private Map<String, Date> createPerCompetitorIdAsString(TrackedRace currentRace, Date fiveSecondsBeforeStart) {
|
||||
Map<String, Date> fromPerCompetitorIdAsString = new HashMap<String, Date>();
|
||||
try {
|
||||
for (Competitor competitor : currentRace.getCompetitorsFromBestToWorst(new MillisecondsTimePoint(new Date()
|
||||
.getTime()))) {
|
||||
fromPerCompetitorIdAsString.put(competitor.getId().toString(), fiveSecondsBeforeStart);
|
||||
}
|
||||
} catch (NoWindException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return fromPerCompetitorIdAsString;
|
||||
}
|
||||
|
||||
private StartAnalysisRankingTableEntryDTO createRankTableEntry(TrackedRace trackedRace, int rank,
|
||||
Competitor competitor) {
|
||||
StartAnalysisRankingTableEntryDTO startAnalysisRankTableEntryDTO = createStartAnalysisRankTableEntryDTOWithRankAndStartTimepoint(
|
||||
competitor, rank, trackedRace);
|
||||
return startAnalysisRankTableEntryDTO;
|
||||
}
|
||||
|
||||
private StartAnalysisRankingTableEntryDTO createStartAnalysisRankTableEntryDTOWithRankAndStartTimepoint(
|
||||
Competitor competitor, int rank, TrackedRace trackedRace) {
|
||||
StartAnalysisRankingTableEntryDTO tableentry = new StartAnalysisRankingTableEntryDTO();
|
||||
tableentry.rankAtFirstMark = rank;
|
||||
tableentry.teamName = competitor.getName();
|
||||
tableentry.speedAtStartTime = trackedRace.getSpeed(competitor, 1).getKnots();
|
||||
tableentry.distanceToLineAtStartTime = trackedRace.getDistanceToStartLine(competitor, 1).getMeters();
|
||||
tableentry.tailColor = competitor.getColor().getAsHtml();
|
||||
return tableentry;
|
||||
}
|
||||
|
||||
private List<PositionDTO> getStartLineBoyPositions(TrackedRace trackedRace) {
|
||||
return getMarkPositionDTOs(trackedRace.getStartTimeReceived(), trackedRace, trackedRace.getRace().getCourse()
|
||||
.getFirstWaypoint());
|
||||
}
|
||||
|
||||
private Waypoint getFirstMarkWayPoint(TrackedRace trackedRace) {
|
||||
Waypoint firstMarkWayPoint = null;
|
||||
Iterator<Waypoint> waypoints = trackedRace.getRace().getCourse().getWaypoints().iterator();
|
||||
int wayPointCounter = 0;
|
||||
while (waypoints.hasNext()) {
|
||||
Waypoint wayPoint = waypoints.next();
|
||||
if (wayPointCounter == 1) {
|
||||
return wayPoint;
|
||||
}
|
||||
wayPointCounter++;
|
||||
}
|
||||
return firstMarkWayPoint;
|
||||
}
|
||||
|
||||
private List<PositionDTO> getMarkPositionDTOs(TimePoint timePoint, TrackedRace trackedRace, Waypoint waypoint) {
|
||||
|
||||
List<PositionDTO> markPositionDTOs = new ArrayList<PositionDTO>();
|
||||
for (Mark startMark : waypoint.getMarks()) {
|
||||
final Position estimatedMarkPosition = trackedRace.getOrCreateTrack(startMark).getEstimatedPosition(
|
||||
timePoint, /* extrapolate */false);
|
||||
if (estimatedMarkPosition != null) {
|
||||
markPositionDTOs.add(new PositionDTO(estimatedMarkPosition.getLatDeg(), estimatedMarkPosition
|
||||
.getLngDeg()));
|
||||
}
|
||||
}
|
||||
return markPositionDTOs;
|
||||
}
|
||||
|
||||
private List<MarkDTO> getMarksOfWayPoint(TrackedRace trackedRace, Waypoint wayPoint) {
|
||||
List<MarkDTO> startLineMarks = new ArrayList<MarkDTO>();
|
||||
for (Mark startMark : wayPoint.getMarks()) {
|
||||
final Position estimatedMarkPosition = trackedRace.getOrCreateTrack(startMark).getEstimatedPosition(
|
||||
trackedRace.getStartTimeReceived(), /* extrapolate */false);
|
||||
if (estimatedMarkPosition != null) {
|
||||
startLineMarks.add(convertToMarkDTO(startMark, estimatedMarkPosition));
|
||||
}
|
||||
}
|
||||
return startLineMarks;
|
||||
}
|
||||
|
||||
private MarkDTO convertToMarkDTO(Mark mark, Position position) {
|
||||
MarkDTO markDTO;
|
||||
if (position != null) {
|
||||
markDTO = new MarkDTO(mark.getId().toString(), mark.getName(), position.getLatDeg(), position.getLngDeg());
|
||||
} else {
|
||||
markDTO = new MarkDTO(mark.getId().toString(), mark.getName());
|
||||
}
|
||||
markDTO.color = mark.getColor();
|
||||
markDTO.shape = mark.getShape();
|
||||
markDTO.pattern = mark.getPattern();
|
||||
markDTO.type = mark.getType();
|
||||
|
||||
return markDTO;
|
||||
}
|
||||
|
||||
public void addStartAnalyisisRacesStoreListener(StartAnalysisRacesStoreListener startAnalyisisRacesStoreListener) {
|
||||
listeners.add(startAnalyisisRacesStoreListener);
|
||||
}
|
||||
|
||||
private WindAndAdvantagesInfoForStartLineDTO createStartAnalysisWindAndLineData(TrackedRace trackedRace) {
|
||||
WindAndAdvantagesInfoForStartLineDTO startAnalysisWindLineInfoDTO = new WindAndAdvantagesInfoForStartLineDTO();
|
||||
LineDetails startline = trackedRace.getStartLine(trackedRace.getStartTimeReceived());
|
||||
StartLineAdvantageDTO startLineAdvantageDTO = new StartLineAdvantageDTO();
|
||||
startLineAdvantageDTO.startLineAdvatageType = getStartlineAdvantageType(trackedRace, new MillisecondsTimePoint(new Date()));
|
||||
startLineAdvantageDTO.startLineAdvantage = startline.getAdvantage().getMeters();
|
||||
startAnalysisWindLineInfoDTO.startLineAdvantage = startLineAdvantageDTO;
|
||||
Position portMarkPosition = trackedRace.getOrCreateTrack(
|
||||
trackedRace.getStartLine(trackedRace.getStartTimeReceived()).getStarboardMarkWhileApproachingLine())
|
||||
.getEstimatedPosition(trackedRace.getStartTimeReceived(), /* extrapolate */
|
||||
false);
|
||||
Wind windAtStart = trackedRace.getWind(portMarkPosition, trackedRace.getStartTimeReceived());
|
||||
startAnalysisWindLineInfoDTO.windDirectionInDegrees = windAtStart.getBearing().getDegrees();
|
||||
startAnalysisWindLineInfoDTO.windSpeedInKnots = windAtStart.getKnots();
|
||||
return startAnalysisWindLineInfoDTO;
|
||||
}
|
||||
|
||||
private StartlineAdvantageType getStartlineAdvantageType(TrackedRace trackedRace, TimePoint timePoint) {
|
||||
try {
|
||||
LegType typeOfFirstLeg;
|
||||
typeOfFirstLeg = getFirstLegTypeOfTrackedRaceAtTimePoint(trackedRace, timePoint);
|
||||
switch (typeOfFirstLeg) {
|
||||
case UPWIND:
|
||||
return StartlineAdvantageType.WIND;
|
||||
case REACHING:
|
||||
return StartlineAdvantageType.GEOMETRIC;
|
||||
default:
|
||||
return StartlineAdvantageType.WIND;
|
||||
}
|
||||
} catch (NoWindException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyListernersAboutStartAnalysisDTOChange() {
|
||||
for (StartAnalysisRacesStoreListener startAnalyisisRacesStoreListener : listeners) {
|
||||
startAnalyisisRacesStoreListener.startAnalyisisRacesChanged(startAnalysisDTOListForCompetitorName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a List of GPSFixDTOs for every competitor name in tracked race
|
||||
* */
|
||||
private Map<String, List<GPSFixDTO>> getGPSFixDTOListForCompetitorName(TrackedRace trackedRace,
|
||||
Map<String, Date> fromPerCompetitorIdAsString, Map<String, Date> toPerCompetitorIdAsString,
|
||||
boolean extrapolate) throws NoWindException {
|
||||
Map<String, List<GPSFixDTO>> result = new HashMap<String, List<GPSFixDTO>>();
|
||||
if (trackedRace != null) {
|
||||
for (Competitor competitor : trackedRace.getRace().getCompetitors()) {
|
||||
if (fromPerCompetitorIdAsString.containsKey(competitor.getId().toString())) {
|
||||
CompetitorDTO competitorDTO = baseDomainFactory.convertToCompetitorDTO(competitor);
|
||||
List<GPSFixDTO> fixesForCompetitor = new ArrayList<GPSFixDTO>();
|
||||
result.put(competitorDTO.getName(), fixesForCompetitor);
|
||||
GPSFixTrack<Competitor, GPSFixMoving> track = trackedRace.getTrack(competitor);
|
||||
TimePoint fromTimePoint = new MillisecondsTimePoint(fromPerCompetitorIdAsString.get(competitorDTO
|
||||
.getIdAsString()));
|
||||
TimePoint toTimePoint = new MillisecondsTimePoint(toPerCompetitorIdAsString.get(competitorDTO
|
||||
.getIdAsString()));
|
||||
// copy the fixes into a list while holding the monitor;
|
||||
// then release the monitor to avoid deadlocks
|
||||
// during wind estimations required for tack determination
|
||||
List<GPSFixMoving> fixes = new ArrayList<GPSFixMoving>();
|
||||
track.lockForRead();
|
||||
try {
|
||||
Iterator<GPSFixMoving> fixIter = track.getFixesIterator(fromTimePoint, /* inclusive */
|
||||
true);
|
||||
while (fixIter.hasNext()) {
|
||||
GPSFixMoving fix = fixIter.next();
|
||||
if (fix.getTimePoint().after(fromTimePoint) && fix.getTimePoint().before(toTimePoint)) {
|
||||
fixes.add(fix);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
track.unlockAfterRead();
|
||||
}
|
||||
|
||||
Iterator<GPSFixMoving> fixIter = fixes.iterator();
|
||||
while (fixIter.hasNext()) {
|
||||
GPSFixMoving fix = fixIter.next();
|
||||
Wind wind = trackedRace.getWind(fix.getPosition(), toTimePoint);
|
||||
final SpeedWithBearing estimatedSpeed = track.getEstimatedSpeed(fix.getTimePoint());
|
||||
Tack tack = wind == null ? null : trackedRace.getTack(estimatedSpeed, wind, fix.getTimePoint());
|
||||
LegType legType = null;
|
||||
WindDTO windDTO = wind == null ? null : createWindDTOFromAlreadyAveraged(wind, toTimePoint);
|
||||
GPSFixDTO fixDTO = createGPSFixDTO(fix, estimatedSpeed, windDTO, tack, legType, /* extrapolate */
|
||||
false);
|
||||
fixesForCompetitor.add(fixDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected WindDTO createWindDTOFromAlreadyAveraged(Wind wind, TimePoint requestTimepoint) {
|
||||
WindDTO windDTO = new WindDTO();
|
||||
windDTO.requestTimepoint = requestTimepoint.asMillis();
|
||||
windDTO.trueWindBearingDeg = wind.getBearing().getDegrees();
|
||||
windDTO.trueWindFromDeg = wind.getBearing().reverse().getDegrees();
|
||||
windDTO.trueWindSpeedInKnots = wind.getKnots();
|
||||
windDTO.trueWindSpeedInMetersPerSecond = wind.getMetersPerSecond();
|
||||
windDTO.dampenedTrueWindBearingDeg = wind.getBearing().getDegrees();
|
||||
windDTO.dampenedTrueWindFromDeg = wind.getBearing().reverse().getDegrees();
|
||||
windDTO.dampenedTrueWindSpeedInKnots = wind.getKnots();
|
||||
windDTO.dampenedTrueWindSpeedInMetersPerSecond = wind.getMetersPerSecond();
|
||||
if (wind.getPosition() != null) {
|
||||
windDTO.position = new PositionDTO(wind.getPosition().getLatDeg(), wind.getPosition().getLngDeg());
|
||||
}
|
||||
if (wind.getTimePoint() != null) {
|
||||
windDTO.measureTimepoint = wind.getTimePoint().asMillis();
|
||||
}
|
||||
return windDTO;
|
||||
}
|
||||
|
||||
private SpeedWithBearingDTO createSpeedWithBearingDTO(SpeedWithBearing speedWithBearing) {
|
||||
return new SpeedWithBearingDTO(speedWithBearing.getKnots(), speedWithBearing.getBearing().getDegrees());
|
||||
}
|
||||
|
||||
private GPSFixDTO createGPSFixDTO(GPSFix fix, SpeedWithBearing speedWithBearing, WindDTO windDTO, Tack tack,
|
||||
LegType legType, boolean extrapolated) {
|
||||
return new GPSFixDTO(fix.getTimePoint().asDate(), fix.getPosition() == null ? null : new PositionDTO(fix
|
||||
.getPosition().getLatDeg(), fix.getPosition().getLngDeg()), speedWithBearing == null ? null
|
||||
: createSpeedWithBearingDTO(speedWithBearing), windDTO, tack, legType, extrapolated);
|
||||
}
|
||||
|
||||
private LegType getFirstLegTypeOfTrackedRaceAtTimePoint(TrackedRace trackedRace, TimePoint timePoint)
|
||||
throws NoWindException {
|
||||
Iterable<TrackedLeg> trackedLegs = trackedRace.getTrackedLegs();
|
||||
if (trackedLegs != null && trackedLegs.iterator().hasNext()) {
|
||||
TrackedLeg firstLegInTrackedRace = trackedLegs.iterator().next();
|
||||
return firstLegInTrackedRace.getLegType(timePoint);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private StartAnalysisCompetitorDTO createStartAnalysisCompetitorDTO(TrackedRace trackedRace, int rank,
|
||||
Competitor competitor) {
|
||||
StartAnalysisCompetitorDTO startAnalysisCompetitorDTOsForRace = new StartAnalysisCompetitorDTO();
|
||||
startAnalysisCompetitorDTOsForRace.competitorDTO = baseDomainFactory.convertToCompetitorDTO(competitor);
|
||||
startAnalysisCompetitorDTOsForRace.rankingTableEntryDTO = createRankTableEntry(trackedRace, rank, competitor);
|
||||
List<GPSFixDTO> boatPositions = getOrCreateGPSFixDTOsForCompetitorForTrackedRace(trackedRace).get(
|
||||
competitor.getName());
|
||||
startAnalysisCompetitorDTOsForRace.gpsFixDTOs = boatPositions;
|
||||
return startAnalysisCompetitorDTOsForRace;
|
||||
}
|
||||
|
||||
private Map<String, List<GPSFixDTO>> getOrCreateGPSFixDTOsForCompetitorForTrackedRace(TrackedRace trackedRace) {
|
||||
try {
|
||||
if (!gpsFixesPathBeforeStartForCompetitor.containsKey(trackedRace)) {
|
||||
gpsFixesPathBeforeStartForCompetitor.put(
|
||||
trackedRace,
|
||||
getGPSFixDTOListForCompetitorName(
|
||||
trackedRace,
|
||||
createPerCompetitorIdAsString(trackedRace, new Date(trackedRace.getStartTimeReceived()
|
||||
.asMillis() - TAILLENGHT_IN_MILLISECONDS)),
|
||||
createPerCompetitorIdAsString(trackedRace, new Date(trackedRace.getStartTimeReceived()
|
||||
.asMillis())), true));
|
||||
}
|
||||
} catch (NoWindException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return gpsFixesPathBeforeStartForCompetitor.get(trackedRace);
|
||||
}
|
||||
|
||||
public static List<StartAnalysisDTO> cloneList(List<StartAnalysisDTO> list) {
|
||||
List<StartAnalysisDTO> clone = new ArrayList<StartAnalysisDTO>(list.size());
|
||||
for (StartAnalysisDTO item : list)
|
||||
clone.add(item);
|
||||
return clone;
|
||||
}
|
||||
|
||||
public void addAsListener(TrackedRace trackedRace) {
|
||||
trackedRace.addListener(new Listener(trackedRace));
|
||||
}
|
||||
|
||||
private class Listener extends AbstractRaceChangeListener {
|
||||
private final TrackedRace trackedRace;
|
||||
|
||||
protected Listener(TrackedRace trackedRace) {
|
||||
this.trackedRace = trackedRace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markPassingReceived(Competitor competitor, Map<Waypoint, MarkPassing> oldMarkPassings,
|
||||
Iterable<MarkPassing> markPassings) {
|
||||
logger.log(Level.INFO, "Received Mark Passing " + competitor.getName());
|
||||
if (markPassings.iterator().hasNext()) {
|
||||
if (getIndexOfMarkPassingMark(markPassings, trackedRace) == 1) {
|
||||
logger.log(Level.INFO, "Received Mark Passing " + competitor.getName() + " Mark 1");
|
||||
if (!getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace).contains(competitor)) {
|
||||
getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace).add(competitor);
|
||||
logger.log(Level.INFO, "Received Mark Passing " + competitor.getName() + " RankingList Size"
|
||||
+ getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace).size());
|
||||
if (getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace).size() == MINIMUM_NUMBER_OF_COMPETITORS_IN_STARTANALYSISRANKINGTABLE) {
|
||||
for (Competitor competitorInRankingList : getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace)) {
|
||||
getOrCreateAndAddStartAnalysisDTOListForCompetitorName(
|
||||
competitorInRankingList.getName()).add(
|
||||
createStartAnalysisDTOForCompetitor(competitorInRankingList, trackedRace));
|
||||
}
|
||||
logger.log(Level.INFO, "Received Mark Passing "
|
||||
+ competitor.getName()
|
||||
+ " StartAnalysisDTOlist for competitor size: "
|
||||
+ getOrCreateAndAddStartAnalysisDTOListForCompetitorName(competitor.getName())
|
||||
.size());
|
||||
notifyListernersAboutStartAnalysisDTOChange();
|
||||
} else if (getOrCreateAndAddRankingListAtMarkOneForTrackedRace(trackedRace).size() > MINIMUM_NUMBER_OF_COMPETITORS_IN_STARTANALYSISRANKINGTABLE) {
|
||||
getOrCreateAndAddStartAnalysisDTOListForCompetitorName(competitor.getName()).add(
|
||||
createStartAnalysisDTOForCompetitor(competitor, trackedRace));
|
||||
logger.log(Level.INFO, "Received Mark Passing "
|
||||
+ competitor.getName()
|
||||
+ " StartAnalysisDTOlist for competitor size: "
|
||||
+ getOrCreateAndAddStartAnalysisDTOListForCompetitorName(competitor.getName())
|
||||
.size());
|
||||
notifyListernersAboutStartAnalysisDTOChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.server;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
|
||||
|
||||
public interface StartAnalysisRacesStoreListener {
|
||||
|
||||
public void startAnalyisisRacesChanged(Map<String , List<StartAnalysisDTO>> startAnalysisDTOs);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.sap.sailing.dashboards.gwt.server.startanalysis;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
|
||||
public abstract class AbstractStartAnalysisCreationValidator {
|
||||
|
||||
private static int MINIMUM_NUMBER_COMPETITORS_FOR_STARTANALYSIS = 3;
|
||||
|
||||
protected boolean threeCompetitorsPassedSecondWayPoint(TrackedRace trackedRace){
|
||||
Waypoint secondWaypoint = trackedRace.getRace().getCourse().getFirstLeg().getTo();
|
||||
Iterator<MarkPassing> markPassingsInOrder = trackedRace.getMarkPassingsInOrder(secondWaypoint).iterator();
|
||||
int counter = 0;
|
||||
while (markPassingsInOrder.hasNext()) {
|
||||
markPassingsInOrder.next();
|
||||
counter ++;
|
||||
}
|
||||
return counter >= MINIMUM_NUMBER_COMPETITORS_FOR_STARTANALYSIS ? true : false;
|
||||
}
|
||||
|
||||
protected boolean competitorPassedSecondWayPoint(Competitor competitor, TrackedRace trackedRace){
|
||||
Waypoint secondWaypoint = trackedRace.getRace().getCourse().getFirstLeg().getTo();
|
||||
return trackedRace.getMarkPassing(competitor, secondWaypoint) == null ? false : true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.sap.sailing.dashboards.gwt.server.startanalysis;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
|
||||
public class StartAnalysisCreationController extends AbstractStartAnalysisCreationValidator {
|
||||
|
||||
private StartAnalysisDTOFactory startAnalysisDTOFactory;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(StartAnalysisCreationController.class.getName());
|
||||
|
||||
public StartAnalysisCreationController(RacingEventService racingEventService) {
|
||||
startAnalysisDTOFactory = new StartAnalysisDTOFactory(racingEventService);
|
||||
}
|
||||
|
||||
public StartAnalysisDTO checkStartAnalysisForCompetitorInTrackedRace(Competitor competitor, TrackedRace trackedRace) {
|
||||
StartAnalysisDTO startAnalysisDTO;
|
||||
if (threeCompetitorsPassedSecondWayPoint(trackedRace) &&
|
||||
competitorPassedSecondWayPoint(competitor, trackedRace))
|
||||
{
|
||||
logger.log(Level.INFO, "Trigger StartAnalysisDTO creation");
|
||||
startAnalysisDTO = startAnalysisDTOFactory.createStartAnalysisForCompetitorAndTrackedRace(competitor, trackedRace);
|
||||
return startAnalysisDTO;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.sap.sailing.dashboards.gwt.server.startanalysis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sailing.dashboards.gwt.client.startanalysis.StartlineAdvantageType;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartLineAdvantageDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisCompetitorDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisRankingTableEntryDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.WindAndAdvantagesInfoForStartLineDTO;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.common.LegType;
|
||||
import com.sap.sailing.domain.common.NoWindException;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.tracking.LineDetails;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
import com.sap.sailing.domain.tracking.TrackedLeg;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sailing.domain.tracking.Wind;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public class StartAnalysisDTOFactory extends AbstractStartAnalysisCreationValidator{
|
||||
|
||||
private final com.sap.sailing.domain.base.DomainFactory baseDomainFactory;
|
||||
|
||||
private static int MINIMUM_NUMBER_COMPETITORS_FOR_STARTANALYSIS = 3;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(StartAnalysisDTOFactory.class.getName());
|
||||
|
||||
public StartAnalysisDTOFactory(RacingEventService racingEventService){
|
||||
baseDomainFactory = racingEventService.getBaseDomainFactory();
|
||||
}
|
||||
|
||||
public StartAnalysisDTO createStartAnalysisForCompetitorAndTrackedRace(Competitor competitor, TrackedRace trackedRace) {
|
||||
StartAnalysisDTO startAnalysisDTO = new StartAnalysisDTO();
|
||||
addStaticDataToStartAnalysisDTOFrom(startAnalysisDTO, trackedRace);
|
||||
List<StartAnalysisCompetitorDTO> competitors = new ArrayList<StartAnalysisCompetitorDTO>();
|
||||
Waypoint secondWaypoint = trackedRace.getRace().getCourse().getFirstLeg().getTo();
|
||||
List<MarkPassing> markPassingsInOrder = convertMarkpPassingsIteratorToList(trackedRace.getMarkPassingsInOrder(secondWaypoint).iterator());
|
||||
|
||||
boolean isCompetitorOneOfFirstThree = false;
|
||||
for (int i = 0; i < MINIMUM_NUMBER_COMPETITORS_FOR_STARTANALYSIS; i++) {
|
||||
competitors.add(createStartAnalysisCompetitorDTO(trackedRace, i + 1,
|
||||
markPassingsInOrder.get(i).getCompetitor()));
|
||||
if (markPassingsInOrder.get(i).getCompetitor().equals(competitor)) {
|
||||
isCompetitorOneOfFirstThree = true;
|
||||
}
|
||||
}
|
||||
if (!isCompetitorOneOfFirstThree) {
|
||||
int rankOfCompetitorWhilePassingSecondWaypoint = getRankOfCompetitorWhilePassingSecondWaypoint(competitor, trackedRace);
|
||||
competitors.add(createStartAnalysisCompetitorDTO(trackedRace, rankOfCompetitorWhilePassingSecondWaypoint, competitor));
|
||||
}
|
||||
startAnalysisDTO.competitor = baseDomainFactory.getCompetitorStore().convertToCompetitorDTO(competitor);
|
||||
startAnalysisDTO.startAnalysisCompetitorDTOs = competitors;
|
||||
startAnalysisDTO.timeOfStartInMilliSeconds = trackedRace.getStartOfRace().asMillis();
|
||||
startAnalysisDTO.regattaAndRaceIdentifier = trackedRace.getRaceIdentifier();
|
||||
logger.log(Level.INFO, "Created StartAnalysis For Competitor "+competitor.getName()+" and "+trackedRace.getRace().getName());
|
||||
return startAnalysisDTO;
|
||||
}
|
||||
|
||||
private List<MarkPassing> convertMarkpPassingsIteratorToList(Iterator<MarkPassing> iterator){
|
||||
List<MarkPassing> list = new ArrayList<MarkPassing>();
|
||||
while(iterator.hasNext()){
|
||||
list.add(iterator.next());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private int getRankOfCompetitorWhilePassingSecondWaypoint(Competitor competitor, TrackedRace trackedRace){
|
||||
Waypoint secondWaypoint = trackedRace.getRace().getCourse().getFirstLeg().getTo();
|
||||
Iterator<MarkPassing> markPassings = trackedRace.getMarkPassingsInOrder(secondWaypoint).iterator();
|
||||
int counter = 0;
|
||||
while(markPassings.hasNext()){
|
||||
counter ++;
|
||||
if(markPassings.next().getCompetitor().getId().equals(competitor.getId()))
|
||||
return counter;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private StartAnalysisDTO addStaticDataToStartAnalysisDTOFrom(StartAnalysisDTO startAnalysisDTO,TrackedRace trackedRace) {
|
||||
startAnalysisDTO.raceName = trackedRace.getRace().getName();
|
||||
startAnalysisDTO.startAnalysisWindLineInfoDTO = createStartAnalysisWindAndLineData(trackedRace);
|
||||
return startAnalysisDTO;
|
||||
}
|
||||
|
||||
|
||||
private StartAnalysisRankingTableEntryDTO createRankTableEntry(TrackedRace trackedRace, int rank,
|
||||
Competitor competitor) {
|
||||
StartAnalysisRankingTableEntryDTO startAnalysisRankTableEntryDTO = createStartAnalysisRankTableEntryDTOWithRankAndStartTimepoint(
|
||||
competitor, rank, trackedRace);
|
||||
return startAnalysisRankTableEntryDTO;
|
||||
}
|
||||
|
||||
private StartAnalysisRankingTableEntryDTO createStartAnalysisRankTableEntryDTOWithRankAndStartTimepoint(
|
||||
Competitor competitor, int rank, TrackedRace trackedRace) {
|
||||
StartAnalysisRankingTableEntryDTO tableentry = new StartAnalysisRankingTableEntryDTO();
|
||||
tableentry.rankAtFirstMark = rank;
|
||||
tableentry.teamName = competitor.getName();
|
||||
tableentry.speedAtStartTime = trackedRace.getSpeed(competitor, 1).getKnots();
|
||||
tableentry.distanceToLineAtStartTime = trackedRace.getDistanceToStartLine(competitor, 1).getMeters();
|
||||
tableentry.tailColor = competitor.getColor().getAsHtml();
|
||||
return tableentry;
|
||||
}
|
||||
|
||||
private WindAndAdvantagesInfoForStartLineDTO createStartAnalysisWindAndLineData(TrackedRace trackedRace) {
|
||||
WindAndAdvantagesInfoForStartLineDTO startAnalysisWindLineInfoDTO = new WindAndAdvantagesInfoForStartLineDTO();
|
||||
LineDetails startline = trackedRace.getStartLine(trackedRace.getStartTimeReceived());
|
||||
StartLineAdvantageDTO startLineAdvantageDTO = new StartLineAdvantageDTO();
|
||||
startLineAdvantageDTO.startLineAdvatageType = getStartlineAdvantageType(trackedRace, new MillisecondsTimePoint(new Date()));
|
||||
startLineAdvantageDTO.startLineAdvantage = startline.getAdvantage().getMeters();
|
||||
startAnalysisWindLineInfoDTO.startLineAdvantage = startLineAdvantageDTO;
|
||||
Position portMarkPosition = trackedRace.getOrCreateTrack(
|
||||
trackedRace.getStartLine(trackedRace.getStartTimeReceived()).getStarboardMarkWhileApproachingLine())
|
||||
.getEstimatedPosition(trackedRace.getStartTimeReceived(), /* extrapolate */
|
||||
false);
|
||||
Wind windAtStart = trackedRace.getWind(portMarkPosition, trackedRace.getStartTimeReceived());
|
||||
startAnalysisWindLineInfoDTO.windDirectionInDegrees = windAtStart.getBearing().getDegrees();
|
||||
startAnalysisWindLineInfoDTO.windSpeedInKnots = windAtStart.getKnots();
|
||||
return startAnalysisWindLineInfoDTO;
|
||||
}
|
||||
|
||||
private StartlineAdvantageType getStartlineAdvantageType(TrackedRace trackedRace, TimePoint timePoint) {
|
||||
try {
|
||||
LegType typeOfFirstLeg;
|
||||
typeOfFirstLeg = getFirstLegTypeOfTrackedRaceAtTimePoint(trackedRace, timePoint);
|
||||
switch (typeOfFirstLeg) {
|
||||
case UPWIND:
|
||||
return StartlineAdvantageType.WIND;
|
||||
case REACHING:
|
||||
return StartlineAdvantageType.GEOMETRIC;
|
||||
default:
|
||||
return StartlineAdvantageType.WIND;
|
||||
}
|
||||
} catch (NoWindException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private LegType getFirstLegTypeOfTrackedRaceAtTimePoint(TrackedRace trackedRace, TimePoint timePoint)
|
||||
throws NoWindException {
|
||||
Iterable<TrackedLeg> trackedLegs = trackedRace.getTrackedLegs();
|
||||
if (trackedLegs != null && trackedLegs.iterator().hasNext()) {
|
||||
TrackedLeg firstLegInTrackedRace = trackedLegs.iterator().next();
|
||||
return firstLegInTrackedRace.getLegType(timePoint);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private StartAnalysisCompetitorDTO createStartAnalysisCompetitorDTO(TrackedRace trackedRace, int rank,
|
||||
Competitor competitor) {
|
||||
StartAnalysisCompetitorDTO startAnalysisCompetitorDTOsForRace = new StartAnalysisCompetitorDTO();
|
||||
startAnalysisCompetitorDTOsForRace.competitorDTO = baseDomainFactory.getCompetitorStore().convertToCompetitorDTO(competitor);
|
||||
startAnalysisCompetitorDTOsForRace.rankingTableEntryDTO = createRankTableEntry(trackedRace, rank, competitor);
|
||||
return startAnalysisCompetitorDTOsForRace;
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,7 @@ package com.sap.sailing.dashboards.gwt.shared;
|
||||
*/
|
||||
public enum ResponseMessage
|
||||
{
|
||||
OK,
|
||||
BETWEEN_RACES,
|
||||
NO_RACE_LIVE,
|
||||
NO_COMPETITOR_SELECTED
|
||||
RACE_LIVE,
|
||||
NO_RACE_LIVE
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.sap.sailing.dashboards.gwt.shared.dto.startanalysis;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
|
||||
|
||||
public class StartAnalysisCompetitorDTO implements Serializable{
|
||||
|
||||
@@ -12,5 +10,4 @@ public class StartAnalysisCompetitorDTO implements Serializable{
|
||||
|
||||
public CompetitorDTO competitorDTO;
|
||||
public StartAnalysisRankingTableEntryDTO rankingTableEntryDTO;
|
||||
public List<GPSFixDTO> gpsFixDTOs;
|
||||
}
|
||||
@@ -1,27 +1,36 @@
|
||||
package com.sap.sailing.dashboards.gwt.shared.dto.startanalysis;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.common.dto.PositionDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.MarkDTO;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public class StartAnalysisDTO implements Serializable, Comparable<StartAnalysisDTO>{
|
||||
public class StartAnalysisDTO implements Serializable, Comparable<StartAnalysisDTO> {
|
||||
|
||||
private static final long serialVersionUID = -1325150193180234561L;
|
||||
|
||||
public String raceName;
|
||||
public List<PositionDTO> startLineMarkPositions;
|
||||
public List<MarkDTO> startLineMarks;
|
||||
public MarkDTO firstMark;
|
||||
public CompetitorDTO competitor;
|
||||
public WindAndAdvantagesInfoForStartLineDTO startAnalysisWindLineInfoDTO;
|
||||
public List<StartAnalysisCompetitorDTO> startAnalysisCompetitorDTOs;
|
||||
public long timeOfStartInMilliSeconds;
|
||||
public RegattaAndRaceIdentifier regattaAndRaceIdentifier;
|
||||
|
||||
|
||||
public StartAnalysisDTO(){}
|
||||
public StartAnalysisDTO() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(StartAnalysisDTO o) {
|
||||
return raceName.compareTo(o.raceName);
|
||||
}
|
||||
|
||||
public List<CompetitorDTO> getCompetitorDTOsFromStartAnaylsisCompetitorDTOs() {
|
||||
List<CompetitorDTO> competitorDTOs = new ArrayList<CompetitorDTO>();
|
||||
for (StartAnalysisCompetitorDTO startAnalysisCompetitorDTO : startAnalysisCompetitorDTOs) {
|
||||
competitorDTOs.add(startAnalysisCompetitorDTO.competitorDTO);
|
||||
}
|
||||
return competitorDTOs;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 585 B |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 626 B |
|
Before Width: | Height: | Size: 416 B After Width: | Height: | Size: 416 B |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 36 KiB |
@@ -7,6 +7,6 @@ Bundle-Vendor: SAP
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
Require-Bundle: com.sap.sse.datamining.shared;bundle-version="1.0.0",
|
||||
com.sap.sailing.domain.common;bundle-version="1.0.0"
|
||||
Require-Bundle: com.sap.sse.datamining.shared,
|
||||
com.sap.sailing.domain.common
|
||||
Export-Package: com.sap.sailing.datamining.shared
|
||||
@@ -15,6 +15,7 @@ import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.datamining.impl.data.LeaderboardGroupWithContext;
|
||||
import com.sap.sailing.datamining.test.util.ConcurrencyTestsUtil;
|
||||
import com.sap.sailing.datamining.test.util.NullProcessor;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
@@ -26,7 +27,7 @@ import com.sap.sse.datamining.components.Processor;
|
||||
public class TestLeaderboardGroupRetrievalProcessor {
|
||||
|
||||
private RacingEventService service;
|
||||
private Processor<RacingEventService, LeaderboardGroup> retriever;
|
||||
private Processor<RacingEventService, LeaderboardGroupWithContext> retriever;
|
||||
|
||||
private Collection<LeaderboardGroup> retrievedGroups;
|
||||
|
||||
@@ -36,16 +37,16 @@ public class TestLeaderboardGroupRetrievalProcessor {
|
||||
stub(service.getLeaderboardGroups()).toReturn(getGroupsInService());
|
||||
|
||||
retrievedGroups = new HashSet<>();
|
||||
Processor<LeaderboardGroup, Void> receiver = new NullProcessor<LeaderboardGroup, Void>(LeaderboardGroup.class, Void.class) {
|
||||
Processor<LeaderboardGroupWithContext, Void> receiver = new NullProcessor<LeaderboardGroupWithContext, Void>(LeaderboardGroupWithContext.class, Void.class) {
|
||||
@Override
|
||||
public void processElement(LeaderboardGroup element) {
|
||||
retrievedGroups.add(element);
|
||||
public void processElement(LeaderboardGroupWithContext element) {
|
||||
retrievedGroups.add(element.getLeaderboardGroup());
|
||||
}
|
||||
};
|
||||
|
||||
Collection<Processor<LeaderboardGroup, ?>> resultReceivers = new ArrayList<>();
|
||||
Collection<Processor<LeaderboardGroupWithContext, ?>> resultReceivers = new ArrayList<>();
|
||||
resultReceivers.add(receiver);
|
||||
retriever = new LeaderboardGroupRetrievalProcessor(ConcurrencyTestsUtil.getExecutor(), resultReceivers);
|
||||
retriever = new LeaderboardGroupRetrievalProcessor(ConcurrencyTestsUtil.getExecutor(), resultReceivers, 0);
|
||||
}
|
||||
|
||||
private Map<String, LeaderboardGroup> getGroupsInService() {
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.sap.sailing.datamining.Activator;
|
||||
import com.sap.sailing.datamining.data.HasGPSFixContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedLegOfCompetitorContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedRaceContext;
|
||||
import com.sap.sailing.datamining.test.util.OpenFunctionManager;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Moving;
|
||||
import com.sap.sailing.domain.base.Nationality;
|
||||
@@ -23,19 +24,17 @@ import com.sap.sailing.domain.common.Speed;
|
||||
import com.sap.sse.common.Named;
|
||||
import com.sap.sse.datamining.factories.FunctionFactory;
|
||||
import com.sap.sse.datamining.functions.Function;
|
||||
import com.sap.sse.datamining.functions.FunctionRegistry;
|
||||
import com.sap.sse.datamining.impl.functions.SimpleFunctionRegistry;
|
||||
|
||||
public class TestSailingFunctionsRegistration {
|
||||
|
||||
private static FunctionFactory functionFactory = new FunctionFactory();
|
||||
|
||||
private FunctionRegistry functionRegistry;
|
||||
private OpenFunctionManager functionRegistry;
|
||||
|
||||
@Before
|
||||
public void setUpFunctionRegistryAndProvider() {
|
||||
functionRegistry = new SimpleFunctionRegistry();
|
||||
functionRegistry.registerAllWithInternalFunctionPolicy(Activator.getDefault().getInternalClassesWithMarkedMethods());
|
||||
functionRegistry = new OpenFunctionManager();
|
||||
functionRegistry.registerAllClasses(Activator.getDefault().getClassesWithMarkedMethods());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -76,7 +75,7 @@ public class TestSailingFunctionsRegistration {
|
||||
@Test
|
||||
public void testImportantRegisteredStatistics() throws NoSuchMethodException, SecurityException {
|
||||
Collection<Function<?>> expectedStatistics = createExpectedImportantRegisteredStatistics();
|
||||
Collection<Function<?>> providedStatistics = functionRegistry.getStatistics();
|
||||
Collection<Function<?>> providedStatistics = functionRegistry.getAllStatistics();
|
||||
for (Function<?> statistic : expectedStatistics) {
|
||||
assertThat("The expected statistic '" + statistic + "' wasn't provided.",
|
||||
providedStatistics.contains(statistic), is(true));
|
||||
|
||||
@@ -2,28 +2,20 @@ package com.sap.sailing.datamining.test.util;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import com.sap.sse.datamining.components.Processor;
|
||||
import com.sap.sse.datamining.impl.DataMiningExecutorService;
|
||||
|
||||
public class ConcurrencyTestsUtil {
|
||||
|
||||
private static final int THREAD_POOL_SIZE = Math.max(Runtime.getRuntime().availableProcessors(), 3);
|
||||
private static ThreadPoolExecutor executor = createExecutor();
|
||||
private static final ExecutorService executor = new DataMiningExecutorService(THREAD_POOL_SIZE);
|
||||
|
||||
public static ThreadPoolExecutor getExecutor() {
|
||||
if (executor.isShutdown()) {
|
||||
executor = createExecutor();
|
||||
}
|
||||
public static ExecutorService getExecutor() {
|
||||
return executor;
|
||||
}
|
||||
|
||||
private static ThreadPoolExecutor createExecutor() {
|
||||
return new ThreadPoolExecutor(THREAD_POOL_SIZE, THREAD_POOL_SIZE, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
|
||||
}
|
||||
|
||||
public static void sleepFor(long milliseconds) {
|
||||
try {
|
||||
Thread.sleep(milliseconds);
|
||||
|
||||
@@ -16,7 +16,7 @@ public class NullProcessor<InputType, ResultType> extends AbstractProcessor<Inpu
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable failure) {
|
||||
|
||||
throw new RuntimeException("An error occured during the processing", failure);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.sap.sailing.datamining.test.util;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.sap.sse.datamining.functions.Function;
|
||||
import com.sap.sse.datamining.impl.functions.FunctionManager;
|
||||
|
||||
public class OpenFunctionManager extends FunctionManager {
|
||||
|
||||
public Collection<Function<?>> getDimensions() {
|
||||
return asSet(dimensions);
|
||||
}
|
||||
|
||||
public Collection<Function<?>> getExternalFunctions() {
|
||||
return asSet(externalFunctions);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,13 +9,15 @@ Import-Package: com.sap.sailing.server,
|
||||
org.osgi.framework;version="1.7.0"
|
||||
Export-Package: com.sap.sailing.datamining,
|
||||
com.sap.sailing.datamining.data
|
||||
Require-Bundle: com.sap.sailing.domain;bundle-version="1.0.0",
|
||||
Require-Bundle: com.sap.sailing.domain,
|
||||
com.sap.sailing.domain.common,
|
||||
com.sap.sailing.datamining.shared;bundle-version="1.0.0",
|
||||
com.sap.sse.datamining;bundle-version="1.0.0",
|
||||
com.sap.sse.datamining.shared;bundle-version="1.0.0",
|
||||
com.sap.sailing.datamining.shared,
|
||||
com.sap.sse.datamining,
|
||||
com.sap.sse.datamining.shared,
|
||||
com.sap.sse,
|
||||
com.sap.sse.common
|
||||
com.sap.sse.common,
|
||||
org.eclipse.osgi,
|
||||
com.sap.sailing.polars
|
||||
Bundle-ClassPath: .
|
||||
Bundle-Activator: com.sap.sailing.datamining.Activator
|
||||
Bundle-ActivationPolicy: lazy
|
||||
@@ -3,7 +3,8 @@ DistanceTraveled=zur
|
||||
Boat=Boot
|
||||
Team=Team
|
||||
Name=Name
|
||||
NationalityAcronym=Nationalität
|
||||
Nationality=Nationalitäts
|
||||
Acronym=Abkürzung
|
||||
SailID=Segelnummer
|
||||
LegNumber=Nummer des Schenkels
|
||||
LegType=Art des Schenkels
|
||||
@@ -13,12 +14,34 @@ CourseArea=Regattabahn
|
||||
BoatClass=Bootsklasse
|
||||
Fleet=Flotte
|
||||
Race=Rennen
|
||||
SailingDomainRetrieverChain=Segel-Domänen Datenbeschaffer
|
||||
LeaderboardSailingDomainRetrieverChain=Segel-Domänen Ranglisten-Beschaffer
|
||||
RaceSailingDomainRetrieverChain=Segel-Domänen Rennen-Beschaffer
|
||||
LegSailingDomainRetrieverChain=Segel-Domänen Leg-Beschaffer
|
||||
GPSFixSailingDomainRetrieverChain=Segel-Domänen GPS-Fix-Beschaffer
|
||||
MarkPassingSailingDomainRetrieverChain=Segel-Domänen Tonnenrundungs-Beschaffer
|
||||
RaceResultSailingDomainRetrieverChain=Segel-Domänen Rennergebnis-Beschaffer
|
||||
LeaderboardGroup=Ranglisten Gruppe
|
||||
RegattaLeaderboard=Regatta Rangliste
|
||||
Leaderboard=Rangliste
|
||||
Leg=Schenkel
|
||||
MarkPassing=Tonnenrundung
|
||||
LegOfCompetitor=Schenkel eines Teilnehmers
|
||||
GpsFix=GPS-Fix
|
||||
Speed=Geschwindigkeit
|
||||
InKnots=in Knoten
|
||||
WindStrength=Windstärke
|
||||
SpeedTenSecondsBefore=Geschwindigkeit 10s vorher
|
||||
WindStrengthInBeaufort=Windstärke in Beaufort
|
||||
BftClusterGroup=Windstärke in Beaufort
|
||||
Bft0=Windstille
|
||||
Bft1=leiser Zug
|
||||
Bft2=leichte Brise
|
||||
Bft3=schwacher Wind
|
||||
Bft4=mäßiger Wind
|
||||
Bft5=frischer Wind
|
||||
Bft6=starker Wind
|
||||
Bft7=steifer Wind
|
||||
Bft8=stürmischer Wind
|
||||
Bft9=Sturm
|
||||
Bft10=schwerer Sturm
|
||||
Bft11=orkanartiger Sturm
|
||||
Bft12=Orkan
|
||||
RelativeScoreInRace=Relative Wertung im Rennen (0 am besten; 1 am schlechtesten)
|
||||
WindSpeedInBeaufort=Windgeschwindigkeit in Bft.
|
||||
@@ -1,12 +1,13 @@
|
||||
Speed=Speed
|
||||
InKnots=in knots
|
||||
SpeedTenSecondsBefore=Speed 10s before
|
||||
DistanceTraveled=Distance Traveled
|
||||
Name=Name
|
||||
LegType=Leg Type
|
||||
SailID=Sail Number
|
||||
Year=Year
|
||||
LegNumber=Leg Number
|
||||
NationalityAcronym=Nationality
|
||||
Nationality=Nationality
|
||||
Acronym=Acronym
|
||||
Regatta=Regatta
|
||||
CourseArea=Course Area
|
||||
BoatClass=Boat Class
|
||||
@@ -15,10 +16,32 @@ Race=Race
|
||||
Competitor=Competitor
|
||||
Boat=Boat
|
||||
Team=Team
|
||||
SailingDomainRetrieverChain=Sailing Domain Retriever
|
||||
LeaderboardSailingDomainRetrieverChain=Sailing Domain Leaderboard Retriever
|
||||
RaceSailingDomainRetrieverChain=Sailing Domain Race Retriever
|
||||
LegSailingDomainRetrieverChain=Sailing Domain Leg Retriever
|
||||
GPSFixSailingDomainRetrieverChain=Sailing Domain GPS Fix Retriever
|
||||
MarkPassingSailingDomainRetrieverChain=Sailing Domain Mark Passing Retriever
|
||||
RaceResultSailingDomainRetrieverChain=Sailing Domain Race Result Retriever
|
||||
LeaderboardGroup=Leaderboard Group
|
||||
RegattaLeaderboard=Regatta Leaderboard
|
||||
Leaderboard=Leaderboard
|
||||
Leg=Leg
|
||||
MarkPassing=Mark Passing
|
||||
LegOfCompetitor=Leg of competitor
|
||||
GpsFix=GPS-Fix
|
||||
WindStrength=Wind Strength
|
||||
WindStrengthInBeaufort=Wind Strength in Beaufort
|
||||
BftClusterGroup=Wind Strength in Beaufort
|
||||
Bft0=Calm
|
||||
Bft1=Light air
|
||||
Bft2=Light breeze
|
||||
Bft3=Gentle breeze
|
||||
Bft4=Moderate breeze
|
||||
Bft5=Fresh breeze
|
||||
Bft6=Strong breeze
|
||||
Bft7=High wind
|
||||
Bft8=Gale
|
||||
Bft9=Strong gale
|
||||
Bft10=Storm
|
||||
Bft11=Violent storm
|
||||
Bft12=Hurricane
|
||||
RelativeScoreInRace=Relative score in race (0 best; 1 worst)
|
||||
WindSpeedInBeaufort=Wind speed in Bft
|
||||
@@ -1,50 +1,63 @@
|
||||
package com.sap.sailing.datamining;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
|
||||
import com.sap.sailing.datamining.data.HasRaceResultOfCompetitorContext;
|
||||
import com.sap.sailing.datamining.data.HasGPSFixContext;
|
||||
import com.sap.sailing.datamining.data.HasMarkPassingContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedLegContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedLegOfCompetitorContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedRaceContext;
|
||||
import com.sap.sailing.domain.common.Speed;
|
||||
import com.sap.sse.datamining.DataMiningBundleService;
|
||||
import com.sap.sse.datamining.DataRetrieverChainDefinition;
|
||||
import com.sap.sse.datamining.DataSourceProvider;
|
||||
import com.sap.sse.datamining.data.ClusterGroup;
|
||||
import com.sap.sse.datamining.impl.AbstractDataMiningActivator;
|
||||
import com.sap.sse.i18n.ResourceBundleStringMessages;
|
||||
import com.sap.sse.i18n.impl.ResourceBundleStringMessagesImpl;
|
||||
|
||||
public class Activator implements BundleActivator, DataMiningBundleService {
|
||||
public class Activator extends AbstractDataMiningActivator implements DataMiningBundleService {
|
||||
|
||||
private static final String STRING_MESSAGES_BASE_NAME = "stringmessages/Sailing_StringMessages";
|
||||
private static final SailingClusterGroups clusterGroups = new SailingClusterGroups();
|
||||
|
||||
private static Activator INSTANCE;
|
||||
|
||||
private final ResourceBundleStringMessages sailingServerStringMessages;
|
||||
private final SailingDataRetrieverChainDefinitions dataRetrieverChainDefinitions;
|
||||
private final SailingClusterGroups clusterGroups;
|
||||
private BundleContext context = null;
|
||||
|
||||
private ServiceReference<DataMiningBundleService> dataMiningBundleServiceReference;
|
||||
private final ResourceBundleStringMessages sailingServerStringMessages;
|
||||
private final SailingDataRetrievalChainDefinitions dataRetrieverChainDefinitions;
|
||||
private Collection<DataSourceProvider<?>> dataSourceProviders;
|
||||
private boolean dataSourceProvidersHaveBeenInitialized;
|
||||
|
||||
public Activator() {
|
||||
dataRetrieverChainDefinitions = new SailingDataRetrieverChainDefinitions();
|
||||
sailingServerStringMessages = new ResourceBundleStringMessagesImpl(STRING_MESSAGES_BASE_NAME, Activator.class.getClassLoader());
|
||||
clusterGroups = new SailingClusterGroups();
|
||||
dataRetrieverChainDefinitions = new SailingDataRetrievalChainDefinitions();
|
||||
sailingServerStringMessages = new ResourceBundleStringMessagesImpl(STRING_MESSAGES_BASE_NAME, getClass().getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
INSTANCE = this;
|
||||
|
||||
dataMiningBundleServiceReference = context.registerService(DataMiningBundleService.class, this, null).getReference();
|
||||
this.context = context;
|
||||
dataSourceProvidersHaveBeenInitialized = false;
|
||||
super.start(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
context.ungetService(dataMiningBundleServiceReference);
|
||||
this.context = null;
|
||||
INSTANCE = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DataMiningBundleService getDataMiningBundleService() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,27 +66,38 @@ public class Activator implements BundleActivator, DataMiningBundleService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Class<?>> getInternalClassesWithMarkedMethods() {
|
||||
public Iterable<Class<?>> getClassesWithMarkedMethods() {
|
||||
Set<Class<?>> internalClasses = new HashSet<>();
|
||||
internalClasses.add(HasTrackedRaceContext.class);
|
||||
internalClasses.add(HasRaceResultOfCompetitorContext.class);
|
||||
internalClasses.add(HasTrackedLegContext.class);
|
||||
internalClasses.add(HasTrackedLegOfCompetitorContext.class);
|
||||
internalClasses.add(HasGPSFixContext.class);
|
||||
internalClasses.add(HasMarkPassingContext.class);
|
||||
return internalClasses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Class<?>> getExternalLibraryClasses() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<DataRetrieverChainDefinition<?, ?>> getDataRetrieverChainDefinitions() {
|
||||
return dataRetrieverChainDefinitions.getDataRetrieverChainDefinitions();
|
||||
}
|
||||
|
||||
public SailingClusterGroups getClusterGroups() {
|
||||
return clusterGroups;
|
||||
@Override
|
||||
public Iterable<DataSourceProvider<?>> getDataSourceProviders() {
|
||||
if (!dataSourceProvidersHaveBeenInitialized) {
|
||||
initializeDataSourceProviders();
|
||||
dataSourceProvidersHaveBeenInitialized = true;
|
||||
}
|
||||
return dataSourceProviders;
|
||||
}
|
||||
|
||||
private void initializeDataSourceProviders() {
|
||||
dataSourceProviders = new HashSet<>();
|
||||
dataSourceProviders.add(new RacingEventServiceProvider(context));
|
||||
}
|
||||
|
||||
public static ClusterGroup<Speed> getWindStrengthInBeaufortClusterGroup() {
|
||||
return clusterGroups.getWindStrengthInBeaufortCluster();
|
||||
}
|
||||
|
||||
public static Activator getDefault() {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.sap.sailing.datamining;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.datamining.impl.AbstractDataSourceProvider;
|
||||
|
||||
public class RacingEventServiceProvider extends AbstractDataSourceProvider<RacingEventService> {
|
||||
|
||||
private final ServiceTracker<RacingEventService, RacingEventService> racingEventServiceTracker;
|
||||
|
||||
public RacingEventServiceProvider(BundleContext context) {
|
||||
super(RacingEventService.class);
|
||||
racingEventServiceTracker = createAndOpenRacingEventServiceTracker(context);
|
||||
}
|
||||
|
||||
private ServiceTracker<RacingEventService, RacingEventService> createAndOpenRacingEventServiceTracker(BundleContext context) {
|
||||
ServiceTracker<RacingEventService, RacingEventService> result = new ServiceTracker<>(context, RacingEventService.class.getName(), null);
|
||||
result.open();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RacingEventService getDataSource() {
|
||||
return racingEventServiceTracker.getService();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.sap.sailing.datamining;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.sap.sailing.domain.common.Speed;
|
||||
import com.sap.sailing.domain.common.impl.KnotSpeedImpl;
|
||||
@@ -11,8 +10,7 @@ import com.sap.sse.datamining.data.ClusterBoundary;
|
||||
import com.sap.sse.datamining.data.ClusterGroup;
|
||||
import com.sap.sse.datamining.impl.data.ClusterWithLowerAndUpperBoundaries;
|
||||
import com.sap.sse.datamining.impl.data.ClusterWithSingleBoundary;
|
||||
import com.sap.sse.datamining.impl.data.ComparableComparator;
|
||||
import com.sap.sse.datamining.impl.data.ComparatorClusterBoundary;
|
||||
import com.sap.sse.datamining.impl.data.ComparableClusterBoundary;
|
||||
import com.sap.sse.datamining.impl.data.ComparisonStrategy;
|
||||
import com.sap.sse.datamining.impl.data.FixClusterGroup;
|
||||
|
||||
@@ -22,85 +20,84 @@ public class SailingClusterGroups {
|
||||
|
||||
public SailingClusterGroups() {
|
||||
Collection<Cluster<Speed>> clusters = new ArrayList<>();
|
||||
Comparator<Speed> comparableComparator = new ComparableComparator<Speed>();
|
||||
|
||||
Speed lowerBoundWindSpeed = new KnotSpeedImpl(0.0);
|
||||
ClusterBoundary<Speed> lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
ClusterBoundary<Speed> lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
Speed upperBoundWindSpeed = new KnotSpeedImpl(1.0);
|
||||
ClusterBoundary<Speed> upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Calm", lowerBound, upperBound));
|
||||
ClusterBoundary<Speed> upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft0", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(1.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(4.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Light air", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft1", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(4.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(7.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Light breeze", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft2", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(7.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(11.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Gentle breeze", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft3", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(11.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(16.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Moderate breeze", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft4", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(16.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(22.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Fresh breeze", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft5", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(22.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(28.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Strong breeze", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft6", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(28.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(34.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("High wind", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft7", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(34.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(41.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Gale", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft8", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(41.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(48.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Strong gale", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft9", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(48.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(56.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Storm", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft10", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(56.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
upperBoundWindSpeed = new KnotSpeedImpl(64.0);
|
||||
upperBound = new ComparatorClusterBoundary<Speed>(comparableComparator, upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Violent Storm", lowerBound, upperBound));
|
||||
upperBound = new ComparableClusterBoundary<Speed>(upperBoundWindSpeed, ComparisonStrategy.LOWER_THAN);
|
||||
clusters.add(new ClusterWithLowerAndUpperBoundaries<Speed>("Bft11", lowerBound, upperBound));
|
||||
|
||||
lowerBoundWindSpeed = new KnotSpeedImpl(64.0);
|
||||
lowerBound = new ComparatorClusterBoundary<Speed>(comparableComparator, lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
clusters.add(new ClusterWithSingleBoundary<Speed>("Hurricane", lowerBound));
|
||||
lowerBound = new ComparableClusterBoundary<Speed>(lowerBoundWindSpeed, ComparisonStrategy.GREATER_EQUALS_THAN);
|
||||
clusters.add(new ClusterWithSingleBoundary<Speed>("Bft12", lowerBound));
|
||||
|
||||
windStrengthInBeaufortCluster = new FixClusterGroup<Speed>("Wind Strength", clusters);
|
||||
windStrengthInBeaufortCluster = new FixClusterGroup<Speed>("BftClusterGroup", clusters);
|
||||
}
|
||||
|
||||
public ClusterGroup<Speed> getWindStrengthInBeaufortCluster() {
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.sap.sailing.datamining;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.sap.sailing.datamining.data.HasGPSFixContext;
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardContext;
|
||||
import com.sap.sailing.datamining.data.HasMarkPassingContext;
|
||||
import com.sap.sailing.datamining.data.HasRaceResultOfCompetitorContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedLegContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedLegOfCompetitorContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedRaceContext;
|
||||
import com.sap.sailing.datamining.impl.components.CompetitorOfRaceInLeaderboardRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.GPSFixRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.LeaderboardGroupRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.LeaderboardRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.MarkPassingRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedLegOfCompetitorRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedLegRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedRaceRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.data.LeaderboardGroupWithContext;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.datamining.DataRetrieverChainDefinition;
|
||||
import com.sap.sse.datamining.impl.SimpleDataRetrieverChainDefinition;
|
||||
|
||||
public class SailingDataRetrievalChainDefinitions {
|
||||
|
||||
private final Collection<DataRetrieverChainDefinition<?, ?>> dataRetrieverChainDefinitions;
|
||||
|
||||
public SailingDataRetrievalChainDefinitions() {
|
||||
dataRetrieverChainDefinitions = new ArrayList<>();
|
||||
|
||||
final DataRetrieverChainDefinition<RacingEventService, HasLeaderboardContext> leaderboardRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
RacingEventService.class, HasLeaderboardContext.class, "LeaderboardSailingDomainRetrieverChain");
|
||||
leaderboardRetrieverChainDefinition.startWith(LeaderboardGroupRetrievalProcessor.class, LeaderboardGroupWithContext.class, "LeaderboardGroup");
|
||||
leaderboardRetrieverChainDefinition.endWith(LeaderboardGroupRetrievalProcessor.class, LeaderboardRetrievalProcessor.class,
|
||||
HasLeaderboardContext.class, "Leaderboard");
|
||||
|
||||
final DataRetrieverChainDefinition<RacingEventService, HasRaceResultOfCompetitorContext> raceResultOfCompetitorRetrieverChainDefinition =
|
||||
new SimpleDataRetrieverChainDefinition<>(leaderboardRetrieverChainDefinition, HasRaceResultOfCompetitorContext.class, "RaceResultSailingDomainRetrieverChain");
|
||||
raceResultOfCompetitorRetrieverChainDefinition.endWith(LeaderboardRetrievalProcessor.class, CompetitorOfRaceInLeaderboardRetrievalProcessor.class, HasRaceResultOfCompetitorContext.class, "Competitor");
|
||||
dataRetrieverChainDefinitions.add(raceResultOfCompetitorRetrieverChainDefinition);
|
||||
|
||||
final DataRetrieverChainDefinition<RacingEventService, HasTrackedRaceContext> trackedRaceRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
leaderboardRetrieverChainDefinition, HasTrackedRaceContext.class, "RaceSailingDomainRetrieverChain");
|
||||
trackedRaceRetrieverChainDefinition.endWith(LeaderboardRetrievalProcessor.class, TrackedRaceRetrievalProcessor.class,
|
||||
HasTrackedRaceContext.class, "Race");
|
||||
|
||||
final DataRetrieverChainDefinition<RacingEventService, HasMarkPassingContext> markPassingRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
trackedRaceRetrieverChainDefinition, HasMarkPassingContext.class, "MarkPassingSailingDomainRetrieverChain");
|
||||
markPassingRetrieverChainDefinition.endWith(TrackedRaceRetrievalProcessor.class, MarkPassingRetrievalProcessor.class, HasMarkPassingContext.class, "MarkPassing");
|
||||
dataRetrieverChainDefinitions.add(markPassingRetrieverChainDefinition);
|
||||
|
||||
final DataRetrieverChainDefinition<RacingEventService, HasTrackedLegOfCompetitorContext> legOfCompetitorRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
trackedRaceRetrieverChainDefinition, HasTrackedLegOfCompetitorContext.class, "LegSailingDomainRetrieverChain");
|
||||
legOfCompetitorRetrieverChainDefinition.addAfter(TrackedRaceRetrievalProcessor.class, TrackedLegRetrievalProcessor.class, HasTrackedLegContext.class, "Leg");
|
||||
legOfCompetitorRetrieverChainDefinition.endWith(TrackedLegRetrievalProcessor.class, TrackedLegOfCompetitorRetrievalProcessor.class,
|
||||
HasTrackedLegOfCompetitorContext.class, "LegOfCompetitor");
|
||||
dataRetrieverChainDefinitions.add(legOfCompetitorRetrieverChainDefinition);
|
||||
|
||||
final DataRetrieverChainDefinition<RacingEventService, HasGPSFixContext> gpsFixRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
legOfCompetitorRetrieverChainDefinition, HasGPSFixContext.class, "GPSFixSailingDomainRetrieverChain");
|
||||
gpsFixRetrieverChainDefinition.endWith(TrackedLegOfCompetitorRetrievalProcessor.class, GPSFixRetrievalProcessor.class,
|
||||
HasGPSFixContext.class, "GpsFix");
|
||||
dataRetrieverChainDefinitions.add(gpsFixRetrieverChainDefinition);
|
||||
}
|
||||
|
||||
public Iterable<DataRetrieverChainDefinition<?, ?>> getDataRetrieverChainDefinitions() {
|
||||
return dataRetrieverChainDefinitions;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.sap.sailing.datamining;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.sap.sailing.datamining.data.HasGPSFixContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedLegContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedLegOfCompetitorContext;
|
||||
import com.sap.sailing.datamining.data.HasTrackedRaceContext;
|
||||
import com.sap.sailing.datamining.impl.components.GPSFixRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.LeaderboardGroupRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.RegattaLeaderboardFilteringRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedLegFilteringRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedLegOfCompetitorFilteringRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedRaceFilteringRetrievalProcessor;
|
||||
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
|
||||
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.datamining.DataRetrieverChainDefinition;
|
||||
import com.sap.sse.datamining.components.Processor;
|
||||
import com.sap.sse.datamining.impl.SimpleDataRetrieverChainDefinition;
|
||||
|
||||
public class SailingDataRetrieverChainDefinitions {
|
||||
|
||||
private final Collection<DataRetrieverChainDefinition<?, ?>> dataRetrieverChainDefinitions;
|
||||
|
||||
public SailingDataRetrieverChainDefinitions() {
|
||||
dataRetrieverChainDefinitions = new ArrayList<>();
|
||||
|
||||
DataRetrieverChainDefinition<RacingEventService, HasTrackedLegOfCompetitorContext> legOfCompetitorRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
RacingEventService.class, HasTrackedLegOfCompetitorContext.class, "SailingDomainRetrieverChain");
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<Processor<RacingEventService, LeaderboardGroup>> leaderboardGroupRetrieverType = (Class<Processor<RacingEventService, LeaderboardGroup>>) (Class<?>) LeaderboardGroupRetrievalProcessor.class;
|
||||
legOfCompetitorRetrieverChainDefinition.startWith(leaderboardGroupRetrieverType, LeaderboardGroup.class, "LeaderboardGroup");
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<Processor<LeaderboardGroup, RegattaLeaderboard>> regattaLeaderboardRetrieverType = (Class<Processor<LeaderboardGroup, RegattaLeaderboard>>) (Class<?>) RegattaLeaderboardFilteringRetrievalProcessor.class;
|
||||
legOfCompetitorRetrieverChainDefinition.addAfter(leaderboardGroupRetrieverType, regattaLeaderboardRetrieverType,
|
||||
RegattaLeaderboard.class, "RegattaLeaderboard");
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<Processor<RegattaLeaderboard, HasTrackedRaceContext>> raceRetrieverType = (Class<Processor<RegattaLeaderboard, HasTrackedRaceContext>>) (Class<?>) TrackedRaceFilteringRetrievalProcessor.class;
|
||||
legOfCompetitorRetrieverChainDefinition.addAfter(regattaLeaderboardRetrieverType, raceRetrieverType,
|
||||
HasTrackedRaceContext.class, "Race");
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<Processor<HasTrackedRaceContext, HasTrackedLegContext>> legRetrieverType = (Class<Processor<HasTrackedRaceContext, HasTrackedLegContext>>) (Class<?>) TrackedLegFilteringRetrievalProcessor.class;
|
||||
legOfCompetitorRetrieverChainDefinition.addAfter(raceRetrieverType, legRetrieverType, HasTrackedLegContext.class, "Leg");
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<Processor<HasTrackedLegContext, HasTrackedLegOfCompetitorContext>> legOfCompetitorRetrieverType = (Class<Processor<HasTrackedLegContext, HasTrackedLegOfCompetitorContext>>) (Class<?>) TrackedLegOfCompetitorFilteringRetrievalProcessor.class;
|
||||
legOfCompetitorRetrieverChainDefinition.endWith(legRetrieverType, legOfCompetitorRetrieverType,
|
||||
HasTrackedLegOfCompetitorContext.class, "LegOfCompetitor");
|
||||
dataRetrieverChainDefinitions.add(legOfCompetitorRetrieverChainDefinition);
|
||||
|
||||
DataRetrieverChainDefinition<RacingEventService, HasGPSFixContext> gpsFixRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
legOfCompetitorRetrieverChainDefinition, HasGPSFixContext.class, "SailingDomainRetrieverChain");
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<Processor<HasTrackedLegOfCompetitorContext, HasGPSFixContext>> gpsFixRetrieverType = (Class<Processor<HasTrackedLegOfCompetitorContext, HasGPSFixContext>>) (Class<?>) GPSFixRetrievalProcessor.class;
|
||||
gpsFixRetrieverChainDefinition.endWith(legOfCompetitorRetrieverType, gpsFixRetrieverType,
|
||||
HasGPSFixContext.class, "GpsFix");
|
||||
dataRetrieverChainDefinitions.add(gpsFixRetrieverChainDefinition);
|
||||
}
|
||||
|
||||
public Collection<DataRetrieverChainDefinition<?, ?>> getDataRetrieverChainDefinitions() {
|
||||
return dataRetrieverChainDefinitions;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import com.sap.sailing.domain.tracking.GPSFixMoving;
|
||||
import com.sap.sse.datamining.shared.annotations.Connector;
|
||||
import com.sap.sse.datamining.shared.annotations.Dimension;
|
||||
import com.sap.sse.datamining.shared.impl.dto.ClusterDTO;
|
||||
import com.sap.sse.i18n.ResourceBundleStringMessages;
|
||||
|
||||
public interface HasGPSFixContext {
|
||||
|
||||
@Connector
|
||||
@Connector(scanForStatistics=false)
|
||||
public HasTrackedLegOfCompetitorContext getTrackedLegOfCompetitorContext();
|
||||
|
||||
@Connector
|
||||
@Connector(ordinal=1)
|
||||
public GPSFixMoving getGPSFix();
|
||||
|
||||
@Dimension(messageKey="WindStrength", ordinal=10)
|
||||
public ClusterDTO getWindStrength();
|
||||
@Dimension(messageKey="WindStrengthInBeaufort", ordinal=11)
|
||||
public ClusterDTO getWindStrengthAsBeaufortCluster(Locale locale, ResourceBundleStringMessages stringMessages);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sailing.polars.PolarDataService;
|
||||
|
||||
public interface HasLeaderboardContext {
|
||||
|
||||
Leaderboard getLeaderboard();
|
||||
|
||||
PolarDataService getPolarDataService();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
|
||||
import com.sap.sailing.polars.PolarDataService;
|
||||
|
||||
public interface HasLeaderboardGroupContext {
|
||||
|
||||
LeaderboardGroup getLeaderboardGroup();
|
||||
|
||||
PolarDataService getPolarDataService();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.NoWindException;
|
||||
import com.sap.sailing.domain.common.Speed;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
import com.sap.sse.datamining.shared.annotations.Connector;
|
||||
import com.sap.sse.datamining.shared.annotations.Dimension;
|
||||
|
||||
public interface HasMarkPassingContext {
|
||||
|
||||
@Connector
|
||||
HasTrackedRaceContext getTrackedRaceContext();
|
||||
|
||||
@Connector
|
||||
MarkPassing getMarkPassing();
|
||||
|
||||
@Connector(messageKey="Competitor")
|
||||
Competitor getCompetitor();
|
||||
|
||||
@Connector(messageKey="Speed", ordinal=1)
|
||||
Speed getSpeed();
|
||||
|
||||
@Connector(messageKey="SpeedTenSecondsBefore", ordinal=2)
|
||||
Speed getSpeedTenSecondsBefore();
|
||||
|
||||
@Dimension(messageKey="LegType", ordinal=6)
|
||||
String getPreviousLegTypeSignifier() throws NoWindException;
|
||||
}
|
||||