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, average_count: int, spectrum=repcap.Spectrum.Default) -> None:
"""
``CALCulate:SPECtrum<*>:WAVeform:AVERage:COUNt`` \n
Snippet: ``driver.calculate.spectrum.waveform.average.count.set(average_count = 1, spectrum = repcap.Spectrum.Default)`` \n
Sets the number of segments used for the averaging of the spectrum.
:param average_count: 2 to 65534
:param spectrum: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Spectrum')
"""
param = Conversions.decimal_value_to_str(average_count)
spectrum_cmd_val = self._cmd_group.get_repcap_cmd_value(spectrum, repcap.Spectrum)
self._core.io.write(f'CALCulate:SPECtrum{spectrum_cmd_val}:WAVeform:AVERage:COUNt {param}')
[docs]
def get(self, spectrum=repcap.Spectrum.Default) -> int:
"""
``CALCulate:SPECtrum<*>:WAVeform:AVERage:COUNt`` \n
Snippet: ``value: int = driver.calculate.spectrum.waveform.average.count.get(spectrum = repcap.Spectrum.Default)`` \n
Sets the number of segments used for the averaging of the spectrum.
:param spectrum: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Spectrum')
:return: average_count: 2 to 65534
"""
spectrum_cmd_val = self._cmd_group.get_repcap_cmd_value(spectrum, repcap.Spectrum)
response = self._core.io.query_str(f'CALCulate:SPECtrum{spectrum_cmd_val}:WAVeform:AVERage:COUNt?')
return Conversions.str_to_int(response)