Commit graph

10748 commits

Author SHA1 Message Date
Dirk Hohndel
6cf100f1cc Avoid crash with empty command line argument
It appears on iOS we can get a command line argument of "" which would
crash Subsurface-mobile on startup.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-17 04:10:39 -07:00
Dirk Hohndel
24bd2eab43 iOS build: add another dependency to dummy.qml
This way the required plugins get automagically added to the bundle.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-17 04:07:37 -07:00
Dirk Hohndel
10833e32ed iOS build: use the Qt version that is available
Simply have the Qt link in packagin/ios point to whatever Qt version
you want to build against and the script picks the right one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-17 04:06:51 -07:00
Dirk Hohndel
da052967c2 Grr. Fix. Typo.
I never push things without compile testing. Never.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-14 12:15:03 -07:00
Robert C. Helling
b2f327f6e0 QML UI: Not giving wrap info improves dive details on narrow screens
This prevents label text from overlapping.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-14 12:05:20 -07:00
Robert C. Helling
fc213066f8 Only setpoint changes with non-zero SP indicate a CCR dive
There might be some spurious setpoint changes at t=0 without
an actual value (I have no idea where those come from). In
any case, those do not indicate that the dive is a CCR dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-14 12:04:36 -07:00
Dirk Hohndel
0d986b9cfd QML UI: show an empty dive list with explanation
If the credentials are valid we should show the dive list. If there are no
dives, simply say so.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-14 12:03:19 -07:00
Dirk Hohndel
3f26de826a QML UI: explain that the user can create a new cloud storage account
Fixes: #1073

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13 22:35:22 -07:00
Robert C. Helling
783844eb3d Set date and time when replanning a dive
Otherwise we pretend the dive is now.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13 22:17:49 -07:00
Dirk Hohndel
07512cb2c8 QML UI: allow entering the cloud PIN on the mobile UI
Now the user doesn't need to do this on the desktop app anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13 16:42:36 -07:00
Dirk Hohndel
5fa965df54 QML UI: prepare to enter the cloud PIN on mobile UI
This just creates the properties to connect QML and C++ code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13 16:41:26 -07:00
Dirk Hohndel
d2f9803883 QML UI: serialize checking credentials
If we run the backend to verify credentials without waiting for it to
finish, the redirect might happen before we know if the credentials are
invalid, unverified or verified - which will cause us to give the wrong
information to the user.

Yes, this additional wait is annoying, but I can't come up with a better
way to do this and avoid incorrect information. At least the UI isn't hung
while we wait.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13 15:25:17 -07:00
Dirk Hohndel
f7daadb1cd QML UI: don't proceed unless cloud credentials are verified
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 18:05:33 -07:00
Robert C. Helling
1df085240d Remove strange whitespace on right of divelist
There was a column of whitespace in the divelist that looked strange.
It was there so a trash can icon can appear. Now the trashcan overlaps
with the item.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 15:49:17 -07:00
Dirk Hohndel
22170d3991 QML UI: add debug output for dive edit save button
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 14:49:40 -07:00
Dirk Hohndel
13c55e2b26 Fix typo
Duh.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 13:41:55 -07:00
Dirk Hohndel
2755e64cea Don't quit when hitting the back button on iOS
This should finally fix this problem.
Famous last words.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 12:12:37 -07:00
Dirk Hohndel
f2e03022fa QML UI: disable GPS functionality on iOS
I still haven't figured out how to make GPS work on iOS. So let's not
pretend this works.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 12:09:49 -07:00
Dirk Hohndel
72523ff0df QML UI: somewhat improve GPS list rendering
At least now it's readable, but on the flipside there's now this odd
margin around the entries.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 07:32:07 -07:00
Dirk Hohndel
92e06007cc QML UI: update for latest Kirigami
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 07:31:53 -07:00
Dirk Hohndel
818031e604 updated build scripts for Mac
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-11 10:37:30 -07:00
Dirk Hohndel
c580122727 Remove unused variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-11 10:32:00 -07:00
Linus Torvalds
710d47a2da Make sure dive computer model is proper malloc'ed allocation
Reported-and-tested-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-11 10:29:31 -07:00
Robert C. Helling
3870916ae2 Fix logic for presaturation
There were two problems in the calculation of tissue pre-
saturation from previous dives: We added the surface interval after
the dive rather than before and when also took dives into accout
that were in the future of the dive considerd.

