Commit graph

6074 commits

Author SHA1 Message Date
Dirk Hohndel
fc96daf93f Fix build on Mac with Qt4
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:26:14 -05:00
Dirk Hohndel
1894bdd3cb Don't trigger creation of dive from invalid plan in planCreated()
This is subtle. The modifications to the selection cause a redraw of the
profile. So we need to make sure that we leave the plan state and return
to profile state BEFORE we do this, otherwise we'll call into
createTemporaryPlan() with invalid data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
5b0f4e79c4 Mark manually entered waypoints as such
With this information, when we re-plan a dive we can bring the user right
back to the point where they ended - they have the waypoints in the dive
pointes table and handles are shown on the right points in the profile -
and the rest of the dive is once again calculated by the planning
algorithm.

For now this state is lost when saving the dive file as we don't add this
flag in the sample to our saved files. So if we don't find any samples
marked as manually added we add ALL of the samples as way points on the
diveplan and the user has to manually remove the ones that were
calculated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
f7119bdccf Planner: make sure no old handles are around when entering Add/Plan
In some cases we don't appear to remove all of the old handles from the
scene and end up showing a handle from a previous instance of the planner
in the upper right corner of the profile.

This patch makes sure that we remove any stray handles that might still be
around before entereing plan or add mode.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
d45a991460 Planner: after canceling a plan, redraw the profile
While planning we might have made changes to the displayed_dive. So we
need to make sure that the profile is redrawn after we cancel a plan (or a
re-plan).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
d7630032e2 Planner: clear out model before re-planning a dive
Otherwise points from a previous run might be around.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
a85a219df3 Add ability to replan a dive that we planned before
When doing this, all waypoints of the calculated ascent are now waypoints
in the plan - so the user has to remove the ascent part of the dive in
order to really replan the dive. That's a pain, but we don't keep the data
around that would tell us which waypoints are user input and which ones
were calculated.

Fixes #527

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:17:52 -05:00
Dirk Hohndel
76f3c0f028 Planner: don't calculate ascent while adding waypoints
It's silly to carefully calculate our ascent for each new waypoint that we
add to the plan. Let's get them all in and THEN calculate an ascent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 15:06:48 -05:00
Dirk Hohndel
c463087ab0 Remove unused function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 15:06:48 -05:00
Dirk Hohndel
77f9bf06fd Planner: correctly free divedatapoints
Simply setting the pointer to NULL leaks memory.
And that C++ recursive two function implementation... oh boy.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 15:06:39 -05:00
Dirk Hohndel
6ed189f32c Planner: bring sanity to the SAC rate handling
The old implementation was... let's call it creative.
This tries to actually get things right instead of using magic.
Don't pretend that double values are ints.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 11:36:54 -05:00
Dirk Hohndel
150676ce3d Merge branch 'joshua-gsoc' of git://github.com/thiagomacieira/subsurface into josh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>

Conflicts:
	subsurface.pro
2014-08-18 20:25:06 -05:00
Dirk Hohndel
48fe5254dc Preferences: increment/decrement partial perssure values by .1
This defaulted to +/-1 which really isn't all that useful.

Fixes #703

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18 14:21:11 -05:00
Dirk Hohndel
0f1381f160 Planner: assign a dive number if the right number seems obvious
Use the same logic as we do for newly added dives.
As a side effect this patch appears to fix the issues with getting the
newly planned dive selected.

