summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2014-06-11 19:48:48 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-11 18:49:28 -0700
commita0f5a74847942a7448d8a6aedc6277cf5436c19b (patch)
tree143438f1b1175f53ef242e8610fd1d41fc75f9c5 /dive.h
parent6a9c4097c04c3b89f63c663ecd232cf70774e2e6 (diff)
downloadsubsurface-a0f5a74847942a7448d8a6aedc6277cf5436c19b.tar.gz
Provide for a dive_computer_type variable within dc structure
This patch lays the foundation for differentiating between open-circuit(OC)dives and rebreather dives (CCR). The following were done: 1) In dive.h add an enum type dive_computer_type 2) In dive.h add two more fields to the dc structure: a) dctype (an enum field indicating dc type) b) no_o2sensor (indicating number of o2 sensors for this dc) 3) In parse-xml.c add a function trimspace that strips any whitespace from a string. This is used by two functions: utf8_string as well as by get_dc_type, described below. The pointer to buffer is not changed in order to ensure consistency when the buffer is freed. 4) In parse-xml.c add a function get_dc_type. This parses the dc_type string from xml and assigns an enum value which will later be returned to the function that parses the dc variables. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index 1aa1facf2..8e4d910d6 100644
--- a/dive.h
+++ b/dive.h
@@ -41,6 +41,8 @@ extern "C" {
#include <stdbool.h>
#endif
+enum dive_comp_type {OC, CCR}; // Flags (Open-circuit and Closed-circuit-rebreather) for setting dive computer type
+
struct gasmix {
fraction_t o2;
fraction_t he;
@@ -217,7 +219,9 @@ struct divecomputer {
depth_t maxdepth, meandepth;
temperature_t airtemp, watertemp;
pressure_t surface_pressure;
- int salinity; // kg per 10000 l
+ enum dive_comp_type dctype; // dive computer type: OC(default) or CCR
+ uint8_t no_o2sensors; // rebreathers: number of O2 sensors used
+ int salinity; // kg per 10000 l
const char *model;
uint32_t deviceid, diveid;
int samples, alloc_samples;