2017-04-27 18:18:03 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2013-04-08 03:20:25 +00:00
|
|
|
#ifndef PLANNER_H
|
|
|
|
#define PLANNER_H
|
|
|
|
|
2014-08-05 10:58:23 +00:00
|
|
|
#define LONGDECO 1
|
2015-03-31 12:52:37 +00:00
|
|
|
#define NOT_RECREATIONAL 2
|
2013-08-30 18:06:26 +00:00
|
|
|
|
2019-08-05 18:43:06 +00:00
|
|
|
#include "units.h"
|
|
|
|
#include "divemode.h"
|
|
|
|
|
|
|
|
/* this should be converted to use our types */
|
|
|
|
struct divedatapoint {
|
|
|
|
int time;
|
|
|
|
depth_t depth;
|
|
|
|
int cylinderid;
|
|
|
|
pressure_t minimum_gas;
|
|
|
|
int setpoint;
|
|
|
|
bool entered;
|
|
|
|
struct divedatapoint *next;
|
|
|
|
enum divemode_t divemode;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct diveplan {
|
|
|
|
timestamp_t when;
|
|
|
|
int surface_pressure; /* mbar */
|
|
|
|
int bottomsac; /* ml/min */
|
|
|
|
int decosac; /* ml/min */
|
|
|
|
int salinity;
|
|
|
|
short gflow;
|
|
|
|
short gfhigh;
|
|
|
|
short vpmb_conservatism;
|
|
|
|
struct divedatapoint *dp;
|
|
|
|
int eff_gflow, eff_gfhigh;
|
|
|
|
int surface_interval;
|
|
|
|
};
|
|
|
|
|
2013-08-30 18:06:26 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-06-01 21:17:06 +00:00
|
|
|
extern int validate_gas(const char *text, struct gasmix *gas);
|
2013-04-08 03:20:25 +00:00
|
|
|
extern int validate_po2(const char *text, int *mbar_po2);
|
|
|
|
extern timestamp_t current_time_notz(void);
|
2013-10-05 07:29:09 +00:00
|
|
|
extern void set_last_stop(bool last_stop_6m);
|
2014-06-02 14:25:58 +00:00
|
|
|
extern void set_verbatim(bool verbatim);
|
|
|
|
extern void set_display_runtime(bool display);
|
|
|
|
extern void set_display_duration(bool display);
|
|
|
|
extern void set_display_transitions(bool display);
|
2016-07-06 12:40:28 +00:00
|
|
|
extern int get_cylinderid_at_time(struct dive *dive, struct divecomputer *dc, duration_t time);
|
2018-08-16 17:10:10 +00:00
|
|
|
extern int get_gasidx(struct dive *dive, struct gasmix mix);
|
2014-05-30 22:40:13 +00:00
|
|
|
extern bool diveplan_empty(struct diveplan *diveplan);
|
2017-05-25 10:57:06 +00:00
|
|
|
extern void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_disclaimer, int error);
|
2019-09-01 15:52:25 +00:00
|
|
|
extern const char *get_planner_disclaimer();
|
2019-09-10 13:29:03 +00:00
|
|
|
extern char *get_planner_disclaimer_formatted();
|
2013-04-08 03:20:25 +00:00
|
|
|
|
2014-08-19 16:41:09 +00:00
|
|
|
extern void free_dps(struct diveplan *diveplan);
|
2013-04-08 03:20:25 +00:00
|
|
|
extern struct dive *planned_dive;
|
|
|
|
extern char *cache_data;
|
2013-08-30 18:06:26 +00:00
|
|
|
|
2019-08-05 18:43:06 +00:00
|
|
|
struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int duration, int depth, int cylinderid, int po2, bool entered, enum divemode_t divemode);
|
|
|
|
struct divedatapoint *create_dp(int time_incr, int depth, int cylinderid, int po2);
|
|
|
|
#if DEBUG_PLAN
|
|
|
|
void dump_plan(struct diveplan *diveplan);
|
|
|
|
#endif
|
|
|
|
struct decostop {
|
|
|
|
int depth;
|
|
|
|
int time;
|
|
|
|
};
|
|
|
|
extern bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, int timestep, struct decostop *decostoptable, struct deco_state **cached_datap, bool is_planner, bool show_disclaimer);
|
|
|
|
|
2013-08-30 18:06:26 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // PLANNER_H
|