core: move gas_volume() to cylinder_t

Feels natural in a C++ code base.

The commit is somewhat complex, because it also changes the
return type to volume_t. The units system really needs some
work. :(

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-07-02 11:12:27 +02:00 committed by bstoeger
parent 4cb3db2548
commit 9c726d8d6f
7 changed files with 27 additions and 21 deletions

View file

@ -384,7 +384,8 @@ static double calculate_airuse(const struct dive &dive)
continue;
}
airuse += gas_volume(&cyl, start) - gas_volume(&cyl, end);
// TODO: implement subtraction for units.h types
airuse += cyl.gas_volume(start).mliter - cyl.gas_volume(end).mliter;
}
return airuse / 1000.0;
}