- tick = parse_int(words[i++]);
-
- word(words[i++], "a:");
- accel = parse_int(words[i++]);
-
- word(words[i++], "p:");
- pres = parse_int(words[i++]);
-
- word(words[i++], "t:");
- temp = parse_int(words[i++]);
-
- word(words[i++], "v:");
- batt = parse_int(words[i++]);
-
- word(words[i++], "d:");
- drogue = parse_int(words[i++]);
-
- word(words[i++], "m:");
- main = parse_int(words[i++]);
-
- word(words[i++], "fa:");
- flight_accel = parse_int(words[i++]);
-
- word(words[i++], "ga:");
- ground_accel = parse_int(words[i++]);
-
- word(words[i++], "fv:");
- flight_vel = parse_int(words[i++]);
-
- word(words[i++], "fp:");
- flight_pres = parse_int(words[i++]);
-
- word(words[i++], "gp:");
- ground_pres = parse_int(words[i++]);
-
- word(words[i++], "a+:");
- accel_plus_g = parse_int(words[i++]);
-
- word(words[i++], "a-:");
- accel_minus_g = parse_int(words[i++]);
-
- word(words[i++], "GPS");
- gps = new AltosGPS();
- gps.nsat = parse_int(words[i++]);
- word(words[i++], "sat");
-
- gps.gps_connected = 0;
- gps.gps_locked = 0;
- gps.lat = gps.lon = 0;
- gps.alt = 0;
- if ((words[i]).equals("unlocked")) {
- gps.gps_connected = 1;
- gps.gps_time = new AltosGPSTime();
- i++;
- } else if (words.length >= 40) {
- gps.gps_locked = 1;
- gps.gps_connected = 1;
-
- gps.gps_time = new AltosGPSTime(words[i], words[i+1]); i += 2;
- gps.lat = parse_coord(words[i++]);
- gps.lon = parse_coord(words[i++]);
- gps.alt = parse_int(strip_suffix(words[i++], "m"));
- gps.ground_speed = parse_double(strip_suffix(words[i++], "m/s(H)"));
- gps.course = parse_int(strip_suffix(words[i++], "°"));
- gps.climb_rate = parse_double(strip_suffix(words[i++], "m/s(V)"));
- gps.hdop = parse_double(strip_suffix(words[i++], "(hdop)"));
- gps.h_error = parse_int(strip_suffix(words[i++], "(herr)"));
- gps.v_error = parse_int(strip_suffix(words[i++], "(verr)"));
- } else {
- gps.gps_time = new AltosGPSTime();
- }
- word(words[i++], "SAT");
- gps_tracking = new AltosGPSTracking();
- gps_tracking.channels = parse_int(words[i++]);
- gps_tracking.cc_gps_sat = new AltosGPSSat[gps_tracking.channels];
- for (int chan = 0; chan < gps_tracking.channels; chan++) {
- gps_tracking.cc_gps_sat[chan] = new AltosGPSSat();
- gps_tracking.cc_gps_sat[chan].svid = parse_int(words[i++]);
- gps_tracking.cc_gps_sat[chan].c_n0 = parse_int(words[i++]);
- }
+ tick = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "a:");
+ accel = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "p:");
+ pres = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "t:");
+ temp = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "v:");
+ batt = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "d:");
+ drogue = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "m:");
+ main = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "fa:");
+ flight_accel = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "ga:");
+ ground_accel = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "fv:");
+ flight_vel = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "fp:");
+ flight_pres = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "gp:");
+ ground_pres = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "a+:");
+ accel_plus_g = AltosParse.parse_int(words[i++]);
+
+ AltosParse.word(words[i++], "a-:");
+ accel_minus_g = AltosParse.parse_int(words[i++]);
+
+ gps = new AltosGPS(words, i);