CCR patch: Calculate the correct partial gas pressures for CCR dives

This patch adds code to the function fillpressures() in dive.c to
allow calculating o2 pressures, based on the data from the po2
sensors in the system. The following changes were made:
1) add code to perform po2 calculations for CCR with 1, 2 or 3
   oxygen sesnors.
2) Add four fields to the gas_pressures structure in dive.h. This
   allows communication of data between the function that calls
   get_pressures() and the return of partail pressure values to the
   calling function.
3) Delete the fields for setpoint and gas partial pressures from
   the structure plot_info. All partial pressures (from instruments
   as well as calculated) now reside in the pressures structure
   that forms part of plot_info.
4) Perform changes in several parts of profile.c to make use of the
   pressures structure in plot_info.

[Dirk Hohndel: yet again massive whitespace cleanup]

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-12 20:46:41 +02:00 committed by Dirk Hohndel
parent 6d65e45787
commit bc9df4652f
3 changed files with 111 additions and 27 deletions

2
dive.h
View file

@ -135,6 +135,8 @@ static inline int get_he(const struct gasmix *mix)
struct gas_pressures {
double o2, n2, he;
double sensor[3];
double setpoint;
};
extern void sanitize_gasmix(struct gasmix *mix);