[PATCH] Identify event 0x07 on Suunto d9-style computers as Below Floor.

Jef Driesen jefdriesen at telenet.be
Mon Aug 5 04:35:12 UTC 2013


Michael,

I'm fine with renaming the unknown event. This unknown event was added 
specifically for the Suunto event, and not as a general purpose unknown 
event. (Nearly all events originate from the Suunto backends, and a few 
have been re-used by the other backends.)

On 2013-07-26 19:49, Michael Andreen wrote:
> This event is started when you accumulate more deco time and stops when
> you get above the floor and deco time starts decreasing.

I found this commit messages very confusing because it's all about a 
"below floor" event, while the commit message explains going "above the 
floor". Your commit message for the subsurface counterpart is more 
intuitive. Can you re-use that one?

"This event is on when accumulating deco time. Once you reach the floor
deco time will start decreasing and the event will stop. Going below the
floor again will re-activate the event."

> diff --git a/include/libdivecomputer/parser.h 
> b/include/libdivecomputer/parser.h
> index a92e653..6af143b 100644
> --- a/include/libdivecomputer/parser.h
> +++ b/include/libdivecomputer/parser.h
> @@ -73,7 +73,7 @@ typedef enum parser_sample_event_t {
> 	SAMPLE_EVENT_SAFETYSTOP_MANDATORY,
> 	SAMPLE_EVENT_DEEPSTOP,
> 	SAMPLE_EVENT_CEILING_SAFETYSTOP,
> -	SAMPLE_EVENT_UNKNOWN,
> +	SAMPLE_EVENT_BELOW_FLOOR,
> 	SAMPLE_EVENT_DIVETIME,
> 	SAMPLE_EVENT_MAXDEPTH,
> 	SAMPLE_EVENT_OLF,

As we already have a CEILING event to indicate the diver ascended above 
the decompression ceiling, I propose to rename the BELOW_FLOOR event to 
just FLOOR. It's shorter and consistent with CEILING, where we also 
don't include the "above" part.

To maintain backwards compatibility, I also propose we add a #define to 
map the old name to the new one:

#define SAMPLE_EVENT_UNKNOWN SAMPLE_EVENT_FLOOR

The old name becomes deprecated, but existing code will still compile, 
and we can apply this patch to the stable release-0.4 branch. Later on, 
when breaking backwards compatibility (in the master branch), we can get 
rid of the #define again.

You forgot to update the array in examples/universal.c with the new 
name.

Jef


More information about the subsurface mailing list