summaryrefslogtreecommitdiffstats
path: root/core/profile.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-07-06 11:58:27 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-09 19:19:04 +0100
commit4724c8853342580d2bc60bf85a566f6285330927 (patch)
tree40e6cb7939281a5baf98de697fe66bfcc6b618af /core/profile.h
parentfbd74c26d6652543cbc7331734e304dbf2ef5113 (diff)
downloadsubsurface-4724c8853342580d2bc60bf85a566f6285330927.tar.gz
Profile: change get_plot_pressure to take index instead of pointer
The goal here is to make it possible to detach the pressure related data from the plot_info structure. Thus, the pressure related data can be allocated independently depending on the number of cylinders per dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/profile.h')
-rw-r--r--core/profile.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/profile.h b/core/profile.h
index 580fc8e68..32b255689 100644
--- a/core/profile.h
+++ b/core/profile.h
@@ -3,6 +3,7 @@
#define PROFILE_H
#include "dive.h"
+#include "display.h"
#ifdef __cplusplus
extern "C" {
@@ -78,12 +79,12 @@ struct ev_select {
bool plot_ev;
};
-extern void compare_samples(struct plot_data *e1, struct plot_data *e2, char *buf, int bufsize, int sum);
+extern void compare_samples(struct plot_info *p1, int idx1, int idx2, char *buf, int bufsize, bool sum);
extern struct plot_info *analyze_plot_info(struct plot_info *pi);
extern void init_plot_info(struct plot_info *pi);
extern void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plot_info *pi, bool fast, struct deco_state *planner_ds);
extern void calculate_deco_information(struct deco_state *ds, const struct deco_state *planner_de, const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi, bool print_mode);
-extern struct plot_data *get_plot_details_new(struct plot_info *pi, int time, struct membuffer *);
+extern int get_plot_details_new(struct plot_info *pi, int time, struct membuffer *);
extern void free_plot_info_data(struct plot_info *pi);
/*
@@ -121,10 +122,11 @@ static inline int get_plot_interpolated_pressure(const struct plot_data *entry,
return get_plot_pressure_data(entry, INTERPOLATED_PR, idx);
}
-static inline int get_plot_pressure(const struct plot_data *entry, int idx)
+static inline int get_plot_pressure(const struct plot_info *pi, int idx, int cylinder)
{
- int res = get_plot_sensor_pressure(entry, idx);
- return res ? res : get_plot_interpolated_pressure(entry, idx);
+ const struct plot_data *entry = pi->entry + idx;
+ int res = get_plot_sensor_pressure(entry, cylinder);
+ return res ? res : get_plot_interpolated_pressure(entry, cylinder);
}
#ifdef __cplusplus