*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
real time;
real height;
real acceleration;
+ real pressure;
} record_t;
public record_t parse_record(file f, real accel_scale) {
int time_off = 4;
int height_off = 11;
int accel_off = 8;
- if (string_to_integer(data[0]) == 2) {
+ int pres_off = 9;
+ switch (string_to_integer(data[0])) {
+ case 2:
time_off = 4;
accel_off = 9;
+ pres_off = 10;
height_off = 12;
+ break;
+ case 5:
+ time_off = 4;
+ accel_off = 10;
+ pres_off = 11;
+ height_off = 13;
+ break;
}
return (record_t) {
.done = false,
- .time = string_to_real(data[time_off]),
- .height = imprecise(string_to_real(data[height_off])),
- .acceleration = imprecise(string_to_real(data[accel_off]) * accel_scale) };
+ .time = string_to_real(data[time_off]),
+ .height = imprecise(string_to_real(data[height_off])),
+ .acceleration = imprecise(string_to_real(data[accel_off]) * accel_scale),
+ .pressure = imprecise(string_to_real(data[pres_off]))
+ };
}
public void dump(file f) {