<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 05 Nov 2014, at 17:37, Willem Ferguson <<a href="mailto:willemferguson@zoology.up.ac.za">willemferguson@zoology.up.ac.za</a>> wrote:</div><div><br></div>Willem,</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: CourierNewPSMT; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;">1) This patch has an unintended consequence: The ending cylinder pressure for the diluent cylinder (as seen on the equipment tab) is changed to reflect that of the ending pressure of the oxygen cylinder. The diluent cylinder index for the Poseidon diluent is the dreaded and infamous 1. We hardcode the cylinder IDs here while reading in the dive log because it is very specific to the Poseidon. In addition, even though these specific two cylinders have already been assigned to enum values of oxygen and diluent respectively, we are in the process of setting up the cylinders, so we cannot already use the functions that use these enum values.</span><br style="font-family: CourierNewPSMT; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: CourierNewPSMT; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;">So:  dive->cylinder[1].sample_end.mbar for this sample dive has a value of 141, that of the oxygen cylinder. The correct ending value for this variable is 137. I have carefully looked around the code around line 600 in file.c but cannot see the cause of this problem. Run the code with and without your patch and see the difference.</span><br style="font-family: CourierNewPSMT; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></blockquote></div><div><br></div>my suspicion is that something fishy is going on in gas pressures.c in 
<pre style="margin-top: 0px; margin-bottom: 0px;"><!--StartFragment-->populate_pressure_information<!--EndFragment--></pre><div>and the functions called from there. Right now, I am not able to follow the logic with diluent handling there but maybe, since you wrote that, you can more easily debug this (figure out when the different gases are actually used) than me.</div><div><br></div><div>BTW, I think the prototypes should be in header files and not in profile.c</div><div><br></div><div>Best</div><div>Robert</div><div><br></div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;">--                                                                              <br>.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO <br>Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics  <br>                      Scientific Coordinator                                   <br>                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik    <br>print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339       <br>    stupid .sig\n";   <a href="http://www.atdotde.de">http://www.atdotde.de</a> </span>
</div>
<br></body></html>