Merged Mock49 and fixed bugs

- Error where mock would not read in the files when running from the jar.
- Error where the AC35 stream now no longer sends us packets with information that is set for 0 for boat location.
#story[881] #pair[fwy13, esa46
This commit is contained in:
Fan-Wu Yang
2017-05-15 15:49:38 +12:00
parent 7bfb6bb968
commit b065b8d9c7
8 changed files with 152 additions and 47 deletions
@@ -25,7 +25,6 @@ public class StreamedCourse extends Observable implements RaceDataSource {
this.boatXMLReader = boatXMLReader;
if (streamedCourseXMLReader != null && boatXMLReader != null) {
this.boatXMLReader.setParticipants(streamedCourseXMLReader.getParticipants());
System.out.println(streamedCourseXMLReader.getParticipants().size());
boatXMLReader.read();
}
@@ -30,7 +30,7 @@ public class Marker {
}
/**
* @deprecated
*
* @param mark1 Mark coordinates.
*/
public Marker(GPSCoordinate mark1) {
@@ -38,7 +38,7 @@ public class Marker {
}
/**
* @deprecated
*
* @param mark1 Mark one coordinate
* @param mark2 Mark two coordinate
*/
@@ -159,7 +159,7 @@ public class VisualiserInput implements Runnable {
* @throws IOException Thrown when an error occurs while reading from the socket.
*/
private byte[] getNextMessageBytes() throws IOException {
inStream.mark(0);
short CRCLength = 4;
short headerLength = 15;
@@ -253,6 +253,11 @@ public class VisualiserInput implements Runnable {
catch (InvalidMessageException | IOException e) {
//Prints exception to stderr, and iterate loop (that is, read the next message).
System.err.println("Unable to read message: " + e.getMessage());
try {
inStream.reset();
} catch (IOException e1) {
e1.printStackTrace();
}
//Continue to the next loop iteration/message.
continue;
}/*