CCR patch: Create memory space to store cylinder pressures
This patch creates memory space to store both the cylinder pressure of the diluent cylinder as well as the oxygen partial pressures of up to four oxygen sensors. This is accomplished within profile.h 1) To the plot_data structure, add: a) an array diluentpressure[2] to store diluent pressures b) create o2setpoint and o2sensor[4] to store oxygen partial pressures 2) Define a constant and prototypes to access the cylinder pressures and their corresponding interpolated values. Signed-off-by: Willem Ferguson <[email protected]>
>From 3633dfd14bff13b1124431e7544963ecf7b23982 Mon Sep 17 00:00:00 2001 From: Willem Ferguson <[email protected]> Date: Tue, 26 Aug 2014 11:46:12 +0200 Subject: [PATCH] CCR patch: Create memory space to store cylinder pressures This patch creates memory space to store both the cylinder pressure of the diluent cylinder as well as the oxygen partial pressures of up to four oxygen sensors. This is accomplished within profile.h 1) To the plot_data structure, add: a) an array diluentpressure[2] to store diluent pressures b) create o2setpoint and o2sensor[4] to store oxygen partial pressures 2) Define a constant and prototypes to access the cylinder pressures and their corresponding interpolated values. Signed-off-by: Willem Ferguson <[email protected]> --- profile.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/profile.h b/profile.h index 55bb396..abbb73b 100644 --- a/profile.h +++ b/profile.h @@ -20,22 +20,25 @@ struct plot_data { unsigned int in_deco : 1; int cylinderindex; int sec; - /* pressure[0] is sensor pressure + /* pressure[0] is sensor pressure [in case of CCR this is oxygen tank pressure] * pressure[1] is interpolated pressure */ int pressure[2]; + /* diluentpressure[0] is diluent pressure [CCR] + * diluentpressure[1] is interpolated diluent pressure [CCR]*/ + int diluentpressure[2]; int temperature; /* Depth info */ int depth; int ceiling; int ceilings[16]; int ndl; - int tts; int stoptime; int stopdepth; int cns; int smoothed; int sac; - double po2, pn2, phe; + double fo2, po2, pn2, phe; + double o2setpoint, o2sensor[4]; // for rebreathers with up to 3 PO2 sensors double mod, ead, end, eadd; velocity_t velocity; int speed; @@ -52,12 +55,6 @@ struct plot_data { int heartbeat; int bearing; }; - -struct ev_select { - char *ev_name; - bool plot_ev; -}; - struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer *dc); void compare_samples(struct plot_data *e1, struct plot_data *e2, char *buf, int bufsize, int sum); struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi); @@ -66,6 +63,11 @@ void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plo void calculate_deco_information(struct dive *dive, struct divecomputer *dc, struct plot_info *pi, bool print_mode); void get_plot_details_new(struct plot_info *pi, int time, struct membuffer *); +struct ev_select { + char *ev_name; + bool plot_ev; +}; + /* * When showing dive profiles, we scale things to the * current dive. However, we don't scale past less than @@ -81,11 +83,15 @@ int get_maxtime(struct plot_info *pi); * partial pressure graphs */ int get_maxdepth(struct plot_info *pi); +#define DILUENT_CYLINDER 1 #define SENSOR_PR 0 #define INTERPOLATED_PR 1 #define SENSOR_PRESSURE(_entry) (_entry)->pressure[SENSOR_PR] +#define DILUENT_PRESSURE(_entry) (_entry)->diluentpressure[SENSOR_PR] #define INTERPOLATED_PRESSURE(_entry) (_entry)->pressure[INTERPOLATED_PR] +#define INTERPOLATED_DILUENT_PRESSURE(_entry) (_entry)->diluentpressure[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 -- 1.9.1
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
