mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
4cb3db2548
commit
9c726d8d6f
7 changed files with 27 additions and 21 deletions
|
@ -258,8 +258,9 @@ std::vector<volume_t> get_gas_used(struct dive *dive)
|
|||
|
||||
start = cyl.start.mbar ? cyl.start : cyl.sample_start;
|
||||
end = cyl.end.mbar ? cyl.end : cyl.sample_end;
|
||||
// TODO: Implement addition/subtraction on units.h types
|
||||
if (end.mbar && start.mbar > end.mbar)
|
||||
gases[idx].mliter = gas_volume(&cyl, start) - gas_volume(&cyl, end);
|
||||
gases[idx].mliter = cyl.gas_volume(start).mliter - cyl.gas_volume(end).mliter;
|
||||
else
|
||||
gases[idx].mliter = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue