from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CountCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("count", core, parent)
[docs]
def set(self, count: int, maskTest=repcap.MaskTest.Default) -> None:
"""
``MTESt<*>:COUNt`` \n
Snippet: ``driver.mtest.count.set(count = 1, maskTest = repcap.MaskTest.Default)`` \n
Returns the number of masks. MTESt:COUNt? MAX returns the maximum number of masks that can be created.
:param count: Number of defined masks
:param maskTest: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Mtest')
"""
param = Conversions.decimal_value_to_str(count)
maskTest_cmd_val = self._cmd_group.get_repcap_cmd_value(maskTest, repcap.MaskTest)
self._core.io.write(f'MTESt{maskTest_cmd_val}:COUNt {param}')
[docs]
def get(self, maskTest=repcap.MaskTest.Default) -> int:
"""
``MTESt<*>:COUNt`` \n
Snippet: ``value: int = driver.mtest.count.get(maskTest = repcap.MaskTest.Default)`` \n
Returns the number of masks. MTESt:COUNt? MAX returns the maximum number of masks that can be created.
:param maskTest: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Mtest')
:return: count: Number of defined masks
"""
maskTest_cmd_val = self._cmd_group.get_repcap_cmd_value(maskTest, repcap.MaskTest)
response = self._core.io.query_str(f'MTESt{maskTest_cmd_val}:COUNt?')
return Conversions.str_to_int(response)