Commit graph

70 commits

Author SHA1 Message Date
Dirk Hohndel
f2b883865c Revert "Pref. to ascent to next stop only when stop is below ceiling"
This reverts commit a6ed36fb73.
2015-08-18 06:40:35 -07:00
Robert C. Helling
a6ed36fb73 Pref. to ascent to next stop only when stop is below ceiling
Usually, we try to ascent to the next stop and check if we break the
ceiling while doing that. This patch adds a preference value to rather
check if the ceiling is above the next stop before attempting to ascent.

The difference if off-gasing during the ascent is taken into account.

Logically, it does not sound like it could be relevant to ignore that
off-gasing but it leads to more conservative schedules and it seems
the original Fortran VPM-B implementation does just this. So one could
argue it is part of that model (if it makes sense or not), so we should
at least give users the possibility to turn this on.

Maybe we should even make this the default for VPM-B.

This patch just addes the code to have the value in the preferences and
the planner to act accordingly. There is no UI for it, yet. To test, you
have to set it in the code. There could be a later patch with a UI if people
like to have it.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:58:09 -07:00
Jan Darowski
cad866013b VPM-B: Add conservatism levels to deco.c
Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 14:36:07 +02:00
Jan Darowski
500fbe4994 VPM-B: add deco choice to the ui.
Removed recreational mode from ui and pref and replaced it with
new deco_mode enum.
Added radio button ui selection.
Set default deco_mode to Buehlmann algorithm.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03 23:07:58 +02:00
Dirk Hohndel
a413141b33 Geo taxonomy: adjust the preferences to the new data structures
This allows us to pick which three categories of geo taxonomy will be
shown in the UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 12:38:40 -07:00
Rick Walsh
425020d2de Add only switch at required stop option
Add the option to only switch at required stop to the planner UI.  This is not actually used yet.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 06:14:24 -07:00
Tomaz Canabrava
21c46b8c2d Preferences infrastructure for GeoManagement
Simple preferences infrastructure with default prefs, prefs and hooks for
the Qt Settings system and our preferences ui.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:11:51 -07:00
Rick Walsh
4dfdea1e1d Add planner minimum gas switch duration option
Add the option for a minimum gas switch duration to the planner UI.  This is not actually used yet.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-19 09:15:09 -07:00
Dirk Hohndel
ff4b5478b5 Store the user's unit preferences in git storage
Save and load a usually unused copy of the preferences with the units that
were active the last time the dive list was saved to git storage (this
isn't used in XML files); storing the unit preferences in the data file is
usually pointless (that's a setting of the software, not a property of the
data), but it's a great hint of what the user might expect to see when
creating a backend service that visualizes the dive list without
Subsurface running - so this is basically a functionality for the core
library that Subsurface itself doesn't use but that another consumer of
the library (like an HTML exporter) will need.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 09:48:10 -07:00
Dirk Hohndel
617b105458 Cloud storage: create preference entry for base URL
This just deals with the mechanics. There is no UI to enter / change this
URL (and that's intentional), neither is it used, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-15 09:56:11 -07:00
Dirk Hohndel
492369b312 Cloud storage: Add preference option whether to sync in the background
This defaults to on as that's the most useful setting for the average
user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12 11:48:56 -07:00
Dirk Hohndel
a6b6674780 Cloud storage: rethink the terminology used
Cloud storage makes more sense that remote storage - at least I assume
that more people are used to thinking about "storing things in the cloud".

Don't use PIN or passphrase, call it a password everywhere.

Don't use copy_string() to copy the password - the git credentials routine
asserts that password is not NULL, so make sure we at least have a pointer
to an empty string here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31 19:45:05 -07:00
Dirk Hohndel
20d1d2c385 Remote storage: add preference for the passphrase
While we don't expose it as this to the user, we'll need an ssh key and
potentially a passphrase in order to communicate with the git server in
our infrastructure. This simply sets up a way to store the passphrase.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:38:59 -07:00
Robert C. Helling
187f7dab9f Add option to display GPS coordinates as decimals
This adds a field to the units preferences to have GPS coordinates
show as decimals (as for example Google maps does it).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-20 10:34:10 -07:00
Joakim Bygdell
afea30fd8a Recmode: Allow the user to specify gas reserve.
Since most regulators have an intermediate pressure of 10bar
the minimum value is 10 while the max is 99.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-09 14:36:17 -07:00
Robert C. Helling
cc8d601422 Checkbox and preference for safety stop
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:46:10 -07:00
Robert C. Helling
8571dcf967 Introduce recreational planner mode
This adopts the planner to the needs of the recreational diver. Rather than immediately
starting to ascent doing deco stops this mode, this mode stays at the last manually
entered depth for the maximal time before mandantory stops appear (NDL). It does not
change gas but keeps using the last used cylinder.

TODO: * Grey out unused UI elements of the planner in this mode
      * Start ascent before gas runs out (or into reserve)
      * Do a 3min @ 5m safety stop.

Fixes #840

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:45:50 -07:00
Gaetan Bisson
5bf23381e0 Save more planner settings into prefs
This adds to the prefs struct the variables last_stop, verbatim_plan,
display_runtime, display_duration, and display_transitions from the
planner so their values are saved from one session to the next.

The widgets for some of those settings had default values in
plannerSettings.ui; remove them since the new code in
subsurfacestartup.c takes care of initializing them.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-25 09:45:46 -07:00
Lubomir I. Ivanov
c45768a09f add and use a version.c / version.h pair
version.c is now object code which is recompiled each time
ssrf-version.h changes, while the interface file version.h
remains that same at all times and files which include it
will not need to be recompiled.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 13:26:51 -08:00
willem ferguson
a700be3207 CCR option: display o2 sensor data
This patch creates the possibility of viewing the individual sensor
values when the po2 button on the profile toolbar is activated. This
follows exactly the procedure for optionally displaying the setpoint
values while viewing po2. A checkbox in the preferences panel determines
whether sensor information is shown. By default it is set to OFF. When
checked, and the po2 button is activated, sensor1 values are shown in
grey, sensor2 in blue and sensor3 in brown.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21 17:00:18 +12:00
Robert C. Helling
f2939dd991 Minor PSCR fixes
Update O2 metabolsim rate and adopt default gas switch depths to
pSCR oxygen drop.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:17:29 +13:00
Robert C. Helling
e219bc70f8 Refactor dctype -> divemode
... and repair a failed rebase (sorry).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:25 -08:00
Robert C. Helling
a478eb5711 Maintab combobox to set dive type
still needs some work

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Willem Ferguson
0de3bc8452 Display CCR setpoint values on the po2 graph
When a CCR dive is viewed and the toolbar button for PO2 is activated,
both the PO2 (green line) and the O2 setpoint (red line) are shown.
This allows evaluation of the PO2 in the CCR loop with respect to the
pre-configured O2 setpoint.

The setpoint graph can be disabled from the Preferences/Graphs tab
by checking the appropriate checkbox.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:18:06 -08:00
Dirk Hohndel
3e6a721771 Always show the full git version when called with --version
This way we finally get the right version shown on Mac and Windows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 12:00:48 -08:00
Tomaz Canabrava
ee5d93e155 Changed Facebook stuff to socialnetworks.h/cpp
All Facebook related stuff now is on SocialNetworks.h/cpp
this makes it much easier to implement things and looking
for bugs.

working:
- logging in
- getting user id
- getting album id ( or creating it )

*much* more testing is needed, of course.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 15:54:28 -08:00
Tomaz Canabrava
14a858cf2a Save and restore Facebook Prefs.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:38:12 -08:00
Anton Lundin
da154222cc Free strduped prefs before exit
This plugs a leak detected by valgrind.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 07:20:10 -08:00
Miika Turkia
4875de45e6 Default some graphs to false
These values are treated as false upon starting Subsurface. Thus they
should be set to false as well. Otherwise extra graphs are drawn to the
profile when exiting the preferences dialog.

Fixes #783

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-14 11:42:29 -08:00
Robert C. Helling
06ddfc0122 Prepare for PSCR calculations
Calculations for passive semi-closed rebreathers are pretty much like OC
except the pO2 is lower bey a certain (SAC dependent) factor. This patch
introduces the corresponding calculations in case dctype == PSCR which is
so far never set and there is currently no UI for these calculations. As
pO2 is SAC dependent it takes a certain attempt at getting it and drops to
defaults from the prefs otherwise.

As there is no UI at this point and I also don't have any dives, this has
not received much testing, yet, but it compiles. At least.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 07:13:04 -08:00
Robert C. Helling
3fc9c1e005 Tissue saturation plot a la Sherwater Pretel
This adds a toolbox icon to turn on a tissue plot inspired by the bar
graph of the Sherwater Petrel,

It shows the inert gas partial pressures for individual compartments. If
they are below the ambient pressure (grey line) they are shown in units of
the ambient pressure, if they are above, the excess is shown as a
percentage of the allowed overpressure for plain Buehlmann. So it has the
same units as a gradient factor. Thus also the a gradient factor line (for
the current depth) is shown.

The different tissues get different colors, greener for the faster ones and bluer
for the slower ones.

Positioning and on/off icon action still need some tender loving care.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:46:30 -07:00
Dirk Hohndel
e893f6bd9d Use the Windows default font on Windows 7 and 8/8.1
It contains the characters we need and will make the application look more
"native".

See #712

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-22 15:56:57 -07: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
Tomaz Canabrava
65eefe7b59 Animation speed is a value, not a boolean
This breaks compatibility with old preferences, but it's a single
key and not that very important so I don't think it's a bigger issue
I've renamed prefs.animation to prefs.animation_speed to denote
that it's a value, and not a state.

Also, fixed the places that were treating it as a state (on/off)
to treat it like a correct value.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23 07:50:03 -07:00
Anton Lundin
60c4587be6 De-duplicate planner default settings
All other default settings we get from subsurfacestartup.c's
initialization of the prefs struct. The planner had its defaults there
and in the retrieve of the settings from QSettings.

This changes so the defaults for planner settings will be read from the
defaults prefs struct as all other settings.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-19 10:24:07 -07:00
Gaetan Bisson
e69bb1879e Store drop_stone_mode, bottomsac, decosac in prefs
The values for drop_stone_mode, bottomsac, and decosac are typically the
kind of personal data specific to a diver that is unlikely to change
from one dive plan to the next.

This patch stores/restores them to/from the preferences file. For this,
it adds bottomsac and decosac to the prefs structure; drop_stone_mode
was already there, though not stored/restored.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 23:09:56 -07:00
Tomaz Canabrava
503a150af0 Added the toggle picture button and hoocked it up
This patch adds the toggle picture button and hoocks
it up with the rest of the code. I'v also changed a call
from ProfileWidget because it caused errors on the ui
generated code, where it would try to call an still-to-be
instantiated object.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 19:59:23 -07:00
Anton Lundin
2ff2daebd7 Move drop_stone_mode setting to prefs
There is no reason to treat drop_stone_mode different from the rest of
the planner settings, so move it to our prefs structure.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09 14:40:36 -07:00
Robert C. Helling
5db706d291 Planner: Add backgas breaks
If the corresponding checkbox is checked the planner does interrupt
pure O2 deco after 12min for 6min on cylinder 0.

To make this work for air I removed the gasmix_is_null logic.

I guess that makes the planner feature complete for the next release.

[Dirk Hohndel: trivial merge into latest master]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03 16:33:19 -07:00
Robert C. Helling
65c5d6815c Make pO2 settings functional in planner
Spin boxes for pO2 are now hooked up to preference values. Adding new
cylinders (or changing their fo2) computes the MOD accordin to the current
value of decopo2. Note that chaning the limits for deco pO2 does _not_
automatically update the switch depth of all cylinders as those might have
been manually entered.

Furthermore, MOD has now to option of rounding to multiples of a given
depth. That is used for the automatic switch depth which are now always
multiples of 3m (so that EAN50 is switched to at 21m rather than 22m).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-25 21:07:10 +08:00
Robert C. Helling
772727fc7f Hook up UI elements for ascent rates to planner
That provides some UI elements that were recently introduced with function
of allowing the ascent rates of the planner to be configured by the user.

I tried to make it work both with senisble as well as with imperial units.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-25 13:48:44 +08:00
Henrik Brautaset Aronsen
630ec88dd4 Be more consistent in partial pressure naming
Lets just use pO₂ instead of PO2, ppO2, ppO₂, PO₂.
They all mean the same, but it's better to be
consistent

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-23 06:48:54 +08:00
Dirk Hohndel
8bd535d092 User survey: force running the survey from command line
This way people can test the dialog much easier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14 14:45:42 -07:00
Dirk Hohndel
b303f217a9 Dive list: add context menu function to renumber dive(s)
No attempt is made to ensure that what the user does is sane. So this can
result in duplicate numbers, non-consecutive numbers, non-monotonous
numbers, whatever floats the users boat.

You can renumber a single dive or all selected dives (with a starting
number given that is applied to the oldest selected dive and then for each
newer selected dive that number is incremented by one).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-20 06:11:32 +09:00
Gehad Elrobey
8380f09619 Renaming the prefs struct members to be consistent with the QSettings.
-Renaming prefs members for consistency.
-Changing references of QSettings to the prefs structure instead.
-Removing unused functions in pref.h were left over from an old version.
-Changing the data-type of bool members to short for consistency with other members.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-16 13:09:55 -07:00
Gehad elrobey
cdf83f5ef6 Change some references of QSettings to the pref struct.
After adding the animation member in the preference struct, it is
very resonable to change these references of QSettings to the
preference structure instead.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-11 07:21:15 -07:00
Lakshman
6a8d929876 Feature to show or hide heart rate graph
Adds new push button "HR" to the button bar on the dive profile to
toggle display of heart rate.

TODO: New icon for the heart rate button is needed.

Fixes #485

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-10 09:21:43 -07:00
Lakshman
ecc8c1d995 Remove check option to show units in text label
Currently the feature to show temperature units while adding dive is
provided through checkbox in preferences->units section. This patch
disables this checkbox and always enables this feature.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-05 13:27:53 -07:00
Lakshman
7696fbf9cd Toggle showing average depth
Add additional check box in "preferences->graph" section that allows
users to hide average depth on dive profile.
By default this option is checked to show average depth.

Fixes #475

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-28 09:38:08 -07:00
Lubomir I. Ivanov
74ed786d75 Add optional Win32 console allocation
This patch adds the optional --win32console command line option.
It does nothing on OSx and Linux, while is only useable on Win32.

On Win32 if the application was built as GUI (not console),
there is no way to view stdout and stderr. With windows.c's
subsurface_console_init() we are able to either redirect
stdout and stderr to the terminal from which subsurface.exe
was started (always happens; --win32console does nothing in
this case) or if --win32console is explicitly added to
a shortcut, create a dedicated console window and monitor
the output there.

if set, WIN32_CONSOLE_APP is a condition that will make the
subsurface_console_init() and subsurface_console_exit()
functions NOP on Windows. The definition will be created if
the user passes 'CONFIG += console' to qmake.

Fixes #436

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-25 07:57:27 -07:00