summaryrefslogtreecommitdiffstats
path: root/save-xml.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-07 20:08:29 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-07 21:03:39 -0800
commit9d80e7bfe47726e1f27be323088eb7d36f14c854 (patch)
tree584d33e44d80a1be22abfd36fc0ce296550d2554 /save-xml.c
parenta72597189ddccf4e495b52d964d175477414abb9 (diff)
downloadsubsurface-9d80e7bfe47726e1f27be323088eb7d36f14c854.tar.gz
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>
Diffstat (limited to 'save-xml.c')
-rw-r--r--save-xml.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/save-xml.c b/save-xml.c
index 1d38cc1b8..fb9eb413a 100644
--- a/save-xml.c
+++ b/save-xml.c
@@ -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");
}