Reported-by: Timothy Massey
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-11 10:28:04 -07:00
Linus Torvalds
7a77569019 Make sure all dive computer events are represented in the plot_info data
We could create a plot_info data that didn't contain all the time slots
for the events fromt he dive computer, which would terminally confuse
the plotting of the event profile widgets because it couldn't match up
the event with the dive plot data model.

So for example, in DiveEventItem::recalculatePos(), when the code tries
to figure out the spot in the data model, it could fail, and then try to
hide the event (because without the data model information it doesn't
know where it should go).  But that hiding would then not match the
logic in DiveEventItem::shouldBeHidden(), and the event would end up
being shown in the upper left-hand corner of the profile after all.

The reason the plot_info data wouldn't contain the time slots is that
the slots are allocated primarily for the sample data, and then the
events would be added in between sample data in populate_plot_entries().

But since we'd only add the event pointer *between* samples, that would
mean that events after the last samples would not get plot-info points
allocated to them.

That issue was exacerbated by how we also truncate uninteresting samples
at the end when some dive computers end up giving a long stream
(possibly several minutes) of "at the surface" events before they
finally turn off logging.

This makes sure that we take the event timestamps into account for the
"maxtime" calculation, and also that we finish populating the plot_info
data with any final event timestamps.

Now all the events will have a matching plot_info entry.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-01 13:09:26 -07:00
Linus Torvalds
36a3f649c5 Don't show surface events at the beginning or end of the dive
That's just annoying and pointless.  So we arbitrarily say that surface
events within the first and last 30s of the dive are suppressed.

But we now do show them in the middle, in case the sampling rate is too
low, and the profile itself doesn't show that we got to the surface.

These heuristics still needs tweaking - if the profile already shows
that we're at the surface, then we should probably suppress the event
triangle.

But in the meantime this at least gets rid of the truly pointless cases.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-01 13:08:45 -07:00
Linus Torvalds
5ea16c0bab Don't ignore surface events in xml parsing
I missed the fact that not only did we skip importing surface events
from the dive computer, we had also made our xml parser ignore them when
loading an xml file.  All part of our historical "let's ignore surface
events because dive computers are being very annoying about it".

Signed-off-by: Linus Torvalds <torvalds@linux-foundtion.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-01 13:08:22 -07:00
Linus Torvalds
7bbd8cc974 Don't ignore surface events from libdivecomputer
There are cases where we actually want to keep them, as exemplified by
this situation from Richard Yorke:

  "I have just come across a situation when ignoring the surface marker
   is a disadvantage.  I have just had a problem with my BC feed
   seeping, slowly filling my BC and as I control my buoyancy on the
   bottom using the air in my drysuit, I did not notice, so that when I
   came to ascend the expanding air in my BC caused a loss of control.

   Fortunately not from a great depth and no untoward consequences.
   However, the Subsurface profile only shows me rising to 4m and
   descending to 5.5m for my safety stop.  However I actually broke the
   surface and descented to 5.5 but the frequency of recording depth was
   not fast enough to show this as it was so brief"

so remove the code that ignores the surface events entirely.

I think we'll have to come up with some smarter filtering model for
showing them, but that is predicated on getting these events to come
through in the first place.

Reported-by: Richard Yorke <yorke.richard@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-31 10:16:20 -07:00
Linus Torvalds
2582972121 Make 'clear_dive()' free the primary dive computer data properly
Our primary dive computer really is special, not just because it's the
first one: it's directly embedded in the "struct dive", and so if you
just walk the divecomputer list, you'll miss it, because it's not _on_
the list, it is the very head _of_ the list.

We had that bug in copy_dive(), and it turns out we have it in
clear_dive() too: clear_dive() would free all the dive computers on the
list, but not the actual primary one.

