summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosCSV.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/AltosCSV.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/AltosCSV.java')
-rw-r--r--ao-tools/altosui/AltosCSV.java20
1 files changed, 4 insertions, 16 deletions
diff --git a/ao-tools/altosui/AltosCSV.java b/ao-tools/altosui/AltosCSV.java
index f7b3c03c..7f14adad 100644
--- a/ao-tools/altosui/AltosCSV.java
+++ b/ao-tools/altosui/AltosCSV.java
@@ -207,22 +207,10 @@ public class AltosCSV {
out.close();
}
- public void write(AltosReader reader) {
- AltosRecord record;
-
- reader.write_comments(out());
- try {
- for (;;) {
- record = reader.read();
- if (record == null)
- break;
- write(record);
- }
- } catch (IOException ie) {
- System.out.printf("IOException\n");
- } catch (ParseException pe) {
- System.out.printf("ParseException %s\n", pe.getMessage());
- }
+ public void write(AltosRecordIterable iterable) {
+ iterable.write_comments(out());
+ for (AltosRecord r : iterable)
+ write(r);
}
public AltosCSV(File in_name) throws FileNotFoundException {