Fixes #692

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18 14:12:05 -05:00
Dirk Hohndel
88fe28636e TankBar: make outline zero-width
In some circumstances Qt will draw a really thick border around
rectangles. This explicitly makes the border of the tank bar thin.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18 11:47:18 -05:00
Thiago Macieira
b1cd536e1c Fix build with Qt 5
<QPrinter> is in QtPrintSupport, so we need to declare we want to use
it.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 23:25:02 -05:00
Gehad elrobey
d72e02c83e HTML: time unit is in minutes not seconds.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 22:58:42 -05:00
Gehad elrobey
4ac018712f HTML: Fix Fake precision value.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 22:58:39 -05:00
Gehad elrobey
362671352e HTML: Update the user-manual with the new export settings.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 22:58:36 -05:00
Dirk Hohndel
8856ccea10 Uemis downloader: show the timestamp for dives while downloading
If we can easily decode the start time of the dive that is currently being
parsed (i.e., if the information doesn't happen to straddle a block
boundary) then show that in the dialog's progress bar.
Make the explanatory text before it shorter so there's enough space.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 16:44:43 -05:00
Joseph W. Joshua
7264ec2fa8 Change presentation of OSTC 3 firmware version
This change changes the way we present the OSTC 3 firmware version to a
correct value, showing the major and minor version number.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-17 14:11:29 -07:00
Gehad elrobey
16515a970f HTML: change empty O2 Value to Air.
-Change column name to 'Gas' as changed in Subsurface.
-Replace '--' with 'Air' to empty tanks.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:24 -06:00
Gehad elrobey
5b9537222e HTML: Make theme colors consistent.
Buttons and fields colors must be consistent in different themes.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:22 -06:00
Gehad elrobey
1494ea9727 HTML: Make SAC, OTU and CNS in uppercase letters.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:19 -06:00
Gehad elrobey
9194a43fd4 HTML: add units to time in dive profile.
Also change the separator to a colon which is more readable.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:17 -06:00
Gehad elrobey
27e400f5e4 HTML: don't show cylinders or weights table if they don't exist
Don't show the table header of cylinders or weights if they are not
available.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:14 -06:00
Gehad elrobey
d2891ecbd0 HTML: Don't export others trip if no dives are selected.
Don't export 'others' trip unless there is really at least one dive to
be inserted into the 'others' group.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:06 -06:00
Miika Turkia
d83c36c36b Fix typo
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:01 -06:00
Thiago Macieira
f3d44db512 Fix and simplify get_file_name
This function created a QFile that it didn't need and it returned a
dangling pointer (the std::string object was destroyed at the end of the
function).

The function now returns a pointer that the caller must free. For that
reason, it's easier in copy_image_and_overwrite to just go for the
QFileInfo call.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:01:56 -06:00
Dirk Hohndel
29f50c6aee Cut'n'paste for dive data: implement paste side
This should correctly set all the values and puts us in edit mode.
Testing so far looks good for both single dive and multiple dives selected
(i.e., you can paste into multiple dives).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 11:58:11 -06:00
Thiago Macieira
1b866e67f3 Ensure Subsurface still compiles with libdivecomputer 0.4.x
The OSTC3 functions we need were introduced in 0.5.0 (more specifically,
in commit 56e2dec7266e71e725604a4a8bff5e61f3d62259).

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-17 10:06:06 -07:00
Dirk Hohndel
822eb7558d Selective copy: forgot tags in the UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 18:35:44 -06:00
Dirk Hohndel
4a7432e3d5 Don't always clear the dive before selectively copying
This will be needed when pasting the data back into a (set of) dive(s).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 18:34:27 -06:00
Dirk Hohndel
3766f57392 Don't show seconds for dive start time in the UI
Some divecomputers only report at minute granularity, anyway. And when
diving with multiple dive computers they will never agree on the exact
time. And anyway, what's the point of second granularity when it comes to
the start time of a dive?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 15:56:38 -06:00
Dirk Hohndel
da07b4e5d7 Make divelist gas column slightly easier to understand
Since printing EANxx was met with a lot of resistance as it wastes space,
maybe this makes things slightly better at least.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 15:50:28 -06:00
Dirk Hohndel
34fceb4a1b Cut'n'paste for dive data: implement copy side
Admittedly not very useful without working paste, but it's progress.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 10:07:06 -06:00
Dirk Hohndel
dd49e3a9a9 Cut'n'paste for dive data: implement some infrastructure
This commit doesn't do anything, yet. It just puts in place helper
infrastructure that will later allow us to cut and paste parts of the data
of one dive into another dive (or set of dives).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 09:21:20 -06:00
Dirk Hohndel
c58d136d33 Dive edit: allow the user to explicitly clear a GPS location
If the GPS coordinates for a dive were incorrect for some reason and the
user wanted to clear them in order to then re-download / apply GPS
information from the Subsurface webservice, prior to this patch we would
always match the location name and re-populate the GPS coordinates, making
it impossible to clear a GPS location without also changing the location
name.

