Add a shortcut to Configure dive computer dialog

This adds a shortcut, Ctrl+Shift+C to jump into the Configure dive computer
dialog.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set a max value for the custom text in OSTC3

The device supports a up to 60 chars custom text. This limits the
LineEdit to that amount, so users see when they reach the max limit.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove now obsolete forward declaration

We now include the Ui header file, so we can remove the forward
declaration.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a icon to the OSTC, Mk.2/2N config line

The icon comes from heinrichsweikamp.com, the same as the ostc3.png did.

I've emailed with Matthias Heinrichs at HW and they have given us
permission to use both the ostc3.png and ostc2n.png under the GPL v2.

They also can provide the hi-res originals if anyone needs to do more
work on these icons.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cleanup syntax and styling in Configure DC

This cleans up some styling and syntax in the Configure Dive Computer
code path.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Compare image times and sample times as signed ints

The problem that we were comparing signed and unsigned ints was originally
found by Lubomir. As image times can be negative (and the comparison should
fail in that case) we need to compared them as signed.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Copy the configure OSTC3 ui to the OSTC UI

Just renumber the ui components. _3 for OSTC.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change the OSTC3 copied ui to be sane for OSTC

The OSTC supports a bit different functionalities than the OSTC3 does.

The "unsupported" bits are
setBrightness
setCalibrationGas
setCompassGain
setDiveMode - Bult into setDecoType (OC/CCR)
setDiveModeColor - Lots of different colors
setFlipScreen
setLanguage - Controlled via flashing different firmwares
setPressureSensorOffset
setUnits
setSetPointFallback
setCcrMode - there are some ppO2 reading functionality in the fist gen
             OSTC that we don't care about, and the rest is controlled
             via choosing a CCR deco algorithm

Also the OSTC have a notion of number of dives it has done, so this adds
ui for that value.

There are also differences in how some values are handled. Ex the OSTC
don't have fixed samplerates that you can choose between. You can rather
just set your sample rate to X seconds.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change the salinity setting for OSTC

On the OSTC's the salinity is in kg/l and is stored as kg/l * 100

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Debug code to simulate read/write to OSTC memory

This adds debug code to simulate the read and write to OSTC memory
dumps.
The OSTC configuration happens via writing whole 512 byte blocks to the
memory and this code is useful when debugging that process

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Decode configuration data from OSTC

This adds code to decode the configuration blocks from the OSTC.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Decode CF configuration data from OSTC

This adds code to decode the custom functions data.

We only decode the relevant CF's. The relevant ones are chosen by which
ones have corresponding settings in the OSTC3.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Debug code for OSTC CF

This code is to debug the rest of the existing CF's, so we can look at
the rest of the values.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Write config data to the OSTC

This adds code that writes configuration data to the OSTC. As we don't
look at all the values in the OSTC config blocks, we read the current
blocks and only change the values we can change.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Finished Cochran dive log import

I fixed up the decode and finished the parse for Cochran EMC, Commander
and Gemini computers. I suspect that this code may only work with files
from certain versions of Cochran Analyst. It works with my own CAN files
and with the samples that came with Analyst v4.01v.

A seemingly arbitrary offset of 0x4914 is needed to access data.
The previous code uses 0x4a14 and 0x4b14. I suspect these are from
different version of Analyst.

[Dirk Hohndel: whitespace cleanup, add files to subsurface.pro, made sure
	       this compiles without the corresponding patch to
	       libdivecomputer (that isn't upstream, yet), cleaned up the
	       usage of structs, removed a few unused variables]

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create a delegate for gas type columns

This creates a delegate for the type column to choose the type value for
gases that is less confusing then the raw value.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create a delegate for depth and gas components

This creates a delegate to simplify the handling of gas components and
the change depth.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>