Making the boat sparkline initialise after the race screen is shown.

#story[952]
This commit is contained in:
Kusal Ekanayake
2017-05-21 14:56:05 +12:00
parent 48d58ea660
commit 8e147bd1bd
3 changed files with 11 additions and 4 deletions
@@ -128,7 +128,7 @@ public class CanvasController {
long elapsedNanosPerFrame = elapsedNanos / frameTimes.length ; long elapsedNanosPerFrame = elapsedNanos / frameTimes.length ;
Double frameRate = 1_000_000_000.0 / elapsedNanosPerFrame ; Double frameRate = 1_000_000_000.0 / elapsedNanosPerFrame ;
drawFps(frameRate.intValue()); drawFps(frameRate.intValue());
raceViewController.checkForPositionChange(); // raceViewController.checkForPositionChange();
} }
// TODO: 1/05/17 cir27 - Make the RaceObjects update on the actual delay. // TODO: 1/05/17 cir27 - Make the RaceObjects update on the actual delay.
@@ -522,4 +522,11 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
Stage getStage() { Stage getStage() {
return stage; return stage;
} }
public static boolean sparkLineStatus(Integer yachtId) {
if (sparklineData.containsKey(yachtId)){
return true;
}
return false;
}
} }
+3 -3
View File
@@ -107,9 +107,9 @@ public class Yacht {
} }
public void setLegNumber(Integer legNumber) { public void setLegNumber(Integer legNumber) {
if (legNumber != this.legNumber && colour != null && position != "-") { // if (colour != null && position != "-" && legNumber != this.legNumber&& RaceViewController.sparkLineStatus(sourceID)) {
RaceViewController.updateYachtPositionSparkline(this, legNumber); // RaceViewController.updateYachtPositionSparkline(this, legNumber);
} // }
this.legNumber = legNumber; this.legNumber = legNumber;
} }