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 <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2014-10-19 07:07:07 -07:00 committed by Dirk Hohndel
parent 839bcaaf70
commit 5f44fdd9cf
11 changed files with 53 additions and 52 deletions

View file

@ -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])