Changeset 40f5e2e in subsurface


Ignore:
Timestamp:
May 31, 2017, 9:54:05 PM (3 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
02d3289
Parents:
3ca11912
git-author:
John Van Ostrand <john@…> (05/31/17 19:08:48)
git-committer:
Dirk Hohndel <dirk@…> (05/31/17 21:54:05)
Message:

Cochran import: Removed long tail of 0 depth from profile

The Cochran logs the first 10 to 20 minutes (configurable) of
surface interval in case the diver re-submerges.

Signed-off-by: John Van Ostrand <john@…>
Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/cochran.c

    r3ca11912 r40f5e2e  
    645645        unsigned int sample_size = size - 0x4914 - config.logbook_size;
    646646        int g;
     647        unsigned int sample_pre_offset = 0, sample_end_offset = 0;
    647648
    648649        // Decode sample data
     
    716717                        corrupt_dive = 1;
    717718
     719                sample_pre_offset = array_uint32_le(log + CMD_PREDIVE_OFFSET);
     720                sample_end_offset = array_uint32_le(log + CMD_END_OFFSET);
     721
    718722                break;
    719723        case TYPE_EMC:
     
    757761                        corrupt_dive = 1;
    758762
    759                 break;
    760         }
     763                sample_pre_offset = array_uint32_le(log + EMC_PREDIVE_OFFSET);
     764                sample_end_offset = array_uint32_le(log + EMC_END_OFFSET);
     765
     766                break;
     767        }
     768
     769        // Use the log information to determine actual profile sample size
     770        // Otherwise we will get surface time at end of dive.
     771        if (sample_pre_offset < sample_end_offset && sample_end_offset != 0xffffffff)
     772                sample_size = sample_end_offset - sample_pre_offset;
    761773
    762774        cochran_parse_samples(dive, buf + 0x4914, buf + 0x4914
Note: See TracChangeset for help on using the changeset viewer.