The old behavior was kind of crude. Just smack the tags that were on the
displayed dive on all selected dives.
This seems to make more sense. We figure out which tags were added to the
displayed dive and add them to all selected dives. And we remove all tags
that were removed from the displayed dive from all selected dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
taglist_added() simply figures out the tags that are in the new list but
not in the original list.
taglist_dump() makes debugging things easier.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds text to the following sections:
1) Dive planner (Open circuit planning)
2) Dive Planner (Recreational OC planning)
3) Use of hashes to move images between directories
4) Undo/Redo feature of dive list manipulations
One image in planner text is modified.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Rounding always up should give us sensible sample interval as EON Steel
adds extra samples.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The logic to select samples from EON Steel for divelogs.de export is the
following:
- Ignore sample at time zero, as that is surface, and the second "odd"
sample contains information we are interested in
- Grab the second sample, first sample with pressure and temperature
readings
- Grab the third sample - "grand parent" is 0, thus our first interval
sample
- Grab the samples when the predecessor (or grand parent) is at least 10
seconds away
This logic seems to produce reasonable results when exporting EON Steel
logs to divelogs.de. Naturally there might be corner cases, that are not
taken into account, but this basic logic seems reasonable in normal
cases. (Unfortunately analysis is done based on a single dive.)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This sets the Suunto EON Steel sample interval to 10 seconds when
exporting to divelogs.de.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This unbreaks the qmake build system by adding urldialog.ui there. Yes,
i know we're planning on switching away but i still build things via
qmake and its nice if it works until we actually remove it.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a default case which just errors out for the switch over
dc_family_t instead of checking a uninitialized variable if this was
ever called with something else than one of the expected dc-family
types.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of writing each dive out to a file and reading that file back in,
let's just use the internal helper function that places the dive as XML
into a membuffer.
So much simpler, so much faster.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
save_one_dive_to_mb() is very useful (but there was a namespace collision
with another helper in save_git.c)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Previously we simply failed silently without showing the user any
indication that something went wrong. That seems wrong.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This disables planner UI elements in recreational mode that have no function
in that mode.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Here on my Mac I had an issue that took a long time to understand.
The build.sh script was correctly creating Marble but did not
correctly run otool on it. So I fixed this by fixing CMake for
the marble library which means we don't need to worry about it
in the build script anymore.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After doing a make clean / make confclean the makefiles
were erased and running the configure script again didn't
created the makefile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
MACOSX_BUNDLE and WIN32 give hints to cmake for different
install behaviors. for instance, trying to copy frameworks
and other stuff to the correct places.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We are compilling those libraries and we know where they are, so
pass the directories and the libraries in a go directly. CMake was
a bit random when choosing the correct ones, this way we are sure
we got them.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive context menu:
After the addition of the item "Add image(s) from web" the item
immediately above is "Add images". It is proper to specify now:
"Add image(s) from file(s)" to make the distinction clear. I also
change "Shift times" to "Shift dive times".
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only build the tests when running them. The downside of the way this is
implemented is that build errors for the tests actually show up as test
errors and are only seen in the test log - but this seemed worth not
having every build include the tests.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a new divelist context menu entry which asks for a URL. The file
is retrieved and if it is an image it is added to the cache and the url
is associated to dives as with local files.
NB this currently only works with URLs pointing directly to images. But it
should not be too hard to add the possibility to add a direction via an html
file and its image tags.
To test: open dives/test43.xml and delete the image and then add the URL
http://euve10195.vserver.de/~robert/wreck.jpg
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Factor out image load to find timestamp from loop over dives.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use more explicit variabel names and make the get timestamp function actually
return the timestamp rather than getting a pointer argument
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also fixed it to correctly parse the mean depth (duh, a test that had a
bug) and added a buddy field for good measure.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we delete a cylinder the gas changes in that dive may have to be
adjusted. We didn't do this at all in the past. With this commit we should
be doing this right for a single dive that is being edited.
This does NOT handle multiple dives being edited at the same time (or more
specifically - if you have multiple dives selected and delete a cylinder,
the dives that had the same set of cylinders (other than the displayed
dive) will get that particular cylinder deleted, but won't have their gas
change events (and sensor data in the samples) adapted.
Possibly we should simply prohibit deleting cylinders when more than one
dive are selected.
See #834
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now the way to edit the profile of a manually added dive is really
counterintuitive: you have to first make some random change to the dive
information, then the profile switches in to editing mode.
This commit adds a simple context menu entry on the profile that is only
shown when the a manually added dive is displayed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
XSLT conversions create V2 XML files, but we shouldn't abort when we parse
those without having the user informed about the potential slowness - all
XSLT based imports are slow, anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Oops, that was embarrassing. Just setting it on displayed_dive doesn't
gain us anything if it isn't transferred to the selected dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We assumed that a trip was selected when all of its dives were selected
instead of just remembering if the trip itself was selected. I'm sure
there was a reason for that but I cannot think of any. But a side effect
is that if you have a trip with only one dive in it and have that one dive
selected and edit it, after saving your changes you end up on the trip
(which is now also selected) and are no longer on the dive. And that seems
quite wrong.
The new code simply remembers that the trip was selected. And selects it
again if it was.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Sometimes we get a sensor number of 255 - which gets turned into a tank
index and then causes all kinds of havoc. Simply refuse to use a tank
number larger than the maximum Subsurface has been compiled for.
Oh, and use consistent variables to handle these unsigned 8 bit integers.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A complete batch of divelog and dive data takes about 20% of the available
space (depending on how long those dives are). This is a hack and I can
see this potentially going wrong, but the alternative is to be even more
conservative and that has its own set of problems as it causes us to need
more "unplug, wait, plug in again and restart" cycles.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This looks like a fairly big change but it mostly just moves a block of
code inside an earlier loop and adjust a few variables around it.
The completely broken and insane Uemis download protocol distributes data
across different "databases" on the dive computer. The "divelogs" are
downloaded in batches of 10 (most of the time), and with this change every
time one of those batches is downloaded we straight away get the matching
"dive" entries.
Hopefully this will avoid having the download abort (for lack of space)
before all components are loaded.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>