Removed some merge artefacts and made sure code compiles and
produces wellformed TeX. Shortend some comments.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
The purpose of this work is to allow for generation of more complete log
pages using TeX/LaTeX.
Previously, the exporting to TeX generated a document that contained
very limited information about the dive. For example: the only details
reported about air consumption were delta pressure and SAC. In addition
no data was reported about what equipment (weights, tanks, suit) was
used.
Per feedback, code was updated to use helper functions, and now exports
data with the units set by the user in the Subsurface preferences. Some
characters (Degree symbol) do not render correctly by default in LaTeX,
so sample code to address this was included in the top comments. Volume
units do not export an ideal character string, so another string was
substituted.
This update adds the following information:
* GPS Location
* Dive computer used
* Max, Min, Air, and Water Temperatures
* Average depth
* Number of cylinders listed, mix, and start/end pressure for each
* Total weight used, and the description and quantity of each weight
* Dive rating (previously, only visibility was reported)
* Buddy
* Dive master
* Suit
This update moved several fields that had no output or had unexpected
names (i.e. "spot", "place") into a "Deprecated section"
Future work:
* The export currently only includes the first entry in the tag list.
* Future versions should export all tags.
* Ideally, this would export a screenshot of the dive location.
* Create a table of correct size for weights and cylinders.
* It would be nice to have a bit more control over the generation of
profile images, but that may be beyond me.
Rebased-and-cleaned-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Ben McCandless <mccand@gmail.com>
This appears to fix the mystery crashes that can occur when deleting a dive
from the dive list.
Fixes: #497
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
When I massaged the code to do multiple gas pressures in commit e1b880f4
("Profile support for multiple concurrent pressure sensors") some of the
Y offsetting code got cut out as being too specific to the old
o2pressure code.
But I removed a bit too much, leaving the label (gas name) and number
(gas pressure) overlapping.
This should fix it.
If we really care about multiple gas pressure labels overlapping each
other, we'll have to revisit this code, but the old two-gas case didn't
do a very good job either (both that old code - and this new version -
can look very good in particular cases, but there are cases where it
won't work so well).
So we may need to revisit this eventually, but this gets it looking fine
for the normal cases.
Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This gets rid of TypeError messages, but does not appear to affect behaviour
qrc:///qml/DiveDetailsEdit.qml:254: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:228: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:216: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:204: TypeError: Cannot read property 'dive' of null
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
MapWidgetContextMenu now has a new action (SELECT_VISIBLE_LOCATIONS),
that will invoke the MapWidgetHelper method selectVisibleLocations().
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The new method selectVisibleLocations() contains a routine
to find all visible MapLocation objects in the Map viewport and
select the dives associated to said MapLocation objects.
This method is to be invoked from the QML context menu.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
First, this function calculates the zoom out effect until both the
current Map center and the target rectangle are visible - see the
"calculate zoom out" part.
Then it calculates a zoom level, so that the target rectangle
fits the viewport, but also so that the zoom is not too much (clamped).
see the "calculate zoom in" part.
NOTE: "centerStored" (the variable used to store the current map center)
is created using QtPositioning.coordinate(), because the code needs a new
object and not a reference of the map.center QGeoCoordinate object.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Add stopZoomAnimations(), which is really just a precaution
function to make sure we have stopped all animation of the
map before doing calculations! Since the animation *should*
be running in a separate thread, this would make sure the Map "center"
and "zoomLevel" properties do not change.
Add pointIsVisible(), which is a helper to determine
if a point created by map.fromCoordinate() method is inside
the viewport. fromCoordinate() has to be called without the
"false" (clip) flag for this to work.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
MapWidgetHelper::centerOnDiveSite() now checks if more than
one dive sites are selected and finds the most top-left and
bottom-right ones in the coordinate system to form
a rectangle.
It also supports the special cases where a selected dive site
does not have coordinates or the case where only a single dive site
with GPS coordinates are selected.
TODO: implement mapwidget.qml::centerOnRectangle()
This QML function will receive a QGeoCoordinate based rectangle which
has to be centered in the viewport with animation.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
For instance, if the 'googlemaps' geoservices plugin is missing
a new message is now shown:
"qml: MapWidget.qml: cannot find a plugin with the name 'googlemaps'"
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Do so until the following issue is resolved:
https://github.com/vladest/googlemaps/issues/9
With the satellite map ([1]), the black tiles at relatively high
zoom levels over the Red Sea cannot be seen. Instead it shows white
tiles at the ultra-maximum zoom level at places.
As a side note, the "satellite" map does not have the country labels
which the "hybrid" map has.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Back when I wrote this code I made a typo. This fixes it.
Reported-By: Alexander Gottwald <jugendtrainingtsck@gmail.com>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No idea why this was restricted to be so narrow. Also, making
the font of the label smaller and lighter seems visually more
pleasing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When I unified the sample pressures in commit 11a0c0cc70 ("Unify
sample pressure and o2pressure as pressure[2] array") I did all the
obvious conversions, including the conversion of the Poseidon txt file
import:
case POSEIDON_PRESSURE:
- sample->cylinderpressure.mbar = lrint(val * 1000);
+ sample->pressure[0].mbar = lrint(val * 1000);
break;
case POSEIDON_O2CYLINDER:
- sample->o2cylinderpressure.mbar = lrint(val * 1000);
+ sample->pressure[1].mbar = lrint(val * 1000);
break;
which was ObviouslyCorrect(tm).
But as so often is the case, obvious doesn't actually exist. The old
"o2cylinderpressure[]" model had an implicit sensor associated with it,
and that implicit sensor mapping wasn't obvious, and didn't get fixed.
It turns out that the way the Poseidon sensor mapping works, the O2
cylinder is cylinder 0, and the diluent cylinder is cylinder 1, so just
use the add_sample_pressure() helper to set both sensor index and
pressure value.
And since we now do all the sensor indexing right, we can also get rid
of some manual cylinder sample pressure code, because the generic dive
fixup will just DTRT. It used to screw up because the diluent sensor
number was wrong before, and the import code tried to work around that
by hand.
Reported-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
...even when not showing transitions, this makes the
first stop look more like a stop (since it does not include
several minutes of ascent).
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Build in a 'build' subdirectory and use the INSTALL_ROOT. Also make sure
you find qmake on custom Qt installations.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes sure that the autocompleting comboboxes never displays the scroll list where the user can pick an entry, and as such forces the view of a autocompleting textfield from the users point of view. The reasoning is that when scrolling in the drop down list it it possible to scroll to far and thus abort the ongoing edit by flicking away the edit page.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Mobile devices hare rather limited when it comes to screen size,
there is no point in reducing the availabel space more than neccecary.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This handles a cornercase where a user starts editing and then cances the divedit followed by a return to edit mode. The previously acive textfield would then be active again even though all changes are lost.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
For some reason the textfields on dive edit page did not loose focus when editing ended by press on the return key.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
When the user makes a selection using the autocomplete function while editing a dive the keyboard should close and the selection list should disappear.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Add star icons from the material repository.
https://material.io/icons/
The icons are under Apache License Version 2.0
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This would work only if the folder:
$BASEDIR/"$MXEDIR"/usr/i686-w64-mingw32.shared/qt5/plugins/geoservices
contains such a file.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The source code is pulled from the forked repository at:
git@github.com:Subsurface-divelog/googlemaps.git
It's rebased if needed, build using 'make -j4' and then
installed.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This patch makes use of the geolocation plugin "googlemaps"
for Qt Location with source code from here:
https://github.com/vladest/googlemaps
The change from the ESRI plugin is that it requires new indexes
for the Hybrid ([3]) and Street ([0]) map types.
There are more zoom levels in this plugins, but our default zoom-in
settings seem to transition well to it.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Until we get some solution from upstream this patch to Kirigami hides the action button when the keyboard is visible.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Calling access() makes no sense at all on android, but this atleast
fixes a compilation error on ndk 15+.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
In the serial api for libdivecomputer is ok to send NULL as the int
pointer actual, if you dont't care about how many bytes that where
actually read or written.
This makes sure we don't crash if the ble backend where ever used with
such a backend.
Signed-off-by: Anton Lundin <glance@acc.umu.se>