Robert,

On 12/10/2014 22:16, Robert C. Helling wrote:
On 12 Oct 2014, at 18:41, Willem Ferguson <[email protected]> 
wrote:


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

You seem to have removed the logic that the deco/planner uses to detect if we 
are in CCR mode, namely that there is pO2 provided.

You have changed the interface of the fill_pressures function. If you do so, 
make sure this does not break stuff. If you use Qt Creator that has the “find 
usages” function which is very useful for this kind of task.

Can you fix this?

Best
Robert

--

I think we have different understandings of the logic.

Your understanding: if a po2 is supplied, this means CCR and the value of po2 by itself is sufficient to detect a CCR dive. Therefore the code can use po2 to test for CCR-type calculations.

My understanding: For CCR dives NO po2 is supplied, only the o2 sensor data. In order to detect a CCR dive, one needs to interrogate dc->dctype. If dc->dctype is CCR, then it is a CCR dive and, in get_pressures(), one first needs to calculate the po2, given the sensor data. That is the reason for feeding the o2 sensor data to function get_pressures(), making use of the gas_pressures structure.

The second last option on get_pressures() (the one that tests for po2) does, at present, NOT cover CCR because the preceeding section covers CCR. I left this section that tests for po2 for a non-CCR case (maybe SCR??) that may potentially insert po2 somewhere among the calculations.

The calculate_deco_information() function assumes a po2 value which, in the case of CCR dive,has not been calculated yet. It first needs to be calculated. The header of calculate_deco_information explicitly mentions that it uses po2 to detect CCR-type dives and that it should execute BEFORE get_pressures(), i.e. before the po2 has been calculated. This is the most likely source of the problem.

The question is: should CCR po2 be calculated within get_pressures(), or somewhere else? My feeling is yes, this is the functional block that calculates all the partial pressures. Why should the calculation of po2 be done elsewhere?

However, the calculation of po2 could potentially be moved to populate_plot_entries(). If you feel this would be better, I would do this with pleasure. But then the calculations of partial gas pressures would be spread over different functions. However, you guys that have been involved in this project so long have miles more experience than me, so I would be more than happy to do this in a way you think logical.

Please share your thoughts  and/or suggestions :-)
Kind regards,
willem

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to