src.services.hs_driver package

Subpackages

Submodules

src.services.hs_driver.base module

class src.services.hs_driver.base.DelayLineChip

Bases: ABC

abstractmethod calc_delay(value: int, unit: str, *args, **kwargs) int | list[int]
get_name() str
name = ''
abstractmethod send_delay(hi: HardwareInterface, value: int | list[int], unit: str, channel, top, mid, bottom, *args, **kwargs)

src.services.hs_driver.hs_driver module

class src.services.hs_driver.hs_driver.DelayLineDriver(hi: HardwareInterface, spi_name: str, sload_pin: int, hs_driver_name: str = 'NO_CHIP')

Bases: object

Delay line driver class to set delay values for the selected chip and side. Called by the main application, from tab Delayline and possibly from the main controls, to set the delay values.

reset_delay(channel: int)

Reset delay for the specified channel.

set_delay(delay: int, unit: str, channel: int, top: int = 0, mid: int = 0, bottom: int = 0)

Call the backend function to set the delay values for the selected chip and channel.

Parameters:
  • delay (int) – Delay value to be set.

  • unit (str) – Unit of the delay value.

  • channel (int) – Channel to set the delay value.

  • top (int) – Pin value for the chip associated with the top button.

  • mid (int) – Pin value for the chip associated with the middle button.

  • bottom (int) – Pin value for the chip associated with the bottom button.

Returns:

None

toggle_latch()

Toggle the SLOAD pin to latch the delay value.

validate_delay(delay: float, unit: str)

Validate delay range for selected chip.

Parameters:
  • delay (float) – Delay value to be set.

  • unit (str) – Unit of the delay value.

Returns:

None

src.services.hs_driver.setup_hs_chip module

src.services.hs_driver.setup_hs_chip.hs_driver_factory(hs_driver_type: str, hardware_interface: HardwareInterface, spi_name: str, *args, **kwargs) DelayLineChip

Function that returns the correct hs driver object based on the hs driver type.

Parameters:
  • hs_driver_type (str) – The hs driver type.

  • hardware_interface (HardwareInterface) – The hardware interface object.

  • spi_name (str) – The spi name.

  • *args – Additional arguments.

  • **kwargs – Additional keyword arguments.

Returns:

The hs driver object.

Return type:

DelayLineChip

src.services.hs_driver.setup_hs_chip.setup_hs_chip(hs_driver_type: str, hardware_interface: HardwareInterface, spi_name: str, *args, **kwargs) DelayLineChip

Module contents