Commit graph

434 commits

Author SHA1 Message Date
Dirk Hohndel
ddff93f096 Event name should be a const char *
This avoids a possible warning when calling this function with a string
literal as second argument.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:15:03 -07:00
Anton Lundin
ed9a060d76 More descriptive variable in calls to get_dive_gas
In a previous patch, 37830bdb ("Always show deco gas as dive gas") the
semantic of the last variable was changed. This updates other calls to
this function.

This is nothing but documenting changes.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 09:56:37 -08:00
Dirk Hohndel
c3614424f9 Correcly look at all relevant dive computer structures
When calculating maxima for a dive, we need to take data from all existing
dive computer structures plus potentially also a fake dive computer
structure that is just passed in in order to create a meaningful profile.

Commit 86c961614b ("Actually walk all dive computers, don't just claim
to do so") missed that second case and no longer took the fake_dc into
account, breaking the display of dives that don't have samples.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 07:07:02 +12:00
Dirk Hohndel
f8f5ffa697 Fix build problem
In commit 86c961614b ("Actually walk all dive computers, don't just
claim to do so") I somehow managed to forget one hunk of the patch (I was
editing out debug messages). And I clearly forgot to test compile the
final patch as pushed. Apologies.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-20 06:24:03 +12:00
Robert C. Helling
837dcde0c1 Use SAC from preferences for PSCR oxygen drop
The ratio between SAC and oxygen metabolism rate can be assumed constant
but not the metabolism rate. So we better base our calculation on the ratio
that uses the SAC from the preferences as that pairs well with the O2
consumption from the preferences.

Hence we ran remove the sac parameter from fill_pressures().

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-20 06:16:15 +12:00
Dirk Hohndel
86c961614b Actually walk all dive computers, don't just claim to do so
If the first dive computer had pressure samples, but the second one (and
no higher one) did, then we would draw a flat horizontal line for the tank
pressure graph (but lable it with the correct pressures). This routine
that is hunting for the actual maxima and minima does have to really go
through all dive computers, not just "this one and up".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19 21:52:08 +12:00
Robert C. Helling
881803441e Save predefined SAC
When planning a dive, the gas consumption is based on a user configured SAC.
Thus we should use that SAC and not try to recompute it from samples.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:18:08 +13:00
Robert C. Helling
e219bc70f8 Refactor dctype -> divemode
... and repair a failed rebase (sorry).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:25 -08:00
Willem Ferguson
0de3bc8452 Display CCR setpoint values on the po2 graph
When a CCR dive is viewed and the toolbar button for PO2 is activated,
both the PO2 (green line) and the O2 setpoint (red line) are shown.
This allows evaluation of the PO2 in the CCR loop with respect to the
pre-configured O2 setpoint.

The setpoint graph can be disabled from the Preferences/Graphs tab
by checking the appropriate checkbox.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:18:06 -08:00
Miika Turkia
4f17cd860f Interpolate running depth when necessary
The running depth must be interpolated when sample interval is more than
10 seconds.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03 09:45:25 -08:00
Miika Turkia
e5c3799270 Fix mean depth on info box
The running depth must be divided by current time to get the average
depth.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 09:15:18 -08:00
Dirk Hohndel
cbd7a5df95 Information overlay: include the moving mean depth
Apparently this is useful for some tech divers.
We urgently need an option to turn off the graph and this text, though, as
I am guessing that this is just distracting and annoying to 90+% of our
users.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 11:34:11 -08:00
Dirk Hohndel
b2f4896f3c Whitespace cleanup
Plus removal of a few qDebug() calls I introduced earlier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 21:02:28 -08:00
Anton Lundin
78d782f3e9 Populate the plot info with tts information
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 20:19:13 -08:00
Anton Lundin
b2199a9687 Free event list names on clear_events()
clear_events() just reset the start point of our event list, but didn't
actually free the event names that got "cleared".

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:34:00 -08:00
Robert C. Helling
d67cce2af8 Recording average depth data
This is the calculation that is needed to display a running average in the
profile.

It adds a new member plot_data.running_sum which can be turned into the
running average by dividing by plot_data.time.

Right now this isn't used by the UI.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17 08:05:02 -08:00
Robert C. Helling
aa22e0610c Don't interpolate pressure while dragging waypoints
A profiler session in the planner shows that for deep long dives
a significant amount of CPU time is spent in populate_pressure_information()
which interpolates the cylinder pressure graphs.

This patch introduces a "fast" flag for the replot of the profile
which is active while the mouse button is still pressed and that
suppresses this calculation.

In the future, this flag could be used for other responsiveness tunings
of the plot.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-04 16:26:47 -06:00
Robert C. Helling
fb265c2929 Context menu entry to change setpoint
This patch adds a context menu entry to add a setpoint change
event. In particular, this can be used to turn a logged dive into
a CCR dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:23:45 -08:00
Robert C. Helling
a4679300cc Correctly computer O2 partial pressure
I had forgotten a / 1000.0 in the conversion of partial pressures from (double) bar to (int32) mbar.

Fixes #763

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 07:46:47 -08:00
Anton Lundin
54237cb9a7 Fix warnings in debug_print_profiledata
Use the right format, now when those variables are integers and not
doubles.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:51:59 -08:00
Robert C. Helling
9561fa3f3e Cleaning up pressures
Added comment about meaning of o2pressure in struct plot_info.

Turned some pressures from double (in bar) to pressure_t (in mbar)

[Dirk Hohndel: picked parts of this patch and dropped others]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 13:25:17 +00:00
willem ferguson
514a0e582a Fix issues in CCR handling
In commit 0d7c192e6e ("For CCR dives, the diluent cylinder is the
current cylinder") a few things got broken. This tries to undo those
changes and adds expanded XML output.

1) Calculate correct partial pressure of oxygen to be plotted on
   dive profile, taking into account the oxygen sensor data.
   Currently, erroneously, OC PO2 values are shown, due to an
   erroneous calling parameter to fill_pressures().
2) Read start and end cylinder pressured correctly.  some wrong
   assignments were done in file.c. This is now corrected and the correct
   cylinder pressures are shown in the equipment tab.
