NSLS-II-CSX / profile_collection

BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

Report completion accurately. #19

Closed danielballan closed 4 years ago

danielballan commented 5 years ago

Fixes https://github.com/NSLS-II-CSX/xf23id1_profiles/issues/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