import java.util.concurrent.*;
import java.util.*;
import java.text.*;
-import org.altusmetrum.altoslib_11.*;
-import org.altusmetrum.altosuilib_11.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
public class TeleGPS
extends AltosUIFrame
- implements AltosFlightDisplay, AltosFontListener, AltosUnitsListener, ActionListener
+ implements AltosFlightDisplay, AltosFontListener, AltosUnitsListener, ActionListener, AltosEepromGrapher
{
static String[] telegps_icon_names = {
}
void download(){
- new AltosEepromManage(this, AltosLib.product_telegps);
+ new AltosEepromManage(this, this, AltosLib.product_telegps);
}
void configure() {
if (set == null)
return;
AltosFlightSeries series = make_series(set);
- new AltosCSVUI(this, series, series.cal_data, chooser.file());
+ new AltosCSVUI(this, series, chooser.file());
}
void graph() {
}
}
+ public void graph_flights(AltosEepromList list) {
+ for (AltosEepromLog log : list) {
+ if (log.file != null) {
+ AltosRecordSet set = record_set(log.file);
+ if (set != null) {
+ try {
+ new TeleGPSGraphUI(set, log.file);
+ } catch (InterruptedException ie) {
+ } catch (IOException ie) {
+ }
+ }
+ }
+ }
+ }
+
void flash() {
AltosFlashUI.show(this);
}
}
static AltosRecordSet record_set(File file) {
- FileInputStream in;
- 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 {
- return new AltosEepromFile(new FileReader(file));
- } catch (Exception e) {
- System.out.printf("Failed to open file '%s'\n", file);
- }
+ try {
+ return AltosLib.record_set(file);
+ } catch (IOException ie) {
+ System.out.printf("%s\n", ie.getMessage());
}
return null;
}