mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Gas usage statistics: don't require gas switch events
Our "get_has_used()" helper only filled in gas usage for cylinders that had a gas change event associated with them. That works really badly for things like CCR, but also simply for cases where the dive computer wasn't necessarily explicitly notified about usage, like sidemount diving etc. Just remove the logic. If some use ends up particularly wanting to ignore some cylinder, they can always do it in the caller instead. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f2a6a76b3e
commit
b9f52d0aff
1 changed files with 0 additions and 12 deletions
|
@ -345,23 +345,11 @@ void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS])
|
|||
{
|
||||
int idx;
|
||||
struct divecomputer *dc;
|
||||
bool used;
|
||||
|
||||
for (idx = 0; idx < MAX_CYLINDERS; idx++) {
|
||||
used = false;
|
||||
cylinder_t *cyl = &dive->cylinder[idx];
|
||||
pressure_t start, end;
|
||||
|
||||
for_each_dc(dive, dc) {
|
||||
if (same_string(dc->model, "planned dive"))
|
||||
continue;
|
||||
if (has_gaschange_event(dive, dc, idx))
|
||||
used = true;
|
||||
}
|
||||
|
||||
if (!used)
|
||||
continue;
|
||||
|
||||
start = cyl->start.mbar ? cyl->start : cyl->sample_start;
|
||||
end = cyl->end.mbar ? cyl->end : cyl->sample_end;
|
||||
if (end.mbar && start.mbar > end.mbar)
|
||||
|
|
Loading…
Reference in a new issue