Source code for rsrtx.Implementations.Trigger.Parallel.State.Bit

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 BitCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1

	Repeated Capability Setting:
	
	.. code-block:: python
	
			# Range: Nr0 .. Nr15 \n
			driver.trigger.parallel.state.bit.repcap_bitNull_set(repcap.BitNull.Nr0)
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("bit", core, parent)
		self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_bitNull_get', 'repcap_bitNull_set', repcap.BitNull.Nr0)

	def repcap_bitNull_set(self, bitNull: repcap.BitNull) -> 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 BitNull.Default.
		Default value after init: BitNull.Nr0
		"""
		self._cmd_group.set_repcap_enum_value(bitNull)

	def repcap_bitNull_get(self) -> repcap.BitNull:
		"""
		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, bit: enums.TriggerParallelBit, trigger=repcap.Trigger.Default, bitNull=repcap.BitNull.Default) -> None: """ ``TRIGger<*>:PARallel:STATe:BIT<*>`` \n Snippet: ``driver.trigger.parallel.state.bit.set(bit = enums.TriggerParallelBit.DONTCARE, trigger = repcap.Trigger.Default, bitNull = repcap.BitNull.Default)`` \n Sets the required state for each digital channel that is used in the bus. :param bit: Bit value: 1 (HIGH) , 0 (LOW) , or X (DONTCARE = DONTcare) :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') :param bitNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Bit') """ param = Conversions.enum_scalar_to_str(bit, enums.TriggerParallelBit) trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) bitNull_cmd_val = self._cmd_group.get_repcap_cmd_value(bitNull, repcap.BitNull) self._core.io.write_with_opc(f'TRIGger{trigger_cmd_val}:PARallel:STATe:BIT{bitNull_cmd_val} {param}')
# noinspection PyTypeChecker
[docs] def get(self, trigger=repcap.Trigger.Default, bitNull=repcap.BitNull.Default) -> enums.TriggerParallelBit: """ ``TRIGger<*>:PARallel:STATe:BIT<*>`` \n Snippet: ``value: enums.TriggerParallelBit = driver.trigger.parallel.state.bit.get(trigger = repcap.Trigger.Default, bitNull = repcap.BitNull.Default)`` \n Sets the required state for each digital channel that is used in the bus. :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') :param bitNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Bit') :return: bit: Bit value: 1 (HIGH) , 0 (LOW) , or X (DONTCARE = DONTcare) """ trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) bitNull_cmd_val = self._cmd_group.get_repcap_cmd_value(bitNull, repcap.BitNull) response = self._core.io.query_str_with_opc(f'TRIGger{trigger_cmd_val}:PARallel:STATe:BIT{bitNull_cmd_val}?') return Conversions.str_to_scalar_enum(response, enums.TriggerParallelBit)
def clone(self) -> 'BitCls': """ 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 = BitCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group