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

checkbox to allow automatic conversion to enumerated string #762

Merged
merged 5 commits into from
Feb 8, 2022
Merged

checkbox to allow automatic conversion to enumerated string #762

merged 5 commits into from
Feb 8, 2022

Conversation

prjemian
Copy link
Collaborator

@prjemian prjemian commented Oct 27, 2021

rules_editor

This PR adds a Enum? checkbox in the rules for a widget associated with a use_enum property for each channel. When checked/True, which is the default behavior now, an attempt will be made to use the channel's value as an index into the list of enumerated strings (enum_strs) for the channel, converting the number to text. Since MEDM screens do not make this conversion, this PR allows the conversion to be an option, controlled by the checkbox and use_enum property.

The adl2pydm converter will add support for this use_enum property, setting it to False for all MEDM dynamic attribute calculation channels.

@codecov-commenter
Copy link

Codecov Report

Merging #762 (863307f) into master (e0996a5) will increase coverage by 0.02%.
The diff coverage is 68.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #762      +/-   ##
==========================================
+ Coverage   58.55%   58.57%   +0.02%     
==========================================
  Files          88       88              
  Lines       10111    10123      +12     
==========================================
+ Hits         5920     5930      +10     
- Misses       4191     4193       +2     
Impacted Files Coverage Δ
pydm/widgets/rules.py 70.87% <0.00%> (-0.08%) ⬇️
pydm/widgets/rules_editor.py 96.38% <100.00%> (+0.10%) ⬆️
pydm/widgets/base.py 90.54% <0.00%> (-0.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0996a5...863307f. Read the comment docs.

@mattgibbs
Copy link
Collaborator

Hi @prjemian, I'm planning on merging this one - I am polling our users at SLAC to figure out if we should keep the Enum? == True default, or if we should revert back to the old (and in my opinion, better) behavior where the integer index was used.

@mattgibbs mattgibbs merged commit 5fa4905 into slaclab:master Feb 8, 2022
@prjemian
Copy link
Collaborator Author

prjemian commented Feb 8, 2022

@mattgibbs Thanks!

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.

BUG: Conditional visibility calculations don't display correctly in converted MEDM screens
3 participants