CCR patch: Import and store oxygen sensor data

This patch allows the importing of oxygen sensor and setpoint data from
Poseidon CCR dive logs.
1) Change parse-xml.c to read up to three oxygen sensor values from xml.
   and to store the information in sample structures
2) Change parse-xml.c to read o2 setpoint values fro xml and to store
   it in sample structures
3) Change dive.c to delete all sensor and setpoint values where
   subsequent samples have sensor/setpoint values that are the same.
4) Change profile.c to store the sensor/setpoint values from the samples
   into plotinfo.
5) Change the sample Poseidon xml log in the dives directory to ensure
   the correct order and hierarchy of the dive and divecomputer nodes.

[Dirk Hohndel: minor cleanup, removed debug code, whitespace]

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
willem ferguson 2014-10-11 09:49:48 +02:00 committed by Dirk Hohndel
parent 2282035a4d
commit 46bb02e8fc
4 changed files with 41 additions and 7 deletions

View file

@ -865,6 +865,14 @@ static void try_to_fill_sample(struct sample *sample, const char *name, char *bu
return;
if (MATCH("cns.sample", get_uint8, &sample->cns))
return;
if (MATCH("sensor1.sample", double_to_o2pressure, &sample->o2sensor[0])) // CCR O2 sensor data
return;
if (MATCH("sensor2.sample", double_to_o2pressure, &sample->o2sensor[1]))
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))
return;
if (MATCH("heartbeat", get_uint8, &sample->heartbeat))