You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can see that both are blank compared to a PV of the same type I found elsewhere:
$ caget BL03I-MO-SGON-01:CS1:DeferMoves.ZNAM BL03I-MO-SGON-01:CS1:DeferMoves.ONAM
BL03I-MO-SGON-01:CS1:DeferMoves.ZNAM Defer Off
BL03I-MO-SGON-01:CS1:DeferMoves.ONAM Defer On
Given they're both blank this is why your string enum complains if they're anything else. Obviously this won't actually work in production as if you set blank on the PV how does it know which one you actually need?
So, we have some choices:
Talk to controls and ask them to provide named states for the PV, or change the PV to a type that is more appropriate
Use an int - This will work but is a bit of a shame as it's not super clear that writing 1 to the erase is what you want to do
Use an IntEnum e.g.
classEraseEnum(int, Enum):
ERASE=1DONE=0
But are you saying that didn't work? In which case we should probably open a discussion up about if this is a bug in ophyd_async
I prefer option 1 but it will be the most work. I can live with option 2 for now in the interests of just getting things done, maybe we can then put in a ticket with controls to improve it at a later date
python2 /dls_sw/work/useful-scripts/find-pv.py BL20I-EA-DET-06:ERASE
/dls_sw/work/R3.14.12.7/support/BL20I-BUILDER/iocs/BL20I-EA-IOC-05/db/BL20I-EA-IOC-05_expanded.db
as abo
record.bo
records take values of 0 or 1, but they can defineZNAM
andONAM
which are user friendly names for the 0/1 statesWe can see that both are blank compared to a PV of the same type I found elsewhere:
blank
this is why your string enum complains if they're anything else. Obviously this won't actually work in production as if you setblank
on the PV how does it know which one you actually need?So, we have some choices:
int
- This will work but is a bit of a shame as it's not super clear that writing 1 to the erase is what you want to doIntEnum
e.g.But are you saying that didn't work? In which case we should probably open a discussion up about if this is a bug in
ophyd_async
I prefer option 1 but it will be the most work. I can live with option 2 for now in the interests of just getting things done, maybe we can then put in a ticket with controls to improve it at a later date
Originally posted by @DominicOram in #524 (comment)
The text was updated successfully, but these errors were encountered: