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>
This commit is contained in:
Tomaz Canabrava 2013-05-09 00:24:03 -03:00
parent d120fed211
commit 9554cb5767
4 changed files with 121 additions and 108 deletions

View file

@ -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