X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosReplayReader.java;h=f420c9589d8d3b1c326560b469d3e941d337c10e;hb=2a4d741872449b5332f28e018fa3acc53ed7d891;hp=a7e30370d2696da8db29aedbdb461e3808a332ac;hpb=8d1d8d2a3c129cdbd55427bcda0f26715b02f1ee;p=fw%2Faltos diff --git a/altoslib/AltosReplayReader.java b/altoslib/AltosReplayReader.java index a7e30370..f420c958 100644 --- a/altoslib/AltosReplayReader.java +++ b/altoslib/AltosReplayReader.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_1; +package org.altusmetrum.altoslib_11; import java.io.*; import java.util.*; @@ -25,10 +25,10 @@ import java.util.*; */ public class AltosReplayReader extends AltosFlightReader { - Iterator iterator; + Iterator iterator; File file; - public AltosRecord read() { + public AltosState read() { if (iterator.hasNext()) return iterator.next(); return null; @@ -39,13 +39,14 @@ public class AltosReplayReader extends AltosFlightReader { public void update(AltosState state) throws InterruptedException { /* Make it run in realtime after the rocket leaves the pad */ - if (state.state > AltosLib.ao_flight_pad) + if (state.state() > AltosLib.ao_flight_pad && state.time_change > 0) Thread.sleep((int) (Math.min(state.time_change,10) * 1000)); + state.set_received_time(System.currentTimeMillis()); } public File backing_file() { return file; } - public AltosReplayReader(Iterator in_iterator, File in_file) { + public AltosReplayReader(Iterator in_iterator, File in_file) { iterator = in_iterator; file = in_file; name = file.getName();