3) Write correct cylinder pressures to XML. Currently the data for
   the two cylinders are written to XML the wrong way round
   (diluent pressures = oxygen and vice versa).
4) Expand XML output:
   a) Write oxygen sensor data to XML
   b) Write no_of_02sensors to XML

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 08:57:21 +00:00
Robert C. Helling
d5d7fdc9af For CCR dives, show plot for diluent and O2 cylinder pressures
Also fixes a bug in the diluent pressure interpolation

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 18:02:42 +00:00
Robert C. Helling
0d7c192e6e For CCR dives, the diluent cylinder is the current cylinder
Change the meaning that _the_ cylinder (as we treat it in OC dives) is the
diluent cylinder (rather than the O2 cylinder). This eliminates special
cases. Now, for CCR, we have to handle the O2 cylinder in addition
(rather than the diluent in addition).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 11:45:06 +00:00
Dirk Hohndel
fa181d1ded More CCR code cleanup
Random constants are bad. Let's use the indices that we already calculated
(and true and false if we mean boolean values).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 07:23:20 +00:00
Lubomir I. Ivanov
1617d437d4 profile.c: fix a bug in calculate_gas_information_new()
In a test case loading dives/test35.xml results in a infinite(-like)
loop (Note: possibly requires the partial pressure plots enabled).

calculate_gas_information_new() has an 'if' branch to
update the cylinderindex to a dive's diluent_cylinder_index,
but it does not consider that said index can be set previously
to -1.

This results in a random neighbour memory assigned as
&dive->cylinder[-1].gasmix and passed to fill_pressures(..).

Following the calculations in the function the He gas,
can receive a bad value (e.g. for the test case in the
E+6 ranges).

Said value is then used in DivePlotDataModel()::pheMax()
(defined by MAX_PPGAS_FUNC()) resulting in one of the loops
(the 3rd one) in DiveCartesianAxis::updateTicks() to
loop indefinitely.

Fixes #759

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12 14:41:39 -08:00
Anton Lundin
1990dafda0 Remove leftover last_setpoint
Back in 24c491053c ("Don't overwrite zero setpoints") the filling of
last_setpoint logic was removed. This clears out the last bits left
over.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:23:28 -08:00
Robert C. Helling
cff413f14d The po2 argument of addS_segment is the setpoint, not the pO2 at that time
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:19:18 -08:00
Robert C. Helling
24c491053c Don't overwrite zero setpoints
As we agreed, in memory we don't zero repeated setpoints and thus zero
setpoints don't have to be overwritten by the last setpoint value.

This corrects the deco ceiling with CCR dives that bailout to OC.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:19:08 -08:00
Robert C. Helling
54692fb814 Use the CCR corrected gases for EAD and END calculations
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 11:45:32 -08:00
Robert C. Helling
06ddfc0122 Prepare for PSCR calculations
Calculations for passive semi-closed rebreathers are pretty much like OC
except the pO2 is lower bey a certain (SAC dependent) factor. This patch
introduces the corresponding calculations in case dctype == PSCR which is
so far never set and there is currently no UI for these calculations. As
pO2 is SAC dependent it takes a certain attempt at getting it and drops to
defaults from the prefs otherwise.

