Skip to content

Commit

Permalink
#54 - fixed fifo mode num samples coercion bug
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbaker committed Mar 4, 2024
1 parent d5c1b9f commit 540218e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/spectrumdevice/devices/digitiser/digitiser_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
26 changes: 25 additions & 1 deletion src/spectrumdevice/settings/triggering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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."""

Expand All @@ -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:
Expand Down

0 comments on commit 540218e

Please sign in to comment.