Commit graph

7205 commits

Author SHA1 Message Date
Tim Wootton
93d59c22d7 Match agreed captalisation style
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 07:57:33 -08:00
Tim Wootton
f72ec5e29b Consistent representation of O₂
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 07:57:28 -08:00
Robert C. Helling
81fce5ad19 Assign setpoint to correct sample in planner
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 07:30:23 -08:00
Dirk Hohndel
702c751ecf Let's not store more or less random data
The backend needs to convert the firmware and serial information into a
sane string - Subsurface shouldn't try to do this by itself.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 12:21:49 -08:00
willem ferguson
b493a9967e CCR dive logs: git I/O
This patch privides for writing CCR dive log parameters to a git
repository and for reading the data back from a git repository.
This involves writing and reading the following members of the
structures of sample:
  o2sensor[3]
  o2cylinderpressure
and dc->no_o2sensors.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 12:14:03 -08:00
Miika Turkia
42dbecae17 Tooltips for some of the manual CSV import fields
Date and duration formats are not necessarily self explanatory so adding
tooltips to explain the expected format.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 09:42:19 -08:00
Miika Turkia
61ad81cf7a Default dive number on manual CSV import
If manual CSV import does not have any dive number, give a default one
so that the dives get import and not silently ignored.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 09:42:19 -08:00
Dirk Hohndel
f32e6a853e Latest strings and translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 07:25:33 -08:00
Robert C. Helling
4a751750e0 Reset plot info pointer when painting several polyons
For each polygon that we paint we have to step through the
plot_info from the start again.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 06:50:19 -08:00
Robert C. Helling
79d5a41182 In our floating point comparison 0.0 should be equal to 0.0
We when comparing floating points we do a relative comparison of the difference.
This fails when both numbers are (exactly) 0.0 which happens to occur when plotting
an O2 graph without o2 data resulting in both min and max for the y-axis to be 0.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 06:49:04 -08:00
Dirk Hohndel
bf14d31804 Make the button labels for apply / cancel of edits more consistent
Before you could 'Cancel' the edit and then would be asked if you wanted
to 'Discard' your changes or 'Cancel'. So clicking 'Cancel' cancelled the
action of having clicked 'Cancel'. That's so confusing, it's even hard to
explain. Yes, it uses "typical" language for user interaction and kind of
makes sense, but it's not easy to understand for the non-technical user.

With the new labels the user is asked to whether they want to 'Apply' the
changes or 'Discard' them. And when they choose 'Discard' the verification
question is still 'Discard' or 'Cancel'. That seems much more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-23 07:45:17 -08:00
Robert C. Helling
13934b0f02 Check error code of get_cylider_idx_by_use()
If not cylinder with type DILUENT or OXYGEN is defined, this function
returns -1 which should not be used as an index to an array. This
patch adds code to check for this return value and exit gracefully.

On line I marked with a comment. Someone more knowledgeable of that part of
code than me should double check that return is here what we want.

[Dirk Hohndel: fixed small oversight...]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22 16:22:57 -08:00
Dirk Hohndel
38bbed978a Use our own file open dialog
Clearly the static dialogs don't work. Even with the previous commit the
dialog still said "Save" insted of "Open". So let's just assemble our own
dialog and be done with it. I hope I got all the options right...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22 16:06:01 -08:00
Dirk Hohndel
ba1631f52d Don't ask confusing questions in open file dialog
Using the SaveFile dialog to open a file caused it to ask the user if they
wanted to overwrite a file when they actually tried to open an existing
file. This fixes that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22 07:47:25 -08:00
Miika Turkia
cc857e6fe4 Add qtwebkit-devel to Fedora installation reqs
One more packet needed to compile on Fedora.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22 06:48:14 -08:00
Dirk Hohndel
48a8c98913 Correct Uemis extra data
When dropping the pointless surface samples at the end of the dive we
stopped going through all the samples - for that reason the offset at the
end to find the data in the footer was wrong.

