Robert,
I have finally seen the light. I apologise for a swathe of confusing messages today. I have diagnosed the problem and it should be pretty easy to fix. What I should have seen in two minutes has taken me several hours of work.

Your patch causes all references to cylinder 0 to be returned as a reference to cylinder 1. So, in principle, cylinder 0 cannot be referenced. The logic that does the cylinder pressure calculations are critically dependent on being able to reference cylinder 0 because of the required interpolation structures that must have an index of 0. So, what happens at the moment is that the oxygen cylinder pressures are overwritten over the diluent pressures because references to the oxygen pressures (index 0) are returned as index 1, thus overwriting the data for cylinder 1. Therefore the end pressures are the same for both oxygen and diluent cylinders. The diluent series is slightly longer, therefore the start of the diluent series is not overwritten.

Unless you think that the problem should be solved elsewhere, I will invert the logic about cylinder numbers within gaspressures.c so that, when the oxygen pressures is addressed it will create a 'pseudo-cylinder 0' and work with that.

Would this be a suitable solution or would you like to do something else?
Kind regards,
willem

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

Reply via email to