move Compare status acquiring after erase-start call
This commit is contained in:
@@ -390,9 +390,9 @@ class DDG1(PSIDeviceBase, DelayGeneratorCSAXS):
|
||||
# counters are forwarded to BEC. Once the flag is set, we create a TransitionStatus DONE->ACQUIRING
|
||||
# and start the acquisition through erase_start.put(1). Finally, we wait for the card to go to ACQUIRING state.
|
||||
mcs._omit_mca_callbacks.clear() # pylint: disable=protected-access
|
||||
mcs.erase_start.put(1)
|
||||
status_acquiring = CompareStatus(mcs.acquiring, ACQUIRING.ACQUIRING)
|
||||
self.cancel_on_stop(status_acquiring)
|
||||
mcs.erase_start.put(1)
|
||||
|
||||
return status_acquiring
|
||||
|
||||
@@ -599,7 +599,17 @@ class DDG1(PSIDeviceBase, DelayGeneratorCSAXS):
|
||||
# an acquisition regularly with a WaitTimeoutError, the timeout can be increased but it should
|
||||
# be investigated why the EPICS interface is slow to respond.
|
||||
try:
|
||||
status_mcs.wait(timeout=3)
|
||||
current_time = time.time()
|
||||
while time.time() - current_time < 3 and mcs.acquiring.get() != ACQUIRING.ACQUIRING:
|
||||
time.sleep(0.1)
|
||||
logger.warning(
|
||||
f"MCS card is not in acquiring state, current state: {mcs.acquiring.get()}"
|
||||
)
|
||||
if mcs.acquiring.get() != ACQUIRING.ACQUIRING:
|
||||
logger.warning(
|
||||
f"MCS card is not in acquiring state, current state: {mcs.acquiring.get()}"
|
||||
)
|
||||
status_mcs.wait(timeout=3)
|
||||
except Exception as exc:
|
||||
logger.warning(f"MCS did not go to Acquiring within 3s. Retrying erase_start {exc}")
|
||||
mcs.erase_start.put(1)
|
||||
|
||||
Reference in New Issue
Block a user