def __init__(self, index=0, **kwargs): super().__init__(index=index, **kwargs) if not AndorSDK3.SDK_INITIALIZED: SDK3.InitialiseLibrary() self.handle = None # self._sdk3cam = SDK3Camera(self._index) # SDK3Camera.__init__(self, self._index) self.add_setting( "use_callback", "bool", lambda: self._using_callback, self._enable_callback, None, ) # Define features with local style. The SDK treats parameter names # without regard to case, so we just need to remove the underscores # when connecting properties to SDK calls. We define all possible # features here; they will be removed if they are not implemented # on the camera. self._accumulate_count = ATInt() self._acquisition_start = ATCommand() self._acquisition_stop = ATCommand() self._alternating_readout_direction = ATBool() self._aoi_binning = ATEnum() self._aoi_height = ATInt() self._aoi_left = ATInt() self._aoi_top = ATInt() self._aoi_width = ATInt() self._aoi_stride = ATInt() self._auxiliary_out_source = ATEnum() self._aux_out_source_two = ATEnum() self._baseline_level = ATInt() self._bit_depth = ATEnum() self._buffer_overflow_event = ATInt() self._bytes_per_pixel = ATFloat() self._camera_acquiring = ATBool() self._camera_dump = ATCommand() self._camera_model = ATString() self._camera_name = ATString() self._camera_present = ATBool() self._controller_id = ATString() self._frame_count = ATInt() self._cycle_mode = ATEnum() self._electronic_shuttering_mode = ATEnum() self._event_enable = ATBool() self._events_missed_event = ATInt() self._event_selector = ATEnum() self._exposed_pixel_height = ATInt() self._exposure_time = ATFloat() self._exposure_end_event = ATInt() self._exposure_start_event = ATInt() self._external_trigger_delay = ATFloat() self._fan_speed = ATEnum() self._firmware_version = ATString() self._frame_rate = ATFloat() self._full_aoi_control = ATBool() self._image_size_bytes = ATInt() self._interface_type = ATString() self._io_invert = ATBool() self._io_selector = ATEnum() self._line_scan_speed = ATFloat() self._lut_index = ATInt() self._lut_value = ATInt() self._max_interface_transfer_rate = ATFloat() self._metadata_enable = ATBool() self._metadata_timestamp = ATBool() self._metadata_frame = ATBool() self._overlap = ATBool() self._pixel_encoding = ATEnum() self._pixel_readout_rate = ATEnum() self._pre_amp_gain_control = ATEnum() self._readout_time = ATFloat() self._rolling_shutter_global_clear = ATBool() self._row_n_exposure_end_event = ATInt() self._row_n_exposure_start_event = ATInt() self._row_read_time = ATFloat() self._scan_speed_control_enable = ATBool() self._sensor_cooling = ATBool() self._sensor_height = ATInt() self._sensor_readout_mode = ATEnum() self._sensor_temperature = ATFloat() self._sensor_width = ATInt() self._serial_number = ATString() self._simple_pre_amp_gain_control = ATEnum() self._software_trigger = ATCommand() self._static_blemish_correction = ATBool() self._spurious_noise_filter = ATBool() self._target_sensor_temperature = ATFloat() self._temperature_control = ATEnum() self._temperature_status = ATEnum() self._timestamp_clock = ATInt() self._timestamp_clock_frequency = ATInt() self._timestamp_clock_reset = ATCommand() self._trigger_mode = ATEnum() self._vertically_centre_aoi = ATBool() # Software buffers and parameters for data conversion. self.num_buffers = 32 self.add_setting( "num_buffers", "int", lambda: self.num_buffers, lambda val: self.set_num_buffers(val), lambda: (1, 100), ) self.buffers = queue.Queue() self._buffer_size = None self._img_stride = None self._img_width = None self._img_height = None self._img_encoding = None self._buffers_valid = False self._exposure_callback = None self.initialize()
def regCamera(cls): if cls.numCameras == 0: SDK3.InitialiseLibrary() cls.numCameras += 1