Commit graph

6328 commits

Author SHA1 Message Date
John Van Ostrand
0996908dd8 Added close button to print preview window title bar.
Without this I was only able to close it by choosing to print.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 07:47:06 -07:00
Dirk Hohndel
b2af700a42 Remove debug output in preference setting
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 07:46:24 -07:00
Dirk Hohndel
3515ad71c1 Divelist: remove units from header, add tooltip
This should help with the issues we are having with alignment / visibility
of the relevant information in the divelist.

Most people will never switch the units (or maybe switch them once, the
first time they use Subsurface). So having the units shown in the table
header quickly becomes redundant - yet having the units in there causes
all kinds of layout issues.

This patch adds a tooltip to both the header and the main data area of the
divelist. The tooltip shows the column name plus unit and the column
header no longer shows the units.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 07:40:22 -07:00
Dirk Hohndel
669da22d8c Allow the user to switch to a gas in a specific tank
When entering a gas switch manually, explicitly show the different tanks
that are available and correctly switch between different tanks with the
same gas.

See #702

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 16:25:00 -07:00
Dirk Hohndel
1291d100f6 Ugly hack to work around broken Qt5.3.2 for Windows cross builds
Checking this in to make sure I don't end up creating broken installers
again. I doubt that this is useful for anyone but me - but then, I don't
think anyone but me creates Windows installers.

Background - when Fedora 20 updated the cross-built version of Qt for
Win64 something broke. Subsurfae installed with those DLLs will crash.
Replacing the older 5.3.1 DLLs fixes this for now, so I have a directory
with just those DLLs and simply replace them in the staging directory
before calling makensis.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 15:10:32 -07:00
Miika Turkia
05b76410d6 Use bottom temperature on Suunto SDM imports
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 15:07:47 -07:00
Dirk Hohndel
2b8043b82b Create better version numbering for Windows
I don't think this will be a problem for the other OSs, but it needs a bit
more testing, especially on the Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 13:01:26 -07:00
Dirk Hohndel
0e0d6135af Don't install Windows 64bit binaries on 32bit system
Also warn people installing 32bit binaries on a 64bit system

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 13:01:19 -07:00
Lubomir I. Ivanov
d5f19c43c9 Divelist: make the column headers for units left aligned
Fixes #739

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 09:29:14 -07:00
Lubomir I. Ivanov
9e4cc81068 qt-qui.cpp: set the locale codec to UTF-8 on Win32
This makes QFile::encodeName() work and filenames
with special chars on Win32 can be opened again.

Fixes #740

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 09:28:11 -07:00
John Van Ostrand
3b5781508c Eliminate packed struct for Cochran
Removed the packed struct and replaced with byte offsets.
Fixed salinity for EMC.
Added start temp for CMDR and Gemini.

[Dirk Hohndel: whitespace cleanup]

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 09:05:15 -07:00
Dirk Hohndel
4d9c30d424 Explicit first gas only on first sample
Instead of the 30 second heuristic we only assume that this is an explicit
first gas if the event coincides the first sample.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 16:27:10 -07:00
John Van Ostrand
1899d99d1c Fixed RegExp bug
This prevented import of log files other than CSV and TXT.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:18:29 -07:00
John Van Ostrand
35df344b03 Added missing files (metrics.cpp and diveshareexportdialog.cpp) to CMakeLists.txt
It now compiles and links properly under cmake.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:18:01 -07:00
John Van Ostrand
884f653176 Added Cochran CAN files to the Open Logbook dialog
Subsurface can now open CAN files as an alternative to importing.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:16:02 -07:00
Dirk Hohndel
e32ba4d6d8 Improve tank handling for Cobalt
This isn't Cobalt specific, this is specific to dive computers that
indicate the first tank that's in use with a gaschange event that
coincides with the first sample.

We need to make sure that we suppress showing that gas change event
(regardless which cylinder it goes to) and instead set the correct
cylinder index from the very start of the dive.

This works with the test data I have and doesn't seem to break thing with
any of the files that I tried... but I'm worried that this is not the
right way to do things.

Fixes #742

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:04:19 -07:00
Lubomir I. Ivanov
874754e22b dive.h: add a variant of FOR_EACH_PICTURE
This prevents a warning caused by -Waddress, that the address
of 'displayed_dive' will always be defined.

