Commit graph

2545 commits

Author SHA1 Message Date
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
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
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
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
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
0778e3e18c divelogexportdialog.cpp: fix a 'uninitialized variable' warning
DiveLogExportDialog::export_depths()

We set a default value of 'unit' which will silence the warning itself.
Then hope that the compiler will respect the argument order i.e. call
get_depth_units() (which sets 'unit') before using *unit as the last
argument passsed to put_format().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:36:28 -07:00
Lubomir I. Ivanov
8c8943bf00 globe.cpp: fix a NO_MARBLE warning
Make eventFilter() return a value for NO_MARBLE.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:35:53 -07:00
Lubomir I. Ivanov
bf3253f390 configuredivecomputerdialog.ui: fix a UIC warning
"gridLayout_1" is used twice. Re-order the grid layouts as 1, 2, 3.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:35:31 -07:00
Lubomir I. Ivanov
341eb05f83 MainWindow: prevent a possible crash on "re-plan"
MainWindow::on_actionReplanDive_triggered():

If a dive in the divelist does not have a "DC Model" for some reason,
selecting "re-plan" from the menu will pass a NULL value
current_dive->dc.model to strcmp() and break before the debug output.

To fix that we check if the said .model value is NULL.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:35:15 -07:00
Miika Turkia
8fcc074b49 Support for importing Poseidon MK6 logs
This patch adds support for importing the logs from a Poseidon MK6
rebreather. This DC produces logs that contain of a .txt file that has
all the meta data and a .csv file that contains the sample readings. The
CSV file is different from the others in that it has a line per each
sample reading at given time. Thus we have to merge all the lines from
one point in time into one sample reading of ours.

[Dirk Hohndel: addressed some compiler warnings]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-26 20:33:50 -07:00
Dirk Hohndel
f81d316570 Correctly place the first gas label in drop to bottom mode
When dropping to the bottom in plan (and add) mode, the gas label was
placed along the diagonal line from (0,0) to the second dive data point
(i.e. the one at the end of the "at deptch" segment). That looks terrible,
the label needs to be along the segment that we are spending at the
bottom.

This patch fixes that problem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21 14:27:50 -07:00
Anton Lundin
856ec092b7 Configure support for OSTC, Mk.2/2N/2C
First out is firmware updates.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:12:37 -07:00
Anton Lundin
02dcae3eca Add a icon for the Suunto Vyper Family config page
This adds a icon to the Vyper config page. The image is taken by me of
my Suunto Vyper. Thats the reason for the quality.

