mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 23:01:04 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
647fe9531a
7 files changed
+33
-24
No files matched your search
-2
@@ -1,11 +1,9 @@
|
||||
package com.sap.sailing.declination.test;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import com.sap.sailing.declination.impl.NOAAImporterForTesting;
|
||||
|
||||
@Ignore("Currently (2020-04-09) the NOAA website seems down")
|
||||
public class NOAADeclinationImportTest extends DeclinationImportTest<NOAAImporterForTesting> {
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
-2
@@ -1,11 +1,9 @@
|
||||
package com.sap.sailing.declination.test;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import com.sap.sailing.declination.impl.NOAAImporter;
|
||||
|
||||
@Ignore("Currently (2020-04-09) the NOAA website seems down")
|
||||
public class NOAASimpleDeclinationTest extends SimpleDeclinationTest<NOAAImporter> {
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@ package com.sap.sailing.declination;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import com.sap.sailing.declination.impl.BGSImporter;
|
||||
import com.sap.sailing.declination.impl.DeclinationImporter;
|
||||
import com.sap.sailing.declination.impl.DeclinationServiceImpl;
|
||||
import com.sap.sailing.declination.impl.NOAAImporter;
|
||||
import com.sap.sailing.domain.common.Mile;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.impl.CentralAngleDistance;
|
||||
@@ -17,7 +17,7 @@ public interface DeclinationService {
|
||||
* A default implementation with a spatial default precision of 60 {@link Mile#METERS_PER_GEOGRAPHICAL_MILE
|
||||
* nautical miles} which equals the length of an arc with one degree on a meridian.
|
||||
*/
|
||||
DeclinationService INSTANCE = new DeclinationServiceImpl(new CentralAngleDistance(1./180.*Math.PI), new BGSImporter());
|
||||
DeclinationService INSTANCE = new DeclinationServiceImpl(new CentralAngleDistance(1./180.*Math.PI), new NOAAImporter());
|
||||
|
||||
/**
|
||||
* Obtains declination information with the default precision of this declination service in time and space
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public abstract class DeclinationImporter {
|
||||
result.notifyAll();
|
||||
}
|
||||
} catch (IOException | ParserConfigurationException | SAXException e) {
|
||||
logger.log(Level.FINE, "Exception while trying to load magnetic declination online", e);
|
||||
logger.log(Level.INFO, "Exception while trying to load magnetic declination online", e);
|
||||
synchronized (result) {
|
||||
result.notifyAll(); // wake up waiter; no result will show up anymore
|
||||
}
|
||||
|
||||
+10
-7
@@ -76,8 +76,8 @@ public class UDPExpeditionReceiverTest {
|
||||
|
||||
private String[] validLines;
|
||||
private String[] someValidWithFourInvalidLines;
|
||||
final List<ExpeditionMessage> messages = new ArrayList<ExpeditionMessage>();
|
||||
final int PORT = 9876;
|
||||
private final List<ExpeditionMessage> messages = new ArrayList<ExpeditionMessage>();
|
||||
private final int PORT = 9929;
|
||||
private DatagramPacket packet;
|
||||
private DatagramSocket socket;
|
||||
private byte[] buf;
|
||||
@@ -447,17 +447,20 @@ public class UDPExpeditionReceiverTest {
|
||||
String[] lines = new String[validLines.length+1];
|
||||
lines[0] = "#0,1,7.900,2,-42.0,3,25.90,9,323.0,13,326.0,48,54.511867,49,10.152700,50,340.3,146,40348.578310*25";
|
||||
System.arraycopy(validLines, 0, lines, 1, validLines.length);
|
||||
// ensure declination service has 2011 loaded (which takes a few seconds)
|
||||
// ensure declination service has 2010 and 2011 loaded (which takes a few seconds)
|
||||
declinationService.getDeclination(
|
||||
new MillisecondsTimePoint(new SimpleDateFormat("yyyy-MM-dd").parse("2010-07-01").getTime()),
|
||||
new DegreePosition(54, 9), /* timeoutForOnlineFetchInMilliseconds */10000);
|
||||
declinationService.getDeclination(
|
||||
new MillisecondsTimePoint(new SimpleDateFormat("yyyy-MM-dd").parse("2011-07-01").getTime()),
|
||||
new DegreePosition(54, 9), /* timeoutForOnlineFetchInMilliseconds */3000);
|
||||
new DegreePosition(54, 9), /* timeoutForOnlineFetchInMilliseconds */10000);
|
||||
sendAndWaitABit(lines);
|
||||
Thread.sleep(3000); // wait until at least the declination was received
|
||||
assertEquals(lines.length, messages.size());
|
||||
// note that the tracks are ordered by timestamps; however, not all Expedition messages have an original timestamp.
|
||||
// So, some of them are timestamped with "now" which shuffles ordering. We keep track of the matched wind fixes in
|
||||
// a map
|
||||
Set<Wind> matched = new HashSet<Wind>();
|
||||
final Set<Wind> matched = new HashSet<>();
|
||||
// now assert that wind bearings have undergone declination correction
|
||||
Position lastKnownPosition = null;
|
||||
for (ExpeditionMessage m : messages) {
|
||||
@@ -466,13 +469,13 @@ public class UDPExpeditionReceiverTest {
|
||||
}
|
||||
if (m.getTrueWind() != null) {
|
||||
Declination declination = declinationService.getDeclination(m.getTimePoint(), lastKnownPosition,
|
||||
/* timeoutForOnlineFetchInMilliseconds */5000);
|
||||
/* timeoutForOnlineFetchInMilliseconds */10000);
|
||||
race.getWindTrack().lockForRead();
|
||||
try {
|
||||
for (Wind recordedWind : race.getWindTrack().getRawFixes()) {
|
||||
if (Math.abs(m.getTrueWindBearing().getDegrees()
|
||||
+ declination.getBearingCorrectedTo(m.getTimePoint()).getDegrees()
|
||||
- recordedWind.getBearing().getDegrees()) <= 0.0000001) {
|
||||
- recordedWind.getBearing().getDegrees()) <= 0.01) { // not more precise due to the use of VeryCompactWindFix in wind track
|
||||
matched.add(recordedWind);
|
||||
break;
|
||||
}
|
||||
|
||||
+5
-1
@@ -28,8 +28,10 @@ import com.sap.sailing.server.gateway.deserialization.impl.FlatSmartphoneUuidAnd
|
||||
import com.sap.sailing.server.gateway.deserialization.impl.Helpers;
|
||||
import com.sap.sailing.server.gateway.jaxrs.AbstractSailingServerResource;
|
||||
import com.sap.sse.common.NoCorrespondingServiceRegisteredException;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
@Path("/v1/gps_fixes")
|
||||
public class GPSFixesResource extends AbstractSailingServerResource {
|
||||
@@ -41,6 +43,7 @@ public class GPSFixesResource extends AbstractSailingServerResource {
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces("application/json;charset=UTF-8")
|
||||
public Response postFixes(String json) {
|
||||
final TimePoint received = MillisecondsTimePoint.now();
|
||||
Pair<UUID, List<GPSFixMoving>> data = null;
|
||||
try {
|
||||
logger.fine("Post issued to " + this.getClass().getName());
|
||||
@@ -67,7 +70,8 @@ public class GPSFixesResource extends AbstractSailingServerResource {
|
||||
changed.add(singleRaceRegatta);
|
||||
}
|
||||
}
|
||||
logger.log(Level.INFO, "Added " + fixes.size() + " fixes for device " + device.toString() + " to store");
|
||||
logger.log(Level.INFO, "Added " + fixes.size() + " fixes for device " + device.toString() + " to store."+
|
||||
(fixes.isEmpty()?"":" Delay: "+fixes.iterator().next().getTimePoint().until(received)));
|
||||
} catch (NoCorrespondingServiceRegisteredException e) {
|
||||
logger.log(Level.WARNING, "Could not store fix for device " + device);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ First of all, make sure you've looked at [http://www.amazon.de/Patterns-Elements
|
||||
#### Installations
|
||||
|
||||
1. Eclipse (Eclipse IDE for Eclipse Committers, version 4.15.0 ["2020-03"]https://www.eclipse.org/downloads/packages/release/2020-03/r/eclipse-ide-eclipse-committers)), [http://www.eclipse.org](http://www.eclipse.org)
|
||||
2. Get the content of the git repository (see
|
||||
2. Get the content of the git repository (see
|
||||
Steps to build and run the Race Analysis Suite below)
|
||||
3. Install the eclipse plugins (see Automatic Eclipse plugin installation below)
|
||||
4. Git (e.g. Git for Windows v2.18), [http://git-scm.com](http://git-scm.com) / [https://git-for-windows.github.io](https://git-for-windows.github.io)
|
||||
@@ -28,9 +28,12 @@ The necessary Eclipse plugins described above can be automatically be installed
|
||||
|
||||
Be aware that with this script it's not possible to update the plugins to newer versions. Instead you can install a new version by unpacking the base package and executing the script.
|
||||
|
||||
On Windows you need a Git Bash or Cygwin shell to run the script. In addition you need to replace all backslashes with forward slashes.
|
||||
###### On Windows
|
||||
You need a Git Bash or Cygwin shell to run the script. In addition you need to replace all backslashes with forward slashes.
|
||||
|
||||
On Mac OS, it's not sufficient to provide the path to the app, instead you need to get the path to the directory inside of the app package hosting the "eclipse" binary (.../Eclipse.app/Contents/MacOS).
|
||||
###### On Mac OS:
|
||||
- Before running the script, start eclipse and install **GWT Plugin** manually from repository [http://storage.googleapis.com/gwt-eclipse-plugin/v3/release](http://storage.googleapis.com/gwt-eclipse-plugin/v3/release)
|
||||
- It's not sufficient to provide the path to the app, instead you need to get the path to the directory inside of the app package hosting the "eclipse" binary (.../Eclipse.app/Contents/MacOS).
|
||||
|
||||
Be aware hat the installation may take several minutes depending on your Internet connection. When the script finished running, please check that no errors occurred (the installation process only logs errors but doesn't fail).
|
||||
|
||||
@@ -95,7 +98,7 @@ The primary Git repository for the project is hosted on sapsailing.com. It is mi
|
||||
* In Eclipse go to "Window->Preferences->Java->Build Path->Classpath Variables" and create a new classpath variable called ``ANDROID_HOME``. Set its value to the install location of your Android SDK, e.g., ``c:\apps\android-sdk-windows`` or ``/usr/local/android-sdk-linux``.
|
||||
* Install GWT SDK and add the SDK in Eclipse (Preferences -> GWT -> GWT Settings -> Add...)
|
||||
* In "Window->Preferences->GWT->Errors/Warnings, set "Missing SDK" to "Ignore"
|
||||
* In "Window->Preferences->General->Editors->TextEditors" check Insert Spaces for Tabs
|
||||
* In "Window->Preferences->General->Editors->TextEditors" check Insert Spaces for Tabs
|
||||
* In "Window->Preferences->Web->HTML Files->Editor" indent using Spaces
|
||||
* In "Window->Preferences->General->Content Types" select on the right side CSS, now add in the lower file association list *.gss to get limited syntax highlighting and content assist in GSS files
|
||||
* Install Eclipse debugger for GWT SuperDevMode
|
||||
@@ -108,12 +111,15 @@ The primary Git repository for the project is hosted on sapsailing.com. It is mi
|
||||
* Set the Eclipse target platform to race-analysis-p2-remote.target (located in com.sap.sailing.targetplatform/definitions)
|
||||
* Wait until the target platform has been resolved completely
|
||||
* Rebuild all projects
|
||||
4. Run the Race Analysis Suite
|
||||
* Start the MongoDB (cd /somePathTo MongoDB/mongodb/bin; rm c:/data/SAP/sailing/mongodb/mongod.lock; ./mongod --dbpath c:/data/SAP/sailing/mongodb)
|
||||
4. On clear workspace additional steps should be performed once:
|
||||
1. Run "GWT Dashboards SDM" launch configuration. After successful start, launch configuration can be stopped.
|
||||
2. Run "GWT Security SDM" launch configuration. After successful start, launch configuration can be stopped.
|
||||
5. Run the Race Analysis Suite
|
||||
* Start the MongoDB (cd /somePathTo MongoDB/mongodb/bin; rm c:/data/SAP/sailing/mongodb/mongod.lock; ./mongod --dbpath c:/data/SAP/sailing/mongodb)
|
||||
* Start the appropriate Eclipse launch configuration (e.g. 'Sailing Server (no Proxy)') You´ll find this in the debug dropdown
|
||||
* <del>Run "Security UI sdm" in the debug dropdown</del> (obsolete)
|
||||
* Run "SailingGWT sdm" in the debug dropdown
|
||||
5. Import races within the Race Analysis Suite
|
||||
* Run "GWT Sailing SDM" in the debug dropdown
|
||||
6. Import races within the Race Analysis Suite
|
||||
* <del>Choose "Security UI sdm" in the upper left corner of the "Development Mode" Tab in Eclipse and open "...Login.html" in your browser</del> (obsolete)
|
||||
* Choose "GWT Sailing SDM" in the "Development Mode" Tab and open "...AdminConsole.html..." (It is normal that the first try fails. Reload the page after the first try)
|
||||
* Default Login: user "admin", password "admin"
|
||||
@@ -178,7 +184,7 @@ The Android Apps can be built in Android Studio or gradle command line. Android
|
||||
* choose "add root" from "Unregistered VCS root detected" (you can add this later, if you missed it)
|
||||
3. Setup the Android SDK
|
||||
* in Android Studio press Tools -> Android -> SDK Manager
|
||||
* Install from section "Tools" (hint: carefull not to update
|
||||
* Install from section "Tools" (hint: carefull not to update
|
||||
* Android SDK Tools
|
||||
* Android SDK Platform-tools
|
||||
* Android SDK Build-tools 22.0.1 (latest version at the time of writing)
|
||||
|
||||
Reference in new issue
Block a user