From 5f44fdd9cf6fba073837cbc1d89c6ed3ea28dd76 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sun, 19 Oct 2014 07:07:07 -0700 Subject: Make planner work again for CCR dives The latest CCR patches had rendered the planner not usable for CCR dives. This patch corrects this (and reenables the CCR set point column for segments). The problem was that a new member setpoint of struct divepoint had been introduced, but there was already po2 which had the same meaning. This patch merges the two and renames them setpoint to prevent future confusion. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- parse-xml.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'parse-xml.c') diff --git a/parse-xml.c b/parse-xml.c index e88c9b944..feb39d130 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -895,9 +895,7 @@ static void try_to_fill_sample(struct sample *sample, const char *name, char *bu return; if (MATCH("sensor3.sample", double_to_o2pressure, &sample->o2sensor[2])) // up to 3 CCR sensors return; - if (MATCH("setpoint.sample", double_to_o2pressure, &sample->o2setpoint)) - return; - if (MATCH("po2.sample", double_to_o2pressure, &sample->po2)) + if (MATCH("po2.sample", double_to_o2pressure, &sample->setpoint)) return; if (MATCH("heartbeat", get_uint8, &sample->heartbeat)) return; @@ -1427,7 +1425,7 @@ static void sample_start(void) cur_sample->stoptime.seconds = laststoptime; cur_sample->stopdepth.mm = laststopdepth; cur_sample->cns = lastcns; - cur_sample->po2.mbar = lastpo2; + cur_sample->setpoint.mbar = lastpo2; cur_sample->sensor = lastsensor; } @@ -1442,7 +1440,7 @@ static void sample_end(void) laststoptime = cur_sample->stoptime.seconds; laststopdepth = cur_sample->stopdepth.mm; lastcns = cur_sample->cns; - lastpo2 = cur_sample->po2.mbar; + lastpo2 = cur_sample->setpoint.mbar; cur_sample = NULL; } @@ -2030,7 +2028,7 @@ extern int shearwater_profile_sample(void *handle, int columns, char **data, cha if (data[2]) cur_sample->temperature.mkelvin = metric ? C_to_mkelvin(atof(data[2])) : F_to_mkelvin(atof(data[2])); if (data[3]) - cur_sample->po2.mbar = atof(data[3]) * 1000; + cur_sample->setpoint.mbar = atof(data[3]) * 1000; if (data[4]) cur_sample->ndl.seconds = atoi(data[4]) * 60; if (data[5]) -- cgit v1.2.3-70-g09d2