Mockoutput's main loop now pops messages off the message queue, rather than iterating over it like an array, and clearing it (this could have threading issues where the iteration starts (with e.g., 5 messages), as it is sending the messages another one is added, and then it ends up clearing the sent messages, and the unsent message.

Made a few quick fixes (to be tidied a bit later) to Mock.Race class. It now has this.startTime, instead of the AnimationTimers having their own starTime value. RaceStatus messages are now sent properly (still need a refactor though), so they actually send the race star time - this means that the visualizer using the mock data source displays the correct time instead of (midnight, jan 1, 1970).

Removed one of the constructors from RaceStatus - it allowed for constructing and sending essentially invalid RaceStatus messages, and simply wasn't needed.

Added a temporary title ("RaceVision - Team 7") to the visualiser - may be worth changing when we decide on a team name.

Fixed a bug with the order of operations in visualiser.StartController.countdownTimer(). Calling begin race before hiding panes caused them to never be hidden.

Mock.Event. Changed the scaleFactor to 5x for the time being - to easier testing of things like pre-race timers, countdowns, etc...

#story[778,782]
This commit is contained in:
fjc40
2017-05-07 15:52:34 +12:00
parent 01224c509a
commit 83ce9b99d2
8 changed files with 37 additions and 34 deletions
@@ -36,6 +36,7 @@ public class App extends Application {
Parent root = loader.load();
Scene scene = new Scene(root, 1200, 800);
stage.setScene(scene);
stage.setTitle("RaceVision - Team 7");
stage.show();
}
}
@@ -98,10 +98,13 @@ public class StartController extends Controller implements Observer {
raceStat = visualiserInput.getRaceStatus().getRaceStatus();
raceStatusLabel.setText("Race Status: " + visualiserInput.getRaceStatus().getRaceStatus());
if (raceStat==2 || raceStat == 3) {
System.out.println("countdown finished!");//TEMP DEBUG REMOVE
stop();
parent.beginRace(visualiserInput, raceClock);
startWrapper.setVisible(false);
start.setVisible(false);
parent.beginRace(visualiserInput, raceClock);
}
}
}.start();
@@ -27,7 +27,7 @@ import static seng302.Networking.Utils.MessageType.*;
*/
public class VisualiserInput implements Runnable
{
//time since last heartbeat
//Time since last heartbeat.
private long lastHeartbeatTime;
//socket port 4945 as 4940 is ac35 live port and 4941 is ac35 test port