mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
5d1bc11ab7
commit
c8eb2dccc5
4 changed files with 136 additions and 129 deletions
9
dive.h
9
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue