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

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

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

[docs] def set(self, source: enums.SignalSource, position_mode: enums.PositionMode) -> None: """ ``DISPlay:SIGNal:LABel:POSMode`` \n Snippet: ``driver.display.signal.label.posMode.set(source = enums.SignalSource.AJ1, position_mode = enums.PositionMode.ABS)`` \n Modifies or queries the position mode: either relative to the diagram or with absolute values according to the units of the waveform. The position mode applies to all labels of the selected source. For different sources, different position modes can be selected. :param source: All waveforms that can be displayed, see method ``RsRtx.display.signal.label.add()`` :param position_mode: ABS | REL \n - ABS: Position in time and voltage values, or in other units depending on the waveform character. Absolute positions move with the waveform display when the scales, the vertical position or offset, or the reference point are changed.Use DISPlay:SIGNal:LABel:HORizontal:ABSolute:POSition and DISPlay:SIGNal:LABel:HORizontal:RELative:POSition to set the position. - REL: Fixed label position in percent of the screen counting from the upper left corner.Use DISPlay:SIGNal:LABel:HORizontal:RELative:POSition and DISPlay:SIGNal:LABel:VERTical:RELative:POSition to set the position. """ param = ArgSingleList().compose_cmd_string(ArgSingle('source', source, DataType.Enum, enums.SignalSource), ArgSingle('position_mode', position_mode, DataType.Enum, enums.PositionMode)) self._core.io.write_with_opc(f'DISPlay:SIGNal:LABel:POSMode {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, source: enums.SignalSource) -> enums.PositionMode: """ ``DISPlay:SIGNal:LABel:POSMode`` \n Snippet: ``value: enums.PositionMode = driver.display.signal.label.posMode.get(source = enums.SignalSource.AJ1)`` \n Modifies or queries the position mode: either relative to the diagram or with absolute values according to the units of the waveform. The position mode applies to all labels of the selected source. For different sources, different position modes can be selected. :param source: All waveforms that can be displayed, see method ``RsRtx.display.signal.label.add()`` :return: position_mode: ABS | REL \n - ABS: Position in time and voltage values, or in other units depending on the waveform character. Absolute positions move with the waveform display when the scales, the vertical position or offset, or the reference point are changed.Use DISPlay:SIGNal:LABel:HORizontal:ABSolute:POSition and DISPlay:SIGNal:LABel:HORizontal:RELative:POSition to set the position. - REL: Fixed label position in percent of the screen counting from the upper left corner.Use DISPlay:SIGNal:LABel:HORizontal:RELative:POSition and DISPlay:SIGNal:LABel:VERTical:RELative:POSition to set the position. """ param = Conversions.enum_scalar_to_str(source, enums.SignalSource) response = self._core.io.query_str_with_opc(f'DISPlay:SIGNal:LABel:POSMode? {param}') return Conversions.str_to_scalar_enum(response, enums.PositionMode)