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 ErrPatternCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("errPattern", core, parent)
[docs]
def set(self, search: str, error_pattern: int) -> None:
"""
``SEARch:TRIGger:LIN:ERRPattern`` \n
Snippet: ``driver.search.trigger.lin.errPattern.set(search = 'abc', error_pattern = 1)`` \n
Sets the frame identifier to search for a checksum error.
:param error_pattern: Numeric or string pattern, see 'Bit pattern parameter'.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('error_pattern', error_pattern, DataType.Integer))
self._core.io.write(f'SEARch:TRIGger:LIN:ERRPattern {param}'.rstrip())
[docs]
def get(self, search: str) -> int:
"""
``SEARch:TRIGger:LIN:ERRPattern`` \n
Snippet: ``value: int = driver.search.trigger.lin.errPattern.get(search = 'abc')`` \n
Sets the frame identifier to search for a checksum error.
:return: error_pattern: Numeric or string pattern, see 'Bit pattern parameter'.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:LIN:ERRPattern? {param}')
return Conversions.str_to_int(response)