Variables without conversion, do not need to pass plannerShared
(due to the QML interface).
Simple variables do not pass plannerShared, but diveplanner
in desktop-widgets and qmlinterface in mobile-widgets call the
implementation directly.
Signed-off-by: jan Iversen <jan@casacondor.com>
Make notes rates available to QML through the Backend interface.
Remove the corresponding variables from plannerShared.
Getters are from prefs. while setters are linked to diveplan model.
Remark: signals from qPrefDivePlanner is used, because the diveplanner model
sets qPrefDivePlanner but do not issue special signals.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change ascent/descent setter function names to set_<name>Display
to show the value is prepared for displaying (common for desktop and QML).
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The spinboxes are already connected to diveplannermodel set_ functions, remove
second connect to plannerShared.
Change get functions to use diveplannermodel.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The last SIGNAL/SLOT cannot be converted due to a limitation in the
new connect() syntax, it does not "understand" default parameters.
Signed-off-by: jan Iversen <jan@casacondor.com>
Change connect for QAbstractButton::clickedto new syntax.
Change connect for QDialogButtonBox::accepted/rejected to new syntax.
Signed-off-by: Jan Iversen <jan@casacondor.com>
correct SLOT was sec_bottomsac(double), which
is not reported as an error.
correct to set_bottomsac(double)
Signed-off-by: Jan Iversen <jan@casacondor.com>
QSignalMapper gives a warning that it is depreciated, and the
doc. states that using a lambda function is more efficient.
Replace use of QSignalMapper.
Signed-off-by: Jan Iversen <jan@casacondor.com>
QSignalMapper had a parameter convert problem, when mapping to
set_deco_mode in plannerShared.
Use lambda function in connect to avoid parameter convert problem.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Use plannerShared setter to update the variables in qPref.
This will also signal the cylindermodel to calculate a new bestmix.
variables:
bottompo2
decopo2
bestmixend
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use plannerShared setter to update o2narcotic. This will also signal
the cylindermodel to calculate a new bestmix.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
variables
bottomsac
decosac
problemsolvingtime
sacfactor
are not set in diveplanner.cpp, but instead
signals a slot in plannerModel.
change signals to slots in plannerShared
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
variables
min_switch_duration
are not set in diveplanner.cpp, but instead
signals a slot in plannerModel.
and are read from plannerShared which includes a conversion
change signals to slots in plannerShared
change read from prefs. to plannerShared
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
change local doo2breaks to plannerShared and update connect.
change signals to slots in plannerShared
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
variables
drop_stone_mode,
last_stop,
switch_at_req_stop
are not set in diveplanner.cpp, but instead
signals a slot in plannerModel.
change signals to slots in plannerShared
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
change local setBailout to plannerShared and update connect.
change signals to slots in plannerShared
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
planner_deco_mode is not set in diveplanner.cpp, but instead
signals a slot in plannerModel.
reserve_gas is not set in diveplanner.cpp, but instead
signals a slot in plannerModel.
change signals to slots in plannerShared
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
WARNING: multi directory commit, needed to secure it builds.
move the core/plannerShared.* to backend-shared.
update CMakeLists.txt to include backend-shared lib in link process.
update ios project to reflect new directory
Signed-off-by: Jan Iversen <jan@casacondor.com>
change the settings variables using UNIT_FACTOR to use
plannerShared instead.
There are no changed functionality, it is simply removing calculations
from the UI.
Signed-off-by: Jan Iversen <jan@casacondor.com>
When connecting a model to the TableModel class, it would connect
clicking on an item to the remove() slot of the model.
This breaks the program flow implied by the undo code:
Ui --> Undo-Command --> Model --> UI
Moreover, the naming of the remove() slot is illogical, because
clicks can also have different effects, as for example in the
cylinder-table.
Therefore, move the connect() call from TableModel to the
callers. In the case of TabDiveSite, move the remove() function
from the model to the TabWidget, where it makes more sense.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When computing the best mix for a target depth, for helium, one
can either require that the partial pressure of N2 is the same
as at the target depth or the partial pressure of N2 plus O2.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Since requiring Qt >= 5.9.1, we can use the pointer-to-member-function
overloads of addAction (introduced in Qt 5.6). This has the advantage
of compile-time checking of the signal/slot parameters.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The units.h file has two functions to convert atm pressure to mbar
and also to convert mbar to atm pressure. Implement these two
functions in the planner.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
This adds a checkbox for rebreather modes of the planner
that force the ascent to be in OC mode. Before, one had
to add a one minute last segment with the mode change but
this is not practical when manually searching for the
maximal bottom time given gas reserves.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This reverts commit 321a920a98.
It appears that the load_xxx functions aren't called, so while the correct
values are stored to the settings, they aren't retrieved. Let's revert while
this gets fixed.
Fixes#1609
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The variables referenced are moved into qPref in earlier commits
so in general all QSettings calls are replaced by qPref*:: calls
Signed-off-by: Jan Iversen <jani@apache.org>
remove use of SettingsObjectWrapper::
remove include of SettingsObjectWrapper.h
use qPrefFoo:: for setters and getters
replace prefs.foo with qPrefXYZ::foo() where feasible
(this expands to the same code, but gives us more control
over the variable).
Signed-off-by: Jan Iversen <jani@apache.org>
remove DivePlanner from SettingsObjectWrapper and reference qPrefDivePlanner
update files using SettingsObjectWrapper/DivePlanner to use qPrefDivePlanner
this activated qPrefDivePlanner and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
There were two catch-all classes for translations outside of class
context. gettextFromC was used exclusively from C, but C++ used
both, gettextFromC and QObject. Some of the string were even present
in both. Therefore, unify to gettextFromC throughout the code base.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Correctly use gettextFromC::instance()->tr(); instead of a simple
tr(); to translate the dive mode names.
This goes on top of 0bc9edf855
and finally makes the whole thing work.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>