Commit graph

53 commits

Author SHA1 Message Date
Anton Lundin
e00233051e Add reminder for OSTC Sport to re-enable bluetooth
The OSTC Sport exits bluetooth mode after the loogbook download. To
update the firmware in the OSTC Sport, we need it enabled again, so we
gently remind the user about doing that before continuing.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 16:27:26 -08:00
Dirk Hohndel
b2f4896f3c Whitespace cleanup
Plus removal of a few qDebug() calls I introduced earlier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 21:02:28 -08:00
Dirk Hohndel
4559a26e31 Fix ConfigureDiveComputer class
This caused a crash when trying to call the firmware upgrade from the
downloader - no idea how this worked for the other caller (from the main
menu).

Anyway, with this the "offer to upgrade the OSTC after a download from an
OSTC that doesn't have the latest version" is indeed functional.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 20:46:44 -08:00
Dirk Hohndel
003f5d18b6 Automatic OSTC firmware update: download file and try to install
This successfully downloads the hex file.
The actuall update of the OSTC fails before it gets started with a crash
when the ConfigureDiveComputer object is created.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 10:22:46 -08:00
Dirk Hohndel
0be0cdb046 OSTC firmware update prompt: use the stable changelog files
Heinrichs Weikamp is giving us stable URLs from which we can get the
latest stable version. The parsing is a bit simplistic, but it seems to
work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 07:37:11 -08:00
Miika Turkia
6cf3355508 Include QDebug header - otherwise a compile error
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 06:41:44 -08:00
Dirk Hohndel
2461a731fc Progress towards automatic OSTC firmware updates
Better parsing of the website data, a simpe dialog that informs the user
that they should upgrade their firmware.

Still doen't call the right code path to DO the upgrade.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 06:39:30 -08:00
Dirk Hohndel
52084c80f7 Move OSTC firmware check around a bit
This rearranges the code so we can call it from the download dialog and
tell the user if there is a newer version of the firmware available.

This needs a proper dialog and needs to be hooked up so that the user can
accept the suggestion and go directly to the firmware update code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-27 08:31:51 -08:00
Dirk Hohndel
1c65b2f3c4 Small whitespace fix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-27 08:26:40 -08:00
Robert C. Helling
230ba7ace8 Read current version from H&W web page
This is only partial. It prints the current version string (to be
processed by a regex) via qDebug().

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-27 07:14:31 -08:00
Anton Lundin
44dd4df852 Enable firmware updates for OSTC3/OSTC Sport
This enables the dormant OSTC3/OSTC Sport firmware update code, now when
the hw_ostc3_device_fwupdate call is available in libdivecomputer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:28:59 -08:00
Anton Lundin
ac207ee5ff Emit the successful message the right way
The successful message was emitted in a some what older way then the
other messages so it was always emitted, even on error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:38:50 -08: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
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
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
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
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
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
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
Anton Lundin
9c0e2fc823 Connect the Suunto Vyper Configuration ui
This code connects up the configuration ui with the backing
data structures thats gets read/written to/from the devices.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:32:21 -04:00
Anton Lundin
3836e64092 This adds a ui for Suunto Vyper settings
This builds up a ui to use for all the settings for the Suunto Vyper
family devices. Some of the fields are pure information, eg, max depth
and number of dives, so they are marked read-only.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:32:12 -04:00
Anton Lundin
f3484d1148 Actually set the setpoints to the OSTC3
The setpoints filled in into the ui where never set on the devicedetails
object so they where never propagated to backup or write settings.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 02:43:42 -04:00
Tim Wootton
42c9699870 Futher capitalisation standardisation
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:24:53 -07:00
Joseph W. Joshua
b940f078b5 Show correct path after saving dive computer settings
When backing up dive computer settings to XML, the confirmation
dialog shows the default file path. This patch fixes that by
displaying the correct file if the user changes the backup location.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21 13:31:34 -05:00
Joseph W. Joshua
4e99382c96 Improve on error reporting in the ConfigureDiveComputer class
This patch improves on the error reporting for the dive computer
configuration dialog to use config->lastError.

The previous code was using a different argument in each function,
which lacked uniformity.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
24cb0b0496 Hide status message when an error message is present
To avoid confusion, this code update makes the status text empty whenever
there is an error message. This makes the error message more prominent.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
a9b55d7f0d Change Dive Computer Configuration dialog
Changes the layout of the ConfigureDiveComputer dialog to use a
list of supported computers on the left, with a stacked widget
showing the configurable details.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
cc6c385f33 Start Work on Firmware Update
This patch implements the first step towards OSTC 3 firmware update.
Its not much, just file selection, but I will build up on it from there.

Implements a thread to initiate firmware updates. Currently, this is
for the OSTC 3.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
8aa7fddb22 Add read/write support for OSTC 3 SetPoint settings
Implements support for reading, writing and backup/restore of set point
settings for the OSTC 3.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
9c032f20c0 Add reading and writing of OSTC 3 Dil values
Implements reading, writing and backup/restore of OSTC 3 Dil Values
(setting 0x15 to 0x19)

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
a52beebbe9 Implement saving of OSTC3 Gas Settings
Implements writing OSTC3 gas settings to the device.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
8b39d2fc17 Read OSTC3 GasSetting Values
Implements the reading of OSTC3 Gas Settings. These are settings
0x10 to 0x14

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
045a6fb6b1 Start working on GAS and DIL tables
Start work for gas1-5 and dil1-5.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
5292bcbf21 Add more OSTC 3 settings
I am adding more OSTC 3 settings as I go along. Here, I have
added dive mode and saturation.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
8ccf2e8f1d Change ConfigureDiveComputerDialog to use tabbed interface
Changes the dive computer configuration dialog to use a
tabbed interface. This will make it easier to add new
dive computer models to the interface.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
09ec8a44e5 Add Support for more OSTC 3 Settings
Adds support for more OSTC 3 Settings to the reading, writing,
backup and restore functions. These settings are: last deco,
units, sampling rate, salinity, dive mode colour and compass
gain.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
aad60ef6da Working XML Backup and Restore
The ConfigureDiveComputer class now has functions for complete
XML backup and restore. These dump the loaded settings on a
dive computer to an XML file, and there is an option to
restore them.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
e54d7d9178 Backup basic settings as XML
This patch enables XML backup. We can now save the settings
to an XML file. Currently this backs up just the basic stuff
such as custom text, language and brightness.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
3534e29ae2 Port writing of date and time to new classes
After splitting dive computer configuration classes, the date/time
setting had not been ported. This adds the same to the classes.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
20eb62a98a Polish up on classes
This patch polishes up on all classes added for dive computer
configuration to give a clean workflow. The classes can now
write and read data from the OSTC 3.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:11 -07:00
Joseph W. Joshua
4fc16b1674 Move divecomputer configuration code to different files
This splits the code in configuredivecomputer.cpp into multiple files.
The read and write threads are moved to configuredivecomputerthreads.h/cpp,
and the device details class is moved to devicedetails.h/.cpp

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:06:42 -03:00
Joseph W. Joshua
2432350064 Add brightness setting
Adds a setting to control the device's brightness. Currently I
have only the OSTC 3. Will add more afterwards.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:56 -03:00
Joseph W. Joshua
3e127a059f Create class to write settings to dive computer
Adds a class to write settings to dive computer, and modifies
the existing ones to integrate it.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:56 -03:00