Source code for rsrtx.Implementations.Search.ResDiagram.Horz.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, mode: enums.PositionMode) -> None: """ ``SEARch:RESDiagram:HORZ:MODE`` \n Snippet: ``driver.search.resDiagram.horz.mode.set(search = 'abc', mode = enums.PositionMode.ABS)`` \n Defines whether absolute or relative values are used to specify the x-axis values. :param search: Search definition :param mode: ABS | REL """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('mode', mode, DataType.Enum, enums.PositionMode)) self._core.io.write_with_opc(f'SEARch:RESDiagram:HORZ:MODE {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, search: str) -> enums.PositionMode: """ ``SEARch:RESDiagram:HORZ:MODE`` \n Snippet: ``value: enums.PositionMode = driver.search.resDiagram.horz.mode.get(search = 'abc')`` \n Defines whether absolute or relative values are used to specify the x-axis values. :param search: Search definition :return: mode: ABS | REL """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:RESDiagram:HORZ:MODE? {param}') return Conversions.str_to_scalar_enum(response, enums.PositionMode)