Add CNS and pO2 tracking in the samples

This adds the new members to the sample structure and fills them from
supported dive computers (Uemis SDA and OSTC / Shearwater Predator,
assuming you have libdivecomputer 0.3).

Save relvant values of this to the XML file and load it back. Handle the
new fields when merging dives.

At this stage we don't DO anything with this, all we do is extract them
from the dive computer, save them to the XML file and load them back.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-12-07 20:08:29 -08:00
parent a72597189d
commit 9d80e7bfe4
6 changed files with 40 additions and 2 deletions

View file

@ -334,6 +334,10 @@ static void save_sample(FILE *f, struct sample *sample, const struct sample *pre
fprintf(f, " stoptime='%u:%02u min'", FRACTION(sample->stoptime.seconds, 60));
if (sample->stopdepth.mm != prev->stopdepth.mm)
show_milli(f, " stopdepth='", sample->stopdepth.mm, " m", "'");
if (sample->cns != prev->cns)
fprintf(f, " cns='%u%%'", sample->cns);
if (sample->po2 != prev->po2)
fprintf(f, " po2='%u.%2u bar'", FRACTION(sample->po2, 1000));
fprintf(f, " />\n");
}