*****SPAM***** Re: [PATCH] Cylinder pressure interpolation and end pressure display for CCR
Robert C. Helling
helling at atdotde.de
Sat Nov 8 07:57:27 PST 2014
On 08 Nov 2014, at 16:06, Willem Ferguson <willemferguson at zoology.up.ac.za> wrote:
Willem,
> On reflection on your comment on magic numbers, I can see how you sigh at my remarks. Thank for your patience! In the next patch that I do I will remove that one statement.
>
no worries.
>
> On 08/11/2014 16:21, Robert C. Helling wrote:
>> Willem,
>>
>>
>>
>>> Am 08.11.2014 um 13:34 schrieb Willem Ferguson <willemferguson at zoology.up.ac.za>:
>>>
>>> in file.c, for Poseidon input, ensure that the cylinder index is
>>> hard-coded by setting sample->sensor to 0.
>>> 2) For the three cases above, ensure that function
>>> populate_pressure_information() in gaspressures.c assigns the
>>> correct cylinder indices. This is performed by using a small
>>> lookup-table, rather than using complex if--else constructs.
Maybe I misunderstood. Are you saying that the Poseidon computer always reports oxygen as gas 0 and diluent as gas 1?
All I meant, in subsurface, it should be possible to assign any cylinder index to them (even when currently they always happen to get the same, just not make that assumption about the future and other rebreathers) and then in the cylinder structure have (as we have) a member that gives you the role of that cylinder (OC, O2 or diluent) and (as we have) have helper functions that return the cylinder index of the O2 and (current) diluent (even though one could use the convention that in CCR mode that is always the “current cylinder”). I think this abstraction leads to much more readable and extendable code.
The rest of the code (plotting, interpolation, gas use) should then only access this information via the member and the helper functions, like for example in interpolation
switch (cylinder.cylinder_use) {
OC:
interpolate_assuming_constant_sac;
break;
O2:
interpolate_assuming_constant_rate;
break;
DILUENT:
dont_try_to_inerpolate;
break;
}
Best
Robert
--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling Elite Master Course Theoretical and Mathematical Physics
Scientific Coordinator
Ludwig Maximilians Universitaet Muenchen, Dept. Physik
print "Just another Phone: +49 89 2180-4523 Theresienstr. 39, rm. B339
stupid .sig\n"; http://www.atdotde.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141108/712a0832/attachment.sig>
More information about the subsurface
mailing list