Source code for rsrtx.Implementations.Display.Signal.Label.Text

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal.Types import DataType
from .....Internal.Utilities import trim_str_response
from .....Internal.ArgSingleList import ArgSingleList
from .....Internal.ArgSingle import ArgSingle
from ..... import enums


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

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

[docs] def set(self, label_id: str, source: enums.SignalSource, label_text: str) -> None: """ ``DISPlay:SIGNal:LABel:TEXT`` \n Snippet: ``driver.display.signal.label.text.set(label_id = 'abc', source = enums.SignalSource.AJ1, label_text = 'abc')`` \n Modifies or queries the text of the specified label. :param label_id: String with the label identifier. :param source: All waveforms that can be displayed, see method ``RsRtx.display.signal.label.add()`` :param label_text: String with the label text that is shown """ param = ArgSingleList().compose_cmd_string(ArgSingle('label_id', label_id, DataType.String), ArgSingle('source', source, DataType.Enum, enums.SignalSource), ArgSingle('label_text', label_text, DataType.String)) self._core.io.write_with_opc(f'DISPlay:SIGNal:LABel:TEXT {param}'.rstrip())
[docs] def get(self, label_id: str, source: enums.SignalSource) -> str: """ ``DISPlay:SIGNal:LABel:TEXT`` \n Snippet: ``value: str = driver.display.signal.label.text.get(label_id = 'abc', source = enums.SignalSource.AJ1)`` \n Modifies or queries the text of the specified label. :param label_id: String with the label identifier. :param source: All waveforms that can be displayed, see method ``RsRtx.display.signal.label.add()`` :return: label_text: String with the label text that is shown """ param = ArgSingleList().compose_cmd_string(ArgSingle('label_id', label_id, DataType.String), ArgSingle('source', source, DataType.Enum, enums.SignalSource)) response = self._core.io.query_str_with_opc(f'DISPlay:SIGNal:LABel:TEXT? {param}'.rstrip()) return trim_str_response(response)