APS-4ID-POLAR / ipython-polar

4-ID-Polar ipython configuration for bluesky (and other)
1 stars 3 forks source link

Convert `mag6t.ramp_button` and `.switch_heater` to `PVPositioner` #100

Open gfabbris opened 3 years ago

gfabbris commented 3 years ago

One difficulty in this problem is that in each step we want to wait for certain conditions. For example, in the staging process, we first click on the ramp button, then wait for the supply current to match the magnet current, then turn on the switch heater, then wait for the magnet status to change. Currently this is done in a workaround, using the SetSignal that simply returns a subscription status based on an input device and function (Codacy doesn't like SetSignal). Then using abs_set (with wait=True) we can make the RunEngine wait for each step to complete.

I suspect the "best" way to do this is by converting .ramp_button and .switch_heater into PVPositioner. I will try to do it later, for now we can just leave it as is.

Originally posted by @gfabbris in https://github.com/APS-4ID-POLAR/ipython-polar/issues/99#issuecomment-805865176

gfabbris commented 3 years ago

Looked into this further and couldn't identify ways to do this better. Converting the ramp_button and switch_heater to PVPositioner isn't trivial, and doesn't help too much as they depend on things like the current difference, or magnet status.