from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Types import DataType
from ...Internal.ArgSingleList import ArgSingleList
from ...Internal.ArgSingle import ArgSingle
from ... import enums
# 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, search: str, source: enums.SignalSource) -> None:
"""
``SEARch:SOURce`` \n
Snippet: ``driver.search.source.set(search = 'abc', source = enums.SignalSource.AJ1)`` \n
Defines the source on which the search conditions are applied. The source can be any analog or digital channel, math or
reference waveform as well as a serial bus configured for a supported protocol.
:param search: String with the name of the search
:param source: Source of the search, see 'Waveform parameter'
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('source', source, DataType.Enum, enums.SignalSource))
self._core.io.write_with_opc(f'SEARch:SOURce {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.SignalSource:
"""
``SEARch:SOURce`` \n
Snippet: ``value: enums.SignalSource = driver.search.source.get(search = 'abc')`` \n
Defines the source on which the search conditions are applied. The source can be any analog or digital channel, math or
reference waveform as well as a serial bus configured for a supported protocol.
:param search: String with the name of the search
:return: source: Source of the search, see 'Waveform parameter'
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str_with_opc(f'SEARch:SOURce? {param}')
return Conversions.str_to_scalar_enum(response, enums.SignalSource)