summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-05-09 00:22:35 -0700
committerKeith Packard <keithp@keithp.com>2017-05-09 00:22:35 -0700
commite311cefae19d7dc71fb10e9a943daa8e2313c8f8 (patch)
treee2f0336744cb7fcd4457ddd6fb284dfc0d5ac7d9
parentc00a80f040de85be18c9d5150cb0661e08158c3d (diff)
altosui: Use new eeprom reading code
This just means using different file opening functions, which then get matched by AltosEepromFile and sent off to the new eeprom code. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--altosui/AltosUI.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java
index 019bbb9e..b0c6d33b 100644
--- a/altosui/AltosUI.java
+++ b/altosui/AltosUI.java
@@ -448,16 +448,23 @@ public class AltosUI extends AltosUIFrame {
static AltosStateIterable record_iterable(File file) {
FileInputStream in;
- try {
- in = new FileInputStream(file);
- } catch (Exception e) {
- System.out.printf("Failed to open file '%s'\n", file);
- return null;
+ if (file.getName().endsWith("telem")) {
+ try {
+ in = new FileInputStream(file);
+ return new AltosTelemetryFile(in);
+ } catch (Exception e) {
+ System.out.printf("Failed to open file '%s'\n", file);
+ }
+ } else {
+
+ try {
+ AltosEepromFile f = new AltosEepromFile(new FileReader(file));
+ return f;
+ } catch (Exception e) {
+ System.out.printf("Failed to open file '%s'\n", file);
+ }
}
- if (file.getName().endsWith("telem"))
- return new AltosTelemetryFile(in);
- else
- return new AltosEepromFile(in);
+ return null;
}
static AltosReplayReader replay_file(File file) {