Skip to content
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

Report completion accurately. #19

Merged

Conversation

danielballan
Copy link
Collaborator

Fixes #17

The TriggeredCamExposure device returns a NullStatus, which
communicates back to the RunEngine that the set operation finished
immediately. This is not accurate: setting the exposure takes a small
but sometimes significant amount of time.

In this PR, we use the fact that Status object can be logically "AND-ed"
to report when all status objects in a set are complete. Example:

In [23]: st = NullStatus()

In [24]: st2 = StatusBase()

In [25]: st3 = StatusBase()

In [26]: st &= st2

In [27]: st &= st3

In [28]: st.done
Out[28]: False

In [29]: st2._finished()

In [30]: st.done
Out[30]: False

In [31]: st3._finished()

In [32]: st.done
Out[32]: True

The ``TriggeredCamExposure`` device returns a ``NullStatus``, which
communicates back to the RunEngine that the set operation finished
immediately. This is not accurate: setting the exposure takes a small
but sometimes significant amount of time.

In this PR, we use the fact that Status object can be logically "AND-ed"
to report when *all* status objects in a set are complete. Example:

```python
In [23]: st = NullStatus()

In [24]: st2 = StatusBase()

In [25]: st3 = StatusBase()

In [26]: st &= st2

In [27]: st &= st3

In [28]: st.done
Out[28]: False

In [29]: st2._finished()

In [30]: st.done
Out[30]: False

In [31]: st3._finished()

In [32]: st.done
Out[32]: True
```
@mrakitin mrakitin merged commit 4ef6a3e into NSLS-II-CSX:master Aug 19, 2020
@mrakitin mrakitin mentioned this pull request Aug 20, 2020
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mv(fccd.exposure()) doesn't finish "really" before next function is started
3 participants