This patch fixes this - but if you have multiple dives with the incorrect
name / GPS location pair, the next edit to a dive that had the GPS
coordinates cleared will re-populate the GPS coordinates (at that point
Subsurface can no longer tell that this was intentional).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 07:09:11 -06:00
Miika Turkia
bb39a8730b Hack double tank support for export to divelogs
If the cylinder description starts with D%d we test if the size in
description matches the cylinder size. If the cylinder size is double
compared to size in description, we mark the dive as double tank dive to
divelogs.de.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 06:57:55 -06:00
Dirk Hohndel
64c9fff850 Survey: rename "Save" button to "Send"
Fixes #701

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 21:41:41 -06:00
Dirk Hohndel
e8d430341c TankBar: hook into prefs and make ppGraphs resize accordingly
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 08:11:14 -06:00
Dirk Hohndel
e71119b40b TankBar: use the itemPos as intended
Which actually makes the code much clearer as now the object is at the
correct spot on the canvas and the positions inside are relative to that.
No more magic gradiants starting at "92"

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 07:30:31 -06:00
Linus Torvalds
5b14ed16ac Add "download into private trip" dialog checkmark
This adds a checkbox for the divecomputer download dialog that allows you
to tell the download to put the newly downloaded dives into a trip of
their own. That in turn will disable the dive merging with any existing
dives, which means that you will not mix up your newly downloaded dives
with any old dives.

That, in turn, is very convenient of you know that some of the dives were
done by other divers (or from testing that happened during servicing etc),
or the dive dates etc were wrong because the dive computer date had reset
due to battery changes etc.

Once you have all the dives in a private trip of their own, you can then
fix them up (delete dives you don't want to merge etc), and then after all
the data is ok you might want to merge the cleaned-up results with
previous trips etc, and then manually ask subsurface to merge the dives or
whatever.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 22:40:14 -06:00
Dirk Hohndel
87ca15c5c3 Add gas text to tank bars
Also restructures the code a bit to make it a little more sane and changes
the colors slightly.

With these changes I think we can claim that this
Fixes #557

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 22:39:47 -06:00
Dirk Hohndel
fa3c18d83b Add initial support for a visual tracker of gas used
This shows a color-coded bar at the bottom of the graph that corresponds
with the active gas.

Todo:
- text that explicitly states gas on the left edge of the bar
- better vertical positioning of the bar
- ability to turn this on and off

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 18:22:27 -06:00
Gehad elrobey
9015160199 HTML: Add coordinates to the HTML exports
- Export dive coordinates (if exist) to JSON file.
- Add dive coordinates to list view and detailed dive view.
- Add hyperlink that opens the dive location in a new tab viewed in
Google maps.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:53:05 -06:00
Gehad elrobey
a03e772954 HTML: Sort by number based on the chosen number format.
Sorting by the number must be based on either subsurface number or the
regular indexing as choosed in settings.json

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:53:03 -06:00
Gehad elrobey
a6fe3a2234 HTML: export selected dives in trips.
When exporting selected dives, traverse the trips and export the trip if
it contains at least one selected dive then search for all selected
dives in this trip.

Exporting selected dives only must contain trip infromation.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:53:00 -06:00
Gehad elrobey
63691ed61b HTML: arrow navigation is based on full dive list.
The navigation arrows from the detailed dive view is based on the full
dive list, regardless of 'items_to_show' list.

This can introduce unexpected behaviour if some search results or
explicitly sorted list are shown in the list view. Restoring this
list view from the detailed dive view after some arrow navigation.

Arrow navigation must be separte and don't change the 'start_id'
variable.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:52:57 -06:00
Gehad elrobey
8bc232b0bd HTML: Scroll page to the top before showing the detailed view.
When looking at the dive list view, clicking on the 'show more details'
retains the view at the current vertical position, meaning that the
graph is somewhere above, outside the page view.

Page must be scrolled to the top before viewing the detailed dive view.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:52:54 -06:00