X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosLogfileChooser.java;h=8b9d77d69cba6f70cd0d385b20ace70c03ca569e;hp=3e9e48922b2f1268642755fbb5899b306feba6ad;hb=3ffaa5d1c00b28be20fd4a26deb7bd41d953e92a;hpb=634a550149e7c344a22a637ba484f115592b1018 diff --git a/ao-tools/altosui/AltosLogfileChooser.java b/ao-tools/altosui/AltosLogfileChooser.java index 3e9e4892..8b9d77d6 100644 --- a/ao-tools/altosui/AltosLogfileChooser.java +++ b/ao-tools/altosui/AltosLogfileChooser.java @@ -27,25 +27,25 @@ import java.util.*; import java.text.*; import java.util.prefs.*; -import altosui.AltosPreferences; -import altosui.AltosReader; -import altosui.AltosEepromReader; -import altosui.AltosTelemetryReader; - public class AltosLogfileChooser extends JFileChooser { JFrame frame; String filename; + File file; public String filename() { return filename; } - public AltosReader runDialog() { + public File file() { + return file; + } + + public AltosRecordIterable runDialog() { int ret; ret = showOpenDialog(frame); if (ret == APPROVE_OPTION) { - File file = getSelectedFile(); + file = getSelectedFile(); if (file == null) return null; filename = file.getName(); @@ -54,9 +54,9 @@ public class AltosLogfileChooser extends JFileChooser { in = new FileInputStream(file); if (filename.endsWith("eeprom")) - return new AltosEepromReader(in); + return new AltosEepromIterable(in); else - return new AltosTelemetryReader(in); + return new AltosTelemetryIterable(in); } catch (FileNotFoundException fe) { JOptionPane.showMessageDialog(frame, filename, @@ -68,7 +68,7 @@ public class AltosLogfileChooser extends JFileChooser { } public AltosLogfileChooser(JFrame in_frame) { - in_frame = frame; + frame = in_frame; setDialogTitle("Select Flight Record File"); setFileFilter(new FileNameExtensionFilter("Flight data file", "eeprom",