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, diagram_group: str, zoom_diagram: str, rel_posi: float) -> None:
"""
``LAYout:ZOOM:HORZ:RELative:POSition`` \n
Snippet: ``driver.layout.zoom.horz.relative.position.set(diagram_group = 'abc', zoom_diagram = 'abc', rel_posi = 1.0)`` \n
Defines the x-value of the centerpoint of the zoom area.
:param diagram_group: Name of the diagram on which the zoom area is based.
:param zoom_diagram: Name of the zoom diagram
:param rel_posi: Relative position of the centerpoint (x-value)
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('diagram_group', diagram_group, DataType.String), ArgSingle('zoom_diagram', zoom_diagram, DataType.String), ArgSingle('rel_posi', rel_posi, DataType.Float))
self._core.io.write_with_opc(f'LAYout:ZOOM:HORZ:RELative:POSition {param}'.rstrip())
[docs]
def get(self, diagram_group: str, zoom_diagram: str) -> float:
"""
``LAYout:ZOOM:HORZ:RELative:POSition`` \n
Snippet: ``value: float = driver.layout.zoom.horz.relative.position.get(diagram_group = 'abc', zoom_diagram = 'abc')`` \n
Defines the x-value of the centerpoint of the zoom area.
:param diagram_group: Name of the diagram on which the zoom area is based.
:param zoom_diagram: Name of the zoom diagram
:return: rel_posi: Relative position of the centerpoint (x-value)
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('diagram_group', diagram_group, DataType.String), ArgSingle('zoom_diagram', zoom_diagram, DataType.String))
response = self._core.io.query_str_with_opc(f'LAYout:ZOOM:HORZ:RELative:POSition? {param}'.rstrip())
return Conversions.str_to_float(response)