+ try {
+ int flight = get_int(line, "flight");
+ String[] tokens = line.split("\\s+");
+ if (tokens.length >= 6) {
+ int start = -1, end = -1;
+ try {
+ if (tokens[2].equals("start"))
+ start = AltosParse.parse_hex(tokens[3]);
+ if (tokens[4].equals("end"))
+ end = AltosParse.parse_hex(tokens[5]);
+ if (flight != 0 && start >= 0 && end > 0) {
+ int len;
+ if (flights == null)
+ len = 0;
+ else
+ len = flights.length;
+ AltosEepromFlight [] new_flights = new AltosEepromFlight[len + 1];
+ for (int i = 0; i < len; i++)
+ new_flights[i] = flights[i];
+ new_flights[len] = new AltosEepromFlight(flight, start, end);
+ flights = new_flights;
+ stored_flight = flights.length;
+ }
+ } catch (ParseException pe) { System.out.printf("Parse error %s\n", pe.toString()); }
+ }
+ } catch (Exception e) {}
+
+ /* HAS_GYRO */
+ try {
+ if (line.startsWith("IMU cal along")) {
+ String[] bits = line.split("\\s+");
+ if (bits.length >= 8) {
+ accel_zero_along = Integer.parseInt(bits[3]);
+ accel_zero_across = Integer.parseInt(bits[5]);
+ accel_zero_through = Integer.parseInt(bits[7]);
+ }
+ }
+ } catch (Exception e) {}