Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Allow the user to set the range of PyDMSpinbox, instead of always taking it from the channel #935

Merged
merged 3 commits into from Oct 25, 2022

Conversation

jbellister-slac
Copy link
Collaborator

Fixes #903

Context

The PyDMSpinBox will always set the maximum and minimum values to display based on the HOPR/LOPR fields of the PV. This happens even if the user tries to set their own limits. And in the case HOPR/LOPR are not defined then it will set minimum and maximum both to zero so that the spinbox cannot display anything other than zero.

As an example, connect a spinbox to MTEST:XPos from the testing ioc and try to use it.

Fix

This will fix the issue by adding the option to set user-defined limits and use those instead of the ones received from the channel. The default options remains to use the ones from the channel so as to not impact existing uses of the spinbox.

userlimits

Testing

Tested with some local examples, modified the existing spin box test for updating limits, added a new one for the new code.

@YektaY YektaY self-requested a review October 19, 2022 20:10
Copy link
Collaborator

@YektaY YektaY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@YektaY YektaY merged commit 86d39f8 into slaclab:master Oct 25, 2022
@jbellister-slac jbellister-slac deleted the fix_spinbox branch June 13, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PyDMSpinBox always takes limits from PV even when user defined limits are set
2 participants