return file;
}
- public AltosStateIterable runDialog() {
+ public AltosRecordSet runDialog() {
int ret;
ret = showOpenDialog(frame);
file = getSelectedFile();
if (file == null)
return null;
- filename = file.getName();
try {
- if (filename.endsWith("eeprom")) {
- FileInputStream in = new FileInputStream(file);
- return new AltosEepromFile(in);
- } else if (filename.endsWith("telem")) {
- FileInputStream in = new FileInputStream(file);
- return new AltosTelemetryFile(in);
- } else {
- throw new FileNotFoundException();
- }
- } catch (FileNotFoundException fe) {
+ return AltosLib.record_set(file);
+ } catch (IOException ie) {
JOptionPane.showMessageDialog(frame,
- fe.getMessage(),
- "Cannot open file",
+ ie.getMessage(),
+ "Error reading file",
JOptionPane.ERROR_MESSAGE);
}
}