From 9554cb57673f3dc4818b9578ea607526c813242e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 9 May 2013 00:24:03 -0300 Subject: Plot of the Cylinder Pressure over time. a few code was moved around, a macro that contained the form of x ? : y; had to be rewritten to x ? x : y since c++ doesn't allow ternarys without the middle operator. The color-choosing for the Cylinder Pressure broke on the Qt port - but it's a small issue. I'm painting everyone as 'dark green' now, will fix that later. Signed-off-by: Tomaz Canabrava --- profile.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'profile.h') diff --git a/profile.h b/profile.h index 13e417785..9389641d5 100644 --- a/profile.h +++ b/profile.h @@ -39,6 +39,7 @@ struct plot_data { void calculate_max_limits(struct dive *dive, struct divecomputer *dc, struct graphics_context *gc); struct plot_info *create_plot_info(struct dive *dive, struct divecomputer *dc, struct graphics_context *gc); int setup_temperature_limits(struct graphics_context *gc, struct plot_info *pi); +int get_cylinder_pressure_range(struct graphics_context *gc); struct ev_select { char *ev_name; @@ -60,6 +61,9 @@ int get_maxtime(struct plot_info *pi); * partial pressure graphs */ int get_maxdepth(struct plot_info *pi); +int get_local_sac(struct plot_data *entry1, struct plot_data *entry2, struct dive *dive); + + #define ALIGN_LEFT 1 #define ALIGN_RIGHT 2 #define INVISIBLE 4 @@ -92,6 +96,14 @@ int get_maxdepth(struct plot_info *pi); #define SCALEY(gc,y) (((y)-gc->topy)/(gc->bottomy-gc->topy)*gc->maxy) #define SCALE(gc,x,y) SCALEX(gc,x),SCALEY(gc,y) +#define SENSOR_PR 0 +#define INTERPOLATED_PR 1 +#define SENSOR_PRESSURE(_entry) (_entry)->pressure[SENSOR_PR] +#define INTERPOLATED_PRESSURE(_entry) (_entry)->pressure[INTERPOLATED_PR] +#define GET_PRESSURE(_entry) (SENSOR_PRESSURE(_entry) ? SENSOR_PRESSURE(_entry) : INTERPOLATED_PRESSURE(_entry)) + +#define SAC_WINDOW 45 /* sliding window in seconds for current SAC calculation */ + #ifdef __cplusplus } #endif -- cgit v1.2.3-70-g09d2