Skip to content

Commit 239c0cb

Browse files
committed
[cytation5] don't start/stop acquisition when already in that mode
1 parent d60a5f4 commit 239c0cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pylabrobot/plate_reading/biotek_backend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import math
66
import re
77
import time
8-
from contextlib import contextmanager
98
from dataclasses import dataclass
109
from typing import Any, Callable, Coroutine, Dict, List, Literal, Optional, Tuple, Union, cast
1110

@@ -883,12 +882,16 @@ def _get_device_info(self, cam):
883882
def start_acquisition(self):
884883
if self.cam is None:
885884
raise RuntimeError("Camera is not initialized.")
885+
if self._acquiring:
886+
return
886887
retry(self.cam.BeginAcquisition)
887888
self._acquiring = True
888889

889890
def stop_acquisition(self):
890891
if self.cam is None:
891892
raise RuntimeError("Camera is not initialized.")
893+
if not self._acquiring:
894+
return
892895
retry(self.cam.EndAcquisition)
893896
self._acquiring = False
894897

0 commit comments

Comments
 (0)