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 SourceCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("source", core, parent)
[docs]
def set(self, source: enums.SourceInt, externalGen=repcap.ExternalGen.Nr1) -> None:
"""
``SOURce:EXTernal<gen>:ROSCillator[:SOURce]`` \n
Snippet: ``driver.source.external.roscillator.source.set(source = enums.SourceInt.EXTernal, externalGen = repcap.ExternalGen.Nr1)`` \n
Controls selection of the reference oscillator for the external generator. Is only valid if External Generator Control
(R&S FSW-B10) is installed. If the external reference oscillator is selected, the reference signal must be connected to
the rear panel of the instrument.
:param source: INTernal Uses the internal reference. EXTernal Uses the external reference; if none is available, an error flag is displayed in the status bar.
:param externalGen: optional repeated capability selector. Default value: Nr1
"""
param = Conversions.enum_scalar_to_str(source, enums.SourceInt)
externalGen_cmd_val = self._cmd_group.get_repcap_cmd_value(externalGen, repcap.ExternalGen)
self._core.io.write(f'SOURce:EXTernal{externalGen_cmd_val}:ROSCillator:SOURce {param}')
# noinspection PyTypeChecker
[docs]
def get(self, externalGen=repcap.ExternalGen.Nr1) -> enums.SourceInt:
"""
``SOURce:EXTernal<gen>:ROSCillator[:SOURce]`` \n
Snippet: ``value: enums.SourceInt = driver.source.external.roscillator.source.get(externalGen = repcap.ExternalGen.Nr1)`` \n
Controls selection of the reference oscillator for the external generator. Is only valid if External Generator Control
(R&S FSW-B10) is installed. If the external reference oscillator is selected, the reference signal must be connected to
the rear panel of the instrument.
:param externalGen: optional repeated capability selector. Default value: Nr1
:return: source: INTernal Uses the internal reference. EXTernal Uses the external reference; if none is available, an error flag is displayed in the status bar.
"""
externalGen_cmd_val = self._cmd_group.get_repcap_cmd_value(externalGen, repcap.ExternalGen)
response = self._core.io.query_str(f'SOURce:EXTernal{externalGen_cmd_val}:ROSCillator:SOURce?')
return Conversions.str_to_scalar_enum(response, enums.SourceInt)