mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Merged develop onto this branch
Tidied code, removed print statements #story[956] #pair[wmu16, mra106]
This commit is contained in:
@@ -304,14 +304,11 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
private Mark getNextMark(BoatGroup bg) {
|
private Mark getNextMark(BoatGroup bg) {
|
||||||
Integer legNumber = bg.getBoat().getLegNumber();
|
Integer legNumber = bg.getBoat().getLegNumber();
|
||||||
|
|
||||||
System.out.println("Leg Number: " + legNumber);
|
|
||||||
List<XMLParser.RaceXMLObject.Corner> markSequence = StreamParser.getXmlObject().getRaceXML().getCompoundMarkSequence();
|
List<XMLParser.RaceXMLObject.Corner> markSequence = StreamParser.getXmlObject().getRaceXML().getCompoundMarkSequence();
|
||||||
|
|
||||||
if (legNumber == 0) {
|
if (legNumber == 0) {
|
||||||
System.out.println("PreStart");
|
|
||||||
return null;
|
return null;
|
||||||
} else if (legNumber == markSequence.size() - 1) {
|
} else if (legNumber == markSequence.size() - 1) {
|
||||||
System.out.println("Finishing");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,19 +412,15 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
|
|
||||||
private void updateLaylines(BoatGroup bg) {
|
private void updateLaylines(BoatGroup bg) {
|
||||||
|
|
||||||
System.out.println("========" + bg.getBoat().getBoatName() + "=========");
|
|
||||||
Mark nextMark = getNextMark(bg);
|
Mark nextMark = getNextMark(bg);
|
||||||
Boolean isUpwind = null;
|
Boolean isUpwind = null;
|
||||||
// Can only calc leg direction if there is a next mark and it is a gate mark
|
// Can only calc leg direction if there is a next mark and it is a gate mark
|
||||||
if (nextMark != null) {
|
if (nextMark != null) {
|
||||||
System.out.println("Next Mark: " + nextMark.getName());
|
|
||||||
if (nextMark instanceof GateMark) {
|
if (nextMark instanceof GateMark) {
|
||||||
if (bg.isUpwindLeg(includedCanvasController, nextMark)) {
|
if (bg.isUpwindLeg(includedCanvasController, nextMark)) {
|
||||||
isUpwind = true;
|
isUpwind = true;
|
||||||
System.out.println(bg.getBoat().getBoatName() + " is on an upwind leg");
|
|
||||||
} else {
|
} else {
|
||||||
isUpwind = false;
|
isUpwind = false;
|
||||||
System.out.println(bg.getBoat().getBoatName() + " is on a downwind leg");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(MarkGroup mg : includedCanvasController.getMarkGroups()) {
|
for(MarkGroup mg : includedCanvasController.getMarkGroups()) {
|
||||||
@@ -476,8 +469,6 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ public class StreamParser extends Thread {
|
|||||||
Long estTimeAtFinish = bytesToLong(
|
Long estTimeAtFinish = bytesToLong(
|
||||||
Arrays.copyOfRange(payload, 38 + (i * 20), 44 + (i * 20)));
|
Arrays.copyOfRange(payload, 38 + (i * 20), 44 + (i * 20)));
|
||||||
boat.setEstimateTimeAtFinish(estTimeAtFinish);
|
boat.setEstimateTimeAtFinish(estTimeAtFinish);
|
||||||
|
boatsPos.put(estTimeAtFinish, boat);
|
||||||
// String boatStatus = "SourceID: " + boatStatusSourceID;
|
// String boatStatus = "SourceID: " + boatStatusSourceID;
|
||||||
// boatStatus += "\nBoat Status: " + (int)payload[28 + (i * 20)];
|
// boatStatus += "\nBoat Status: " + (int)payload[28 + (i * 20)];
|
||||||
// boatStatus += "\nLegNumber: " + (int)payload[29 + (i * 20)];
|
// boatStatus += "\nLegNumber: " + (int)payload[29 + (i * 20)];
|
||||||
|
|||||||
Reference in New Issue
Block a user