Skip to content

Commit ba4c4dd

Browse files
committed
Try resetting the camera class each shot instead.
1 parent ea54aa8 commit ba4c4dd

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

labscript_devices/IMAQdxCamera/blacs_workers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def close(self):
118118

119119

120120
class IMAQdx_Camera(object):
121-
def __init__(self, serial_number, exception_on_failed_shot=True):
121+
def __init__(self, serial_number):
122122
global nv
123123
import nivision as nv
124124
_monkeypatch_imaqdispose()
@@ -139,7 +139,7 @@ def __init__(self, serial_number, exception_on_failed_shot=True):
139139
)
140140
# Keep an img attribute so we don't have to create it every time
141141
self.img = nv.imaqCreateImage(nv.IMAQ_IMAGE_U16)
142-
self.exception_on_failed_shot = exception_on_failed_shot
142+
self.exception_on_failed_shot = True
143143
self._abort_acquisition = False
144144

145145
def set_attributes(self, attr_dict):
@@ -287,8 +287,7 @@ def get_camera(self):
287287
if self.mock:
288288
return MockCamera()
289289
else:
290-
return self.interface_class(self.serial_number,
291-
exception_on_failed_shot=self.exception_on_failed_shot)
290+
return self.interface_class(self.serial_number)
292291

293292
def set_attributes_smart(self, attributes):
294293
"""Call self.camera.set_attributes() to set the given attributes, only setting
@@ -396,6 +395,7 @@ def transition_to_buffered(self, device_name, h5_filepath, initial_values, fresh
396395
self.stop_acquisition_timeout = properties['stop_acquisition_timeout']
397396
self.exception_on_failed_shot = properties['exception_on_failed_shot']
398397
saved_attr_level = properties['saved_attribute_visibility_level']
398+
self.camera.exception_on_failed_shot = self.exception_on_failed_shot
399399
# Only reprogram attributes that differ from those last programmed in, or all of
400400
# them if a fresh reprogramming was requested:
401401
if fresh:

labscript_devices/IMAQdxCamera/labscript_devices.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class IMAQdxCamera(TriggerableDevice):
2929
"pixel_size",
3030
"magnification",
3131
"manual_mode_camera_attributes",
32-
"exception_on_failed_shot",
3332
"mock",
3433
],
3534
"device_properties": [
3635
"camera_attributes",
3736
"stop_acquisition_timeout",
37+
"exception_on_failed_shot",
3838
"saved_attribute_visibility_level"
3939
],
4040
}
@@ -162,7 +162,6 @@ def __init__(
162162
if isinstance(serial_number, (str, bytes)):
163163
serial_number = int(serial_number, 16)
164164
self.serial_number = serial_number
165-
self.exception_on_failed_shot = exception_on_failed_shot
166165
self.BLACS_connection = hex(self.serial_number)[2:].upper()
167166
if camera_attributes is None:
168167
camera_attributes = {}

0 commit comments

Comments
 (0)