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, histogram: str, source: enums.SignalSource) -> None:
"""
``LAYout:HISTogram:SOURce`` \n
Snippet: ``driver.layout.histogram.source.set(histogram = 'abc', source = enums.SignalSource.AJ1)`` \n
Defines the waveform which is the source of the histogram.
:param histogram: String parameter
:param source: Waveform source of the histogram, see 'Waveform parameter'. If the histogram source is a measurement, the histogram shows the density distribution of the results for the selected measurement (MEASm:MAIN) .
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('histogram', histogram, DataType.String), ArgSingle('source', source, DataType.Enum, enums.SignalSource))
self._core.io.write_with_opc(f'LAYout:HISTogram:SOURce {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, histogram: str) -> enums.SignalSource:
"""
``LAYout:HISTogram:SOURce`` \n
Snippet: ``value: enums.SignalSource = driver.layout.histogram.source.get(histogram = 'abc')`` \n
Defines the waveform which is the source of the histogram.
:param histogram: String parameter
:return: source: Waveform source of the histogram, see 'Waveform parameter'. If the histogram source is a measurement, the histogram shows the density distribution of the results for the selected measurement (MEASm:MAIN) .
"""
param = Conversions.value_to_quoted_str(histogram)
response = self._core.io.query_str_with_opc(f'LAYout:HISTogram:SOURce? {param}')
return Conversions.str_to_scalar_enum(response, enums.SignalSource)