summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar willem ferguson <willemferguson@zoology.up.ac.za>2014-10-13 21:19:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-13 23:15:41 +0200
commitc8eb2dccc5acbd11388373bf70edb2f4e73d2323 (patch)
treef978624e58c084a9db092603ed26c828c0124248 /dive.h
parent5d1bc11ab75eee9f2f79d2cd40132ec1885ee1a6 (diff)
downloadsubsurface-c8eb2dccc5acbd11388373bf70edb2f4e73d2323.tar.gz
CCR patch: Reorganise the oxygen partial pressure calculations
This patch responds to the side effects that the CCR code has had with respect to ceilings in OC dives and dive plans. Dive ceilings are now calculated correctly again. The following were performed: 1) remove the oxygen sensor and setpoint fields from the gas_pressures structure. 2) Re-insert setpoint and oxygen sensor fields in the plot_data structure. 3) Remove the algorithm that reads the o2 sensor data and calculates the pressures.po2 value from function fill_pressures() in dive.c and save it as a separate function calc_ccr_po2() in profile.c. 4) Activate calc_ccr_po2 from function fill_pressures() in profile.c. 5) Move the relative position of the call to fill_pressures() within the function create_polt_info_new() in profile.c. 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.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/dive.h b/dive.h
index af5049fab..694817b44 100644
--- a/dive.h
+++ b/dive.h
@@ -123,6 +123,7 @@ extern int units_to_sac(double volume);
extern int gas_volume(cylinder_t *cyl, pressure_t p);
extern int wet_volume(double cuft, pressure_t p);
+
static inline int get_o2(const struct gasmix *mix)
{
return mix->o2.permille ?: O2_IN_AIR;
@@ -135,10 +136,10 @@ static inline int get_he(const struct gasmix *mix)
struct gas_pressures {
double o2, n2, he;
- double sensor[3];
- double setpoint;
};
+extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2);
+
extern void sanitize_gasmix(struct gasmix *mix);
extern int gasmix_distance(const struct gasmix *a, const struct gasmix *b);
extern struct gasmix *get_gasmix_from_event(struct event *ev);
@@ -261,10 +262,6 @@ struct divecomputer {
struct divecomputer *next;
};
-
-extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2, const struct divecomputer *dc);
-
-
#define MAX_CYLINDERS (8)
#define MAX_WEIGHTSYSTEMS (6)
#define W_IDX_PRIMARY 0