from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ValueCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("value", core, parent)
[docs]
def set(self, level: float, evnt=repcap.Evnt.Default, lvl=repcap.Lvl.Default) -> None:
"""
``TRIGger:EVENt<*>:LEVel<*>[:VALue]`` \n
Snippet: ``driver.trigger.event.level.value.set(level = 1.0, evnt = repcap.Evnt.Default, lvl = repcap.Lvl.Default)`` \n
Sets the trigger level for the specified event and source (channel) . If the trigger source is serial bus, the trigger
level is set by the thresholds in the protocol configuration.
:param level: -10 to 10
:param evnt: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Event')
:param lvl: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Level')
"""
param = Conversions.decimal_value_to_str(level)
evnt_cmd_val = self._cmd_group.get_repcap_cmd_value(evnt, repcap.Evnt)
lvl_cmd_val = self._cmd_group.get_repcap_cmd_value(lvl, repcap.Lvl)
self._core.io.write(f'TRIGger:EVENt{evnt_cmd_val}:LEVel{lvl_cmd_val}:VALue {param}')
[docs]
def get(self, evnt=repcap.Evnt.Default, lvl=repcap.Lvl.Default) -> float:
"""
``TRIGger:EVENt<*>:LEVel<*>[:VALue]`` \n
Snippet: ``value: float = driver.trigger.event.level.value.get(evnt = repcap.Evnt.Default, lvl = repcap.Lvl.Default)`` \n
Sets the trigger level for the specified event and source (channel) . If the trigger source is serial bus, the trigger
level is set by the thresholds in the protocol configuration.
:param evnt: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Event')
:param lvl: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Level')
:return: level: -10 to 10
"""
evnt_cmd_val = self._cmd_group.get_repcap_cmd_value(evnt, repcap.Evnt)
lvl_cmd_val = self._cmd_group.get_repcap_cmd_value(lvl, repcap.Lvl)
response = self._core.io.query_str(f'TRIGger:EVENt{evnt_cmd_val}:LEVel{lvl_cmd_val}:VALue?')
return Conversions.str_to_float(response)