<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 13/10/2014 12:27, Robert Helling
      wrote:<br>
    </div>
    <blockquote
      cite="mid:EE102CAD-2BDE-41F6-A12A-8266CA6E5FD7@atdotde.de"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <br>
      <div><br>
        <blockquote type="cite"><span style="font-family: Menlo-Regular;
            font-size: 12px; 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;">What I can do is this:</span><br
            style="font-family: Menlo-Regular; font-size: 12px;
            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: Menlo-Regular; font-size: 12px;
            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;">Create a function in profile.c that does
            the voting. It will reside in profile.c, be plot_info aware,
            and return a double, being the calculated po2 value. Now we
            can remove the sensor values from the pressures structure
            and return the sensor data to the "base level" of plot_info.
            This might also remove the need of a 5th calling parameter
            for get_pressures(). Please comment, will you?</span><br
            style="font-family: Menlo-Regular; font-size: 12px;
            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>
      <br>
      <div>… I think this is much better and should solve all problems
        at once.</div>
      <div><br>
      </div>
      <div>Best</div>
      <div>Robert</div>
      <br>
    </blockquote>
    Robert,<br>
    <br>
    I have had a bit of time to look through the code and, to get things
    working in the shorter term, it looks like there are two options:<br>
    <br>
    1) Use populate_plot_entries() in profile.c, which, while populating
    plot_data, will calculate the appropriate po2 value and store it in
    event->pressures.o2. All the appropriate pointers are in the
    calling parameters for this function. I would then keep the ccr-po2
    calculations as a separate function being called by
    populate_plot_entries(). But this would split the partial pressure
    calculations over more than one function.<br>
    <br>
    2) To call ccr-o2 calculations from fill_pressures, a pointer to
    plot_data would be required in order to get to the o2 sensor values,
    assuming they are not in the pressures structure any more. This
    would imply  changing the calling parameters so that a pointer to
    plot_data is passed in order that the o2 calculations can be done
    with a construct such as <br>
    pressures->o2 = calc_CCR_po2(struct plot_data *entry;  struct
    divecomputer *dc);<br>
    If this were to happen, the most direct route would possibly be to
    make the first calling parameter of fill_pressures() a pointer to
    plot_data. Then, inside that function, a pointer to "pressures" is
    created by <br>
    gas_pressures *pressures = &(entry->pressures);<br>
    or something similar. Then fill_pressures() can pass the pointer to
    plot_data on when it calls CCR-o2 calculations.<br>
    This would keep all the partial pressure calculations together but
    would in effect necessitate a change in the calling parameters for
    fill_pressures.<br>
    <br>
    Please give me comment?<br>
    <br>
    I hope the above is understandable.<br>
    Kind regards,<br>
    wilem<br>
    <br>
  </body>
</html>