Commit graph

7270 commits

Author SHA1 Message Date
Dirk Hohndel
bb12dea03c Allow LIBDCDEVEL to specify a path
That's something I had wanted to fix so many times...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-02 08:51:31 -08:00
Anton Lundin
60f09bbd42 Remove libdivecomputer ifdefs for configuring OSTC
The hw_ostc_device_eeprom_read / hw_ostc_device_eeprom_write functions
have bin in libdivecomputer since v0.1.0, so there was an error when the
read settings part ended up behind ifdef's.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-02 07:06:12 -08:00
Miika Turkia
194d4b4c00 Variable should be declared before loop
Fixing incorrect variable scope. (I do not really see any functional
differences on Firefox, but better declare the variable before the
loop.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-02 07:05:42 -08:00
Lubomir I. Ivanov
de49957a52 configuredivecomputerthreads.cpp: conditionally define read_ostc_cf()
Fixes a warning. The function is only used if
DC_VERSION_CHECK(0, 5, 0) is defined.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:31:14 -08:00
Lubomir I. Ivanov
21bfe88a30 libdivecomputer.c: reduce the scope of 'i' in sample_cb()
Silences a warning about an unused variable.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:31:05 -08:00
Lubomir I. Ivanov
a04be5a7e4 file.c: fix uninitialized variable
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:30:56 -08:00
Robert C. Helling
fb265c2929 Context menu entry to change setpoint
This patch adds a context menu entry to add a setpoint change
event. In particular, this can be used to turn a logged dive into
a CCR dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:23:45 -08:00
Robert C. Helling
96a94f1a19 A widget to add a set-point change
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:19:03 -08:00
Robert C. Helling
584775cbc0 Added XCode to Mac build instructions
In order to compile anything on Mac you need to have XCode and its command
line tools.

After an OSX update (as I just did to Yosemite) the command line tools
have to be reinstalled. Otherwise there are strange error message about
missing header files for libusb2 (even though that is still installed
via homebrew).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:17:22 -08:00
Miika Turkia
356580e8a6 Add libdivecomputer and libgit2 to Ubuntu building
Some instructions how building libdivecomputer differs from Subsurface
build. And mention to copy libigt2 over to other repository if needed.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 07:45:46 -08:00
Miika Turkia
11be32645b Tuning the manual CSV import dialog
This allows more space between the input fields in the dialog.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 13:19:54 -08:00
Miika Turkia
1b74947bf5 Allow user to select date format on manual CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 13:19:49 -08:00
Tim Wootton
3b3d8949f7 Correct diveplan as it's dive plan everywhere else in planner
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 13:18:29 -08:00
Tim Wootton
00068c2247 More 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:43 -08:00
Tim Wootton
7034907e26 Consitent punctuation of shortened words
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 07:57:39 -08:00
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