On 08 Nov 2014, at 16:06, Willem Ferguson <[email protected]> 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 >>> <[email protected]>: >>> >>> 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
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
