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 HysteresisCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("hysteresis", core, parent)
[docs]
def set(self, hysteresis: enums.DigitalHysteresis, digitalNull=repcap.DigitalNull.Default) -> None:
"""
``DIGital<*>:HYSTeresis`` \n
Snippet: ``driver.digital.hysteresis.set(hysteresis = enums.DigitalHysteresis.MAXIMUM, digitalNull = repcap.DigitalNull.Default)`` \n
Defines the size of the hysteresis to avoid the change of signal states due to noise for the channel group to which the
indicated digital channel belongs. The setting affects only the settings of the first MSO bus (Bus1) . You can set the
hysteresis for all buses with BUS<bb>:PARallel:HYSTeresis<n>. See also: method ``RsRtx.digital.thCoupling.set()``
:param hysteresis: MAXIMUM | MAXimum | ROBUST | ROBust | NORMAL | NORMal \n
- MAXIMUM = MAXimum: Maximum value that is possible and useful for the signal and its settings
- ROBUST = ROBust: Different hysteresis values for falling and rising edges to avoid an undefined state of the trigger system.
- NORMAL = NORMal: The instrument sets a value suitable for the signal and its settings.
:param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital')
"""
param = Conversions.enum_scalar_to_str(hysteresis, enums.DigitalHysteresis)
digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull)
self._core.io.write(f'DIGital{digitalNull_cmd_val}:HYSTeresis {param}')
# noinspection PyTypeChecker
[docs]
def get(self, digitalNull=repcap.DigitalNull.Default) -> enums.DigitalHysteresis:
"""
``DIGital<*>:HYSTeresis`` \n
Snippet: ``value: enums.DigitalHysteresis = driver.digital.hysteresis.get(digitalNull = repcap.DigitalNull.Default)`` \n
Defines the size of the hysteresis to avoid the change of signal states due to noise for the channel group to which the
indicated digital channel belongs. The setting affects only the settings of the first MSO bus (Bus1) . You can set the
hysteresis for all buses with BUS<bb>:PARallel:HYSTeresis<n>. See also: method ``RsRtx.digital.thCoupling.set()``
:param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital')
:return: hysteresis: MAXIMUM | MAXimum | ROBUST | ROBust | NORMAL | NORMal \n
- MAXIMUM = MAXimum: Maximum value that is possible and useful for the signal and its settings
- ROBUST = ROBust: Different hysteresis values for falling and rising edges to avoid an undefined state of the trigger system.
- NORMAL = NORMal: The instrument sets a value suitable for the signal and its settings.
"""
digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull)
response = self._core.io.query_str(f'DIGital{digitalNull_cmd_val}:HYSTeresis?')
return Conversions.str_to_scalar_enum(response, enums.DigitalHysteresis)