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 YoffsetCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("yoffset", core, parent)
[docs]
def set(self, mask_test: str, mask_segment: int, offset_y: float) -> None:
"""
``MTESt:SEGMent:RESCale:YOFFset`` \n
Snippet: ``driver.mtest.segment.rescale.yoffset.set(mask_test = 'abc', mask_segment = 1, offset_y = 1.0)`` \n
Moves the mask segment vertically. The specified offset is added to the y-values of all points of the selected mask
segment. Only takes effect after the method ``RsRtx.mtest.segment.rescale.recalculate.set()`` command.
:param mask_test: String with the name of the mask test
:param mask_segment: Number of the segment. Counting starts from 0.
:param offset_y: -1000 to 1000
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('mask_segment', mask_segment, DataType.Integer), ArgSingle('offset_y', offset_y, DataType.Float))
self._core.io.write_with_opc(f'MTESt:SEGMent:RESCale:YOFFset {param}'.rstrip())
[docs]
def get(self, mask_test: str, mask_segment: int) -> float:
"""
``MTESt:SEGMent:RESCale:YOFFset`` \n
Snippet: ``value: float = driver.mtest.segment.rescale.yoffset.get(mask_test = 'abc', mask_segment = 1)`` \n
Moves the mask segment vertically. The specified offset is added to the y-values of all points of the selected mask
segment. Only takes effect after the method ``RsRtx.mtest.segment.rescale.recalculate.set()`` command.
:param mask_test: String with the name of the mask test
:param mask_segment: Number of the segment. Counting starts from 0.
:return: offset_y: -1000 to 1000
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('mask_segment', mask_segment, DataType.Integer))
response = self._core.io.query_str_with_opc(f'MTESt:SEGMent:RESCale:YOFFset? {param}'.rstrip())
return Conversions.str_to_float(response)