from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal.RepeatedCapability import RepeatedCapability
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class SpectrumCls:
"""
| Commands in total: 61
| Subgroups: 10
| Direct child commands: 1
Repeated Capability Setting:
.. code-block:: python
# Range: Nr1 .. Nr4 \n
driver.calculate.spectrum.repcap_spectrum_set(repcap.Spectrum.Nr1)
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("spectrum", core, parent)
self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_spectrum_get', 'repcap_spectrum_set', repcap.Spectrum.Nr1)
def repcap_spectrum_set(self, spectrum: repcap.Spectrum) -> None:
"""
Repeated Capability default value numeric suffix.
This value is used, if you do not explicitely set it in the child set/get methods, or if you leave it to Spectrum.Default.
Default value after init: Spectrum.Nr1
"""
self._cmd_group.set_repcap_enum_value(spectrum)
def repcap_spectrum_get(self) -> repcap.Spectrum:
"""
Returns the current default repeated capability for the child set/get methods.
"""
# noinspection PyTypeChecker
return self._cmd_group.get_repcap_enum_value()
@property
def waveform(self):
"""
| Commands in total: 18
| Subgroups: 4
| Direct child commands: 0
"""
if not hasattr(self, '_waveform'):
from .Waveform import WaveformCls
self._waveform = WaveformCls(self._core, self._cmd_group)
return self._waveform
@property
def state(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_state'):
from .State import StateCls
self._state = StateCls(self._core, self._cmd_group)
return self._state
@property
def source(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_source'):
from .Source import SourceCls
self._source = SourceCls(self._core, self._cmd_group)
return self._source
@property
def threshold(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_threshold'):
from .Threshold import ThresholdCls
self._threshold = ThresholdCls(self._core, self._cmd_group)
return self._threshold
@property
def pexcursion(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_pexcursion'):
from .Pexcursion import PexcursionCls
self._pexcursion = PexcursionCls(self._core, self._cmd_group)
return self._pexcursion
@property
def magnitude(self):
"""
| Commands in total: 3
| Subgroups: 3
| Direct child commands: 0
"""
if not hasattr(self, '_magnitude'):
from .Magnitude import MagnitudeCls
self._magnitude = MagnitudeCls(self._core, self._cmd_group)
return self._magnitude
@property
def overlap(self):
"""
| Commands in total: 7
| Subgroups: 4
| Direct child commands: 0
"""
if not hasattr(self, '_overlap'):
from .Overlap import OverlapCls
self._overlap = OverlapCls(self._core, self._cmd_group)
return self._overlap
@property
def frequency(self):
"""
| Commands in total: 10
| Subgroups: 7
| Direct child commands: 0
"""
if not hasattr(self, '_frequency'):
from .Frequency import FrequencyCls
self._frequency = FrequencyCls(self._core, self._cmd_group)
return self._frequency
@property
def plist(self):
"""
| Commands in total: 14
| Subgroups: 9
| Direct child commands: 0
"""
if not hasattr(self, '_plist'):
from .Plist import PlistCls
self._plist = PlistCls(self._core, self._cmd_group)
return self._plist
@property
def gate(self):
"""
| Commands in total: 4
| Subgroups: 4
| Direct child commands: 0
"""
if not hasattr(self, '_gate'):
from .Gate import GateCls
self._gate = GateCls(self._core, self._cmd_group)
return self._gate
[docs]
def preset(self, spectrum=repcap.Spectrum.Default) -> None:
"""
``CALCulate:SPECtrum<*>:PRESet`` \n
Snippet: ``driver.calculate.spectrum.preset(spectrum = repcap.Spectrum.Default)`` \n
Presets the spectrum measurement.
:param spectrum: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Spectrum')
"""
spectrum_cmd_val = self._cmd_group.get_repcap_cmd_value(spectrum, repcap.Spectrum)
self._core.io.write(f'CALCulate:SPECtrum{spectrum_cmd_val}:PRESet')
[docs]
def preset_and_wait(self, spectrum=repcap.Spectrum.Default, opc_timeout_ms: int = -1) -> None:
spectrum_cmd_val = self._cmd_group.get_repcap_cmd_value(spectrum, repcap.Spectrum)
"""
``CALCulate:SPECtrum<*>:PRESet`` \n
Snippet: ``driver.calculate.spectrum.preset_and_wait(spectrum = repcap.Spectrum.Default)`` \n
Presets the spectrum measurement.
Same as preset, but waits for the operation to complete before continuing further. Use the RsMxo.utilities.opc_timeout_set() to set the timeout value.
:param spectrum: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Spectrum')
:param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call.
"""
self._core.io.write_with_opc(f'CALCulate:SPECtrum{spectrum_cmd_val}:PRESet', opc_timeout_ms)
def clone(self) -> 'SpectrumCls':
"""
Clones the group by creating new object from it and its whole existing subgroups.
Also copies all the existing default Repeated Capabilities setting,
which you can change independently without affecting the original group.
"""
new_group = SpectrumCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group