scan: Set stopping at _runctx_scan_runner finalization
Closes #4251 (closed)
This enforce to have the following state machine when the scan is aborted:
-
PREPARING
→STOPPING
→USER_ABORTED/FAILED
Previously the state machine was the following:
-
PREPARING
→USER_ABORTED/FAILED
Notice that a ctrl-c durring the STARTING
was already working this way:
-
PREPARING
→STARTING
(which isRUNNING
) →STOPPING
→USER_ABORTED/FAILED
- With my patch, in this case,
_set_state(STOPPING)
will be called twice, but the second will basically do nothing.
- With my patch, in this case,
During STOPPING
, presets are stopped, and sometimes motors are returning to the origin, that's an important step.
No idea if it's the good way to fix this missing step. Also, this maybe this have side effects on other sub systems (flint/blissdata/writer), i can't tell.
Edited by Valentin Valls