from typing import List
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, signal: List[enums.SignalSource]=None, cursor=repcap.Cursor.Default) -> None:
"""
``CURSor<*>:SOURce`` \n
Snippet: ``driver.cursor.source.set(signal = [SignalSource.C1, SignalSource.XY4], cursor = repcap.Cursor.Default)`` \n
Selects the cursor source or multiple sources, which are the waveforms to be measured. The query returns the waveforms
sorted by category and number.
:param signal: Comma-separated list of waveforms.
:param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor')
"""
param = ''
if signal:
param = Conversions.enum_list_to_str(signal, enums.SignalSource)
cursor_cmd_val = self._cmd_group.get_repcap_cmd_value(cursor, repcap.Cursor)
self._core.io.write(f'CURSor{cursor_cmd_val}:SOURce {param}'.strip())
# noinspection PyTypeChecker
[docs]
def get(self, cursor=repcap.Cursor.Default) -> List[enums.SignalSource]:
"""
``CURSor<*>:SOURce`` \n
Snippet: ``value: List[enums.SignalSource] = driver.cursor.source.get(cursor = repcap.Cursor.Default)`` \n
Selects the cursor source or multiple sources, which are the waveforms to be measured. The query returns the waveforms
sorted by category and number.
:param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor')
:return: signal: Comma-separated list of waveforms.
"""
cursor_cmd_val = self._cmd_group.get_repcap_cmd_value(cursor, repcap.Cursor)
response = self._core.io.query_str(f'CURSor{cursor_cmd_val}:SOURce?')
return Conversions.str_to_list_enum(response, enums.SignalSource)