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, value: int, refLevel=repcap.RefLevel.Default) -> None:
"""
``REFLevel<*>:AUTO:COUNt`` \n
Snippet: ``driver.refLevel.auto.count.set(value = 1, refLevel = repcap.RefLevel.Default)`` \n
Defines the number of histograms from which the average is calculated.
Prerequisites: \n
- method ``RsRtx.refLevel.auto.state.set()`` is set to ON
- method ``RsRtx.refLevel.ldetection.set()`` is set to AUTO
:param refLevel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'RefLevel')
"""
param = Conversions.decimal_value_to_str(value)
refLevel_cmd_val = self._cmd_group.get_repcap_cmd_value(refLevel, repcap.RefLevel)
self._core.io.write_with_opc(f'REFLevel{refLevel_cmd_val}:AUTO:COUNt {param}')
[docs]
def get(self, refLevel=repcap.RefLevel.Default) -> int:
"""
``REFLevel<*>:AUTO:COUNt`` \n
Snippet: ``value: int = driver.refLevel.auto.count.get(refLevel = repcap.RefLevel.Default)`` \n
Defines the number of histograms from which the average is calculated.
Prerequisites: \n
- method ``RsRtx.refLevel.auto.state.set()`` is set to ON
- method ``RsRtx.refLevel.ldetection.set()`` is set to AUTO
:param refLevel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'RefLevel')
"""
refLevel_cmd_val = self._cmd_group.get_repcap_cmd_value(refLevel, repcap.RefLevel)
response = self._core.io.query_str_with_opc(f'REFLevel{refLevel_cmd_val}:AUTO:COUNt?')
return Conversions.str_to_int(response)