Source code for rsrtx.Implementations.Display.Signal.Label.Horizontal.Relative.Position

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

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

[docs] def set(self, label_id: str, source: enums.SignalSource, position: float) -> None: """ ``DISPlay:SIGNal:LABel:HORizontal:RELative:POSition`` \n Snippet: ``driver.display.signal.label.horizontal.relative.position.set(label_id = 'abc', source = enums.SignalSource.AJ1, position = 1.0)`` \n Modifies or queries the relative horizontal and vertical positiions of the specified label if method ``RsRtx.display.signal.label.posMode.set()`` is set to REL. :param label_id: String with the label identifier. :param source: All waveforms that can be displayed, see method ``RsRtx.display.signal.label.add()`` :param position: Position in percent of the screen counting from the upper left corner. """ param = ArgSingleList().compose_cmd_string(ArgSingle('label_id', label_id, DataType.String), ArgSingle('source', source, DataType.Enum, enums.SignalSource), ArgSingle('position', position, DataType.Float)) self._core.io.write(f'DISPlay:SIGNal:LABel:HORizontal:RELative:POSition {param}'.rstrip())
[docs] def get(self, label_id: str, source: enums.SignalSource) -> float: """ ``DISPlay:SIGNal:LABel:HORizontal:RELative:POSition`` \n Snippet: ``value: float = driver.display.signal.label.horizontal.relative.position.get(label_id = 'abc', source = enums.SignalSource.AJ1)`` \n Modifies or queries the relative horizontal and vertical positiions of the specified label if method ``RsRtx.display.signal.label.posMode.set()`` is set to REL. :param label_id: String with the label identifier. :param source: All waveforms that can be displayed, see method ``RsRtx.display.signal.label.add()`` :return: position: Position in percent of the screen counting from the upper left corner. """ 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(f'DISPlay:SIGNal:LABel:HORizontal:RELative:POSition? {param}'.rstrip()) return Conversions.str_to_float(response)