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

Make useful scripts into a dodal utility #732

Open
stan-dot opened this issue Aug 7, 2024 · 0 comments
Open

Make useful scripts into a dodal utility #732

stan-dot opened this issue Aug 7, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request python Pull requests that update Python code

Comments

@stan-dot
Copy link
Contributor

stan-dot commented Aug 7, 2024

          Tagging @stan-dot as this is general good info. So to look up the type of a PV I do the following:
$ caget BL03I-EA-XSP3-01:ERASE.ZNAM BL03I-EA-XSP3-01:ERASE.ONAM
BL03I-EA-XSP3-01:ERASE.ZNAM    
BL03I-EA-XSP3-01:ERASE.ONAM    

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:

  1. Talk to controls and ask them to provide named states for the PV, or change the PV to a type that is more appropriate
  2. 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
  3. Use an IntEnum e.g.
class EraseEnum(int, Enum):
    ERASE = 1
    DONE = 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

Originally posted by @DominicOram in #524 (comment)

@stan-dot stan-dot added enhancement New feature or request python Pull requests that update Python code labels Aug 7, 2024
@stan-dot stan-dot self-assigned this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

1 participant