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

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Types import DataType
from .....Internal.ArgSingleList import ArgSingleList
from .....Internal.ArgSingle import ArgSingle
from ..... import enums


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

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

[docs] def set(self, label_id: str, source: enums.SignalSource, state: bool) -> None: """ ``DISPlay:SIGNal:LABel:STATe`` \n Snippet: ``driver.display.signal.label.state.set(label_id = 'abc', source = enums.SignalSource.AJ1, state = False)`` \n Displays or hides a single label that is identified by the signal source and label ID. :param label_id: String with the label identifier. :param source: See method ``RsRtx.display.signal.label.add()``. :param state: ON: shows the label on the screen. method ``RsRtx.display.signal.label.show.set()`` must be set to ON for the source. """ param = ArgSingleList().compose_cmd_string(ArgSingle('label_id', label_id, DataType.String), ArgSingle('source', source, DataType.Enum, enums.SignalSource), ArgSingle('state', state, DataType.Boolean)) self._core.io.write_with_opc(f'DISPlay:SIGNal:LABel:STATe {param}'.rstrip())
[docs] def get(self, label_id: str, source: enums.SignalSource) -> bool: """ ``DISPlay:SIGNal:LABel:STATe`` \n Snippet: ``value: bool = driver.display.signal.label.state.get(label_id = 'abc', source = enums.SignalSource.AJ1)`` \n Displays or hides a single label that is identified by the signal source and label ID. :param label_id: String with the label identifier. :param source: See method ``RsRtx.display.signal.label.add()``. :return: state: ON: shows the label on the screen. method ``RsRtx.display.signal.label.show.set()`` must be set to ON for the source. """ 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:STATe? {param}'.rstrip()) return Conversions.str_to_bool(response)