Lowered frequency sparkline updates
- sparkline only updates when a boat passes a point - all lines start in the middle - slow frame rate issue resolved #story[876]
This commit is contained in:
@@ -102,8 +102,9 @@ public class RaceController extends Controller {
|
||||
startBoats.add(boat);
|
||||
}
|
||||
for (int i=0; i<startBoats.size(); i++){
|
||||
Float startPos = ((float)startBoats.size()+1)/2;
|
||||
XYChart.Series<Number, Number> series = new XYChart.Series();
|
||||
series.getData().add(new XYChart.Data(0, i+1));
|
||||
series.getData().add(new XYChart.Data(0, startPos));
|
||||
sparklineChart.getData().add(series);
|
||||
}
|
||||
|
||||
@@ -209,7 +210,6 @@ public class RaceController extends Controller {
|
||||
//int [] boatsInRace = {1, 2, 3, 4, 5, 6};
|
||||
int placingVal = boatsInRace.size();
|
||||
//System.out.println(boatsInRace.get(0).toString());
|
||||
System.out.println(startBoats.get(0).toString());
|
||||
sparkLineNumber++;
|
||||
for (int i=0; i<boatsInRace.size(); i++){
|
||||
for (int j=0; j<startBoats.size(); j++){
|
||||
|
||||
@@ -84,7 +84,10 @@ public class StreamedRace implements Runnable {
|
||||
int legNumber = boatStatusMessage.getLegNumber();
|
||||
|
||||
if (legNumber >= 1 && legNumber < legs.size()) {
|
||||
if (boat.getCurrentLeg() != legs.get(legNumber)){
|
||||
boat.setCurrentLeg(legs.get(legNumber));
|
||||
controller.updateSparkline(startingBoats);
|
||||
}
|
||||
}
|
||||
|
||||
if (boatStatusEnum == BoatStatusEnum.RACING) {
|
||||
@@ -190,7 +193,7 @@ public class StreamedRace implements Runnable {
|
||||
public void handle(long arg0) {
|
||||
if (boatsFinished < startingBoats.size()) {
|
||||
boatsFinished = 0;
|
||||
controller.updateSparkline(startingBoats);
|
||||
//controller.updateSparkline(startingBoats);
|
||||
totalTimeElapsed = System.currentTimeMillis() - timeRaceStarted;
|
||||
|
||||
for (Boat boat : startingBoats) {
|
||||
|
||||
Reference in New Issue
Block a user