2019-12-08 18:30:39 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef PLANNERSHARED_H
|
|
|
|
#define PLANNERSHARED_H
|
|
|
|
#include <QObject>
|
2019-12-14 19:29:16 +00:00
|
|
|
#include "core/pref.h"
|
2019-12-08 18:30:39 +00:00
|
|
|
|
|
|
|
// This is a shared class (mobile/desktop), and contains the core of the diveplanner
|
|
|
|
// without UI entanglement.
|
|
|
|
// It make variables and functions available to QML, these are referenced directly
|
|
|
|
// in the desktop version
|
|
|
|
//
|
|
|
|
// The mobile diveplanner shows all diveplans, but the editing functionality is
|
|
|
|
// limited to keep the UI simpler.
|
|
|
|
|
2020-02-03 18:08:35 +00:00
|
|
|
class PlannerShared: public QObject {
|
2019-12-08 18:30:39 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2019-12-14 19:29:16 +00:00
|
|
|
// Planning data
|
|
|
|
static deco_mode planner_deco_mode();
|
|
|
|
static int reserve_gas();
|
2019-12-24 10:22:48 +00:00
|
|
|
static bool dobailout();
|
2019-12-23 12:04:19 +00:00
|
|
|
static bool doo2breaks();
|
2019-12-23 12:15:07 +00:00
|
|
|
static int min_switch_duration();
|
2020-01-10 21:51:28 +00:00
|
|
|
static int surface_segment();
|
2019-12-14 19:29:16 +00:00
|
|
|
|
2019-12-23 14:40:21 +00:00
|
|
|
// Gas data
|
|
|
|
static double bottomsac();
|
|
|
|
static double decosac();
|
|
|
|
static double sacfactor();
|
2019-12-23 16:23:24 +00:00
|
|
|
static bool o2narcotic();
|
2019-12-23 16:25:46 +00:00
|
|
|
static double bottompo2();
|
|
|
|
static double decopo2();
|
|
|
|
static int bestmixend();
|
2019-12-23 14:40:21 +00:00
|
|
|
|
2019-12-12 19:01:38 +00:00
|
|
|
public slots:
|
|
|
|
|
2019-12-14 19:29:16 +00:00
|
|
|
// Planning data
|
|
|
|
static void set_planner_deco_mode(deco_mode value);
|
|
|
|
static void set_reserve_gas(int value);
|
2019-12-24 10:22:48 +00:00
|
|
|
static void set_dobailout(bool value);
|
2019-12-23 12:04:19 +00:00
|
|
|
static void set_doo2breaks(bool value);
|
2019-12-23 12:15:07 +00:00
|
|
|
static void set_min_switch_duration(int value);
|
2020-01-10 21:51:28 +00:00
|
|
|
static void set_surface_segment(int value);
|
2019-12-14 19:29:16 +00:00
|
|
|
|
2019-12-23 14:40:21 +00:00
|
|
|
// Gas data
|
|
|
|
static void set_bottomsac(double value);
|
|
|
|
static void set_decosac(double value);
|
|
|
|
static void set_sacfactor(double value);
|
2019-12-23 16:23:24 +00:00
|
|
|
static void set_o2narcotic(bool value);
|
2019-12-23 16:25:46 +00:00
|
|
|
static void set_bottompo2(double value);
|
|
|
|
static void set_decopo2(double value);
|
|
|
|
static void set_bestmixend(int value);
|
2019-12-08 18:30:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PLANNERSHARED_H
|