Now the extra data all seems to match what I can see on my screen after
the dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 21:43:36 -08:00
Dirk Hohndel
74dd93c6a4 Improve Uemis debug output for short data blocks
It's useful to know just how short the read was when trying to figure out
what went wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 21:42:55 -08:00
Dirk Hohndel
acb8a0e118 Add serial and firmware to the extra data
And add the missing newline to the debug output to help us identify
encodings for serial and firmware.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 21:42:00 -08:00
Anton Lundin
5437e9f637 Create a subsurface_access for Android too
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 12:14:30 -08:00
Dirk Hohndel
fc7f0c6215 Use getSaveFileName() as the file open dialog
This way we can specify file names that don't exist and therefore make our
git syntax (/path/to/dir[branch]) work.

Thanks to Tomaz for pointing this out.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 09:46:24 -08:00
Miika Turkia
61cc1c4dbe Instructions for building Ubuntu packages
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 08:58:40 -08:00
Robert C. Helling
61961b11ad Print gas changes at the correct lines in diveplan
This is a pain. We plan with segments but the plan shows waypoints.
If after a constant depth segment the gaschange (or setpoint chenge
for that matter) appears, the _next_ line should get the info
about the new gas (i.e. change _after_ the constant depth segment).

If, however, the gas is changed after a transition, the final waypoint
of the transition gets the gas printed.

And all is different for a verbatim plan, where the gas change is
an event rather than part of a segment.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 07:42:49 -08:00
Robert C. Helling
3f0159b734 Show the setpoint in the diveplan
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 07:42:21 -08:00
Robert C. Helling
1dfebe7c10 Don't plan gas switches when in CCR mode
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 07:42:09 -08:00
Willem Ferguson
e288751353 Update fixup_pressure to calculate CCR oxygen cylinderpressures
Fixup_pressure() needs to calculate the cylinder pressures at the
start and at the end of the dive, also for CCR oxygen cylinders.
Since, in the case of CCR, the default cylinder is the diluent,
this is not automatically done for oxygen. This code provides
for fixup_pressure() to be able to do the calculations for oxygen
as well. Another change to fixup_dive() invokes fixup_pressure()
to calculate the values for the oxygen cylinder.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 07:33:52 -08:00
Willem Ferguson
27d19b605b Save-XML: Correct bug in cylinder gas parameters
Correct a bug that I introduced previously.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>

From 45570d66ecf238aec8997f5d0c20c01dfe0aa4fa Mon Sep 17 00:00:00 2001
From: willem ferguson <willemferguson@zoology.up.ac.za>
Date: Fri, 21 Nov 2014 14:59:14 +0200
Subject: [PATCH] Save-XML: Correct bug in cylinder gas parameters

Correct a bug that I introduced previously

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 07:31:22 -08:00
Dirk Hohndel
19aa4245b4 Remember serial and firmware for divecomputers
This is not the right way to get serial numbers and firmware versions. The
libdivecomputer interface here is simply broken. Those ARE NOT numbers.

But until we have the capability in libdivecomputer to return reasonable
strings to us, this could be a stop gap measure to help us understand how
these are formatted.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 15:04:37 -08:00
Dirk Hohndel
7cedc4d48f Stop cluttering stout with DC_VENDOR data
This was intended for debugging and somehow stayed enabled.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 15:04:37 -08:00
Anton Lundin
e883819061 De-obfuscated Poseidon gaschange event building
After some feedback on the mailing list, bitwise XOR wasn't the
preferred way to build the gaschange event.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 14:32:27 -08:00
Anton Lundin
72c47a856e Adjust Poseidon Mouth piece event strings
After some feedback on the mailing list, these strings where preferred.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 14:32:15 -08:00
Dirk Hohndel
2f7a7f3e6a Prevent garbage from being saved in the userid field
It seems that in some scenarios we end up with a string that isn't NUL
terminated and that results in garbage being stored as userid. This patch
is a little brute force but it fixes the problem even if a previous
version os Subsurface ended up adding other text to the end of the userid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 14:30:44 -08:00
John Van Ostrand
21675de534 Small changes to Yearly Statistics window
Added a title bar with close button.
Set an appropriate title.
Centred the window relative to mainwindow.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 07:47:20 -08:00
Robert C. Helling
a4679300cc Correctly computer O2 partial pressure
I had forgotten a / 1000.0 in the conversion of partial pressures from (double) bar to (int32) mbar.

