summaryrefslogtreecommitdiffstats
path: root/profile.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-09 00:24:03 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-09 00:24:03 -0300
commit9554cb57673f3dc4818b9578ea607526c813242e (patch)
tree0226acea1ad83f01eab763114b4a64d6d3441778 /profile.h
parentd120fed21191f547db1b2bc3a04a9ce389faec0f (diff)
downloadsubsurface-9554cb57673f3dc4818b9578ea607526c813242e.tar.gz
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 <tcanabrava@kde.org>
Diffstat (limited to 'profile.h')
-rw-r--r--profile.h12
1 files changed, 12 insertions, 0 deletions
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