Commit graph

2537 commits

Author SHA1 Message Date
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
Anton Lundin
5a394aaff6 Make ConfigureDiveComputerDialog ui a class member
Almost all of our other classes have the ui class as a class member in
the controller code. This switches ConfigureDiveComputerDialog to that
model.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:08:18 +02:00
Anton Lundin
3785c76657 Enable/Disable Update Firmware button based on dc
Disable the Update Firmware button if you choose a device that we don't
support update firmware for.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:07:00 +02:00
Anton Lundin
40bc4b629a Don't allow writing before we got data
Don't allow creation of backup files or writes to the computer before we
know we got some data, either from a backup file or from the actual
device.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:06:34 +02:00
Anton Lundin
51ef56fbcb Set limits for Saturation/Desaturation on OSTC3
The default max value for a QSpinBox is 99. The default Saturation
factor for the OSTC3 is 110%. This code sets the max, min and default
values on those spinboxes.
The values comes from me reading the assembler code for the OSTC3.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:03:17 +02:00
Giuseppe Bilotta
3d11904f59 Remove double include
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15 22:53:10 +02:00
Anton Lundin
0b85f59e87 255% as limit for Saturation/Desaturation on OSTC3
The default max value for a QSpinBox is 99. The default Saturation
factor for the OSTC3 is 110%. This code raises the max values to 255
which is as far as i've read the ostc3_interface.odt the max value.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15 14:51:21 +02:00
Salvo 'LtWorf' Tomaselli
4cdb80c4cd Export to DiveShare
Adds the possibility of exporting dives to DiveShare.

Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:33:46 +02:00
Dirk Hohndel
64d1ccc550 Setup defaults for some of the OSTC3 settings
This is still missing lots of values which are now set to 0 with rather
unfortunate consequences (for example, setting Saturation and Desaturation
to 0 turns off the NDL / Deco calculations). So this code right now is
quite broken.

But at least this fixes the reported crash and gets some valid data
initialized.

Fixes #744

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:32:15 +02:00