mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Got the live ac35 data working in paralell with the parse and the app. Boats move and the live data works correctly. We need to fix the markers now
#story[818]
This commit is contained in:
@@ -18,8 +18,8 @@ public class App extends Application
|
|||||||
primaryStage.setScene(new Scene(root));
|
primaryStage.setScene(new Scene(root));
|
||||||
|
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
StreamReceiver sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4941,"TestThread1");
|
// StreamReceiver sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4941,"TestThread1");
|
||||||
// StreamReceiver sr = new StreamReceiver("livedata.americascup.com", 4941, "TestThread1");
|
StreamReceiver sr = new StreamReceiver("livedata.americascup.com", 4941, "TestThread1");
|
||||||
sr.start();
|
sr.start();
|
||||||
StreamParser streamParser = new StreamParser("TestThread2");
|
StreamParser streamParser = new StreamParser("TestThread2");
|
||||||
|
|
||||||
|
|||||||
@@ -594,7 +594,7 @@ public class CanvasController {
|
|||||||
yAxisLocation += (int) Math.round(distanceScaleFactor * Math.sin(angleFromReference) * distanceFromReference);
|
yAxisLocation += (int) Math.round(distanceScaleFactor * Math.sin(angleFromReference) * distanceFromReference);
|
||||||
} else if (angleFromReference < 0 && angleFromReference >= -Math.PI / 2) {
|
} else if (angleFromReference < 0 && angleFromReference >= -Math.PI / 2) {
|
||||||
//System.out.println("3");
|
//System.out.println("3");
|
||||||
System.out.println(distanceFromReference);
|
// System.out.println(distanceFromReference);
|
||||||
angleFromReference = Math.abs(angleFromReference);
|
angleFromReference = Math.abs(angleFromReference);
|
||||||
System.out.println(Math.cos(angleFromReference) * distanceFromReference);
|
System.out.println(Math.cos(angleFromReference) * distanceFromReference);
|
||||||
xAxisLocation -= (int) Math.round(distanceScaleFactor * Math.sin(angleFromReference) * distanceFromReference);
|
xAxisLocation -= (int) Math.round(distanceScaleFactor * Math.sin(angleFromReference) * distanceFromReference);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javafx.geometry.Point3D;
|
|||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
import sun.awt.UNIXToolkit;
|
||||||
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
@@ -119,6 +120,7 @@ public class StreamParser extends Thread{
|
|||||||
int raceStatus = payload[11];
|
int raceStatus = payload[11];
|
||||||
// System.out.println("raceStatus = " + raceStatus);
|
// System.out.println("raceStatus = " + raceStatus);
|
||||||
long expectedStartTime = extractTimeStamp(Arrays.copyOfRange(payload,12,18), 6);
|
long expectedStartTime = extractTimeStamp(Arrays.copyOfRange(payload,12,18), 6);
|
||||||
|
// System.out.println("Race starting in: " + expectedStartTime);
|
||||||
long windDir = bytesToLong(Arrays.copyOfRange(payload,18,20));
|
long windDir = bytesToLong(Arrays.copyOfRange(payload,18,20));
|
||||||
long windSpeed = bytesToLong(Arrays.copyOfRange(payload,20,22));
|
long windSpeed = bytesToLong(Arrays.copyOfRange(payload,20,22));
|
||||||
int noBoats = payload[22];
|
int noBoats = payload[22];
|
||||||
@@ -133,6 +135,7 @@ public class StreamParser extends Thread{
|
|||||||
boatStatus += "\nEstTimeAtNextMark: " + extractTimeStamp(Arrays.copyOfRange(payload,31 + (i * 20),37+ (i * 20)), 6);
|
boatStatus += "\nEstTimeAtNextMark: " + extractTimeStamp(Arrays.copyOfRange(payload,31 + (i * 20),37+ (i * 20)), 6);
|
||||||
boatStatus += "\nEstTimeAtFinish: " + extractTimeStamp(Arrays.copyOfRange(payload,37 + (i * 20),43+ (i * 20)), 6);
|
boatStatus += "\nEstTimeAtFinish: " + extractTimeStamp(Arrays.copyOfRange(payload,37 + (i * 20),43+ (i * 20)), 6);
|
||||||
boatStatuses.add(boatStatus);
|
boatStatuses.add(boatStatus);
|
||||||
|
// System.out.println("boatStatus = " + boatStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ public class StreamReceiver extends Thread {
|
|||||||
});
|
});
|
||||||
packetBuffer = pq;
|
packetBuffer = pq;
|
||||||
connect();
|
connect();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start () {
|
public void start () {
|
||||||
|
|||||||
Reference in New Issue
Block a user