summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosCSVUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-09-27 17:11:48 -0700
committerKeith Packard <keithp@keithp.com>2010-09-27 17:11:48 -0700
commitc89a34d1eb25155405b0036baeadc7bbfeade1c2 (patch)
tree1329c7c89b3d6a182fb68ec8f00c37a6104f5ab9 /ao-tools/altosui/AltosCSVUI.java
parente66919aa46193bd8c7a1e86fb32a3367dae121f5 (diff)
altosui: Create iterables for log file scanning. Split out display threads
Convert from log file reading paradigm to using iterators which is more idiomatic for java. Split more code out of AltosUI.java, including the display update threads for telemetry monitoring and logfile replay.x Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosCSVUI.java')
-rw-r--r--ao-tools/altosui/AltosCSVUI.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/ao-tools/altosui/AltosCSVUI.java b/ao-tools/altosui/AltosCSVUI.java
index 643d4112..4eb72de8 100644
--- a/ao-tools/altosui/AltosCSVUI.java
+++ b/ao-tools/altosui/AltosCSVUI.java
@@ -35,17 +35,17 @@ public class AltosCSVUI
extends JDialog
implements Runnable, ActionListener
{
- JFrame frame;
- Thread thread;
- AltosReader reader;
- AltosCSV writer;
+ JFrame frame;
+ Thread thread;
+ AltosRecordIterable iterable;
+ AltosCSV writer;
public void run() {
AltosLogfileChooser chooser;
chooser = new AltosLogfileChooser(frame);
- reader = chooser.runDialog();
- if (reader == null)
+ iterable = chooser.runDialog();
+ if (iterable == null)
return;
JFileChooser csv_chooser;
@@ -67,8 +67,7 @@ public class AltosCSVUI
"Cannot open file",
JOptionPane.ERROR_MESSAGE);
}
- writer.write(reader);
- reader.close();
+ writer.write(iterable);
writer.close();
}
}