2018-08-01 15:14:04 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include "core/subsurface-string.h"
|
2018-08-14 10:25:15 +00:00
|
|
|
#include "qPrefDivePlanner.h"
|
2018-08-01 15:14:04 +00:00
|
|
|
#include "qPrefPrivate.h"
|
|
|
|
|
|
|
|
static const QString group = QStringLiteral("Planner");
|
|
|
|
|
|
|
|
qPrefDivePlanner *qPrefDivePlanner::instance()
|
|
|
|
{
|
|
|
|
static qPrefDivePlanner *self = new qPrefDivePlanner;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void qPrefDivePlanner::loadSync(bool doSync)
|
|
|
|
{
|
|
|
|
disk_ascratelast6m(doSync);
|
|
|
|
disk_ascratestops(doSync);
|
|
|
|
disk_ascrate50(doSync);
|
|
|
|
disk_ascrate75(doSync);
|
|
|
|
disk_bestmixend(doSync);
|
|
|
|
disk_bottompo2(doSync);
|
|
|
|
disk_bottomsac(doSync);
|
|
|
|
disk_decopo2(doSync);
|
|
|
|
disk_decosac(doSync);
|
|
|
|
disk_descrate(doSync);
|
|
|
|
disk_display_duration(doSync);
|
|
|
|
disk_display_runtime(doSync);
|
|
|
|
disk_display_transitions(doSync);
|
|
|
|
disk_display_variations(doSync);
|
|
|
|
disk_doo2breaks(doSync);
|
2019-01-10 20:18:53 +00:00
|
|
|
disk_dobailout(doSync);
|
2019-10-29 16:57:34 +00:00
|
|
|
disk_o2narcotic(doSync);
|
2018-08-01 15:14:04 +00:00
|
|
|
disk_drop_stone_mode(doSync);
|
|
|
|
disk_last_stop(doSync);
|
|
|
|
disk_min_switch_duration(doSync);
|
|
|
|
disk_planner_deco_mode(doSync);
|
|
|
|
disk_problemsolvingtime(doSync);
|
|
|
|
disk_reserve_gas(doSync);
|
|
|
|
disk_sacfactor(doSync);
|
|
|
|
disk_safetystop(doSync);
|
|
|
|
disk_switch_at_req_stop(doSync);
|
|
|
|
disk_verbatim_plan(doSync);
|
|
|
|
}
|
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "ascratelast6m", ascratelast6m);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "ascratestops", ascratestops);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "ascrate50", ascrate50);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "ascrate75", ascrate75);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-08 14:44:51 +00:00
|
|
|
HANDLE_PREFERENCE_STRUCT(DivePlanner, "bestmixend", bestmixend, mm);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "bottompo2", bottompo2);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "bottomsac", bottomsac);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "decopo2", decopo2);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "decosac", decosac);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "descrate", descrate);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "display_duration", display_duration);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "display_runtime", display_runtime);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "display_transitions", display_transitions);
|
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "display_variations", display_variations);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "doo2breaks", doo2breaks);
|
2019-01-10 20:18:53 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "dobailbout", dobailout);
|
2019-10-29 16:57:34 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "o2narcotic", o2narcotic);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "drop_stone_mode", drop_stone_mode);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "last_stop", last_stop);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "min_switch_duration", min_switch_duration);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2019-03-25 21:40:59 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "surface_segment", surface_segment);
|
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_ENUM(DivePlanner, deco_mode, "deco_mode", planner_deco_mode);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "problemsolvingtime", problemsolvingtime);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "reserve_gas", reserve_gas);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_INT(DivePlanner, "sacfactor", sacfactor);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "safetystop", safetystop);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "switch_at_req_stop", switch_at_req_stop);
|
2018-08-01 15:14:04 +00:00
|
|
|
|
2018-09-07 16:06:00 +00:00
|
|
|
HANDLE_PREFERENCE_BOOL(DivePlanner, "verbatim_plan", verbatim_plan);
|