diff options
author | Keith Packard <keithp@keithp.com> | 2010-09-05 01:13:01 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-09-05 01:13:01 -0700 |
commit | 410ba89eef9c9817eef81b702966cb88820ff7c4 (patch) | |
tree | f9e9f5512c1a4a212302d5f95456556c37014f8b | |
parent | 6205547ec7191aab0259a8449520e966a96129e6 (diff) |
altosui: Start idle thread after the rocket leaves the pad
This makes the first altitude report time consistently 10 seconds
after launch, instead of some random time depending on when the rocket
launched relative to the time the device connection was made.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | ao-tools/altosui/AltosUI.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 49153766..fbce5e14 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -277,6 +277,7 @@ public class AltosUI extends JFrame { class IdleThread extends Thread { + boolean started; private AltosState state; int reported_landing; @@ -346,6 +347,10 @@ public class AltosUI extends JFrame { public void notice(AltosState new_state) { AltosState old_state = state; state = new_state; + if (!started && state.state > Altos.ao_flight_pad) { + started = true; + start(); + } if (old_state != null && old_state.state != state.state) report(false); } @@ -398,7 +403,6 @@ public class AltosUI extends JFrame { info_reset(); info_finish(); - idle_thread.start(); try { for (;;) { try { |