from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
from .... import repcap
# 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, dlc_operator: enums.ConditionOperator, trigger=repcap.Trigger.Default) -> None:
"""
``TRIGger<*>:LIN:DLECondition`` \n
Snippet: ``driver.trigger.lin.dleCondition.set(dlc_operator = enums.ConditionOperator.EQUal, trigger = repcap.Trigger.Default)`` \n
Operator to set the data length for triggering 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.trigger.lin.dlength.set()`` .
See also:method ``RsRtx.trigger.lin.border.set()`` .
:param dlc_operator: For little endian transfer direction, EQUal must be set.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
"""
param = Conversions.enum_scalar_to_str(dlc_operator, enums.ConditionOperator)
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
self._core.io.write(f'TRIGger{trigger_cmd_val}:LIN:DLECondition {param}')
# noinspection PyTypeChecker
[docs]
def get(self, trigger=repcap.Trigger.Default) -> enums.ConditionOperator:
"""
``TRIGger<*>:LIN:DLECondition`` \n
Snippet: ``value: enums.ConditionOperator = driver.trigger.lin.dleCondition.get(trigger = repcap.Trigger.Default)`` \n
Operator to set the data length for triggering 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.trigger.lin.dlength.set()`` .
See also:method ``RsRtx.trigger.lin.border.set()`` .
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
:return: dlc_operator: For little endian transfer direction, EQUal must be set.
"""
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
response = self._core.io.query_str(f'TRIGger{trigger_cmd_val}:LIN:DLECondition?')
return Conversions.str_to_scalar_enum(response, enums.ConditionOperator)