Scaling of cylinder pressures in profile
Willem Ferguson
willemferguson at zoology.up.ac.za
Mon Nov 11 03:50:25 PST 2019
On 2019/11/11 11:38, Berthold Stoeger wrote:
> On Montag, 11. November 2019 09:05:18 CET Willem Ferguson wrote:
>> There appears to be a bug in Subsurface. Check the attached dive log and
>> the rendering of cylinder pressures. Also see attached screenshot. I did
>> not notice this until now. Is it perhaps the last merge base don my PR
>> that causes this?
> Funnily enough, this seems to be an old bug that now becomes active. Consider
> this code in calculate_max_limits_new():
>
> for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
> int mbar = dive->cylinder[cyl].start.mbar;
> if (mbar > maxpressure)
> maxpressure = mbar;
> if (mbar < minpressure)
> minpressure = mbar;
> }
>
> If you have less than MAX_CYLINDERS cylinders (i.e. in 100% of cases), mbar
> will evaluate to 0. Thus, minpressure will be 0 in all cases. This code never
> worked.
>
> What happens now is that this part of the code actually starts to work. But if
> you don't have an "air integrated" computer, you will not have pressure
> readings,
But, for non-AI dives, you have start and end pressures for each
cylinder, typed in manually. For AI dives (as far as I can make out),
start and end pressures are evaluated by the software.
> so minpressure will remain the minimum start-pressure of any of your
> cylinders.
This appears to be the appropriate procedure.
>
> That gives the funky effect you see.
>
> Possibility 1: if minpressure == maxpressure (meaning that we found no
> pressure reading), set minpressure to 0. This will restore the old behavior
> for non-air integrated computers.
>
> Possibility 2: correctly determine the minimum pressure by looking at the
> profile data not the *events*.
I think the profile data are actually used to initialise the min and max
pressures for an instrumented cylinder and it might therefore not be
necessary to inspect the actual cylinder pressure values during the
dive. Which events do you refer to here? Gas change events? I know for
some dive computers an automatic gas change event is created right at
the start of the dive.
Is it necessary that the loop should go all the way to MAX_CYLINDERS ??
Surely, if there are only two cylinders then it could stop at an index
of 1 ?? The question, of course, is how would dives behave that have
some pressure for one or 2 cylinders but no pressure data for other.
That is the situation that I am in with a sidemount configuration. Since
I have only one sensor, I need to write the data for the second cylinder
on my slate and then enter that by hand in the Equipment panel.
Kind regards,
willem
--
This message and attachments are subject to a disclaimer.
Please refer to
http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf
<http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf> for
full
details.
More information about the subsurface
mailing list