Add dive tags and support invalid dives

This started out as a way to keep dives in the dive list but being able to
mark them as 'invalid' so they wouldn't be visible (with an option to
disable that feature).

Now it supports an (at this point, fixed) set of tags that can be assigned
to a dive with 'invalid' being just one of them (but one that is special
as it gets some additional support for hiding such dive and marking dives
as (in)valid from the divelist).

[Dirk Hohndel: merged with the latest code and minor changes for coding
	       style and consistency. Ensure divelist is marked as
	       modified when changing 'invalid' tag]

Signed-Off-By: Jozef Ivanecký (dodo.sk@gmail.com)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Ďoďo 2013-04-09 17:54:36 +02:00 committed by Dirk Hohndel
parent 68545465ba
commit ed3f67bc33
9 changed files with 198 additions and 5 deletions

13
dive.h
View file

@ -28,6 +28,18 @@
#define SEAWATER_SALINITY 10300
#define FRESHWATER_SALINITY 10000
/* Dive types definition */
#define DTYPE_INVALID 1
#define DTYPE_BOAT 2
#define DTYPE_SHORE 4
#define DTYPE_DRIFT 8
#define DTYPE_DEEP 16
#define DTYPE_CAVERN 32
#define DTYPE_ICE 64
#define DTYPE_WRECK 128
#define DTYPE_CAVE 256
#define DTYPE_ALTITUDE 512
#define DTYPE_POOL 1024
/*
* Some silly typedefs to make our units very explicit.
@ -342,6 +354,7 @@ struct dive {
pressure_t surface_pressure;
duration_t duration;
int salinity; // kg per 10000 l
int dive_tags;
struct divecomputer dc;
};