mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Unify sample pressure and o2pressure as pressure[2] array
We currently carry two pressures around for all the samples and plot info, but the second pressure is reserved for CCR dives as the O2 cylinder pressure. That's kind of annoying when we *could* use it for regular sidemount dives as the secondary pressure. So start prepping for that instead: don't make it "pressure" and "o2pressure", make it just be an array of two pressure values. NOTE! This is purely mindless prepwork. It literally just does a search-and-replace, keeping the exact same semantics, so "pressure[1]" is still just O2 pressure. But at some future date, we can now start using it for a second sensor value for sidemount instead. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
94d8abd1a2
commit
11a0c0cc70
17 changed files with 68 additions and 68 deletions
|
@ -23,12 +23,13 @@ struct plot_data {
|
|||
unsigned int in_deco : 1;
|
||||
int cylinderindex;
|
||||
int sec;
|
||||
/* pressure[0] is sensor cylinder pressure [when CCR, the pressure of the diluent cylinder]
|
||||
* pressure[1] is interpolated cylinder pressure */
|
||||
int pressure[2];
|
||||
/* o2pressure[0] is o2 cylinder pressure [CCR]
|
||||
* o2pressure[1] is interpolated o2 cylinder pressure [CCR] */
|
||||
int o2cylinderpressure[2];
|
||||
/* pressure[0] is main sensor pressure (diluent for CCR)
|
||||
* pressure[1] is secondary sensor pressure (O2 for CCR)
|
||||
*
|
||||
* pressure[x][0] is sensor pressure
|
||||
* pressure[x][1] is interpolated pressure
|
||||
*/
|
||||
int pressure[2][2];
|
||||
int temperature;
|
||||
/* Depth info */
|
||||
int depth;
|
||||
|
@ -97,11 +98,11 @@ int get_maxdepth(struct plot_info *pi);
|
|||
|
||||
#define SENSOR_PR 0
|
||||
#define INTERPOLATED_PR 1
|
||||
#define SENSOR_PRESSURE(_entry) (_entry)->pressure[SENSOR_PR]
|
||||
#define O2CYLINDER_PRESSURE(_entry) (_entry)->o2cylinderpressure[SENSOR_PR]
|
||||
#define SENSOR_PRESSURE(_entry) (_entry)->pressure[0][SENSOR_PR]
|
||||
#define O2CYLINDER_PRESSURE(_entry) (_entry)->pressure[1][SENSOR_PR]
|
||||
#define CYLINDER_PRESSURE(_o2, _entry) (_o2 ? O2CYLINDER_PRESSURE(_entry) : SENSOR_PRESSURE(_entry))
|
||||
#define INTERPOLATED_PRESSURE(_entry) (_entry)->pressure[INTERPOLATED_PR]
|
||||
#define INTERPOLATED_O2CYLINDER_PRESSURE(_entry) (_entry)->o2cylinderpressure[INTERPOLATED_PR]
|
||||
#define INTERPOLATED_PRESSURE(_entry) (_entry)->pressure[0][INTERPOLATED_PR]
|
||||
#define INTERPOLATED_O2CYLINDER_PRESSURE(_entry) (_entry)->pressure[1][INTERPOLATED_PR]
|
||||
#define GET_PRESSURE(_entry) (SENSOR_PRESSURE(_entry) ? SENSOR_PRESSURE(_entry) : INTERPOLATED_PRESSURE(_entry))
|
||||
#define GET_O2CYLINDER_PRESSURE(_entry) (O2CYLINDER_PRESSURE(_entry) ? O2CYLINDER_PRESSURE(_entry) : INTERPOLATED_O2CYLINDER_PRESSURE(_entry))
|
||||
#define SAC_WINDOW 45 /* sliding window in seconds for current SAC calculation */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue