Add tankpressure parsing for UDDF files

David McNett sent me some example Cochran CAN file data, along with his
UDDF exports of same.  I still have absolutely no idea how to decode the
CAN files (although the subsurface decrypting code seems to correctly
decrypt the data, and I see binary patters rather than just noise), but
at least I can make sure we parse the UDDF portion better.

See also

  https://github.com/nugget/cochran2uddf

for David's tool to convert the Cochran CSV exports into UDDF.

Data-source: David McNett <nugget@macnugget.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add some more cochran data parsing code/comments

The code is pretty useless, the comments perhaps equally so.  I'm trying
to figure out what the data pattern is for the cochran CAN files.  There
definitely *is* a pattern, but it actually seems to be different for the
files of different people - and it's not obvious in any case.

There probably are multiple versions of the format, and there might be
things like "David has a high-pressure sensor, and Alex does not" going
on too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Update cochran depth precision: it's in 3-inch increments

The Cochran CSV depth exports are indeed in tenths of feet, but the
decimal is always 0, 3, 5 or 8.  Where the 3 and 8 are obviously 0.25
and 0.75 rounded up to one decimal place.

So Cochran does seem to be very much about imperial units, with depth
and cylinder pressure scaled by four (depth in quarter-foot increments,
pressume in 4-psi increments)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add a few more conversion helper functions to dive.h

Convert feet to mm, psi to mbar, and F to mkelvin.  We do this elsewhere
too, but I'm going to need it for the Cochran CSV files, so let's do the
helpers now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
cochran: add support for importing the exported CSV files

The Cochran Analyst software can export the basic dive information as
CSV files (comma-separated values).

Individual CSV files contain just one particular type of information:
depth, temperature or cylinder pressure, which is rather inconvenient.
However, the way subsurface works, you can just import these CSV files
all as individual dives, and then subsurface will automatically merge
the dives with the same date and time - and in the process it will also
merge all the samples.

So it turns out that we don't really need any special handling.  You can
literally just do

     subsurface <list-your-cochran-export-files-here>

and you're all done.

Of course, the CSV files really *are* pretty useless, since they don't
contain all the nice information about where the dive took place etc.
So you literally just get the dive profile.  But that's better than
getting nothing at all.

I'd love to actually be able to parse the real native Cochran Analyst
software CAN files, but in the meantime this is at least a starting
point.  And if I'm ever able to parse those nasty CAN-files, this makes
comparisons with the exports much easier.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fix cochran CSV pressure data import

The cochran CSV pressure data is actually in units of '4 psi', not in
just psi.  That seems to be the resolution cochran internally keeps
things in, and unlike the depth reading there's no conversion to
standard units in the export (for depth, the quarter-foot depth
resolution is converted to tenths of feet when exporting).

Yeah, none of this makes any sense to me either, but I knew it was the
case.  I had just forgotten that factor-of-four when I did the importer.

With this fix, I get the same subsurface data (modulo some rounding
differences particularly for temperature) whether I go through David
McNett's UDDF converter, or just import the CSV data directly.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Update to new sane libdivecomputer interfaces

This does mean that you have to build subsurface against a new version
of libdivecomputer, and that version is likely going to have various
slightly incompatible changes.  But the new interfaces allow for easily
adding new supported dive computers without subsurface having to be
updated for each new vendor and model, so some slight pain is definitely
worth it this time.

I'm not even going to try to have some backwards-compatible version
here, the libdivecomputer interface changes are so extensive.  Native
enumeration of devices is just the smallest part of it: the constants
and types that libdivecomputer uses now have much nicer names that all
start with DC_ or dc_, so you don't get the kinds of name clashes we had
with "gasmix_t" etc.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>