diff options
author | Willem Ferguson <willemferguson@zoology.up.ac.za> | 2014-08-26 22:43:59 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-26 14:17:15 -0700 |
commit | bded7d3ae072a25f31a5563f76f46324d743f200 (patch) | |
tree | 201d2d2cda939bc6616a057389e254e58c44b103 /profile.h | |
parent | 6195c139dcf8f803c1a29a50a575a75cfe266ec2 (diff) | |
download | subsurface-bded7d3ae072a25f31a5563f76f46324d743f200.tar.gz |
CCR patch: Create memory space to store cylinder pressures
This patch creates memory space to store both the cylinder pressure of the
diluent cylinder as well as the oxygen partial pressures of up to four
oxygen sensors. This is accomplished within profile.h
1) To the plot_data structure, add:
a) an array diluentpressure[2] to store diluent pressures
b) create o2setpoint and o2sensor[4] to store oxygen partial pressures
2) Define a constant and prototypes to access the cylinder pressures
and their corresponding interpolated values.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.h')
-rw-r--r-- | profile.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -20,9 +20,12 @@ struct plot_data { unsigned int in_deco : 1; int cylinderindex; int sec; - /* pressure[0] is sensor pressure + /* pressure[0] is sensor pressure [when CCR, the pressure of the oxygen cylinder] * pressure[1] is interpolated pressure */ int pressure[2]; + /* diluentpressure[0] is diluent pressure [CCR] + * diluentpressure[1] is interpolated diluent pressure [CCR] */ + int diluentpressure[2]; int temperature; /* Depth info */ int depth; @@ -36,6 +39,7 @@ struct plot_data { int smoothed; int sac; double po2, pn2, phe; + double o2setpoint, o2sensor[3]; //for rebreathers with up to 3 PO2 sensors double mod, ead, end, eadd; velocity_t velocity; int speed; @@ -81,10 +85,13 @@ int get_maxtime(struct plot_info *pi); * partial pressure graphs */ int get_maxdepth(struct plot_info *pi); +#define DILUENT_CYLINDER 1 #define SENSOR_PR 0 #define INTERPOLATED_PR 1 #define SENSOR_PRESSURE(_entry) (_entry)->pressure[SENSOR_PR] +#define DILUENT_PRESSURE(_entry) (_entry)->diluentpressure[SENSOR_PR] #define INTERPOLATED_PRESSURE(_entry) (_entry)->pressure[INTERPOLATED_PR] +#define INTERPOLATED_DILUENT_PRESSURE(_entry) (_entry)->diluentpressure[INTERPOLATED_PR] #define GET_PRESSURE(_entry) (SENSOR_PRESSURE(_entry) ? SENSOR_PRESSURE(_entry) : INTERPOLATED_PRESSURE(_entry)) #define SAC_WINDOW 45 /* sliding window in seconds for current SAC calculation */ |