The format option "%m" doesn't work for MINGW/Windows and is reported as
an unknown conversation type and this sscanf() call would not work.
The alternative is to malloc() enough space manually - e.g.
strlen(input) + 1.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This shouldn't be part of the UI (qmlmanager), but part of our
overall handling of dive computers and BT devices.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While it seemed logical to use the advertized service UUID that doesn't
appear to be working - instead using this hard coded UUID seems to do
the trick. I now did a successful download from my Shearwater Petrel.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Cochran logs the first 10 to 20 minutes (configurable) of
surface interval in case the diver re-submerges.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Older models allowed for configuration sample frequency; This patch adds
detection of sample frequency (profile_period) for cochran log file
imports.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We remember the offered service uuids as we detect the device and then
try the first one - likely this needs to be fixed / tuned to pick the
right one if multiple uuids are offered.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The linear search to determine that a just downloaded dive was already
downloaded, started from the oldest dive in the logbook. It is, however
more likely that a just downloaded dive is one of the most recently
downloaded. So, just search backwards. Just a trivial performance
improvement.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Searching why the mobile app also downloads pre existing dives, it appears
that in the mobile app, the preexisting attribute is 0, where it should be the
number of dives before the download. This is easily solved by adding the correct
setting on the download thread. This solves the issue of downloading pre existing
dives.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
For this I had to also make the DCDeviceData accessible,
and for that it needed to be a pointer.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set the descriptor when starting the thread, this removes
code from the desktop code and makes everything in sync always.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Keeping the Desktop and QML versions of Subsurface
using the same codebase will keep the code saner,
this change makes the Desktop version use the
DCDeviceData helper sturct that encapsulates
the device_data_t member for easy access on the
QML. This also helped move a bit of initializations
from the UI to the Core - and that's always good.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
this class encapsulates the device_data_t from libdivecomputer
in a way that permit us to use it on QML.
this will be needed to prepare the data for the download thread.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
fill_computer_list() creates a Qt friendly
structure that contains all of the necessary
information about dive computers and it's
devices, and it's needed both in Qml and Widgets
to allow the user to download their dives.
This patch makes it possible to use the code
in QML without duplication.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is important to not duplicate code for the Qml
view. Now the DownloadFromDiveComputer widget is mostly
free from important code (that has been upgraded to the
core folder), and I can start coding the QML interface.
There are still a few functions on the desktop widget
that will die so I can call them via the QML code later.
I also touched the location of a few globals (please, let's
stop using those) - because it was declared on the
desktop code and being used in the core.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Corrected problem where dive profiles would include post dive
surface interval samples.
Added detection for corrupt dives.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
Connect up all the settings that are the same, and remove those who are
not, and correct those who only are minor differences.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
This is mostly copy-paste from the ostc3 case, but there are some minor
differences. Some minor things have different meaning, and there's a
slightly different command set, but I couldn't figure out a sane way of
joining them.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
The core to avoid adding redundant gas switch events was completely
buggered, and caused the result list to be corrupted if it ever
triggered. This should fix it.
Fixes: b5de08b7 ("No gas change event on merging dives with same gas")
Reported-by: Jan Mulder <jlmulder@xs4all.nl>
Cc: Miika Turkia <miika.turkia@gmail.com>
Cc: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By copying a line from the Linux bluetooth code I can download
from OSTC dive computers on Mac. Don't ask me why this works.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
See https://github.com/Subsurface-divelog/subsurface/issues/345. The
menues where not translated. The basis of this error is a simple
typo in core/taxonomy.c where the classname was mis-spelled in the
QT_TRANSLATE_NOOP. In addition, to pull and translate the strings
from C code, the normal tr() does not work, and the functionality
from the gettextfromc class is used.
Fixes: #345
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
The file static po2 value, used to set the setpoint data, was not re-initialized
at the parsing of a dive during import from the divecomputer. So, in one import session,
the po2 was transferred from one dive to the next, obviously resulting in weird bugs, due
to possible wrong po2 settings.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This is another attept at the problem if identifying a potentially
user supplied text in the dive notes upon replannig a dive.
It gets rid of the user visable position markers (*!* and ***) and
cirumvents problems with mark-up by first converting the old notes
to plan text (assuming that user only enters plain text in the notes
field as we do in other places as well). Then the automatically added
part is identified by locating the disclaimer in the text (if the user
edited/delted the disclaimer or changed langue in between it is her
problem to manually delete the old plan).
Everything from the disclaimer on is deleted and replaced by the new plan.
If the disclaimer is not found, the new plan is appended to the old notes.
This way we make sure no information gets automatically deleted.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2 strings in the planner output showed based on "Bühlmann ZHL-16B with GFLow = "
gradient factors without % after the factor. While this is fine for an
abbreviated form like GF 40/80, this looks strange for a verbose sentence like
the 2 corrected ones.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Currently we do not know what the extra data in the sampleBlob is, but
the block size must be adjusted nevertheless.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
New strategy to identify old planner output in notes when
replanning a dive: Text anchors ("*!*" and "***") added for planner output
For backwards compatibility: If there is no anchor but an old table
delete everything.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Some of these header files are no longer necessary, and will be removed
from libdivecomputer in the near future.
Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It appears that Cobalt might include additional gas mixes, and only way
to determine what is used appears to be to ensure that start and end
pressures are greater than 0. One would assume there to be something
else available in the database, but I was not able to spot it.
Fixes#297
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This prints this information in the header near
"Subsurface" where I guess at least the version information
belongs. Plus it saves a line.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This is a rather arbitrary value, intended to create actually valid
pressure values for Uwatec Memomouse users - since we treat 0bar as
invalid pressure value, this simply creates an arbitrary '30bar + delta'
to '30bar' consumption graph (since all the Memomouse devices give us is
the pressure delta that was used during the dive).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of delivering the actual start and end pressure, memomouse
gives you a start pressure that matches the delta between actual
start and end pressure, and an end pressure of zero. Who the heck
knows why it does that, but the information is better than nothing,
so we should accept it.
Fixes#286
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Upon replanning a dive, we want to delete the old
dive plan in the notes and replace it with the actual.
This fixes a problem when we failed to detect the old plan due
to the deco model name appearing in the disclaimer that was used
as a marker for the notes.
This patch also adds translation markers for the deco model name strings..
Fixes#285
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Nothing really special here. Just a split of the only p02 max threshold into
a min threshold and max threshold, and the adaptation of the UI. Change of
translatable strings included.
ref: https://github.com/Subsurface-divelog/subsurface/issues/259
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This can occur e.g. if directory permissions prevent one from writing to
the local cloud storage directory. (Such a crash was discussed on
mailing list.) The error message on GUI is misleading, claiming that
cloud connection failed...
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
---
We probably should check the return value of other git operations as
well, but going for bare minimum for now.
Wfloat-conversion enabled for C++ part of the code
Fix warnings raised by the flag using lrint
Original issue reported on the mailing list:
The ascent/descent rates are sometimes not what is expected.
E.g. setting the ascent rate to 10m/min results in an actual
ascent rate of 9m/min.
This is due to truncating the ascent rate preference,
then effectively rounding up the time to reach each stop to 2s intervals.
The result being that setting the ascent rate to 10m/min
results in 20s to ascend 3m (9m/min), when it should be exactly 18s.
Reported-by: John Smith <noseygit@hotmail.com>
Reported-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
Sending nicely readable formatted coordinates to Google Maps does not
result in a correctly positioned map. Google likes unreadable
decimal format.
Little hacky solution. Added a gps_decimal attribute, populate that
with the standard function for format a coordinate to string, but
reset the preferences value temporarly so that it always converts it
to decimal style.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Add automatic tests in TestPlan for minimum gas:
- Copy minimum gas result (pressure) to diveplan.
- Add cylinder size and working pressure for bottom gas to every dive in TestPlan
Hint: Unrealistic cylinder sizes (100l, 200l) have to be used for the very long and deep dives in TestPlan
- Add minimum gas check for every dive
- Add two additional test dives in TestPlan which produce sane minimum gas results with 24l tank
Hint: Deco check for these new dives is commented out at the moment
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
For the "crazy" long and deep dives in "TestPlan" an overflow happened here.
Rearranged the calculation to have more margin.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
The function is unused, to silence the warning add the "unused"
GCC attribute to the function declaration.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use lrint() to fix both:
1)
core\planner.c:902:23: warning: conversion to 'int' from 'doub
le' may alter its value [-Wfloat-conversion]
2)
core\planner.c:907:21: warning: conversion to 'int32_t' from '
double' may alter its value [-Wfloat-conversion]
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The following pragma is Clang specific:
It produces a warning:
warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
Only enable it for Clang by checking the __clang__ macro.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
... for consistency, while we are at it.
There are still some internal depth variables which are ints
somebody might take a go at those.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This is needed in the altitude pressure conversion as there
negative altitudes are possible (for diving in the netherlands
or the Dead Sea).
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Add minimum gas calculation to planner output.
Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime.
Connect UI signals and slots for recalculation of diveplan.
Disable minimum gas calculation if there was already a warning before.
If minimum gas result is larger then cylinder start pressure give warning message instead of result.
Add line break before pO2 warnings but only if warnings exist.
Signed-off-by: Joachim Ritter <jritter@bitsenke.de>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Not using lrint(f) when converting double/float to int
creates rounding errors.
This error was detected by TestParse::testParseDM4 failure
on Windows. It was creating rounding inconsistencies
on Linux too, see change in TestDiveDM4.xml.
Enable -Wfloat-conversion for gcc version greater than 4.9.0
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
Using gcc option "-Wfloat-conversion" is useful to catch
potential conversion errors (where lrint should be used).
rint returns double and still raises the same warning,
this is why this change updates all rint calls to lrint.
In few places, where input type is a float, corresponding
lrinf is used.
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
On Windows that would fail because stat() doesn't deal well with our
utf8 strings.
Added new subsurface_stat() portability function to replace stat().
Added Windows implementation of subsurface_stat() using wstat(),
with conversion to ut16 of the inputed path.
Other platform implementations (linux, android) make use of the normal stat().
Added non ASCII test case in TestGitStorage::testGitStorageLocal()
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
When merging, we should treat an empty dive site (which will be deleted
on save) the same as not having a dive site.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Enable translation for a few additional internal dive events.
Ensure that all event names in datatrak.c are collected for translation.
Ensure that for gaschange in profile info box the "cyl." string is also translated.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
If the second dive site doesn't have a particular string, but the first
one does, we did the wrong thing and created a result string like
(first dive site string) or ((null))
which is not useful. We should just use the first dive site string
as-is.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch eliminates the difference between the saturation and
desaturation rates. This was probably once meant as a conservative
measure but the desaturation rate was increased rather than the
saturation rate (which is probably a typo, as reported by Stefan).
Since there is no good basis for this anyway, this patch sets
both factors to 1.0 (and if accepted the whole factor business
should be removed).
This makes our deco times slightly longer. But in the past,
we had introduced a 1.2% fudge factor in the critical radius
calculation to add conservatism and match the benchmark better.
Removing this fudge factor brings us close to the benchmarks.
Expected test values updated.
Reported-by: Stefan <sjti@gmx.net>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
We used to always create a new dive site structure when loading dive
site data from XML.
That is completely bogus, because it can (and does) create duplicate
dive sites with the same UUID. Which makes the whole UUID pointless.
So instead, look up the existing dive site associated with the UUID
loaded from the XML, and try to merge the data properly if we already
had dive site information for that UUID.
Reported-by: Alessandro Volpi <volpial@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
I have no idea why we only merged air temperatures. But it was very
explicit (even the function doing the merging was named
"merge_airtemp()"), and water temperatures were left alone.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The Qt model sorting for the dive date was using a unsigned number,
which doesn't work for dates before 1970.
Also, the dive date parsing got the year 1900 wrong. Not that we really
care, because other parts of date handling will screw up with any date
before the year 1904. So if you claim to be diving before 1904, you get
basically random behavior.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The test for the dive being a planned dive was completely bogus:
- it should use "same_string()" which correctly checks for NULL
- the string it checks for is obviously spelled wrong anyway.
Reported-by: Alessandro Volpi <volpial@gmail.com>
Fixes: a031dbbbd ("When merging planned dives keep all cylinders")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
In the beginning of the diveplan, divedatapoints of zero
duration indicate available gases with the depth giving
the suggested switch depth. Zero-duration datapoints in
the middle of the dive do not have this meaning and should
thus be ignored when composing the gaslist.
The tests should have these gas defining segments in the beginning.
This fixes a problem when replanning a dive that would change
to random gases during deco.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This resets the maximum crushing pressures and the maximal
ambient pressure between repetitive dives to prevent anomalies
that a dive produces a shorter deco when following another one
than without.
Reported-by: sfuchs@gmx.de
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes some further updates to the new cylinder merging code:
- avoid re-using the cylinder if the usage type (OC/diluent/O2) is
different between the two dives, even if the gasmix might be the
same.
- avoid re-using a cylinder if the user has manually added pressure
data for it (and the pressures don't match)
- when deciding to reuse a cylinder, make sure that we merge as much of
the type information as makes sense.
This will potentially result in more cylinders that might need manual
cleanup, but at least we won't be throwing out user data. And in most
cases where merging happens, none of this is an issue (because the data
comes fresh from a dive computer, and won't have been manually edited to
trigger the new rules).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The old cylinder merging code depended on the preferred dive having all
the cylinders, and the newly merged dive was just forced to pick from
that existing set of cylinders.
That worked ok if you have a "main" dive computer that you have all the
gases programmed for, and you download that first, and then you download
any secondary data later.
But it completely messed up if the second dive computer had gases that
the first one didn't know about, and just basically ended up doing
random things.
This rewrites the whole thing to actually try to create a union of the
two sets of cylinders when merging, with sane matching so that if the
cylinders match you won't get duplicates.
Miika Turkia hit this when he only used one gas, but had several gases
defined in his OSTC that he downloaded after his Vyper (with had just
the single gas defined).
This should fix that case (at least it does for my xml merging test-case
that showed the same problem after some munging).
Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
There is no need to have two variables for the same purpose.
[Dirk Hohndel: changed to keep the two separate functions as otherwise
we no longer parse existing repos successfully]
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to streamline the view between desktop and mobile we need to save
selected profile related settings to git.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
When the first leg in the planner is not cylinder 0, a gaschange
event at t=1s is inserted. In the profile, we should treat that
as inital gas, so no pressure information is printed for cylinder 0
that is used nominally for one second.
This fixes a problem reported by Willem.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Changed the markup with <div> and <br> tags of the planner output in
a way that is is a good compromise for both displaying in UI and
printing.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This is what we have same_string() for...
This prevents a crash when saving a dive in the planner.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adding --win32log as the first command line option on Windows
will now log all stdout and stderr output to the files
subsurface_err.log and subsurface_out.log in the working directory.
This change required a new argument 'bool logfile' to be added to:
subsurface_console_init() which is defined in all platform files
(linux.c, macos.c, etc.)
Example usage:
subsurface.exe --win32log -v -v -v
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This is important if in one dive we have the real dive and
a planned version of the dive as different computers using
different sets of cylinders.
[Dirk Hohndel: an early version of this was mistakenly pushed out
by me; I reverted that and added this commit since
fixing things up as I had done for the other two
patches made things nearly unreadable]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When Suunto Vytecs are used in gauge mode they don't record gasmixes.
If a tank pressure sensor is present they nevertheless record the
pressures. This patch handles this situation by assuming the tanks
contain air (and warning the user about this).
[Dirk Hohndel: I had mistakenly pushed out an earlier version of this
commit, so this fixes things up to the final version]
Reported-by: antonnorth@gmail.com
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When merging a real dive with a planned dive (for comparison),
we should not try to be clever in merging similar cylinders,
rather keep the union of both cylinder sets as the two versions
of the dive might differ in exctly which gas and how much of it
was used.
Increase MAX_CYLINDERS to 20 to make room for this. We warn if we
exceed this number.
[Dirk Hohndel: I had mistakenly pushed out an earlier version of this
commit, so this fixes things up to the final version]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>