Source code for rsrtx.Implementations.Search.Result.Sort.Mode

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

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

[docs] def set(self, search: str, sort_mode: enums.SortMode) -> None: """ ``SEARch:RESult:SORT[:MODE]`` \n Snippet: ``driver.search.result.sort.mode.set(search = 'abc', sort_mode = enums.SortMode.POSition)`` \n Sorts the search result table by x-value position or value of the result. :param search: Search definition :param sort_mode: POSition | VALue \n - POSition: Sorts the search result table by the x-value position. - VALue: Sorts the search result table by the value of the result. """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('sort_mode', sort_mode, DataType.Enum, enums.SortMode)) self._core.io.write_with_opc(f'SEARch:RESult:SORT:MODE {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, search: str) -> enums.SortMode: """ ``SEARch:RESult:SORT[:MODE]`` \n Snippet: ``value: enums.SortMode = driver.search.result.sort.mode.get(search = 'abc')`` \n Sorts the search result table by x-value position or value of the result. :param search: Search definition :return: sort_mode: POSition | VALue \n - POSition: Sorts the search result table by the x-value position. - VALue: Sorts the search result table by the value of the result. """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:RESult:SORT:MODE? {param}') return Conversions.str_to_scalar_enum(response, enums.SortMode)