slaclab / pydm

Python Display Manager
http://slaclab.github.io/pydm/
Other
111 stars 76 forks source link

FIX: PyDMSlider out of bounds bug #1084

Closed phys-cgarnier closed 6 days ago

phys-cgarnier commented 3 weeks ago

The PyDMSlider has a bug(s) when the channel it is connected to is a certain type of PV (epics record). If the record is an analog out (ao), and it does not have the record fields DRVH and DRVL set, then the slider is not forced to be within the bounds of the minimum and maximum properties. Since the default values of DRVH and DRVL are both zero, the slider wouldn't have a range of allowed values outside of "0".

This can cause two bugs. The first was calculated step size becomes 0, which would essentially form a never ending while loop of allowed positions when the slider value was out of bounds. The second bug is PV values could be out of the slider bounds.

These bugs only occur when both DRVH and DRVL were at default values. If either was set it would not occur. This PR has code to catch these edges and then raise value errors since we neither want a unending loop or a slider with values existing out of bounds.