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:ABSolute:POSition`` \n
Snippet: ``driver.display.signal.label.horizontal.absolute.position.set(label_id = 'abc', source = enums.SignalSource.AJ1, position = 1.0)`` \n
Modifies or queries the absolute horizontal and vertical positiions of the specified label if method
``RsRtx.display.signal.label.posMode.set()`` is set to ABS.
: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: Depends on waveform position and scaling
"""
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:ABSolute:POSition {param}'.rstrip())
[docs]
def get(self, label_id: str, source: enums.SignalSource) -> float:
"""
``DISPlay:SIGNal:LABel:HORizontal:ABSolute:POSition`` \n
Snippet: ``value: float = driver.display.signal.label.horizontal.absolute.position.get(label_id = 'abc', source = enums.SignalSource.AJ1)`` \n
Modifies or queries the absolute horizontal and vertical positiions of the specified label if method
``RsRtx.display.signal.label.posMode.set()`` is set to ABS.
: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: Depends on waveform position and scaling
"""
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:ABSolute:POSition? {param}'.rstrip())
return Conversions.str_to_float(response)