Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added parsing of the CCR setpoint information for Garmin Descent computers. #40

Merged

Conversation

mikeller
Copy link
Member

This is adding support for parsing the setpoint information in logfiles downloaded from Garmin Descent devices.

Screenshot from 2022-11-24 11-25-25

The Garmin devices do not have support for ppO2 sensor input, so they only work in 'fixed setpoint' mode for CCR dives, and dive data records do not contain actual ppO2 values. The ppO2 values are retrofitted to the dive data based on 'setpoint change' events reported by the device. With this change CCR dives downloaded from a Garmin device are correctly classified as CCR dive, and the calculated ceiling / tissue loading graphs are accurate and match the deco stops reported by the device. Before this change, CCR dives were classified as open circuit dives, often resulting in a massively overstated calculated ceiling.

This has been tested for logs with only automated setpoint changes - more test dives are needed to reverse engineer the log file format for manual setpoint changes, as the setpoint fields are not documented in Garmin's documentation for the FIT file format.

Signed-off-by: Michael Keller github@ike.ch

…uters.

This is adding support for parsing the setpoint information in logfiles downloaded from Garmin Descent devices.

The Garmin devices do not have support for ppO2 sensor input, so they only work in 'fixed setpoint' mode for CCR dives, and dive data records do not contain actual ppO2 values.
The ppO2 values are retrofitted to the dive data based on 'setpoint change' events reported by the device. With this change CCR dives downloaded from a Garmin device are correctly classified as CCR dive, and the calculated ceiling / tissue loading graphs are accurate and match the deco stops reported by the device.
Before this change, CCR dives were classified as open circuit dives, often resulting in a massively overstated calculated ceiling.

This has been tested for logs with only automated setpoint changes - more test dives are needed to reverse engineer the log file format for manual setpoint changes, as the setpoint fields are not documented in Garmin's documentation for the FIT file format.

Signed-off-by: Michael Keller <github@ike.ch>
@torvalds
Copy link
Collaborator

Looks sane from a quick scan.

…armin Descent computers.

Also improved the display of setpoint information - switch mode is shown, and auto switch depth is only shown in auto mode.
All of this has been tested.

Signed-off-by: Michael Keller <github@ike.ch>
@dirkhh
Copy link
Collaborator

dirkhh commented Dec 5, 2022

I realize that Linus apparently didn't act on his own approval.
I'm traveling on business (new job is keeping me pretty far away from Subsurface right now) - but will try to give it a good look this week.
Would you mind sharing a sample .FIT file or two? Feel free to send them directly to Linus and me (email addresses are easily found in the git log output :) )

@torvalds torvalds merged commit 6200a79 into subsurface:Subsurface-DS9 Dec 5, 2022
@mikeller mikeller deleted the added_garmin_ccr_setpoint_info branch December 5, 2022 21:37
@mikeller
Copy link
Member Author

mikeller commented Dec 5, 2022

Now that this has been merged, is it the expectation that I make a pull request in https://github.com/subsurface/subsurface to update the submodule version, or will this be done by a maintainer as part of a periodical / pre-release update?

@torvalds
Copy link
Collaborator

torvalds commented Dec 5, 2022

@dirkhh will generally update libdivecomputer somewhat regularly as he makes releases, no need to make a pull request there.

And it is presumably not hugely urgent, since you clearly can and do build your own binaries.

@dirkhh
Copy link
Collaborator

dirkhh commented Dec 6, 2022

This has been merged into Subsurface and will be available in the latest test builds (and will eventually become part of the next release)

mikeller added a commit to mikeller/libdc that referenced this pull request Dec 8, 2022
…o CC for CCR dives.

This might need a bit of discussion.
As a CCR diver I would like to see the ability to properly track the 'on loop' / 'bailed out to open circuit' status directly in Subsurface, because this is an important (or even the most important) bit of status information during a CCR dive. This should extend to the use of the correct ppO2 / gas mix in the deco ceiling / tissue model calculation. My idea for how to do this would be to track the 'type' ('diluent' / 'OC bailout') for every gasmix / tank that is reported by the dive computer. Most CCR capable dive computers that I am familiar with require the user to enter two different gas lists for diluent and bailout, so this should work with the existing libdivecomputer API for these.
> Unfortunately I think making this change in Subsurface will require a bit of work, as the libdivecomputer field capable of tracking the 'type' of a gas or tank (`cache->tankinfo[]`) does not seem to be consumed at all in Subsurface. So this pull request is just providing a prerequisite for the change in Subsurface by populating `tankinfo[]`. In addition to this it also triggers a message on every switch from CC to OC and back, at least giving a visual indication of these diver triggered events. The messages can probably be removed from libdivecomputer again once 'loop status' tracking has been added to Subsurface.
> Also included is a fix of the tab expansion mess that I created in subsurface#40. Apologies for this, I've switched to using a custom `.vimrc` for this project now.

Signed-off-by: Michael Keller <github@ike.ch>
mikeller added a commit to mikeller/libdc that referenced this pull request Dec 8, 2022
This might need a bit of discussion.
As a CCR diver I would like to see the ability to properly track the 'on loop' / 'bailed out to open circuit' status directly in Subsurface, because this is an important (or even the most important) bit of status information during a CCR dive. This should extend to the use of the correct ppO2 / gas mix in the deco ceiling / tissue model calculation. My idea for how to do this would be to track the 'type' ('diluent' / 'OC bailout') for every gasmix / tank that is reported by the dive computer. Most CCR capable dive computers that I am familiar with require the user to enter two different gas lists for diluent and bailout, so this should work with the existing libdivecomputer API for these.
Unfortunately I think making this change in Subsurface will require a bit of work, as the libdivecomputer field capable of tracking the 'type' of a gas or tank (`cache->tankinfo[]`) does not seem to be consumed at all in Subsurface. So this pull request is just providing a prerequisite for the change in Subsurface by populating `tankinfo[]`. In addition to this it also triggers a message on every switch from CC to OC and back, at least giving a visual indication of these diver triggered events. The messages can probably be removed from libdivecomputer again once 'loop status' tracking has been added to Subsurface.
Also included is a fix of the tab expansion mess that I created in subsurface#40. Apologies for this, I've switched to using a custom `.vimrc` for this project now.

Signed-off-by: Michael Keller <github@ike.ch>
mikeller added a commit to mikeller/libdc that referenced this pull request Jan 16, 2023
This might need a bit of discussion.
As a CCR diver I would like to see the ability to properly track the 'on loop' / 'bailed out to open circuit' status directly in Subsurface, because this is an important (or even the most important) bit of status information during a CCR dive. This should extend to the use of the correct ppO2 / gas mix in the deco ceiling / tissue model calculation. My idea for how to do this would be to track the 'type' ('diluent' / 'OC bailout') for every gasmix / tank that is reported by the dive computer. Most CCR capable dive computers that I am familiar with require the user to enter two different gas lists for diluent and bailout, so this should work with the existing libdivecomputer API for these.
Unfortunately I think making this change in Subsurface will require a bit of work, as the libdivecomputer field capable of tracking the 'type' of a gas or tank (`cache->tankinfo[]`) does not seem to be consumed at all in Subsurface. So this pull request is just providing a prerequisite for the change in Subsurface by populating `tankinfo[]`. In addition to this it also triggers a message on every switch from CC to OC and back, at least giving a visual indication of these diver triggered events. The messages can probably be removed from libdivecomputer again once 'loop status' tracking has been added to Subsurface.
Also included is a fix of the tab expansion mess that I created in subsurface#40. Apologies for this, I've switched to using a custom `.vimrc` for this project now.

Signed-off-by: Michael Keller <github@ike.ch>
mikeller added a commit to mikeller/libdc that referenced this pull request Feb 9, 2023
This might need a bit of discussion.
As a CCR diver I would like to see the ability to properly track the 'on loop' /
'bailed out to open circuit' status directly in Subsurface, because this is an
important (or even the most important) bit of status information during a CCR
dive. This should extend to the use of the correct ppO2 / gas mix in the deco
ceiling / tissue model calculation. My idea for how to do this would be to track
the 'type' ('diluent' / 'OC bailout') for every gasmix / tank that is reported
by the dive computer. Most CCR capable dive computers that I am familiar with
require the user to enter two different gas lists for diluent and bailout, so
this should work with the existing libdivecomputer API for these. Unfortunately
I think making this change in Subsurface will require a bit of work, as the
libdivecomputer field capable of tracking the 'type' of a gas or tank
(`cache->tankinfo[]`) does not seem to be consumed at all in Subsurface. So this
pull request is just providing a prerequisite for the change in Subsurface by
populating `tankinfo[]`. In addition to this it also triggers a message on every
switch from CC to OC and back, at least giving a visual indication of these
diver triggered events. The messages can probably be removed from
libdivecomputer again once 'loop status' tracking has been added to Subsurface.
Also included is a fix of the tab expansion mess that I created in
subsurface#40. Apologies for this, I've switched
to using a custom `.vimrc` for this project now.

Signed-off-by: Michael Keller <github@ike.ch>
mikeller added a commit to mikeller/libdc that referenced this pull request Feb 9, 2023
This might need a bit of discussion.
As a CCR diver I would like to see the ability to properly track the 'on loop' /
'bailed out to open circuit' status directly in Subsurface, because this is an
important (or even the most important) bit of status information during a CCR
dive. This should extend to the use of the correct ppO2 / gas mix in the deco
ceiling / tissue model calculation. My idea for how to do this would be to track
the 'type' ('diluent' / 'OC bailout') for every gasmix / tank that is reported
by the dive computer. Most CCR capable dive computers that I am familiar with
require the user to enter two different gas lists for diluent and bailout, so
this should work with the existing libdivecomputer API for these. Unfortunately
I think making this change in Subsurface will require a bit of work, as the
libdivecomputer field capable of tracking the 'type' of a gas or tank
(`cache->tankinfo[]`) does not seem to be consumed at all in Subsurface. So this
pull request is just providing a prerequisite for the change in Subsurface by
populating `tankinfo[]`. In addition to this it also triggers a message on every
switch from CC to OC and back, at least giving a visual indication of these
diver triggered events. The messages can probably be removed from
libdivecomputer again once 'loop status' tracking has been added to Subsurface.
Also included is a fix of the tab expansion mess that I created in
subsurface#40. Apologies for this, I've switched
to using a custom `.vimrc` for this project now.

Signed-off-by: Michael Keller <github@ike.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants