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 StateCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("state", core, parent)
[docs]
def set(self, mask_test: str, mask_segment: int, state: bool) -> None:
"""
``MTESt:SEGMent:STATe`` \n
Snippet: ``driver.mtest.segment.state.set(mask_test = 'abc', mask_segment = 1, state = False)`` \n
Enables and disables the mask segment. Disabled segments are not considered by running tests.
:param mask_test: String with the name of the mask test
:param mask_segment: Number of the segment. Counting starts from 0.
:param state: OFF | ON
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('mask_segment', mask_segment, DataType.Integer), ArgSingle('state', state, DataType.Boolean))
self._core.io.write_with_opc(f'MTESt:SEGMent:STATe {param}'.rstrip())
[docs]
def get(self, mask_test: str, mask_segment: int) -> bool:
"""
``MTESt:SEGMent:STATe`` \n
Snippet: ``value: bool = driver.mtest.segment.state.get(mask_test = 'abc', mask_segment = 1)`` \n
Enables and disables the mask segment. Disabled segments are not considered by running tests.
:param mask_test: String with the name of the mask test
:param mask_segment: Number of the segment. Counting starts from 0.
:return: state: OFF | ON
"""
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:STATe? {param}'.rstrip())
return Conversions.str_to_bool(response)