Changeset fbaeeec in subsurface


Ignore:
Timestamp:
Feb 3, 2017, 2:45:58 AM (8 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
414d7f2
Parents:
a1c5125
git-author:
Stefan Fuchs <sfuchs@…> (02/02/17 23:28:45)
git-committer:
Dirk Hohndel <dirk@…> (02/03/17 02:45:58)
Message:

Print SAC values from prefs in diveplan

Print the SAC values from preferences into the diveplan.
These are the values used for calculation of gas consumption.

Signed-off-by: Stefan Fuchs <sfuchs@…>
Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/planner.c

    ra1c5125 rfbaeeec  
    826826                        altitude,
    827827                        depth_unit);
     828
     829        /* Get SAC values and units for printing it in gas consumption */
     830        float bottomsacvalue, decosacvalue;
     831        int sacdecimals;
     832        const char* sacunit;
     833
     834        bottomsacvalue = get_volume_units(prefs.bottomsac, &sacdecimals, &sacunit);
     835        decosacvalue = get_volume_units(prefs.decosac, NULL, NULL);
     836       
     837        /* Reduce number of decimals from 1 to 0 for bar/min, keep 2 for cuft/min */
     838        if (sacdecimals==1) sacdecimals--;
    828839       
    829840        /* Print the gas consumption next.*/   
     
    831842                snprintf(temp, sz_temp, "%s", translate("gettextFromC", "Gas consumption (CCR legs excluded):"));
    832843        else
    833                 snprintf(temp, sz_temp, "%s", translate("gettextFromC", "Gas consumption:"));
     844                snprintf(temp, sz_temp, "%s %.*f|%.*f%s/min):", translate("gettextFromC", "Gas consumption (based on SAC"),
     845                        sacdecimals, bottomsacvalue, sacdecimals, decosacvalue, sacunit);
    834846        len += snprintf(buffer + len, sz_buffer - len, "<div><br>%s<br>", temp);
    835847        for (int gasidx = 0; gasidx < MAX_CYLINDERS; gasidx++) {
Note: See TracChangeset for help on using the changeset viewer.