The Boyle's law compensation compares the ambient pressure to a baseline value,
and adjusts the theory bubble radius accordingly. Currently we use the ceiling
at the last user-entered waypoint (the start of the decompression phase) as the
baseline value. However, in a deep to shallow multi-level dive, decompression
can start earlier, and taking a shallower ceiling leads to a more aggressive
ascent. This is particularly noticeable if the user enters stops during ascent.
With this commit, we take the baseline ambient pressure for Boyle's law
compensation as the deeper of the:
(1) Ceiling prior to ascending during a user-entered portion of the dive, and
(2) Ceiling at the start of the last user-entered waypoint.
This makes the calculated profile more conservative for some deep to shallow
multi-level dives.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In a user provided sample the last column name included "\r\n" which
prevented us from automatically matching that column.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The fixup_dive() function assumes that values that are set already in the
divecomputer and dive structures come from a reliable source - sometimes
dive computers are able to track a maximum depth continuously, so that
value can be larger than the deepest sample and we need to honor that.
But in the case of a manually added dive, the samples define the dive. So
in this case we need to reset the values that were calculated when the
dive was first added so that the user can then edit the dive and reduce
the maximum depth reached in the profile and have that reflected in the
dive list.
Fixes#926
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cleaned up the code in do_uemis_import, this way it should
run a little faster as I am doing the check if the returned
divespot is valid at an earlier point
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
At some point I would like to understand the logic behind
the debug bits, so I am not messing around with them.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Give the user the possibility to attach images to a dive even
when the times do not match
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the gas selection list on a waypoint refers to a gaschange there
influencing the following segments, there must not be a gas selection
on the last manually entered waypoint since from there the planner
handles the gas selection.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds delegates to simplify configuration of setpoint values in the
OSTC's.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The table data is set via role, so retrieve the data via role too.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The callback function was introduced in 0.23, so put it behind that
ifdef.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Assuring that ds isn't NULL, had a few cases
that made SubSurface crash. Have not investigated
the root cause but it's likely that it is related to
the Uemis specific code. Nevertheless, checking ds
non NULL is certainly not a bad thing to do.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the load_uemis_divespot returns false we must assure
we delete the divespot that was created during process_raw_buffer
Also added some comments
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cleaning up track_uemis_divespot because this function is not needed
anymore.
As I am loading the divespots now within do_uemis_import, I also adjusted
the memory calculation - this is not completed yet.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Changed the do_uemis_import to load divespots right after matching
the dive details.
Logic implemented to verify that we are not duplicating divespots by
comparing the uuid from get_dive_site_by_uuid(dive->dive_site_uuid)
with the one from get_dive_site_uuid_by_name
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Deleting unnecessary code to support future design
change coming with the next patch
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added load_uemis_divespot.
This will be used later in do_uemis_import to improve
the amount of divespots that must be loaded actually.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
New routine to support finding a dive spot based on the dive id,
this is needed due to the weird way Uemis is providing data.
This function will be used in the uemis-downloader.c within
do_uemis_import.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use dive->when when creating a dive site instead of time(NULL) as Dirk
suggested
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The backend now redirects you to the correct URL once you log in with your
email address and password. So all the user needs to know is to go to
https://cloud.subsurface-divelog.org
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This one sadly only appears to be called with 0% and 100% in my examples.
Not sure what to do about that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This switches to use the closeEvent to save settings and cleanup instead
of the destructor.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I have some trouble understanding this code, but as there is a clear
bug involved (null dereference), I ask others to verify if I am onto
something. And if datatrak import still works with this patch.
From af2935622b1f00f373ed38c8e3194e25504372b6 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Wed, 9 Sep 2015 18:03:45 +0300
Subject: [PATCH] Fix null dereference and parsing logic
Null dereference in the first change is obviously a bug.
The parsing logic I only assume to be wrong and suggest that we discard
dives that are deemed to be bogus.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This device_data_t pointer was a remnant from initial work. It is
useless and can be safely removed.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the dc_serial_*_open method fails then we should exit with
an error and don't try to open the device using the native
implementation.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the spinner caused all kinds of problems inside VMs, wasn't shown at
all for some people on Win10 and appeared to get stuck a lot and still
left people with the perception that Subsurface was hung, this patch takes
a more traditional approach and gives the user a progress dialog.
An additional benefit of this is that the user now can cancel a hung
transfer.
The slightly weird passing in of the callback allows for the separation of
UI and core logic code...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
get_dive_duration_string() should be used in a similiar way
to socialnetworks.cpp so that the Dive::put_duration()
method sets the variable in the h:min format.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Dive class has a method which sets the m_time and m_date
members but it uses a custom format. By using the static
dateFormat and timeFormat variables this helper class now uses
the same date and time format as in the dive list.
Fixes#920
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subsurface crashes when multiple dives are selected on divelogs.de
export. The crash occurs on malloc that is called indirectly from
xmlReadMemory().
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This if'defs DC_TRANSPORT_* use with SSRF_CUSTOM_SERIAL, because the
enum doesn't exist when building against stock libdivecomputer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This teaches subsurface how to understand more fields in the xml that
libdivecomputers's universal tool generates.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is trying to clean things up quite a bit and make it less specific to
my directory layout.
It still calls the signing script that tries to sign things with my keys,
so it won't work for others without tuning, but this should get you
closer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>