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 DleConditionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("dleCondition", core, parent)
[docs]
def set(self, search: str, dlc_operator: enums.ConditionOperator) -> None:
"""
``SEARch:TRIGger:LIN:DLECondition`` \n
Snippet: ``driver.search.trigger.lin.dleCondition.set(search = 'abc', dlc_operator = enums.ConditionOperator.EQUal)`` \n
Operator to set the data length for search on LIN data. For Big Endian transfer direction, you can trigger on a number of
bytes less than the data length of the frame, that means, on the first bytes that are transmitted. For Little Endian
transfer direction, the exact number of data bytes in the frame must be set. Example: The data word to be sent is 12 34
56, and it is sent little endian by the LIN node. With Data length ≥ 2 and Transfer = Big endian, you trigger on the data
of the first two bytes, that is 56 34. With Data length = 3 and Transfer = Little endian, you trigger on the required
data word 12 34 56. The number of data bytes to be found is set with method ``RsRtx.search.trigger.lin.dlength.set()`` .
See also: method ``RsRtx.search.trigger.lin.border.set()`` .
:param dlc_operator: For little endian transfer direction, EQUal must be set.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('dlc_operator', dlc_operator, DataType.Enum, enums.ConditionOperator))
self._core.io.write(f'SEARch:TRIGger:LIN:DLECondition {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.ConditionOperator:
"""
``SEARch:TRIGger:LIN:DLECondition`` \n
Snippet: ``value: enums.ConditionOperator = driver.search.trigger.lin.dleCondition.get(search = 'abc')`` \n
Operator to set the data length for search on LIN data. For Big Endian transfer direction, you can trigger on a number of
bytes less than the data length of the frame, that means, on the first bytes that are transmitted. For Little Endian
transfer direction, the exact number of data bytes in the frame must be set. Example: The data word to be sent is 12 34
56, and it is sent little endian by the LIN node. With Data length ≥ 2 and Transfer = Big endian, you trigger on the data
of the first two bytes, that is 56 34. With Data length = 3 and Transfer = Little endian, you trigger on the required
data word 12 34 56. The number of data bytes to be found is set with method ``RsRtx.search.trigger.lin.dlength.set()`` .
See also: method ``RsRtx.search.trigger.lin.border.set()`` .
:return: dlc_operator: For little endian transfer direction, EQUal must be set.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:LIN:DLECondition? {param}')
return Conversions.str_to_scalar_enum(response, enums.ConditionOperator)