Exact macro variant suggested by Dirk.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 09:10:12 -07:00
Dirk Hohndel
70a2e91f1c Assigment in if statements
This is one of the warnings that I agree with. The original code was very
hard on my eyes... the explicit comparison to NULL is just so much easier
to understand when reading the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:43:33 -07:00
Lubomir I. Ivanov
85df7ebb02 cochran.c: make cochran_predive_event_bytes() return 0
It seems that an iteration will happen even if the function
returns 0, but this looks like a non-breaking change.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:40:27 -07:00
Lubomir I. Ivanov
469f42f8d5 cochran.c: mark 'ascent_rate' as unused
cochran_parse_samples():
'ascent_rate' can be used at some point so we mark it
as unused with (void)

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:40:03 -07:00
Lubomir I. Ivanov
e64a25d715 cochran.c: coding style cleanup
- empty lines
- indentation
- { placement
- others...

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:39:26 -07:00
Miika Turkia
4bc9b7748b Parse meta information from Seaber log
This will parse date information from Seabear log file and skips the
"header" data to allow parsing of the CSV content.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:25:45 -07:00
Miika Turkia
8da71c7d90 Add test dive for Seabear HUDC
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:25:34 -07:00
Miika Turkia
70d4b25146 Fix reading of CDATA elements
If the element we are parsing is of type XML_CDATA_SECTION_NODE, we have
to check the node's name from the parent.

Fixes #718

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:25:29 -07:00
Anton Lundin
ee7c86f206 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>
2014-10-27 15:41:55 -07:00
Anton Lundin
0e3a9328bc 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>
2014-10-27 15:41:51 -07:00
John Van Ostrand
49401eec0b 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>
2014-10-27 15:21:19 -07:00
Anton Lundin
b5dedcfba4 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>
2014-10-27 14:41:49 -07:00
Anton Lundin
0afc52579b 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>
2014-10-27 14:41:44 -07:00
Anton Lundin
e2b579881f 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>
2014-10-27 14:41:37 -07:00
Anton Lundin
84c0ea951a 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>
2014-10-27 14:41:31 -07:00
Anton Lundin
4bcb416780 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>
2014-10-27 14:41:07 -07:00
Anton Lundin
29ee1896a4 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>
2014-10-27 14:40:51 -07:00
Anton Lundin
353868e6ec 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>
2014-10-27 14:40:41 -07:00
Anton Lundin
eacf8fc623 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>
2014-10-27 14:40:09 -07:00
Robert C. Helling
a2f9f0c8bf 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>
2014-10-27 14:39:00 -07:00
Anton Lundin
aeebe8519d 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>
2014-10-27 14:36:40 -07:00
Anton Lundin
ae4015dc10 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>
2014-10-27 14:36:13 -07:00
Anton Lundin
8f89d3cbec 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>
2014-10-27 14:35:50 -07:00
Anton Lundin
d835e6342d 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>
2014-10-27 14:35:18 -07:00
Anton Lundin
8ba6736ca8 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>
2014-10-27 14:35:05 -07:00
Dirk Hohndel
7b4bf88313 Correctly save a re-planned dive
In commit a85a219df3 ("Add ability to replan a dive that we planned
before") I completely mishandled the saving of the replanned data.
How embarrassing.

Fixes #747
See #527

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 12:37:27 -07:00
Dirk Hohndel
5888fa0778 Update translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 10:02:11 -07:00
Dirk Hohndel
15a982f90f Quiet some warnings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 09:48:38 -07:00
Miika Turkia
5ec3d0dca0 Set old setpoint value, if new one is not recorded
Since the setpoint value is initialized as zero, we have to set the
previous value if we do not have a current reading.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 09:32:44 -07:00
Miika Turkia
8b6d49092b Do not zero setpoint value when duplicate
We cannot zero setpoint value upon import if the current and previous
values are zero. This is because on setpoint context a value of 0 means
open circuit.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 09:32:22 -07:00
Lubomir I. Ivanov
1f1bb71d78 divelistview.cpp: move a variable in a Q_OS_MAC branch
Not used on other OS and triggers a warning.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:38:34 -07:00
Lubomir I. Ivanov
8b85cafa69 profile.c: remove a variable which is set but not used
fill_o2_values():
struct gas_pressures *pressures;

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:38:19 -07:00
Lubomir I. Ivanov
2a9b0c7ebc profile.c: remove unused variables in calculate_ccr_po2()
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:37:57 -07:00
Lubomir I. Ivanov
8bc5f388b5 deco.c: remove unused variables in add_segment()
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:37:39 -07:00