Source code for rsrtx.Implementations.Mtest.Segment.Count

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CountCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def get(self, mask_test_name: str, msk_segm_idx: int=None) -> int: """ ``MTESt:SEGMent:COUNt`` \n Snippet: ``value: int = driver.mtest.segment.count.get(mask_test_name = 'abc', msk_segm_idx = 1)`` \n Returns the number of segments in the mask definition :param mask_test_name: String with the name of the mask test :return: number: Number of segments """ param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test_name', mask_test_name, DataType.String), ArgSingle('msk_segm_idx', msk_segm_idx, DataType.Integer, None, is_optional=True)) response = self._core.io.query_str(f'MTESt:SEGMent:COUNt? {param}'.rstrip()) return Conversions.str_to_int(response)