Source code for rsrtx.Implementations.Bus.Parallel.Hysteresis

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from ....Internal.RepeatedCapability import RepeatedCapability
from .... import enums
from .... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class HysteresisCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1

	Repeated Capability Setting:
	
	.. code-block:: python
	
			# Range: Nr1 .. Nr4 \n
			driver.bus.parallel.hysteresis.repcap_busHysteresis_set(repcap.BusHysteresis.Nr1)
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("hysteresis", core, parent)
		self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_busHysteresis_get', 'repcap_busHysteresis_set', repcap.BusHysteresis.Nr1)

	def repcap_busHysteresis_set(self, busHysteresis: repcap.BusHysteresis) -> None:
		"""
		Repeated Capability default value numeric suffix.
		This value is used, if you do not explicitely set it in the child set/get methods, or if you leave it to BusHysteresis.Default.
		Default value after init: BusHysteresis.Nr1
		"""
		self._cmd_group.set_repcap_enum_value(busHysteresis)

	def repcap_busHysteresis_get(self) -> repcap.BusHysteresis:
		"""
		Returns the current default repeated capability for the child set/get methods.
		"""
		# noinspection PyTypeChecker
		return self._cmd_group.get_repcap_enum_value()

[docs] def set(self, hysteresis: enums.DigitalHysteresis, bus=repcap.Bus.Default, busHysteresis=repcap.BusHysteresis.Default) -> None: """ ``BUS<*>:PARallel:HYSTeresis<*>`` \n Snippet: ``driver.bus.parallel.hysteresis.set(hysteresis = enums.DigitalHysteresis.MAXIMUM, bus = repcap.Bus.Default, busHysteresis = repcap.BusHysteresis.Default)`` \n Defines the size of the hysteresis for the channel group to avoid the change of signal states due to noise. For the parallel bus 1, you can also use method ``RsRtx.digital.hysteresis.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 bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') :param busHysteresis: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Hysteresis') """ param = Conversions.enum_scalar_to_str(hysteresis, enums.DigitalHysteresis) bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) busHysteresis_cmd_val = self._cmd_group.get_repcap_cmd_value(busHysteresis, repcap.BusHysteresis) self._core.io.write(f'BUS{bus_cmd_val}:PARallel:HYSTeresis{busHysteresis_cmd_val} {param}')
# noinspection PyTypeChecker
[docs] def get(self, bus=repcap.Bus.Default, busHysteresis=repcap.BusHysteresis.Default) -> enums.DigitalHysteresis: """ ``BUS<*>:PARallel:HYSTeresis<*>`` \n Snippet: ``value: enums.DigitalHysteresis = driver.bus.parallel.hysteresis.get(bus = repcap.Bus.Default, busHysteresis = repcap.BusHysteresis.Default)`` \n Defines the size of the hysteresis for the channel group to avoid the change of signal states due to noise. For the parallel bus 1, you can also use method ``RsRtx.digital.hysteresis.set()`` . :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') :param busHysteresis: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Hysteresis') :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. """ bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) busHysteresis_cmd_val = self._cmd_group.get_repcap_cmd_value(busHysteresis, repcap.BusHysteresis) response = self._core.io.query_str(f'BUS{bus_cmd_val}:PARallel:HYSTeresis{busHysteresis_cmd_val}?') return Conversions.str_to_scalar_enum(response, enums.DigitalHysteresis)
def clone(self) -> 'HysteresisCls': """ Clones the group by creating new object from it and its whole existing subgroups. Also copies all the existing default Repeated Capabilities setting, which you can change independently without affecting the original group. """ new_group = HysteresisCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group