-
Notifications
You must be signed in to change notification settings - Fork 1
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
Search for objects by PV name fragment #21
Comments
I can see this being useful. PVsDoing this for a specific PV seems straight-forward. How would you want to interact with this feature? I'm thinking: m1 = Motor(name="m1", prefix="255idVME:m1")
registry.register(m1)
assert registry["ca://255idVME:m1.RBV"] is m1.user_readback The PrefixesPrefixes will take more thought, especially since threaded ophyd and ophyd-async work differently. I don't know of a way to reliably determine what the IOC prefix is for every device, or if it even has one, or has multiple. Threaded ophyd: The class EnergyPositioner(Device):
mono = FCpt(Monochromator, "{mono_prefix}")
undulator = FCpt(Undulator, "{id_prefix}")
def __init__(self, prefix: str= "" , *, mono_prefix: str, id_prefix: str, ...):
assert prefix == "", "Specify *mono_prefix* and *id_prefix*"
self.mono_prefix = mono_prefix
self.id_prefix = id_prefix
energy = EnergyPositioner(mono_prefix="255idbUP:", id_prefix="US:25ID:")
registry.register(energy)
registry.findall(source="25idbUP:") # <- what should this return? That last line could return Ophyd-async: Doesn't treat prefixes as special, and prefix is not even an argument to the base Back to the original motor example: registry.findall(source="ca://255idVME:m1", allow_none=True) could return either:
Seems like the option 2 is the only one that meets your original use case. Would this be too much noise to be useful? |
|
Searching is enabled for labels and names. Can it be expanded to search by PV (or prefix) fragment?
Or, what objects are connected to IOC prefix
ABC:
?The text was updated successfully, but these errors were encountered: