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, lo_input_mode: enums.SourceInt, channel=repcap.Channel.Default) -> None:
"""
``CHANnel<*>:EFRontend:FREQuency:LOSCillator:MODE`` \n
Snippet: ``driver.channel.efrontend.frequency.loscillator.mode.set(lo_input_mode = enums.SourceInt.EXTernal, channel = repcap.Channel.Default)`` \n
For measurement setups Coupled LO and Coupled Ref, the command queries the input mode of the local oscillator. The mode
is defined by the selected setup definition. In Advanced measurement setup, set the LO input mode according to the
connection of the local oscillator in your setup. See also: method ``RsRtx.efrontend.setup()`` .
:param lo_input_mode: INTernal | EXTernal \n
- INTernal: The LO input of the selected frontend is NOT connected to the LO output of another frontend. The reference frequency is received via Ref In from the oscilloscope.
- EXTernal: The LO input of the selected frontend is connected to the LO output of another frontend.
:param channel: optional repeated capability selector. Default value: Ch1 (settable in the interface 'Channel')
"""
param = Conversions.enum_scalar_to_str(lo_input_mode, enums.SourceInt)
channel_cmd_val = self._cmd_group.get_repcap_cmd_value(channel, repcap.Channel)
self._core.io.write_with_opc(f'CHANnel{channel_cmd_val}:EFRontend:FREQuency:LOSCillator:MODE {param}')
# noinspection PyTypeChecker
[docs]
def get(self, channel=repcap.Channel.Default) -> enums.SourceInt:
"""
``CHANnel<*>:EFRontend:FREQuency:LOSCillator:MODE`` \n
Snippet: ``value: enums.SourceInt = driver.channel.efrontend.frequency.loscillator.mode.get(channel = repcap.Channel.Default)`` \n
For measurement setups Coupled LO and Coupled Ref, the command queries the input mode of the local oscillator. The mode
is defined by the selected setup definition. In Advanced measurement setup, set the LO input mode according to the
connection of the local oscillator in your setup. See also: method ``RsRtx.efrontend.setup()`` .
:param channel: optional repeated capability selector. Default value: Ch1 (settable in the interface 'Channel')
"""
channel_cmd_val = self._cmd_group.get_repcap_cmd_value(channel, repcap.Channel)
response = self._core.io.query_str_with_opc(f'CHANnel{channel_cmd_val}:EFRontend:FREQuency:LOSCillator:MODE?')
return Conversions.str_to_scalar_enum(response, enums.SourceInt)