from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from ....Internal.Types import DataType
from ....Internal.Utilities import trim_str_response
from ....Internal.ArgSingleList import ArgSingleList
from ....Internal.ArgSingle import ArgSingle
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AddCoupledCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("addCoupled", core, parent)
[docs]
def set(self, zoom_name: str, xoffset: int, yoffset: int, new_zoom_name: str) -> None:
"""
``LAYout:ZOOM:ADDCoupled`` \n
Snippet: ``driver.layout.zoom.addCoupled.set(zoom_name = 'abc', xoffset = 1, yoffset = 1, new_zoom_name = 'abc')`` \n
Creates a new zoom diagram based on the settings of an existing zoom area for the same source. For numerical values, the
input of a unit is not supported for this command.
:param zoom_name: Defines the name of the zoom diagram to be copied.
:param xoffset: Defines an offset to the existing zoom area in x direction.
:param yoffset: Defines an offset to the existing zoom area in y direction.
:param new_zoom_name: Defines the name of the new zoom diagram.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('zoom_name', zoom_name, DataType.String), ArgSingle('xoffset', xoffset, DataType.Integer), ArgSingle('yoffset', yoffset, DataType.Integer), ArgSingle('new_zoom_name', new_zoom_name, DataType.String))
self._core.io.write_with_opc(f'LAYout:ZOOM:ADDCoupled {param}'.rstrip())
[docs]
def get(self, new_zoom_name: str) -> str:
"""
``LAYout:ZOOM:ADDCoupled`` \n
Snippet: ``value: str = driver.layout.zoom.addCoupled.get(new_zoom_name = 'abc')`` \n
Creates a new zoom diagram based on the settings of an existing zoom area for the same source. For numerical values, the
input of a unit is not supported for this command.
:param new_zoom_name: Defines the name of the new zoom diagram.
:return: new_zoom_name: Defines the name of the new zoom diagram.
"""
param = Conversions.value_to_quoted_str(new_zoom_name)
response = self._core.io.query_str_with_opc(f'LAYout:ZOOM:ADDCoupled? {param}')
return trim_str_response(response)