Source code for rsrtx.Implementations.Mtest.Source

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, mask_test: str, source: enums.SignalSource) -> None: """ ``MTESt:SOURce`` \n Snippet: ``driver.mtest.source.set(mask_test = 'abc', source = enums.SignalSource.AJ1)`` \n Selects the waveform to be tested against the mask. :param mask_test: String containing the name of the mask test :param source: Waveform to be tested, see 'Waveform parameter' """ param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('source', source, DataType.Enum, enums.SignalSource)) self._core.io.write_with_opc(f'MTESt:SOURce {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, mask_test: str) -> enums.SignalSource: """ ``MTESt:SOURce`` \n Snippet: ``value: enums.SignalSource = driver.mtest.source.get(mask_test = 'abc')`` \n Selects the waveform to be tested against the mask. :param mask_test: String containing the name of the mask test :return: source: Waveform to be tested, see 'Waveform parameter' """ param = Conversions.value_to_quoted_str(mask_test) response = self._core.io.query_str_with_opc(f'MTESt:SOURce? {param}') return Conversions.str_to_scalar_enum(response, enums.SignalSource)