diff options
| author | Bdale Garbee <bdale@gag.com> | 2013-05-16 00:36:23 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2013-05-16 00:36:23 -0600 | 
| commit | 02d111b1b53ef01fc6e9ab6c4bc60b8af1be0067 (patch) | |
| tree | 8356f4a019969ee99a45e264c87d38555cf316cc /src/kalman/load_csv.5c | |
| parent | 7a2e1f05adad990a6b161865267abf07ffec7a7e (diff) | |
| parent | 7699a55aed3a9a7daeb4c6a5a9a280f43edf455f (diff) | |
Merge branch 'branch-1.2' into debian
Diffstat (limited to 'src/kalman/load_csv.5c')
| -rw-r--r-- | src/kalman/load_csv.5c | 21 | 
1 files changed, 17 insertions, 4 deletions
diff --git a/src/kalman/load_csv.5c b/src/kalman/load_csv.5c index 15e83166..0086c6db 100644 --- a/src/kalman/load_csv.5c +++ b/src/kalman/load_csv.5c @@ -31,6 +31,7 @@ namespace load_csv {  		real	time;  		real	height;  		real	acceleration; +		real	pressure;  	} record_t;  	public record_t parse_record(file f, real accel_scale) { @@ -40,16 +41,28 @@ namespace load_csv {  		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) {  | 
