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, key: str, signal_source: enums.SignalSource, mode: enums.PositionMode) -> None:
"""
``SEARch:TRIGger:LEVel:NOISe:MODE`` \n
Snippet: ``driver.search.trigger.level.noise.mode.set(key = 'abc', signal_source = enums.SignalSource.AJ1, mode = enums.PositionMode.ABS)`` \n
Defines whether absolute values or relative values to the vertical scaling are used as a hysteresis for noise rejection.
:param key: String with the name of the search
:param signal_source: Source of the trigger waveform, see 'Waveform parameter'
:param mode: ABS | REL
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('key', key, DataType.String), ArgSingle('signal_source', signal_source, DataType.Enum, enums.SignalSource), ArgSingle('mode', mode, DataType.Enum, enums.PositionMode))
self._core.io.write_with_opc(f'SEARch:TRIGger:LEVel:NOISe:MODE {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, key: str, signal_source: enums.SignalSource) -> enums.PositionMode:
"""
``SEARch:TRIGger:LEVel:NOISe:MODE`` \n
Snippet: ``value: enums.PositionMode = driver.search.trigger.level.noise.mode.get(key = 'abc', signal_source = enums.SignalSource.AJ1)`` \n
Defines whether absolute values or relative values to the vertical scaling are used as a hysteresis for noise rejection.
:param key: String with the name of the search
:param signal_source: Source of the trigger waveform, see 'Waveform parameter'
:return: mode: ABS | REL
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('key', key, DataType.String), ArgSingle('signal_source', signal_source, DataType.Enum, enums.SignalSource))
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:LEVel:NOISe:MODE? {param}'.rstrip())
return Conversions.str_to_scalar_enum(response, enums.PositionMode)