Source code for rsrtx.Implementations.Digital.Label

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Utilities import trim_str_response
from ... import repcap


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

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("label", core, parent)

[docs] def set(self, label: str, digitalNull=repcap.DigitalNull.Default) -> None: """ ``DIGital<*>:LABel`` \n Snippet: ``driver.digital.label.set(label = 'abc', digitalNull = repcap.DigitalNull.Default)`` \n Sets a name for the indicated digital channel. The name is displayed in the diagram. The setting affects only the settings of the first MSO bus (Bus1) . You can set the label for all buses with method ``RsRtx.bus.parallel.bit.label.set()`` . :param label: String containing the channel name :param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital') """ param = Conversions.value_to_quoted_str(label) digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull) self._core.io.write(f'DIGital{digitalNull_cmd_val}:LABel {param}')
[docs] def get(self, digitalNull=repcap.DigitalNull.Default) -> str: """ ``DIGital<*>:LABel`` \n Snippet: ``value: str = driver.digital.label.get(digitalNull = repcap.DigitalNull.Default)`` \n Sets a name for the indicated digital channel. The name is displayed in the diagram. The setting affects only the settings of the first MSO bus (Bus1) . You can set the label for all buses with method ``RsRtx.bus.parallel.bit.label.set()`` . :param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital') :return: label: String containing the channel name """ digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull) response = self._core.io.query_str(f'DIGital{digitalNull_cmd_val}:LABel?') return trim_str_response(response)