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

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

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

[docs] def set(self, search: str, sort_ascending: bool) -> None: """ ``SEARch:RESult:SORT:ASCending`` \n Snippet: ``driver.search.result.sort.ascending.set(search = 'abc', sort_ascending = False)`` \n If enabled, the results are listed in asscending order, i.e. the smallest value at the top. :param search: Search definition :param sort_ascending: OFF | ON """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('sort_ascending', sort_ascending, DataType.Boolean)) self._core.io.write_with_opc(f'SEARch:RESult:SORT:ASCending {param}'.rstrip())
[docs] def get(self, search: str) -> bool: """ ``SEARch:RESult:SORT:ASCending`` \n Snippet: ``value: bool = driver.search.result.sort.ascending.get(search = 'abc')`` \n If enabled, the results are listed in asscending order, i.e. the smallest value at the top. :param search: Search definition :return: sort_ascending: OFF | ON """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:RESult:SORT:ASCending? {param}') return Conversions.str_to_bool(response)