dirvers/nvstep: fixes

This commit is contained in:
l_samenv
2023-10-26 10:05:26 +02:00
parent 2c13e9b091
commit 4d1858560b

View File

@ -330,22 +330,14 @@ proc nvstep::updateflow {value} {
}
sct filtered $flow
if {$source eq "flow"} {
if {$flow < 1} {
# avoid negative flow values, but it smooth]
set flow [expr exp($flow - 1)]
}
updateval [sct nvpath]/flow $flow
} elseif {$source eq "pressure" {
} elseif {$source eq "pressure"} {
if {$flow < -50} {
set flow -62.5
} else {
set off [hval [sct nvpath]/calib/mbar_offset]
set fpm [hval [sct nvpath]/calib/ln_per_min_per_mbar]
set flow [expr ($flow - $off) * $fpm]
if {$flow < 1} {
# avoid negative flow values, but keep it smooth]
set flow [expr exp($flow - 1)]
}
}
updateval_e [sct nvpath]/flowp $flow -62.5 no_sensor
} else {