This combines the display with EADD since this is the same
value with a different unit. And show it for air dives as
well.
Suggested by Jan Mulder & Anton Lundin
Signed-off-by: Robert C. Helling <helling@atdotde.de>
In the planner, the SAC is prescribed, so there is little
use in plotting it (as the color of the cylinder pressure
line). Rather use the color to show the density of breathing
gas.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This appears to be critical for work of breathing so it might be
worthwhile to compute. So far only in infobox.
For background, see
https://www.youtube.com/watch?v=QBajM3xmOtc
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Update the function to create the dive duration string in a way that
it can be used also in info and stats tab and added some more flexibility.
Changed layout for <1h freedives to "0:05:35" (w/o units) or "5:35min"
(with units and :) or "5min 35sec" (with units with space).
Add a new function to create the surface interval string.
Completely remove old function get_time_string() and get_time_string_s().
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
There was a bug in the old code due to confusion between minutes
and seconds as the unit of the time axis. But rather than limiting
the time for the last handle in terms of the time axis (which
potentially includes long deco and allowing that for bottom time
quickly leads to dives many many hours long) limit it to 150%
of the previous bottom time.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Some people (like me) have Qt elsewhere. So long as qmake is in PATH,
we should be able to support it.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Issue #272 lead to the introduction of a new private property of the
ComboBoxDelegate class (editable). This new property was not correctly
set when creating the weight system delegate. This corrects the (trivial)
error, and now allows edit of the weight system name.
Fixes: #392
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
As a last minute addition, and for peace of mind and soul, add just
another size check, to run before reading values from buffer.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
datatrak_import() is the main function called from parse_file(), but
dt_dive_parser() is where the hard work is done, for both, drop file
seeking/reading and use memory pointers instead.
datatrak_import() now returns 0 on success or 1 on failure and abort
import if parser function fails instead of keeping on trying.
dt_dive_parser() emits a warning if libdc_model is zero (manual dives).
Do not parse profiles if libdc_model is zero, for unknown models we set
a fake 0xEE value coverted to Aladin Air X/Z libdc model number. Func
now takes a pointer to a buffer and moves along the dive, when done
returns a pointer to the actual memory position or NULL if something
went wrong.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Remove dtrak_profile() profile parsing func as this work is left to
libdivecomputer.
Simplifies read_file_header() to return the number of dives in the log
file as we don't use the rest of header data.
Add dtrak_prepare_data() to achieve a device_data_t structure and get
the correct libdc model number for the device.
Remove checking macro substituted with JUMP in header file.
Add dt_libdc_buffer() to get a buffer parseable with libdivecomputer.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Remove dtrakheader structure. In the end, we only make use of the number
of dives in the log file.
Define a models_table_t table which strores the known Uwatec's Aladin
models and its equivalence with libdivecomputer known models.
Add a macro to check that movements in memblock buffer don't get out of
the allocated memory.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Datatrak import is called from parse_file() in file.c. This function
reads the full file to be imported into a memblock structure. It's
easier and more secure, to parse this buffer instead of the file itself.
These are the necessary changes in function datatrak_import()
declaration and call.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Apparently the refactoring changed these values to be returned directly
in seconds. Not sure why, but luckily we have test cases that discovered
the change.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Moving the GUI independent Seabear import functionality to Subsurface
core. This will allow Robert to call it directly from download from DC.
Tested with H3 against released and daily versions of Subsurface. The
result differs somewhat, but it is actually fixing 2 bugs:
- Temperature was mis-interpreted previously
- Sample interval for a dive with 1 second interval was parsed
incorrectly
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
We now respect the settings in the preferences and also only show
the duration as minutes and seconds if the dive is a free dive.
Fixes#361Fixes#362
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Tags are handled differently from other fields, we need to call
the special handling after the new dive was added and marked as
the current dive.
Fixes: #369
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we don't have a GPS service userid in the preferences and the GpsLocation class
isn't instantiated, this would cause a crash.
Fixes#367
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add one more picture to the already existing test.
This new picture is a JPEG and has data after JFIF EOI tag.
Suggested-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Changes to the "Add pictures to dive" function:
- Make Exif handling more tolerant by removing the JPG sanity
check for EOI
- Give info to user if exif.cpp can't identify a Exif date/time
- Restrict file dialog filter for correct picture time by DC photo
to JPG because Exif is only available from JPG
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
When doing the xslt transformation for UDDF export, the C source does
actually give a parameter units with value 0. Thus we need to treat
that case as normal mode.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>