+
+ /* Construct our internal representation of the eeprom data */
+ AltosEepromNew eeprom = new AltosEepromNew(flights.config_data, data);
+
+ /* Now see if we can't actually parse the resulting
+ * file to generate a better filename. Note that this
+ * doesn't need to work; we'll still save the data using
+ * a less accurate name.
+ */
+ AltosEepromRecordSet set = new AltosEepromRecordSet(eeprom);
+
+ AltosState state = new AltosState();
+
+ for (AltosState s : set) {
+ state = s;
+ if (state.gps != null)
+ break;
+ }
+
+ AltosFile f = MakeFile(flights.config_data.serial, log.flight, state);
+
+ monitor.set_filename(f.toString());
+
+ FileWriter w = new FileWriter(f);
+
+ eeprom.write(w);
+ w.close();