Question: Would it be ok to grab a PR image from Suunto's web page to
use here? If so they got better ones...

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:12:16 -07:00
Anton Lundin
8439e72bb1 Style cleanup
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:12:04 -07:00
Anton Lundin
1c2ddd62c1 Disable update firmware button for OSTC3 for now
We currently don't support update firmware for the OSTC3. Where waiting
for support in libdivecomputer for that, so disable that button for now.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:11:48 -07:00
Anton Lundin
c11e2fbb6f Fix spelling in configure dive computer tool tips
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:11:21 -07:00
Gehad elrobey
fae86eb4ce HTML: Export unit preferences to settings file
Working on HTML exports to support imperial and metric units and also
custom selected units based on subsurface preferences.
User selected units is exported to settings file that will be mainly used
by listlib javascript file.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:04:01 -07:00
Dirk Hohndel
71d21c375c Recalculate the decompression if the date / time of a dive changes
The pre-existing tissue load going into a dive can change if the start
time of a dive changes. Therefore we need to recalculate the ceiling when
editing start time (or date) of a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 17:40:11 -07:00
Dirk Hohndel
e1db94ea0c Correctly edit dive date/time when editing manually entered dives
While the existing code worked fine for editing that start date or time of
dives downloaded from a dive computer or imported from some other source,
for manually entered dives this did not work and the date or time was
always reset to the original time once the changes were saved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 17:34:53 -07:00
Giuseppe Bilotta
4de44e6c9f TableView: fix button sizing
Ensure that there is no (clipped) overflowfrom the header.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:24:15 -07:00
Giuseppe Bilotta
58ac3b8f86 Fix tableview margins
The previous hard-coded solution for GTK+ didn't work on HiDPI, and a
comment hinted that even on Mac OS X it might need tuning. Find a more
generic solution that should work regardless of platform and style,
based purely on the geometries reported by the style itself.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:24:08 -07:00
Giuseppe Bilotta
dfec501e7a Resolution-independent trash icon
Also, generate the corresponding pixmap only once, and distribute it to
all models that need it.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:23:36 -07:00
Giuseppe Bilotta
60702f104c Resolution-indepent dive pictures
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:23:27 -07:00
Giuseppe Bilotta
048f18db85 Resolution-independent DiveEventItem icon sizes
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:23:18 -07:00
Robert C. Helling
5f44fdd9cf Make planner work again for CCR dives
The latest CCR patches had rendered the planner not usable for CCR dives.
This patch corrects this (and reenables the CCR set point column for
segments). The problem was that a new member setpoint of struct divepoint
had been introduced, but there was already po2 which had the same meaning.
This patch merges the two and renames them setpoint to prevent future
confusion.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:07:07 -07:00
Anton Lundin
74f27a0a39 Add support to reset OSTC3 settings to default
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:22:22 -07:00
Anton Lundin
b2a66eab14 Wire up more settings in the OSTC3 settings
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:21:38 -07:00
Anton Lundin
0c7cc03892 Add a more settings to the OSTC3 settings
This adds the settings not previously available in the OSTC3 settings.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:21:01 -07:00
Anton Lundin
a3a9fd405c Create a Advanced settings page for OSTC3
This creates a Advanced settings page for the OSTC3 and moves the deco
settings off to that page.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:20:54 -07:00
Anton Lundin
ba603f882b Add GAS settings to the gas screen
These settings are gas related so they fitted in the spare space in the
gas screen.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:20:44 -07:00
Tomaz Canabrava
1180b5d2d3 Fix plus icon position based on the theme
I hope this time I got it right. basically, the old code
tried to guess where the plus icon should be with a fairly
bad set of defauults.

This one patch asks for the Qt style where everything is and
uses that knowledge to make it be in a more sane position.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Giuseppe Bilotta <giuseppe.bilota@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:18:38 -07:00
Giuseppe Bilotta
32ab2b34d3 Unify icon metrics
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:15 -07:00
Giuseppe Bilotta
72b256de62 actually use defaultIconSize()
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:11 -07:00
Giuseppe Bilotta
5a2db2db4b Define auxiliary functions for metrics
Collect font, font metrics and icon size functions in a separate module.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:07 -07:00
Giuseppe Bilotta
f18bcd6607 Dynamic dive trip list column widths
Compute the default widths for the columns in the dive trip list from
their header and (expected) content length rather than some fixed pixel
sizes.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:03 -07:00
Giuseppe Bilotta
10351b3495 Make TableView resolution independent
Don't hard-code column widths or icon sizes/positions. Instead, compute
them from the fonts used.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:15:58 -07:00
Giuseppe Bilotta
d8f756fe14 Dynamic ToolTipItem metrics
Instead of hard-coding the icon sizes and spacing, compute them from the
font sizes, that Qt auto-computes from the displya DPI.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:15:53 -07:00
Giuseppe Bilotta
0171368b6d Dynamic StarWidget metrics
The default IMG_SIZE and SPACING in the StarWidget are not appropriate
for HiDPI displays. Replace them with StarMetrics which are
auto-computed from the (default) font size (which Qt determines from the
display DPI settings).

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:15:44 -07:00
Anton Lundin
29851d956f Fix the type of the for the Suunto max depth
The type is now a double. It was a int during development, but due to
the feet/128 precision i changed it to a Double, but the default value
wasn't changed type on.
All the Qt tools swallowed the number there without complaining but the
Qt designer insisted on changing it to a double.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:11:51 +02:00
Anton Lundin
fce83b953d Fix column order for OSTC3 diluent table
The fist column is the O2% value, and was handled like that in the data.
It was only the column header that was wrong.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:11:16 +02:00
Anton Lundin
882986dfdf Save columnwith of Ostc3 settings tables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:09:15 +02:00