add wait for acquiring compare status in on_complete of mcs card
This commit is contained in:
@@ -297,7 +297,7 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
|
||||
# Once we have received all channels, push data to BEC and reset for next accumulation
|
||||
if len(self._current_data) == self.NUM_MCA_CHANNELS:
|
||||
logger.debug(
|
||||
logger.info(
|
||||
f"Current data index {self._current_data_index} complete, pushing to BEC."
|
||||
)
|
||||
self.mca.put(self._current_data, acquisition_group=self._acquisition_group)
|
||||
@@ -459,6 +459,9 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
and self.scan_parameters.num_points is not None
|
||||
):
|
||||
if self.scan_parameters.scan_type == "software_triggered":
|
||||
logger.info(
|
||||
f"Software triggered scan: {self._current_data_index}/{self.scan_parameters.num_points} points received."
|
||||
)
|
||||
if self._current_data_index == self.scan_parameters.num_points:
|
||||
for callback in self._scan_done_callbacks:
|
||||
callback(exception=None)
|
||||
@@ -552,11 +555,13 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
|
||||
# Add CompareStatus for Acquiring DONE
|
||||
status = CompareStatus(self.acquiring, ACQUIRING.DONE)
|
||||
status.wait(timeout=3)
|
||||
|
||||
# Combine both statuses
|
||||
ret_status = status & status_async_data
|
||||
# NOTE: Handle external stop/cancel, and stop monitoring
|
||||
ret_status.add_callback(self._status_failed_callback)
|
||||
ret_status.wait(timeout=3)
|
||||
self.cancel_on_stop(ret_status)
|
||||
return ret_status
|
||||
|
||||
|
||||
Reference in New Issue
Block a user