mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +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) {
|
||||
int depth = s->depth.mm;
|
||||
int pressure = s->pressure[0].mbar;
|
||||
int temperature = s->temperature.mkelvin;
|
||||
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)
|
||||
mintemp = temperature;
|
||||
if (temperature > maxtemp)
|
||||
maxtemp = temperature;
|
||||
|
||||
if (pressure && pressure < minpressure)
|
||||
minpressure = pressure;
|
||||
if (pressure > maxpressure)
|
||||
maxpressure = pressure;
|
||||
if (heartbeat > maxhr)
|
||||
maxhr = heartbeat;
|
||||
if (heartbeat && heartbeat < minhr)
|
||||
|
|
Loading…
Reference in a new issue