mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cylinders which have lesser pressure in the end are used
Make cylinders that have at least 5bar less pressure in the end than in the beginning considered "used". Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f291eb6a79
commit
485fde8979
1 changed files with 4 additions and 0 deletions
|
@ -292,6 +292,8 @@ void get_selected_dives_text(char *buffer, int size)
|
|||
}
|
||||
}
|
||||
|
||||
#define SOME_GAS 5000 // 5bar drop in cylinder pressure makes cylinder used
|
||||
|
||||
bool is_cylinder_used(struct dive *dive, int idx)
|
||||
{
|
||||
struct divecomputer *dc;
|
||||
|
@ -299,6 +301,8 @@ bool is_cylinder_used(struct dive *dive, int idx)
|
|||
if (cylinder_none(&dive->cylinder[idx]))
|
||||
return false;
|
||||
|
||||
if ((dive->cylinder[idx].start.mbar - dive->cylinder[idx].end.mbar) > SOME_GAS)
|
||||
return true;
|
||||
for_each_dc(dive, dc) {
|
||||
struct event *event = get_next_event(dc->events, "gaschange");
|
||||
while (event) {
|
||||
|
|
Loading…
Add table
Reference in a new issue