Explicit first gas only on first sample

Instead of the 30 second heuristic we only assume that this is an explicit
first gas if the event coincides the first sample.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-10-28 16:27:10 -07:00
parent 1899d99d1c
commit 4d9c30d424
2 changed files with 2 additions and 2 deletions

View file

@ -131,7 +131,7 @@ bool DiveEventItem::shouldBeHidden()
* Don't bother showing those
*/
struct sample *first_sample = &get_dive_dc(&displayed_dive, dc_number)->sample[0];
if (!strcmp(event->name, "gaschange") && (event->time.seconds < 30 || event->time.seconds == first_sample->time.seconds))
if (!strcmp(event->name, "gaschange") && event->time.seconds == first_sample->time.seconds)
return true;
for (int i = 0; i < evn_used; i++) {

View file

@ -302,7 +302,7 @@ bool is_cylinder_used(struct dive *dive, int idx)
for_each_dc(dive, dc) {
struct event *event = get_next_event(dc->events, "gaschange");
while (event) {
if (event->time.seconds < 30 || event->time.seconds == dc->sample[0].time.seconds)
if (event->time.seconds == dc->sample[0].time.seconds)
firstGasExplicit = true;
if (get_cylinder_index(dive, event) == idx)
return true;