Source code for rsrtx.Implementations.Mtest.Condition

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 ConditionCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("condition", core, parent)

[docs] def set(self, mask_test: str, pass_fail_mode: enums.MtestPassFailMode) -> None: """ ``MTESt:CONDition`` \n Snippet: ``driver.mtest.condition.set(mask_test = 'abc', pass_fail_mode = enums.MtestPassFailMode.ACQuisitions)`` \n Sets the first criteria for a failed test, the kind of hits to be considered for test evaluation. A test has failed if the number of sample hits or acquisition hits exceeds the limit defined by method ``RsRtx.mtest.tolerance.set()`` . :param mask_test: String with the name of the mask test :param pass_fail_mode: SAMPles | ACQuisitions \n - SAMPles: Considers the number of samples that hit the mask. - ACQuisitions: Considers the number of acquisitions that contain at least one sample hit. How many samples hit the mask in that acquisition is not relevant. """ param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('pass_fail_mode', pass_fail_mode, DataType.Enum, enums.MtestPassFailMode)) self._core.io.write_with_opc(f'MTESt:CONDition {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, mask_test: str) -> enums.MtestPassFailMode: """ ``MTESt:CONDition`` \n Snippet: ``value: enums.MtestPassFailMode = driver.mtest.condition.get(mask_test = 'abc')`` \n Sets the first criteria for a failed test, the kind of hits to be considered for test evaluation. A test has failed if the number of sample hits or acquisition hits exceeds the limit defined by method ``RsRtx.mtest.tolerance.set()`` . :param mask_test: String with the name of the mask test :return: pass_fail_mode: SAMPles | ACQuisitions \n - SAMPles: Considers the number of samples that hit the mask. - ACQuisitions: Considers the number of acquisitions that contain at least one sample hit. How many samples hit the mask in that acquisition is not relevant. """ param = Conversions.value_to_quoted_str(mask_test) response = self._core.io.query_str_with_opc(f'MTESt:CONDition? {param}') return Conversions.str_to_scalar_enum(response, enums.MtestPassFailMode)