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 RegionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("region", core, parent)
[docs]
def set(self, mask_test: str, mask_segment: int, region: enums.MtestRegion) -> None:
"""
``MTESt:SEGMent:REGion`` \n
Snippet: ``driver.mtest.segment.region.set(mask_test = 'abc', mask_segment = 1, region = enums.MtestRegion.INNer)`` \n
Defines the region of the segment that builds the mask.
:param mask_test: String with the name of the mask test
:param mask_segment: Number of the segment. Counting starts from 0.
:param region: UPPer | LOWer | INNer \n
- UPPer: the segment points are connected to a line, the display area above this line is the mask segment
- LOWer: the segment points are connected to a line, the display area below this line is the mask segment
- INNer: the segment points form a closed geometrical shape, which is the mask segment
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('mask_segment', mask_segment, DataType.Integer), ArgSingle('region', region, DataType.Enum, enums.MtestRegion))
self._core.io.write_with_opc(f'MTESt:SEGMent:REGion {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, mask_test: str, mask_segment: int) -> enums.MtestRegion:
"""
``MTESt:SEGMent:REGion`` \n
Snippet: ``value: enums.MtestRegion = driver.mtest.segment.region.get(mask_test = 'abc', mask_segment = 1)`` \n
Defines the region of the segment that builds the mask.
:param mask_test: String with the name of the mask test
:param mask_segment: Number of the segment. Counting starts from 0.
:return: region: UPPer | LOWer | INNer \n
- UPPer: the segment points are connected to a line, the display area above this line is the mask segment
- LOWer: the segment points are connected to a line, the display area below this line is the mask segment
- INNer: the segment points form a closed geometrical shape, which is the mask segment
"""
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:REGion? {param}'.rstrip())
return Conversions.str_to_scalar_enum(response, enums.MtestRegion)