mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 20:16:16 +00:00
profile: Use all sensors to scale the pressure graph
It's possible for the first sensor to start with a pressure significantly lower than other sensors. Signed-off-by: Michael Andreen <michael@andreen.dev>
This commit is contained in:
parent
a7889d1f4e
commit
7217506072
1 changed files with 8 additions and 5 deletions
|
@ -305,19 +305,22 @@ static void calculate_max_limits_new(const struct dive *dive, const struct divec
|
||||||
|
|
||||||
while (--i >= 0) {
|
while (--i >= 0) {
|
||||||
int depth = s->depth.mm;
|
int depth = s->depth.mm;
|
||||||
int pressure = s->pressure[0].mbar;
|
|
||||||
int temperature = s->temperature.mkelvin;
|
int temperature = s->temperature.mkelvin;
|
||||||
int heartbeat = s->heartbeat;
|
int heartbeat = s->heartbeat;
|
||||||
|
|
||||||
|
for (int sensor = 0; sensor < MAX_SENSORS; ++sensor) {
|
||||||
|
int pressure = s->pressure[sensor].mbar;
|
||||||
|
if (pressure && pressure < minpressure)
|
||||||
|
minpressure = pressure;
|
||||||
|
if (pressure > maxpressure)
|
||||||
|
maxpressure = pressure;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mintemp && temperature < mintemp)
|
if (!mintemp && temperature < mintemp)
|
||||||
mintemp = temperature;
|
mintemp = temperature;
|
||||||
if (temperature > maxtemp)
|
if (temperature > maxtemp)
|
||||||
maxtemp = temperature;
|
maxtemp = temperature;
|
||||||
|
|
||||||
if (pressure && pressure < minpressure)
|
|
||||||
minpressure = pressure;
|
|
||||||
if (pressure > maxpressure)
|
|
||||||
maxpressure = pressure;
|
|
||||||
if (heartbeat > maxhr)
|
if (heartbeat > maxhr)
|
||||||
maxhr = heartbeat;
|
maxhr = heartbeat;
|
||||||
if (heartbeat && heartbeat < minhr)
|
if (heartbeat && heartbeat < minhr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue