from ........Internal.Core import Core
from ........Internal.CommandsGroup import CommandsGroup
from ........Internal import Conversions
from ........ import enums
from ........ import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class FunctionCls:
"""
| Commands in total: 2
| Subgroups: 1
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("function", core, parent)
@property
def auto(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_auto'):
from .Auto import AutoCls
self._auto = AutoCls(self._core, self._cmd_group)
return self._auto
[docs]
def set(self, detector: enums.DetectorK30, window=repcap.Window.Default, trace=repcap.Trace.Default) -> None:
"""
``[SENSe][:WINDow<n>]:DETector<t>[:FUNCtion]`` \n
Snippet: ``driver.applications.k30NoiseFigure.sense.window.detector.function.set(detector = enums.DetectorK30.RMS, window = repcap.Window.Default, trace = repcap.Trace.Default)`` \n
Defines the trace detector to be used for trace analysis. For details see 'Mapping samples to sweep points with the trace
detector'. For EMI measurements, the trace detector is used for the initial peak search only, not for the final test. The
detector for the final test is configured using method ``RsFsw.calculate.marker.function.fmeasurement.detector.set()`` .
If the EMI (R&S FSW-K54) measurement option is installed and the filter type 'CISPR' is selected, additional detectors
are available, even if EMI measurement is not active. For details see 'Detectors and dwell time'.
:param detector: APEak Autopeak NEGative Negative peak POSitive Positive peak QPEak Quasipeak (CISPR filter only) SAMPle First value detected per trace point RMS RMS value AVERage Average CAVerage CISPR Average (CISPR filter only) CRMS CISPR RMS (CISPR filter only) For more information see 'Mapping samples to sweep points with the trace detector'.
:param window: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Window')
:param trace: optional repeated capability selector. Default value: Tr1 (settable in the interface 'Detector')
"""
param = Conversions.enum_scalar_to_str(detector, enums.DetectorK30)
window_cmd_val = self._cmd_group.get_repcap_cmd_value(window, repcap.Window)
trace_cmd_val = self._cmd_group.get_repcap_cmd_value(trace, repcap.Trace)
self._core.io.write(f'SENSe:WINDow{window_cmd_val}:DETector{trace_cmd_val}:FUNCtion {param}')
# noinspection PyTypeChecker
[docs]
def get(self, window=repcap.Window.Default, trace=repcap.Trace.Default) -> enums.DetectorK30:
"""
``[SENSe][:WINDow<n>]:DETector<t>[:FUNCtion]`` \n
Snippet: ``value: enums.DetectorK30 = driver.applications.k30NoiseFigure.sense.window.detector.function.get(window = repcap.Window.Default, trace = repcap.Trace.Default)`` \n
Defines the trace detector to be used for trace analysis. For details see 'Mapping samples to sweep points with the trace
detector'. For EMI measurements, the trace detector is used for the initial peak search only, not for the final test. The
detector for the final test is configured using method ``RsFsw.calculate.marker.function.fmeasurement.detector.set()`` .
If the EMI (R&S FSW-K54) measurement option is installed and the filter type 'CISPR' is selected, additional detectors
are available, even if EMI measurement is not active. For details see 'Detectors and dwell time'.
:param window: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Window')
:param trace: optional repeated capability selector. Default value: Tr1 (settable in the interface 'Detector')
:return: detector: APEak Autopeak NEGative Negative peak POSitive Positive peak QPEak Quasipeak (CISPR filter only) SAMPle First value detected per trace point RMS RMS value AVERage Average CAVerage CISPR Average (CISPR filter only) CRMS CISPR RMS (CISPR filter only) For more information see 'Mapping samples to sweep points with the trace detector'.
"""
window_cmd_val = self._cmd_group.get_repcap_cmd_value(window, repcap.Window)
trace_cmd_val = self._cmd_group.get_repcap_cmd_value(trace, repcap.Trace)
response = self._core.io.query_str(f'SENSe:WINDow{window_cmd_val}:DETector{trace_cmd_val}:FUNCtion?')
return Conversions.str_to_scalar_enum(response, enums.DetectorK30)
def clone(self) -> 'FunctionCls':
"""
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 = FunctionCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group