Consider the following device in the queueserver startup:
from ophyd_async.epics.motor import Motor
from ophyd_async.core import init_devices, Device
class SimStage(Device):
def __init__(self, prefix: str, name = ""):
self.vertical = Motor(f"{prefix}m2")
self.horizontal = Motor(f"{prefix}m3")
super().__init__(name=name)
with init_devices():
sim_stage = SimStage("25idc:simMotor:", name="asim_stage")
The following should be valid to put on the queue since sim_stage.vertical satisfies bluesky.protocols.Movable.
{
"name": "mv",
"args": ["sim_stage.vertical", -20]
}
However, sim_stage does not appear in the resulting existing devices and plans file, because the parent device sim_stagedoes not satisfying either of bluesky.protocols.Readable or bluesky.protocols.Flyable:
If I add protocols.HasName to the list of checks in is_device(), then the sim_stage shows up in the list of devices:
sim_stage:
classname: SimStage
is_flyable: false
is_movable: false
is_readable: false
module: __main__
Then together with #327, the original plan should work.
In practice, most of my parent devices are actually Readable, so maybe this isn't worth fixing, but maybe this should at least be documented somewhere? Or a warning issued if registering a non-readable device?
Consider the following device in the queueserver startup:
The following should be valid to put on the queue since sim_stage.vertical satisfies
bluesky.protocols.Movable.{ "name": "mv", "args": ["sim_stage.vertical", -20] }However,
sim_stagedoes not appear in the resulting existing devices and plans file, because the parent devicesim_stagedoes not satisfying either ofbluesky.protocols.Readableorbluesky.protocols.Flyable:bluesky-queueserver/bluesky_queueserver/manager/profile_ops.py
Line 676 in ccbfd68
If I add
protocols.HasNameto the list of checks inis_device(), then the sim_stage shows up in the list of devices:Then together with #327, the original plan should work.
In practice, most of my parent devices are actually Readable, so maybe this isn't worth fixing, but maybe this should at least be documented somewhere? Or a warning issued if registering a non-readable device?