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 ToleranceCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("tolerance", core, parent)
[docs]
def set(self, mask_test: str, tol_viol_cnt: int) -> None:
"""
``MTESt:TOLerance`` \n
Snippet: ``driver.mtest.tolerance.set(mask_test = 'abc', tol_viol_cnt = 1)`` \n
Sets the second criteria for a failed test, the number of tolerable sample hits or acquisition hits. Use method
``RsRtx.mtest.condition.set()`` to define which hits are considered for test evaluation.
:param mask_test: String with the name of the mask test
:param tol_viol_cnt: 0 to 4E+9
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('tol_viol_cnt', tol_viol_cnt, DataType.Integer))
self._core.io.write_with_opc(f'MTESt:TOLerance {param}'.rstrip())
[docs]
def get(self, mask_test: str) -> int:
"""
``MTESt:TOLerance`` \n
Snippet: ``value: int = driver.mtest.tolerance.get(mask_test = 'abc')`` \n
Sets the second criteria for a failed test, the number of tolerable sample hits or acquisition hits. Use method
``RsRtx.mtest.condition.set()`` to define which hits are considered for test evaluation.
:param mask_test: String with the name of the mask test
:return: tol_viol_cnt: 0 to 4E+9
"""
param = Conversions.value_to_quoted_str(mask_test)
response = self._core.io.query_str_with_opc(f'MTESt:TOLerance? {param}')
return Conversions.str_to_int(response)