Various bug fixes

- Made canvas fill entire screen
- Made window scale to screens that aren't 1920x1080
- Changed boat speeds in mock so they aren't too fast
- Added command line options to switch server

Tags: #story[829]
This commit is contained in:
Michael Rausch
2017-05-03 21:56:51 +12:00
parent f0d6312fa5
commit d992422efd
11 changed files with 78 additions and 36 deletions
-2
View File
@@ -21,8 +21,6 @@ public class Event {
private final double ORIGIN_LON = -64.857063;
private final double SCALE = 16000;
/**
* Event class containing the time of specific event, related team/boat, and
* event location such as leg.
@@ -57,7 +57,7 @@ public class StreamParser extends Thread{
*/
public void run(){
try {
System.out.println("START OF STREAM");
System.out.println("[CLIENT] Start of stream");
streamStatus = true;
xmlObject = new XMLParser();
while (StreamReceiver.packetBuffer == null || StreamReceiver.packetBuffer.size() < 1) {
@@ -94,7 +94,7 @@ public class StreamParser extends Thread{
*
*/
public void start () {
System.out.println("Starting " + threadName );
System.out.println("[CLIENT] Starting " + threadName );
if (t == null) {
t = new Thread (this, threadName);
t.start ();
@@ -181,18 +181,18 @@ public class StreamParser extends Thread{
currentTimeString = format.format((new Date (currentTime)).getTime());
if (timeTillStart > 0) {
timeSinceStart = timeTillStart;
System.out.println("Time till start: " + timeTillStart + " Seconds");
//System.out.println("Time till start: " + timeTillStart + " Seconds");
} else {
if (raceStatus == 4 || raceStatus == 8){
raceFinished = true;
raceStarted = false;
System.out.println("RACE HAS FINISHED");
System.out.println("[CLIENT] Race has finished");
} else if (!raceStarted){
raceStarted = true;
raceFinished = false;
System.out.println("RACE HAS STARTED");
System.out.println("[CLIENT] Race has started");
}
System.out.println("Time since start: " + -1 * timeTillStart + " Seconds");
//System.out.println("Time since start: " + -1 * timeTillStart + " Seconds");
timeSinceStart = timeTillStart;
}
long windDir = bytesToLong(Arrays.copyOfRange(payload,18,20));
@@ -24,6 +24,7 @@ public class StreamReceiver extends Thread {
public StreamReceiver(String hostAddress, int hostPort, String threadName) {
this.threadName = threadName;
this.setDaemon(true);
try {
host = new Socket(hostAddress, hostPort);
} catch (IOException e) {
@@ -44,7 +45,7 @@ public class StreamReceiver extends Thread {
}
public void start () {
System.out.println("Starting " + threadName );
System.out.println("[CLIENT] Starting " + threadName );
if (t == null) {
t = new Thread (this, threadName);
t.start ();
@@ -95,7 +96,6 @@ public class StreamReceiver extends Thread {
} catch (Exception e) {
moreBytes = false;
}
}
}