src.services.flc_mini.interlock_service package¶
Submodules¶
src.services.flc_mini.interlock_service.interlock_set module¶
- class src.services.flc_mini.interlock_service.interlock_set.Interlock¶
Bases:
object- en_heartbeat(hi: HardwareInterface, en_heartbeat: bool)¶
Enable heartbeat signal for the selected branch of the channel.
- Parameters:
hi – HardwareInterface object
en_heartbeat – bool, enable heartbeat signal
- en_moving_avg(hi: HardwareInterface, select_branch: int, en_mov_average: bool)¶
Enable moving average for the selected branch of the channel.
- Parameters:
hi (-) – HardwareInterface object
select_branch (-) – int, the selected branch
en_mov_average (-) – bool, whether to enable or disable moving average
- get_interlock_vector(hi: HardwareInterface)¶
Send the request to the FPGA to get the interlock vector and return the received value
- Parameters:
hi (HardwareInterface) – selected hardware interface
- Returns:
interlock register value
- Return type:
bytes
- set_params(fifo_depth: int, max_error: int, moving_avg: bool, adc_branch: int)¶
Set the parameters for the interlock algorithm and save them in the object
- Parameters:
fifo_depth – int, FIFO depth of the moving average algorithm
max_error – int, maximum error value
moving_avg – bool, enable moving average
adc_branch – int, selected branch of the ADC channel
- sort_interlock_vector(interlock_vector: bytes)¶
Sort the interlock vector, reverse the bit order, and write the error according to register values.
- Parameters:
interlock_vector (bytes) – Interlock vector
- trigger_interlock(hi: HardwareInterface)¶
Software trigger for interlock security system
- Parameters:
hi (HardwareInterface) – Selected hardware interface
- write_fifo_depth(hi: HardwareInterface, select_fifo: int, fifo_depth: int)¶
Set the FIFO depth of the moving average algorithm
- Parameters:
hi (HardwareInterface) – selected hardware interface
fifo_depth (int) – FIFO depth value
- write_heartbeat(hi: HardwareInterface, heartbeat_data: bool)¶
Write the heartbeat signal to the FPGA
- Parameters:
hi (HardwareInterface) – selected hardware interface
heartbeat_data (bool) – True or False
- write_max_error(hi: HardwareInterface, select_branch: int, max_error: int)¶
Set the maximum error value of moving average :param hi: HardwareInterface object :param select_branch: selected branch of ADC channel :param max_error: maximum error value
- write_params(hi: HardwareInterface)¶
Send the interlock settings to the FPGA
- Parameters:
hi – HardwareInterface object