summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c00a80f)
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>
static AltosStateIterable record_iterable(File file) {
FileInputStream in;
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);
}
static AltosReplayReader replay_file(File file) {
}
static AltosReplayReader replay_file(File file) {