Currently if we do a bps.mv on a FakeEpicsMotor the plan will fail:
from unittest.mock import MagicMock
import bluesky.plan_stubs as bps
from bluesky import RunEngine
from ophyd import Component, Device, EpicsMotor
from ophyd.sim import make_fake_device
from ophyd.status import Status
class MyDevice(Device):
x = Component(EpicsMotor, "")
FakeDevice = make_fake_device(MyDevice)
my_fake_device = FakeDevice(name="")
RE = RunEngine()
try:
RE(bps.mv(my_fake_device.x.get(), 10))
except:
print(f"Move failed: {my_fake_device.x}")
Which will remove trying to get the limits from the PV and make the motor appear to immediately move to the setpoint. I propose that we put something like this in as default behaviour in FakeEpicsMotor. Obviously generally simulating motion could be a pandoras box but this will at least allow plans with a basic mv in them to work
Currently if we do a
bps.mv
on aFakeEpicsMotor
the plan will fail:We can fix this doing something like:
Which will remove trying to get the limits from the PV and make the motor appear to immediately move to the setpoint. I propose that we put something like this in as default behaviour in
FakeEpicsMotor
. Obviously generally simulating motion could be a pandoras box but this will at least allow plans with a basicmv
in them to work