This is a minor memory leak, no more, so it's not exactly critial, but
let's just do it right.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-31 10:16:13 -07:00
Rick Walsh
8acbeed555 Add some gas mix validation to the planner
A few basic rules for gas validation:
	We can't have <0%, or >100% of either O2 or He
	O2 + He must not be >100%
	Switch depth can't be <0%

This places limits on user-input values

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-28 14:24:10 -07:00
Miika Turkia
47a2e8b1d9 Shearwater import model name for Petrel and Predator
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-28 14:23:10 -07:00
Miika Turkia
1aa6bd9904 Set model on Shearwater import
For starters, let's just state that this dive was downloaded from
Shearwater. However, once we have information how model numbers map to
names, we can use that info for the models we know about.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-28 14:22:58 -07:00
Miika Turkia
1e5fe4f3fe Use serial as device ID on Shearwater import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-28 14:22:51 -07:00
Rick Walsh
1e607ae98d fixup: Don't confuse EAD and END
The previous patch (Planner: add best mix EAD preference) used the term EAD
(equivalent air depth) in variable names and strings, when it should have been
END (equivalent narcotic depth).
They're not the same thing and shouldn't be confused.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:55 -07:00
Rick Walsh
9b29173363 Planner: add best mix EAD preference
Add best mix EAD preference and UI, along with a tooltip describing what it
does

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:38 -07:00
Rick Walsh
67dda48c88 Add best mix function to planner cylinder model
This allows calculation and selection of best mix in the planner cylinder
entry, by entering the gas depth, followed by "b" for best (trimix) mix, or
"bn" for best nitrox mix.

The UI is not intuitive, but it is quick and easy.  At the very least, it
should be documented.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:30 -07:00
Rick Walsh
b61b3a8d28 Add functions to calculate best mix
Best mix O2 calculated based on planner Bottom O2 preference
Best mix He calculated based on EAD of 30m (should be made user-configurable)

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:23 -07:00
Joakim Bygdell
a6c8d0028e Make autocomplete work on add dive
This sets the list models for autocompleting suit, buddy and
divemaster.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:01:53 -07:00
Joakim Bygdell
80274b0968 Add init function to qmlmanager
In order to get autocomplete to work on manual dive add
we apparently need a separate init function.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 06:59:38 -07:00
Joakim Bygdell
6be5aba799 QML UI: hide handles for comboboxes
Hide the handles for the comboboxes, making the text input fields
look like the normal text fields.
This is left as a separate patch as there currently seems to be issues with autocomplete
on Android.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:06:24 -07:00
Joakim Bygdell
0e4e8edf78 QML UI: add comboboxes to DiveDetailsEdit
This adds autocompleting text input fields for suit, buddy and
divemaster.

[Dirk Hohndel: some whitespace cleanup]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:05:20 -07:00
Joakim Bygdell
fcc370b2fe Add functions to DiveObjectsHelper
This generated the QStringLists needed to populate the combobxes
in DiveDetailsEdit.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:02:27 -07:00
Miika Turkia
6392bf83ab Use manual temperatures in CSV details import
When importing dive details from a CSV file, it is better to treat the
values as manually imported instead of imported from a dive computer.
The original way discarded the temperature values from the details
import if a dive profile was imported and merged to the dive details.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:02:22 -07:00
Miika Turkia
2936b63a04 Typo in CSV import
Variables are started with $ sign...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:02:09 -07:00
Miika Turkia
c259a8f6fe Fix typo
Ends up being "enteryour" without the space.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 09:28:30 -07:00
Miika Turkia
b468390155 NULL terminate the parameters array
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:28:28 -07:00
Miika Turkia
30976c05a4 Parse txt formatted log files
This parses .txt log files produced by Dataplus and Oceanlog software.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:28:07 -07:00
Miika Turkia
98741c864c Use encoded file name on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:28:00 -07:00
Miika Turkia
74065ad8aa Allow parsing of .txt files on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:27:31 -07:00
Dirk Hohndel
b2d2d13650 Update translation sources
This removes the strings from the dummy files and the theme test file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-04 15:13:12 -07:00