Fixes #763

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 07:46:47 -08:00
Anton Lundin
54237cb9a7 Fix warnings in debug_print_profiledata
Use the right format, now when those variables are integers and not
doubles.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:51:59 -08:00
Anton Lundin
d3ca1df765 Change the OSTC3 macros to have a ; in the end
This changes the OSTC3 READ_SETTING/WRITE_SETTING macros into something
that can have a ; in the end which makes some editors auto-indent it better.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:51:38 -08:00
Anton Lundin
36b6045460 Document more about fields in Poseidon MkVI logs
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:50:33 -08:00
Anton Lundin
e2c9c0bec4 Create more events from Poseidon MkVI logs
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:50:10 -08:00
Anton Lundin
8486a32515 Create gaschange events from Poseidon MkVI logs
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:50:01 -08:00
Anton Lundin
7caad0c0df Create events from mouthpiece position
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:47:19 -08:00
Anton Lundin
f6b2fe3bf0 Add support for importing CEILING from MKVI logs
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:46:53 -08:00
Anton Lundin
61239a890c Import NDL from Poseidon MKVI logs
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 17:46:33 -08:00
Dirk Hohndel
3dc864f1b1 Profile: adjust tank pressures at gas change (incomplete)
This code sets up the UI that will allow the user to adjust tank pressures
at a gaschange event. The actual changing of the pressure is not
implemented, yet, so this is disabled until someone finds time to do so.

The scenario is this: a tec diver or sidemount diver without pressure
sensors on at least one of their tanks still wants to reasonably
accurately track gas consumption during a dive. The diver takes notes of
the pressures at every tank switch (I find that odd, but apparently some
cave divers indeed do that as they switch back and forth between different
gases) and then wants to adjust the pressures in Subsurface to match those
written down.

One difficulty here is that the first and last pressure of a tank with no
sensor data is still considered "sensor pressure" - this is basically an
implementation detail in the code that is used to do the pressure
interpolation to have constant-SAC pressure plots for tanks without
sensors. So when we check if there is indeed no pressure data available at
the gas change, we can't just work with the interpolated pressure - if
this is the first (or last) time the tank was used, that pressure may be
marked as sensor pressure.

What's missing is the UI to enter the desired new pressure plus the black
magic that actually inserts this into the dive in a way that doesn't break
the assumptions in the rest of the code. I'm running out of time to do
that but wanted to preserve this code so someone can continue this later.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 16:29:27 -08:00
Dirk Hohndel
f2a2ded04e Profile: don't offer to switch to an already active tank
Adding a gas change to tank that we are already breathing from makes no
sense, so let's not offer this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:44:33 +00:00
Dirk Hohndel
639e079131 Profile: add helper function to get the sample entry for a mouse position
This seems quite useful to have.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:40:42 +00:00
Dirk Hohndel
21658383e5 Profile: keep the plotInfo in the corresponding member variable
We had the variable. As a pointer. Which we used memset to clear. Ouch -
that smells like some bad cut and paste.

With this change the object keeps the corresponding plotInfo around (just
like some others do) and can use it later. I suspect this code could use
some larger cleanup, but it's a bit too late for this in the development
cycle, I guess. I'm sure I'll regret this in the future...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:28:16 +00:00
Dirk Hohndel
76c44dd6a3 Don't offer to add a gas change if there is ony one gas
In the context menu of the profile it makes no sense to offer the ability
to switch gases unless there is a gas to switch to.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:15:33 +00:00
Salvador Cuñat
9848760821 Update spanish translation of user manual to english e0c9ebf
Includes the dive list filters and modifications on tissues graph.
Corrects a typpo.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 00:54:22 +00:00
Robert C. Helling
9561fa3f3e Cleaning up pressures
Added comment about meaning of o2pressure in struct plot_info.

Turned some pressures from double (in bar) to pressure_t (in mbar)

[Dirk Hohndel: picked parts of this patch and dropped others]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 13:25:17 +00:00
willem ferguson
46acb24a86 Update todo list for CCR
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 13:15:43 +00:00
Dirk Hohndel
1723c01603 Replace other references to hohndel.org
The only place where I'm not sure if there are unintended sideeffects of
changing over to the new domain is QCoreApplication::setOrganizationDomain

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 13:13:39 +00:00