projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
telegps: Get telegps application working again
[fw/altos]
/
telegps
/
TeleGPS.java
diff --git
a/telegps/TeleGPS.java
b/telegps/TeleGPS.java
index cf2cbd4fefce4e114fb8605cbdda3a2a5ff535cb..5e500e0259a74623e6d934d2e85b876bc0107d2a 100644
(file)
--- a/
telegps/TeleGPS.java
+++ b/
telegps/TeleGPS.java
@@
-152,7
+152,7
@@
public class TeleGPS
status_update.saved_listener_state = listener_state;
if (state == null)
status_update.saved_listener_state = listener_state;
if (state == null)
- state = new AltosState();
+ state = new AltosState(
new AltosCalData()
);
int i = 0;
for (AltosFlightDisplay display : displays) {
int i = 0;
for (AltosFlightDisplay display : displays) {
@@
-287,23
+287,30
@@
public class TeleGPS
new TeleGPSConfig(this);
}
new TeleGPSConfig(this);
}
+ private static AltosFlightSeries make_series(AltosRecordSet set) {
+ AltosFlightSeries series = new AltosFlightSeries(set.cal_data());
+ set.capture_series(series);
+ series.finish();
+ return series;
+ }
+
void export() {
void export() {
- AltosDataChooser chooser;
- chooser = new AltosDataChooser(this);
- Altos
StateIterable states
= chooser.runDialog();
- if (s
tates
== null)
+ AltosDataChooser chooser
= new AltosDataChooser(this)
;
+
+ Altos
RecordSet set
= chooser.runDialog();
+ if (s
et
== null)
return;
return;
- new AltosCSVUI(this, states, chooser.file());
+ AltosFlightSeries series = make_series(set);
+ new AltosCSVUI(this, series, series.cal_data, chooser.file());
}
void graph() {
}
void graph() {
- AltosDataChooser chooser;
- chooser = new AltosDataChooser(this);
- AltosStateIterable states = chooser.runDialog();
- if (states == null)
+ AltosDataChooser chooser = new AltosDataChooser(this);
+ AltosRecordSet set = chooser.runDialog();
+ if (set == null)
return;
try {
return;
try {
- new TeleGPSGraphUI(s
tates
, chooser.file());
+ new TeleGPSGraphUI(s
et
, chooser.file());
} catch (InterruptedException ie) {
} catch (IOException ie) {
}
} catch (InterruptedException ie) {
} catch (IOException ie) {
}
@@
-612,7
+619,7
@@
public class TeleGPS
connect(device);
}
connect(device);
}
- static Altos
StateIterable record_iterable
(File file) {
+ static Altos
RecordSet record_set
(File file) {
FileInputStream in;
if (file.getName().endsWith("telem")) {
try {
FileInputStream in;
if (file.getName().endsWith("telem")) {
try {
@@
-624,8
+631,7
@@
public class TeleGPS
} else {
try {
} else {
try {
- AltosEepromFile f = new AltosEepromFile(new FileReader(file));
- return f;
+ return new AltosEepromFile(new FileReader(file));
} catch (Exception e) {
System.out.printf("Failed to open file '%s'\n", file);
}
} catch (Exception e) {
System.out.printf("Failed to open file '%s'\n", file);
}
@@
-634,18
+640,18
@@
public class TeleGPS
}
static AltosReplayReader replay_file(File file) {
}
static AltosReplayReader replay_file(File file) {
- Altos
StateIterable states = record_iterable
(file);
- if (s
tates
== null)
+ Altos
RecordSet set = record_set
(file);
+ if (s
et
== null)
return null;
return null;
- return new AltosReplayReader(s
tates.iterator()
, file);
+ return new AltosReplayReader(s
et
, file);
}
static boolean process_graph(File file) {
}
static boolean process_graph(File file) {
- Altos
StateIterable states = record_iterable
(file);
- if (s
tates
== null)
+ Altos
RecordSet set = record_set
(file);
+ if (s
et
== null)
return false;
try {
return false;
try {
- new TeleGPSGraphUI(s
tates
, file);
+ new TeleGPSGraphUI(s
et
, file);
} catch (Exception e) {
return false;
}
} catch (Exception e) {
return false;
}