from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DmaxCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("dmax", core, parent)
[docs]
def set(self, data_max_pattern: int, trigger=repcap.Trigger.Default, tcondition=repcap.Tcondition.Default) -> None:
"""
``TRIGger<*>:I2S:TCONdition<*>:DMAX`` \n
Snippet: ``driver.trigger.i2S.tcondition.dmax.set(data_max_pattern = 1, trigger = repcap.Trigger.Default, tcondition = repcap.Tcondition.Default)`` \n
Sets the end value of an data range if the operator method ``RsRtx.trigger.i2S.tcondition.condition.set()`` is set to
INRange or OORange.
:param data_max_pattern: Numeric pattern in 2's complement format. See also: 'Bit pattern parameter' DMAX must be greater or equal than DMIN. X bits are not allowed. If the bit string is shorter than the word length, the rightmost bit of the input bit string is aligned to the rightmost (LSB) bit of the word.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
:param tcondition: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Tcondition')
"""
param = Conversions.decimal_value_to_str(data_max_pattern)
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
tcondition_cmd_val = self._cmd_group.get_repcap_cmd_value(tcondition, repcap.Tcondition)
self._core.io.write(f'TRIGger{trigger_cmd_val}:I2S:TCONdition{tcondition_cmd_val}:DMAX {param}')
[docs]
def get(self, trigger=repcap.Trigger.Default, tcondition=repcap.Tcondition.Default) -> int:
"""
``TRIGger<*>:I2S:TCONdition<*>:DMAX`` \n
Snippet: ``value: int = driver.trigger.i2S.tcondition.dmax.get(trigger = repcap.Trigger.Default, tcondition = repcap.Tcondition.Default)`` \n
Sets the end value of an data range if the operator method ``RsRtx.trigger.i2S.tcondition.condition.set()`` is set to
INRange or OORange.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
:param tcondition: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Tcondition')
:return: data_max_pattern: Numeric pattern in 2's complement format. See also: 'Bit pattern parameter' DMAX must be greater or equal than DMIN. X bits are not allowed. If the bit string is shorter than the word length, the rightmost bit of the input bit string is aligned to the rightmost (LSB) bit of the word.
"""
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
tcondition_cmd_val = self._cmd_group.get_repcap_cmd_value(tcondition, repcap.Tcondition)
response = self._core.io.query_str(f'TRIGger{trigger_cmd_val}:I2S:TCONdition{tcondition_cmd_val}:DMAX?')
return Conversions.str_to_int(response)