mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +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.show();
|
||||
StreamReceiver sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4941,"TestThread1");
|
||||
// StreamReceiver sr = new StreamReceiver("livedata.americascup.com", 4941, "TestThread1");
|
||||
// StreamReceiver sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4941,"TestThread1");
|
||||
StreamReceiver sr = new StreamReceiver("livedata.americascup.com", 4941, "TestThread1");
|
||||
sr.start();
|
||||
StreamParser streamParser = new StreamParser("TestThread2");
|
||||
|
||||
|
||||
@@ -594,7 +594,7 @@ public class CanvasController {
|
||||
yAxisLocation += (int) Math.round(distanceScaleFactor * Math.sin(angleFromReference) * distanceFromReference);
|
||||
} else if (angleFromReference < 0 && angleFromReference >= -Math.PI / 2) {
|
||||
//System.out.println("3");
|
||||
System.out.println(distanceFromReference);
|
||||
// System.out.println(distanceFromReference);
|
||||
angleFromReference = Math.abs(angleFromReference);
|
||||
System.out.println(Math.cos(angleFromReference) * distanceFromReference);
|
||||
xAxisLocation -= (int) Math.round(distanceScaleFactor * Math.sin(angleFromReference) * distanceFromReference);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class StreamPacket {
|
||||
this.messageLength = messageLength;
|
||||
this.timeStamp = timeStamp;
|
||||
this.payload = payload;
|
||||
//System.out.println("type = " + this.type.toString());
|
||||
// System.out.println("type = " + this.type.toString());
|
||||
//switch the packet type to deal with what ever specific packet you want to deal with
|
||||
// if (this.type == PacketType.XML_MESSAGE){
|
||||
// //System.out.println("--------");
|
||||
|
||||
@@ -6,6 +6,7 @@ import javafx.geometry.Point3D;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import sun.awt.UNIXToolkit;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
@@ -119,6 +120,7 @@ public class StreamParser extends Thread{
|
||||
int raceStatus = payload[11];
|
||||
// System.out.println("raceStatus = " + raceStatus);
|
||||
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 windSpeed = bytesToLong(Arrays.copyOfRange(payload,20,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 += "\nEstTimeAtFinish: " + extractTimeStamp(Arrays.copyOfRange(payload,37 + (i * 20),43+ (i * 20)), 6);
|
||||
boatStatuses.add(boatStatus);
|
||||
// System.out.println("boatStatus = " + boatStatus);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ public class StreamReceiver extends Thread {
|
||||
});
|
||||
packetBuffer = pq;
|
||||
connect();
|
||||
|
||||
}
|
||||
|
||||
public void start () {
|
||||
|
||||
Reference in New Issue
Block a user