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:GATE:MODE`` \n
Snippet: ``driver.search.gate.mode.set(search = 'abc', mode = enums.PositionMode.ABS)`` \n
Defines whether the gate settings are configured using absolute or relative 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:GATE:MODE {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.PositionMode:
"""
``SEARch:GATE:MODE`` \n
Snippet: ``value: enums.PositionMode = driver.search.gate.mode.get(search = 'abc')`` \n
Defines whether the gate settings are configured using absolute or relative 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:GATE:MODE? {param}')
return Conversions.str_to_scalar_enum(response, enums.PositionMode)