As there is no UI at this point and I also don't have any dives, this has
not received much testing, yet, but it compiles. At least.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 07:13:04 -08:00
willem ferguson
40bdd607c0 Calculate nitrogen and helium gas pressures for CCR after import from CSV
Currently the gas pressures stored in structures of pressure are
calculated using the gasmix composition of the currently selected
cylinder. But with CCR dives the default cylinder is the oxygen
cylinder (here, index 0). However, the gas pressures need to
be calculated using gasmix data from cylinder 1 (the diluent
cylinder). This patch allows setting the appropriate cylinder
for calculating the values in the structures of pressure. It
also allows for correctly calculating gas pressures for any
open circuit cylinders (e.g. bailout) that a CCR diver may
use. This is performed as follows:

1) In dive.h create an enum variable {oxygen, diluent, bailout}

2) Within the definition of cylinder_t, add a member: cylinder_use_type
   This stores an enum variable, one of the above.

3) In file.c where the Poseidon CSV data are read in, assign
   the appropriate enum values to each of the cylinders.

4) Within the definition of structure dive, add two members:
   int oxygen_cylinder_index
   int diluent_cylinder_index
   This will keep the indices of the two main CCR cylinders.

5) In dive.c create a function get_cylinder_use(). This scans the
   cylinders for that dive, looking for a cylinder that has a
   particular cylinder_use_type and returns that cylinder index.

6) In dive.c create a function fixup_cylinder_use() that stores the
   indices of the oxygen and diluent cylinders in the variables
   dive->oxygen_cylinder_index and dive->diluent_cylinder_index,
   making use of the function in 4) above.

7) In profile.c, modify function calculate_gas_information_new()
   to use the above functions for CCR dives to find the oxygen and
   diluent cylinders and to calculate partail gas pressures based
   on the diluent cylinder gas mix.

This results in the correct calculation of gas partial pressures
in the case of CCR dives, displaying the correct partial pressure
graphs in the dive profile widget.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 14:13:55 -08:00
willem ferguson
6cf3787a0e Remove code that zeroes out duplicate oxygen sensor and temperature values
Remove the code that changes all duplicate oxygen sensor, setpoint and
temperature values from a dive log to zero. One of the motivations is
that a zero setpoint value indicates an Open Circuit dive segment, not
Closed Circuit Rebreather. The code in dive.c is removed and the comments
for the corresponding restoration code that restores the last known values
into sensor or temperature with zero values is [fill_o2_values()
in profile.c] is changed to apply to the present situation.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 22:13:47 -07:00
Dirk Hohndel
e32ba4d6d8 Improve tank handling for Cobalt
This isn't Cobalt specific, this is specific to dive computers that
indicate the first tank that's in use with a gaschange event that
coincides with the first sample.

We need to make sure that we suppress showing that gas change event
(regardless which cylinder it goes to) and instead set the correct
cylinder index from the very start of the dive.

This works with the test data I have and doesn't seem to break thing with
any of the files that I tried... but I'm worried that this is not the
right way to do things.

Fixes #742

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:04:19 -07:00
Lubomir I. Ivanov
8b85cafa69 profile.c: remove a variable which is set but not used
fill_o2_values():
struct gas_pressures *pressures;

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:38:19 -07:00
Lubomir I. Ivanov
2a9b0c7ebc profile.c: remove unused variables in calculate_ccr_po2()
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:37:57 -07:00
Robert C. Helling
5f44fdd9cf Make planner work again for CCR dives
The latest CCR patches had rendered the planner not usable for CCR dives.
This patch corrects this (and reenables the CCR set point column for
segments). The problem was that a new member setpoint of struct divepoint
had been introduced, but there was already po2 which had the same meaning.
This patch merges the two and renames them setpoint to prevent future
confusion.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:07:07 -07:00
willem ferguson
51a112c8bf CCR patch: Correction of inconsistency in profile.c
fill_o2_values() in profile.c: Robert identified the inconsistency of po2
assignmemts when using OC dives as opposed to CCR dives.
This is corrected here. OC dives still need to be processed in this function
because the po2 values have not been initialised anywhere else before
thos code executes.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:33:46 +02:00
Robert C. Helling
34bb461c3d Reshuffle CCR voting logic and minor clean ups
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:33:46 +02:00
willem ferguson
c8eb2dccc5 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>
2014-10-13 23:15:41 +02:00
willem ferguson
bc9df4652f 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>
2014-10-12 15:23:49 -04:00
willem ferguson
49c9ad199f CCR patch: Oxygen partial pressures
This patch does three things:
1) A new function fill_o2_values() is added to profile.c. This
   fills all oxygen sesnsor and setpoint values that have been
   zeroed before in order to save space in the dive log. This
   recreates the full set of sensor values obtained from the
   original CCR xml log file.
