This requires some serious hacking around with brew to get the libraries and
frameworks that we use to also be able to run on 10.5, but this is the part
that's needed in the Subsurface configuration.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The imperial cylinder sizes are not just in cubic feet: they are in
cubic feet of gas at STP. So the imperial/metric difference is not
just about converting blindly from liters to cubic feet, you also have
to take the working pressure of the cylinder into account.
This was broken by commit f9b7c5dfe9 ("Make units in cells
consistant in CylindersModel"), because those poor sheltered Swedish
people have never had to work with the wondrous imperial cylinder
sizing, and think that units should make _sense_. Hah.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of always assuming that all numbers are in the users locale
weight units, allow the user to say "kg" or "lbs" explicitly.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We'll want to do sane parsing of strings, but the C library makes it
hard to handle user input sanely and the Qt toDouble() function
interface was designed by a retarded chipmunk.
So just extend our existing hacky "ascii_strtod()" to allow a more
generic interface.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Note that this is IMHO the wrong fix. Because we shouldn't just ignore the
units, we should do correct conversions.
Before this patch, if the user is in metric mode and then types in 4.5kg
or 10lbs for a weight, Subsurface ignores the entry and throws it away.
Very much not the expected behavior.
With this patch Subsurface will take the value, but ignore the unit and
assume that the user meant kg (since it's in metric mode). Still not
really the expected behavior for 10lbs (which is now 10kg), but if the
user typed 4.5kg (which admittedly is much more likely), then with this
change Subsurface will do the right thing.
Fixes#395
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When near the surface the pressure doesn't change - and then there is a
sudden drop at the end.
Signed-off-by: Rodrigo Severo <rodrigo@fabricadeideias.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was first reported by Benjamin Fogel who also sent a patch but that
patch was changing all pngs instead of just those affected.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Patch f4db392a changed CSV import to use field numbers instead of
indexes. Thus removing the now incorrect description of numbering from
user manual. Note, that screenshot should be updated as well.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For the common user, a field number is more intuitive than field index.
So let's use that in numbering CSV import fields.
Fixes#388
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On Ubuntu, new events have time zero. This is fixed by resetting
gc.rightx to maxtime at the end of plot function.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Nowadays cylinder tags are generated based on actual usage. This
includes all the required information on cylinders. Therefore generating
incomplete cylinder tags from all listed cylinders is not needed
anymore.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds support for cylinders for UDDF version 3.2.1.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adding support for multiple cylinders on UDDF export. This also adds a
cylinder reference to the tankdata to enable mix lookups.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch generates a waypoint for events occurring between profile
samples. It approximates the depth of the crafted waypoint linearly
between the recorded sample depths.
Fixes#385
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive with test events, can be used to test approximation of depth when
exporting dives.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Bookmark with compass heading is named 'heading' and should use the
bookmark icon.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I never imagined that people would want to track more than 4
weightsystems, but we just had an enhancement request from a user who
tried to enter a 5th system. Let's hope 6 is enough for everyone.
Fixes#383
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And prevent the user from editing equipment in trip edit mode (those edits
are both meaningless and of course will be ignored once we save the
changes to the trip).
Also moved some code for setting up tanks, weights, tags, etc, into the
"this is not a trip-edit" part of the updateDiveInfo() function.
Fixes#392
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Regardless of whether the user clicks in the info tab, makes a change to
equipment or starts by editing the profile (i.e., clicking on the little
penguin), we should get into the same state and behave the same way.
This means that when editing a manually added dive we are always in
editMode == MANUALLY_ADDED_DIVE - and editMode == DIVE means we are
editing a dive that came from another source.
Fixes#379
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch disables/enables the DC device node based on what type of
transport the selected DC uses. The only time the device node field is
used is if the selected DC uses a serial transport type. IrDA and USB type
transports do not use the device node.
Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We want to install the Subsurface icon so it can be used e.g. in menus.
(Commit ee5d8e3c moved the icons to resources, but the application icon
is special case, that should be installed globally.)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use QStringList::contains instead of iterating the list.
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
MANUALLY_ADDED_DIVE is a different flavor of ADD mode (in both cases we
are in "planner mode"), so bail out for that as well.
See #379
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
UDDF export saved events only if they occurred at exactly same time as a
profile sample. This patch will include events between samples as well.
This assumes that profile samples are recorded in even intervals.
Fixes#385
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
1) Text about libdivecomputer log and dump files
2) Text about coordinate formats acceptable
3) Text about CSV import
4) Minor reorganisation of TOC
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Seems there is a different way to state O2 percentage in DivingLog.
This patch includes that format along with the previously seen one.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Seems that we can detect the unit of samples from DivingLog import when
comparing the maximum dive depth to the maximum recorded sample depth.
If sample is bigger, it is recorded in imperial. Of course this relies
on the assumption that the max depth of dive is recorded in metric unit,
but that seems to be the case, at least in the sample received.
It really does not make any sense to have both units in use for one dive
without any info on the unit used. But since that is the case, let's try
to cope with it.
Fixes#316
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As an aside, our resolution is great and certainly high enough for the
real world, but it's easy to get into situations where we don't display
the exact same degrees / minutes / seconds as the user entered...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
QList is optimized for storing pointer-sized items, thus
a QVector is the better choice for everything else.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Thise files dates back from the beginning of the Qt port and
were never used anyway...
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>