Commit graph

58 commits

Author SHA1 Message Date
Anton Lundin
b0260c6025 Emit 100% progress after quick actions
These actions are basically instant. The infrastructure are in place so
if someone feels for building a proper progress, be my guest, but this
just makes sure the progress bar acts like in the other cases to the
user.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21 17:04:04 +12:00
Anton Lundin
3f805dda1d Emit progress from suunto vyper config operations
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21 17:03:32 +12:00
Anton Lundin
cbdaec4d9d Emit progress events from firmware updates
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21 17:03:28 +12:00
Anton Lundin
1d67bae745 Add infrastructure to emit progress from threads
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21 17:03:21 +12:00
Anton Lundin
0787d941a0 Refactor device handling threads
This refactors the device handling threads into having one common
ancestor class.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21 17:03:14 +12:00
Anton Lundin
04ac309725 Cleanup OSTC settings debug code
The old OSTC settings debug code was a bit ugly.

This cleans that up and contains all the ugly-ness behind the
DEBUG_OSTC ifdef.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 07:37:12 -08:00
Anton Lundin
266c3f9aa2 Remove debug code
This debug code was accidentally added in b2f4896f ("Whitespace cleanup")

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 16:27:44 -08:00
Dirk Hohndel
db0c1b834a Another whitespace update
grmbl.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 00:16:47 -08:00
Anton Lundin
e503b5c707 Move Constructor next to rest of the class
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 23:59:17 -08:00
Anton Lundin
8e33c0ce38 Lift code out to write_ostc_settings
This lifts the writing of settings out of the run() method and
introduces better error handling when libdivecomputer returns a
error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 23:59:12 -08:00
Anton Lundin
79327d7181 Lift code out to write_ostc3_settings
This lifts the writing of settings out of the run() method and
introduces better error handling when libdivecomputer returns a
error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 23:58:29 -08:00
Anton Lundin
89e197a16b Lift code out to read_ostc_settings
This lifts the reading of settings out of the run() method and
introduces better error handling when libdivecomputer returns a
error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 23:58:03 -08:00
Anton Lundin
3655a726c2 Lift code out to read_ostc3_settings
This lifts the reading of settings out of the run() method and
introduces better error handling when libdivecomputer returns a
error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 23:57:57 -08:00
Anton Lundin
ec369141a3 Lift code out to write_suunto_vyper_settings
This lifts the writing of settings out of the run() method and
introduces better error handling when libdivecomputer returns a
error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 23:56:31 -08:00
Anton Lundin
046b7ef313 Lift code out to read_suunto_vyper_settings
This lifts the reading of settings out of the run() method and
introduces better error handling when libdivecomputer returns a
error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 23:56:23 -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
Anton Lundin
6abbe6f8be Minor style cleanup
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 20:18:59 -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
d6f417b5bf Read and write alarm time correctly for Stinger
The Stinger stores the alarm time in seconds, instead of minutes as the
Vyper does it. This corrects for that.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:39:02 -08:00
Anton Lundin
a696da9146 Make sure the device open error reaches the user
This is a bit ugly fix to make sure the right error message reaches the
user in case of being unable to open the device.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:38:31 -08:00
Anton Lundin
5a81746797 Style cleanup
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:46:38 -06:00
Anton Lundin
60f09bbd42 Remove libdivecomputer ifdefs for configuring OSTC
The hw_ostc_device_eeprom_read / hw_ostc_device_eeprom_write functions
have bin in libdivecomputer since v0.1.0, so there was an error when the
read settings part ended up behind ifdef's.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-02 07:06:12 -08:00
Lubomir I. Ivanov
de49957a52 configuredivecomputerthreads.cpp: conditionally define read_ostc_cf()
Fixes a warning. The function is only used if
DC_VERSION_CHECK(0, 5, 0) is defined.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:31:14 -08:00
Anton Lundin
d3ca1df765 Change the OSTC3 macros to have a ; in the end
This changes the OSTC3 READ_SETTING/WRITE_SETTING macros into something
that can have a ; in the end which makes some editors auto-indent it better.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:51:38 -08: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
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
7afc65b99b Check return value after firmware updates
This reports back a error to the user if the firmware update failed.

We should re-wire this to have a log-function that gets called from
libdivecomputer via the context to get an actual error message.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21 14:42:29 -07:00
Anton Lundin
581288fb46 Fix compability with libdivecomputer < 0.5.0
hw_ostc_device_fwupdate was introduced after 0.4.2 so ifdef it to
libdivecomputer >= 0.5.0. The scope of users interested in this feature
probably isn't big enough to justify a bump of our dependencies to a
unreleased version of libdivecomputer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21 14:41:28 -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
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
839bcaaf70 Correct OSTC3 read/write of pressure sensor offset
The OSTC3 stores the pressure sensor offset as a signed 8-bit integer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:36:28 -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
d266fce08e Read/Write more settings from the OSTC3
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:22:05 -07:00
Anton Lundin
b2a9de7cb4 Simplify some OSTC3 Code with macros
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:21:57 -07:00
Anton Lundin
c06a7d6e6d Define settings ids for the new OSTC3 settings
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:21:23 -07:00
Anton Lundin
624f0e9b24 Fix 02 typo, rename O2 members in devicesettings
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:20:20 -07:00
Anton Lundin
9e958c80fa Add missing compass gain read from the OSTC3
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:19:58 -07:00
Anton Lundin
556474e4dd Add a missing break after OSTC3 settings write
There was a missing break after writing the settings to the OSTC3. It
caused us to fall down into the default case and saying that the
operation was unsupported.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:10:18 +02:00
Anton Lundin
d025d5bbb6 Set the diluent values from the right buffer
The OSTC3 settings code read the data from the computer into spData, but
set the data into the devicedetails object from dilData.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:09:38 +02:00
Anton Lundin
0c4f027386 Read and write desaturation from OSTC3's
This adds missing code to read and write the desaturation factor to and
from OSTC3's.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15 14:51:03 +02:00
Anton Lundin
d7cae093be Check that the model is a supported one
This code adds some crude checks to verify that the device is a
supported one before we actually read/write from it. This is to
white/black-list devices so we don't write or read memory that we don't
know anything about.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:26:32 +02:00
Anton Lundin
daa5c14cbf This adds read/write of Suunto Vyper configs
This implements the reading and writing of the configuration varables
from the Suunto Vyper family devices.

Everything here is implemented based on the excellent information on:
http://www.sarnau.info/papers:suunto_vyper

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:31:53 -04:00
Anton Lundin
60d0b622a9 Remove double-assignment to rc varable
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:30:25 -04:00
Anton Lundin
f353ef023f Store the setpoint values read from OSTC3
The setpoint values was never stored in the deviceinfo object.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 02:43:34 -04:00
Dirk Hohndel
f61ee20ba3 Don't use switch with just one case
This should be an if statement.

Gets rid of build warning.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-02 07:35:58 -07:00
Joseph W. Joshua
7264ec2fa8 Change presentation of OSTC 3 firmware version
This change changes the way we present the OSTC 3 firmware version to a
correct value, showing the major and minor version number.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-17 14:11:29 -07:00