From c89a34d1eb25155405b0036baeadc7bbfeade1c2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 27 Sep 2010 17:11:48 -0700 Subject: 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 --- ao-tools/altosui/AltosCSV.java | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'ao-tools/altosui/AltosCSV.java') 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 { -- cgit v1.2.3