w
This commit is contained in:
1 file changed
+9
-4
@@ -18,7 +18,7 @@ class PandaBoxOMNY(PandaBox):
|
||||
self._timeout_on_completed = 10
|
||||
|
||||
def on_stage(self):
|
||||
|
||||
super().on_stage()
|
||||
# TODO, adjust as seen fit.
|
||||
# Adjust the acquisition group based on scan parameters if needed
|
||||
if self.scan_info.msg.scan_type == "fly":
|
||||
@@ -36,7 +36,10 @@ class PandaBoxOMNY(PandaBox):
|
||||
captured = 0
|
||||
start_time = time.monotonic()
|
||||
try:
|
||||
expected_points = int(self.scan_info.msg.num_points * self.scan_info.msg.scan_parameters.get("frames_per_trigger",1))
|
||||
expected_points = int(
|
||||
self.scan_info.msg.num_points
|
||||
* self.scan_info.msg.scan_parameters.get("frames_per_trigger", 1)
|
||||
)
|
||||
while captured < expected_points:
|
||||
logger.info(
|
||||
f"Run with captured {captured} and expected points : {expected_points}."
|
||||
@@ -45,7 +48,9 @@ class PandaBoxOMNY(PandaBox):
|
||||
captured = int(ret[0].split("=")[-1])
|
||||
time.sleep(0.01)
|
||||
if (time.monotonic() - start_time) > self._timeout_on_completed:
|
||||
raise TimeoutError(f"Pandabox {self.name} did not complete after {self._timeout_on_completed} with points captured {captured}/{expected_points}")
|
||||
raise TimeoutError(
|
||||
f"Pandabox {self.name} did not complete after {self._timeout_on_completed} with points captured {captured}/{expected_points}"
|
||||
)
|
||||
finally:
|
||||
self._disarm()
|
||||
|
||||
@@ -69,7 +74,7 @@ class PandaBoxOMNY(PandaBox):
|
||||
if __name__ == "__main__":
|
||||
import time
|
||||
|
||||
panda = PandaBoxCSAXS(
|
||||
panda = PandaBoxOMNY(
|
||||
name="omny_panda",
|
||||
host="omny-panda.psi.ch",
|
||||
signal_alias={
|
||||
|
||||
Reference in new issue
Block a user