On 03/11/2014 09:48, Miika Turkia wrote:
On Mon, Nov 3, 2014 at 3:02 PM, Willem Ferguson <[email protected] <mailto:[email protected]>> wrote:

    Calculate correct 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 (cylinder 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. These open circuit cylinders would have cylinder indices
    of 2 and larger.

Will hard coding the diluent cylinder index be sufficient for us? If we have always oxygen cylinder on index 0 and diluent on cylinder 1, then I guess hard coding might be sufficient, but if there can be variation with different rebreathers, then it would make sense to have the diluent and oxygen cylinders assigned dynamically per dive.

Otherwise we should probably just use define to have the diluent and oxygen cylinders named properly so one don't need to guess what the numbers mean.

miika

Thanks, Miika,

It is a difficult question to answer because there are different approaches that could be adopted.

One could have coded:

if (dc->dctype==CCR etc.) cylinderindex=1; // MUCH simpler than the current patch.

But this is obscure code for someone else doing code development later on and who does not understand the existing logic. Therefore the way it is implemented in the current code, which is (I hope) much more understandable. But your argument is to get the existing logic clear in the first place.

In a way, one wants to leave as much flexibility because one is not sure, in expanding this code, what problems will arise in future. My personal suspicion is that for all CCR with a 100% oxygen cylinder and a diluent cylinde , the cylinder assignments will be as they are at present (and with my very limited knowledge and experience I do not know of a CCR system that is configured otherwise). This would favour a more hard coded approach.

You guys have the experience. Please advise??  Robert, your opinion?

Kind regards,
willem


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

Reply via email to