2) Function fill_o2_values() is activated in function create_
   plot_info_new() in profile.c
3) The calling parameters to function fill_pressures() in dive.c
   are changed. The last parameter is now a pointer to a structure
   of divecomputer. This will be needed in the last patch of the
   present series of three patches.

[Dirk Hohndel: minor whitespace cleanup]

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:40:34 -04:00
Anton Lundin
3b30009d7a Remove unused variables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:34:40 -04:00
Linus Torvalds
df4e26c875 Start sanitizing gaschange event information
Decode the gasmix data into a sane format when creating the event, and
add the (currently unused) ability to specify a gas change to a
particular cylinder rather than (or in addition to) the gasmix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 07:45:37 -04:00
Dirk Hohndel
43765d2897 Keeping up the fight for whitespace consistency
Sadly, some of the code being fixed is my own...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-11 07:26:26 -04:00
willem ferguson
46bb02e8fc CCR patch: Import and store oxygen sensor data
This patch allows the importing of oxygen sensor and setpoint data from
Poseidon CCR dive logs.
1) Change parse-xml.c to read up to three oxygen sensor values from xml.
   and to store the information in sample structures
2) Change parse-xml.c to read o2 setpoint values fro xml and to store
   it in sample structures
3) Change dive.c to delete all sensor and setpoint values where
   subsequent samples have sensor/setpoint values that are the same.
4) Change profile.c to store the sensor/setpoint values from the samples
   into plotinfo.
5) Change the sample Poseidon xml log in the dives directory to ensure
   the correct order and hierarchy of the dive and divecomputer nodes.

[Dirk Hohndel: minor cleanup, removed debug code, whitespace]

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-11 07:12:04 -04:00
Robert C. Helling
15a99f8789 Add tissue saturation plot to tooltip
This adds a graphical representation of tissue loadings at the current moment during the dive
to the tooltip box. The layout is inspired by the Sherwater Petrel.Add tissue saturation plot to tooltip

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:48:05 -07:00
Robert C. Helling
3fc9c1e005 Tissue saturation plot a la Sherwater Pretel
This adds a toolbox icon to turn on a tissue plot inspired by the bar
graph of the Sherwater Petrel,

It shows the inert gas partial pressures for individual compartments. If
they are below the ambient pressure (grey line) they are shown in units of
the ambient pressure, if they are above, the excess is shown as a
percentage of the allowed overpressure for plain Buehlmann. So it has the
same units as a gradient factor. Thus also the a gradient factor line (for
the current depth) is shown.

The different tissues get different colors, greener for the faster ones and bluer
for the slower ones.

Positioning and on/off icon action still need some tender loving care.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:46:30 -07:00
Robert C. Helling
d6abb739d9 Helper function for partial pressure calculation
This patch introduces a new structure holding partial pressures (doubles in bar) for
all three gases and a helper function to compute them from gasmix (which holds fractions)
and ambient pressure. Currentlty this works for OC and CCR, to be extended later to PSCR.

Currently the dive_comp_type argument is unused.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:20:25 -07:00
willem ferguson
d1c521ce5e CCR patch: adapt code for diluent cylinder pressures (3)
This patch implements the cylinder pressure calculations for diluent
gas in CCR dive computers. This is the third patch for achieving this.
The following were performed:

1) Add two lines to try_to_fill_sample() in parse-xml so that
   diluent cylinder pressures are stored from XML dive log file
   into structures of sample.
2) Add one line to populate_plot_entries() in profile.c so that
   the diluent cylinder pressures are copied from structures of
   sample to structures of plot_info.
3) add three constant #defines in profile.h
4) change populate_pressure_information() in gaspressures.c in
   order to take into account pressure calculations for the
   diluent cylinder, calling subordinate functions in the
   appropriate way.
5) change create_plot_info_new() in profile.c in order to initiate
   the pressure calculations for the diluent cylinder.
6) Implement two debugging functions (one in profile.c, another
   in gaspressures.c). These debugging functions are activated
   by means of #defines.

Two function calls dealing with oxygen pressure are currently commented
out.  They will be activated in the following patch that attends to CCR
oxygen partial pressure calculation.

[Dirk Hohndel: rather massive whitespace cleanup]

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-11 08:32:10 -07:00