Source code for rsrtx.Implementations.Search.ResDiagram.Horz.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


# 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, search: str, rel_posi: float) -> None: """ ``SEARch:RESDiagram:HORZ:RELative:POSition`` \n Snippet: ``driver.search.resDiagram.horz.relative.position.set(search = 'abc', rel_posi = 1.0)`` \n Defines the x-value of the centerpoint of the zoom area. :param search: Search definition :param rel_posi: 0 to 100 """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('rel_posi', rel_posi, DataType.Float)) self._core.io.write_with_opc(f'SEARch:RESDiagram:HORZ:RELative:POSition {param}'.rstrip())
[docs] def get(self, search: str) -> float: """ ``SEARch:RESDiagram:HORZ:RELative:POSition`` \n Snippet: ``value: float = driver.search.resDiagram.horz.relative.position.get(search = 'abc')`` \n Defines the x-value of the centerpoint of the zoom area. :param search: Search definition :return: rel_posi: 0 to 100 """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:RESDiagram:HORZ:RELative:POSition? {param}') return Conversions.str_to_float(response)