changed/fixed behaviour of stop commands in PPMS

- make sure new target created by the stop command is between
  old and new target
- fixed bad behaviour of level reading

Change-Id: I484c0902c694c0edb81e2d9238985c05f92e04f4
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22100
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2020-01-08 14:46:45 +01:00
parent d442c5b6bf
commit f0a3306f9c
3 changed files with 98 additions and 84 deletions

View File

@ -81,7 +81,7 @@ def clamp(_min, value, _max):
"""return the median of 3 values,
i.e. value if min <= value <= max, else min or max depending on which side
value lies outside the [min..max] interval
value lies outside the [min..max] interval. This works even when min > max!
"""
# return median, i.e. clamp the the value between min and max
return sorted([_min, value, _max])[1]