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 ModeCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("mode", core, parent)
[docs]
def set(self, mode: enums.ProbeSetupMode, probe=repcap.Probe.Default) -> None:
"""
``PROBe<*>:SETup:MODE`` \n
Snippet: ``driver.probe.setup.mode.set(mode = enums.ProbeSetupMode.AUToset, probe = repcap.Probe.Default)`` \n
Select the action that is started when you press the micro button on the probe head.
:param mode: RCONtinuous | RSINgle | AUToset | AZERo | SEToffsettomean | SITFile | NOACtion | FINDtriglevel | REPort | PROBemode | PRSetup \n
- RCONtinuous: Run continuous: The acquisition is running as long as the probe button is pressed.
- RSINgle: Run single: Starts a defined number of acquisitions (same as Single key) .
- AUTOSET: Starts the autoset procedure.
- AZero: AutoZero: performs an automatic correction of the zero error.
- SEToffsettomean: Set offset to mean: performs an automatic compensation for a DC component of the input signal.
- SITFile: Save Image To File:Directs the display image to a file. The MMEMory:NAME command defines the file name. The file format is defined with HCOPy:DEVicem:LANGuage.
- NOACtion: Nothing is started on pressing the micro button.
- FINDtriglevel: Sets the trigger level automatically to 0.5 * (MaxPeak – MinPeak) . The function is not available for an external trigger source.
- REPort: Creates and saves a report of the current results.
- PROBemode: Only available for R&S RT-ZM probes. Changes the measurement mode of the probe.
- PRSetup: Opens the Probes Setup dialog box.
:param probe: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Probe')
"""
param = Conversions.enum_scalar_to_str(mode, enums.ProbeSetupMode)
probe_cmd_val = self._cmd_group.get_repcap_cmd_value(probe, repcap.Probe)
self._core.io.write_with_opc(f'PROBe{probe_cmd_val}:SETup:MODE {param}')
# noinspection PyTypeChecker
[docs]
def get(self, probe=repcap.Probe.Default) -> enums.ProbeSetupMode:
"""
``PROBe<*>:SETup:MODE`` \n
Snippet: ``value: enums.ProbeSetupMode = driver.probe.setup.mode.get(probe = repcap.Probe.Default)`` \n
Select the action that is started when you press the micro button on the probe head.
:param probe: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Probe')
:return: mode: RCONtinuous | RSINgle | AUToset | AZERo | SEToffsettomean | SITFile | NOACtion | FINDtriglevel | REPort | PROBemode | PRSetup \n
- RCONtinuous: Run continuous: The acquisition is running as long as the probe button is pressed.
- RSINgle: Run single: Starts a defined number of acquisitions (same as Single key) .
- AUTOSET: Starts the autoset procedure.
- AZero: AutoZero: performs an automatic correction of the zero error.
- SEToffsettomean: Set offset to mean: performs an automatic compensation for a DC component of the input signal.
- SITFile: Save Image To File:Directs the display image to a file. The MMEMory:NAME command defines the file name. The file format is defined with HCOPy:DEVicem:LANGuage.
- NOACtion: Nothing is started on pressing the micro button.
- FINDtriglevel: Sets the trigger level automatically to 0.5 * (MaxPeak – MinPeak) . The function is not available for an external trigger source.
- REPort: Creates and saves a report of the current results.
- PROBemode: Only available for R&S RT-ZM probes. Changes the measurement mode of the probe.
- PRSetup: Opens the Probes Setup dialog box.
"""
probe_cmd_val = self._cmd_group.get_repcap_cmd_value(probe, repcap.Probe)
response = self._core.io.query_str_with_opc(f'PROBe{probe_cmd_val}:SETup:MODE?')
return Conversions.str_to_scalar_enum(response, enums.ProbeSetupMode)