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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fill_o2_values() in profile.c: Robert identified the inconsistency of po2
assignmemts when using OC dives as opposed to CCR dives.
This is corrected here. OC dives still need to be processed in this function
because the po2 values have not been initialised anywhere else before
thos code executes.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
The linux.c file is really for just generic Unix systems, so adapt the
.pro file logic to match.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
This patch responds to the side effects that the CCR code has had with
respect to ceilings in OC dives and dive plans. Dive ceilings are now
calculated correctly again.
The following were performed:
1) remove the oxygen sensor and setpoint fields from the gas_pressures
structure.
2) Re-insert setpoint and oxygen sensor fields in the plot_data structure.
3) Remove the algorithm that reads the o2 sensor data and calculates the
pressures.po2 value from function fill_pressures() in dive.c and save
it as a separate function calc_ccr_po2() in profile.c.
4) Activate calc_ccr_po2 from function fill_pressures() in profile.c.
5) Move the relative position of the call to fill_pressures() within the
function create_polt_info_new() in profile.c.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Do not do XML parse on pictures. Currently just ignore them, in the
future we might want to save them somewhere and include them in
Subsurface logs.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
All recorded cylinders are exported to divelogs.de. This potentially
includes cylinders that have not been used.
The start and end pressure for additional cylinders is taken from the
cylinder information. Main tank gets this information from first and
last pressure reading or from the cylinder information if samples are
not available. This should be ok when there is only one cylinder with
pressure sensor, but does not probably work for people having multiple
sensors.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds code to the function fillpressures() in dive.c to
allow calculating o2 pressures, based on the data from the po2
sensors in the system. The following changes were made:
1) add code to perform po2 calculations for CCR with 1, 2 or 3
oxygen sesnors.
2) Add four fields to the gas_pressures structure in dive.h. This
allows communication of data between the function that calls
get_pressures() and the return of partail pressure values to the
calling function.
3) Delete the fields for setpoint and gas partial pressures from
the structure plot_info. All partial pressures (from instruments
as well as calculated) now reside in the pressures structure
that forms part of plot_info.
4) Perform changes in several parts of profile.c to make use of the
pressures structure in plot_info.
[Dirk Hohndel: yet again massive whitespace cleanup]
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds support for importing additional cylinders from
divelogs.de. This also adds support for He on the import.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of trying to use add_event() to reinsert events we simply copy the
memory and adjust the pointers.
Using add_event() lost the gas mix and gas index information on gaschange
events - and this prevent switches between cylinders with the same gasmix
to be rendered correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch does three things:
1) A new function fill_o2_values() is added to profile.c. This
fills all oxygen sesnsor and setpoint values that have been
zeroed before in order to save space in the dive log. This
recreates the full set of sensor values obtained from the
original CCR xml log file.
2) Function fill_o2_values() is activated in function create_
plot_info_new() in profile.c
3) The calling parameters to function fill_pressures() in dive.c
are changed. The last parameter is now a pointer to a structure
of divecomputer. This will be needed in the last patch of the
present series of three patches.
[Dirk Hohndel: minor whitespace cleanup]
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>