Changeset 34a42d7 in subsurface


Ignore:
Timestamp:
Mar 30, 2017, 2:44:45 AM (2 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
751626e
Parents:
09b5f9b
git-author:
Dirk Hohndel <dirk@…> (03/30/17 02:30:23)
git-committer:
Dirk Hohndel <dirk@…> (03/30/17 02:44:45)
Message:

Shift fake tank pressures up by 30bar

This is a rather arbitrary value, intended to create actually valid
pressure values for Uwatec Memomouse users - since we treat 0bar as
invalid pressure value, this simply creates an arbitrary '30bar + delta'
to '30bar' consumption graph (since all the Memomouse devices give us is
the pressure delta that was used during the dive).

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/libdivecomputer.c

    r09b5f9b r34a42d7  
    209209                        // don't get the actual start and end pressure, but instead a start pressure
    210210                        // that matches the consumption and an end pressure of always 0
    211                         if (!IS_FP_SAME(tank.beginpressure, 0.0) && (same_string(devdata->vendor, "Uwatec") || !IS_FP_SAME(tank.endpressure, 0.0))) {
    212                                 dive->cylinder[i].start.mbar = lrint(tank.beginpressure * 1000);
    213                                 dive->cylinder[i].end.mbar = lrint(tank.endpressure * 1000);
     211                        // In order to make this work, we arbitrary shift this up by 30bar so the
     212                        // rest of the code treats this as if they were valid values
     213                        if (!IS_FP_SAME(tank.beginpressure, 0.0)) {
     214                                if (!IS_FP_SAME(tank.endpressure, 0.0)) {
     215                                        dive->cylinder[i].start.mbar = lrint(tank.beginpressure * 1000);
     216                                        dive->cylinder[i].end.mbar = lrint(tank.endpressure * 1000);
     217                                } else if (same_string(devdata->vendor, "Uwatec")) {
     218                                        dive->cylinder[i].start.mbar = lrint(tank.beginpressure * 1000 + 30000);
     219                                        dive->cylinder[i].end.mbar = 30000;
     220                                }
    214221                        }
    215222                }
Note: See TracChangeset for help on using the changeset viewer.