from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Types import DataType
from .....Internal.ArgSingleList import ArgSingleList
from .....Internal.ArgSingle import ArgSingle
from ..... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class PalignmentCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("palignment", core, parent)
[docs]
def set(self, search: str, data_alignment: enums.SpiDataAlignment) -> None:
"""
``SEARch:TRIGger:SPI:PALignment`` \n
Snippet: ``driver.search.trigger.spi.palignment.set(search = 'abc', data_alignment = enums.SpiDataAlignment.BIT)`` \n
Defines how the specified data pattern is searched.
:param data_alignment: WORD | BIT \n
- WORD: The pattern is matched only at word boundaries.
- BIT: Bit-by-bit: the pattern can start at any position in the message.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('data_alignment', data_alignment, DataType.Enum, enums.SpiDataAlignment))
self._core.io.write_with_opc(f'SEARch:TRIGger:SPI:PALignment {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.SpiDataAlignment:
"""
``SEARch:TRIGger:SPI:PALignment`` \n
Snippet: ``value: enums.SpiDataAlignment = driver.search.trigger.spi.palignment.get(search = 'abc')`` \n
Defines how the specified data pattern is searched.
:return: data_alignment: WORD | BIT \n
- WORD: The pattern is matched only at word boundaries.
- BIT: Bit-by-bit: the pattern can start at any position in the message.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:SPI:PALignment? {param}')
return Conversions.str_to_scalar_enum(response, enums.SpiDataAlignment)