From 540218ee30038d2f616ed42ec9154552aae5906a Mon Sep 17 00:00:00 2001 From: crnbaker Date: Mon, 4 Mar 2024 14:40:19 +0000 Subject: [PATCH] #54 - fixed fifo mode num samples coercion bug --- .../devices/digitiser/digitiser_card.py | 2 +- src/spectrumdevice/settings/triggering.py | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/spectrumdevice/devices/digitiser/digitiser_card.py b/src/spectrumdevice/devices/digitiser/digitiser_card.py index e173703..5831ec3 100644 --- a/src/spectrumdevice/devices/digitiser/digitiser_card.py +++ b/src/spectrumdevice/devices/digitiser/digitiser_card.py @@ -233,7 +233,7 @@ def set_post_trigger_length_in_samples(self, length_in_samples: int) -> None: def _coerce_num_samples_if_fifo(self, value: int) -> int: if self.acquisition_mode == AcquisitionMode.SPC_REC_FIFO_MULTI: - if value != mod(value, get_memsize_step_size(self._model_number)): + if mod(value, get_memsize_step_size(self._model_number)) != 0: logger.warning( f"FIFO mode: coercing length to nearest {get_memsize_step_size(self._model_number)}" f" samples" ) diff --git a/src/spectrumdevice/settings/triggering.py b/src/spectrumdevice/settings/triggering.py index cfd162b..7f19162 100644 --- a/src/spectrumdevice/settings/triggering.py +++ b/src/spectrumdevice/settings/triggering.py @@ -11,6 +11,14 @@ from spectrumdevice.spectrum_wrapper import decode_bitmap_using_list_of_ints from spectrum_gmbh.py_header.regs import ( + SPC_TMASK0_CH0, + SPC_TMASK0_CH1, + SPC_TMASK0_CH2, + SPC_TMASK0_CH3, + SPC_TMASK0_CH4, + SPC_TMASK0_CH5, + SPC_TMASK0_CH6, + SPC_TMASK0_CH7, SPC_TMASK_SOFTWARE, SPC_TMASK_EXT0, SPC_TMASK_EXT1, @@ -49,6 +57,22 @@ class TriggerSource(Enum): """Enables the X2 (logic) trigger for the OR mask.""" SPC_TMASK_EXT3 = SPC_TMASK_EXT3 """Enables the X3 (logic) trigger for the OR mask.""" + SPC_TMASK0_CH0 = SPC_TMASK0_CH0 + """Enables channel 0 for recognition within the channel OR mask""" + SPC_TMASK0_CH1 = SPC_TMASK0_CH1 + """Enables channel 1 for recognition within the channel OR mask""" + SPC_TMASK0_CH2 = SPC_TMASK0_CH2 + """Enables channel 2 for recognition within the channel OR mask""" + SPC_TMASK0_CH3 = SPC_TMASK0_CH3 + """Enables channel 3 for recognition within the channel OR mask""" + SPC_TMASK0_CH4 = SPC_TMASK0_CH4 + """Enables channel 4 for recognition within the channel OR mask""" + SPC_TMASK0_CH5 = SPC_TMASK0_CH5 + """Enables channel 5 for recognition within the channel OR mask""" + SPC_TMASK0_CH6 = SPC_TMASK0_CH6 + """Enables channel 6 for recognition within the channel OR mask""" + SPC_TMASK0_CH7 = SPC_TMASK0_CH7 + """Enables channel 7 for recognition within the channel OR mask""" SPC_TMASK_NONE = SPC_TMASK_NONE """No trigger source selected.""" @@ -62,7 +86,7 @@ class TriggerSource(Enum): class ExternalTriggerMode(Enum): - """An Enum representing the supported trigger modes. See the Spectrum documentation more more Information. + """An Enum representing the supported trigger modes. See the Spectrum documentation more Information. SPC_TM_NONE: SPC_TM_POS: