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
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DpositionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("dposition", core, parent)
[docs]
def set(self, search: str, data_position: int) -> None:
"""
``SEARch:TRIGger:SPI:DPOSition`` \n
Snippet: ``driver.search.trigger.spi.dposition.set(search = 'abc', data_position = 1)`` \n
Sets the number of bits or words before the first word of interest,
see also method ``RsRtx.search.trigger.spi.palignment.set()`` . These offset bits/words are skipped. The index 0 is
associated with the first data bit or word. If the position operator defines a range, also define the last bit/word of
interest using method ``RsRtx.search.trigger.spi.dpto.set()``
:param data_position: 0 to 32.767E+3
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('data_position', data_position, DataType.Integer))
self._core.io.write(f'SEARch:TRIGger:SPI:DPOSition {param}'.rstrip())
[docs]
def get(self, search: str) -> int:
"""
``SEARch:TRIGger:SPI:DPOSition`` \n
Snippet: ``value: int = driver.search.trigger.spi.dposition.get(search = 'abc')`` \n
Sets the number of bits or words before the first word of interest,
see also method ``RsRtx.search.trigger.spi.palignment.set()`` . These offset bits/words are skipped. The index 0 is
associated with the first data bit or word. If the position operator defines a range, also define the last bit/word of
interest using method ``RsRtx.search.trigger.spi.dpto.set()``
:return: data_position: 0 to 32.767E+3
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:SPI:DPOSition? {param}')
return Conversions.str_to_int(response)