from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import enums
from ...... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class PresetCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("preset", core, parent)
[docs]
def set(self, nrz_thres_preset: enums.BusPreset, bus=repcap.Bus.Default) -> None:
"""
``BUS<*>:CMSB:NRZ:THReshold:PRESet`` \n
Snippet: ``driver.bus.cmsb.nrz.threshold.preset.set(nrz_thres_preset = enums.BusPreset.MANual, bus = repcap.Bus.Default)`` \n
Sets the NRZ thresholds to predefined or individually definable voltage levels.
:param nrz_thres_preset: V05 | V2 | V5 | V7 | MANual \n
- V05: Sets the clock and data threshold to +0.5 V (in case of NRZ Unclocked: data threshold, only)
- V2: Sets the clock and data threshold to +2.0 V (in case of NRZ Unclocked: data threshold, only)
- V5: Sets the clock and data threshold to +5.0 V (in case of NRZ Unclocked: data threshold, only)
- V7: Sets the clock and data threshold to +7.0 V (in case of NRZ Unclocked: data threshold, only)
- MANual: Allows to set individual threshold voltage levels
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
"""
param = Conversions.enum_scalar_to_str(nrz_thres_preset, enums.BusPreset)
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
self._core.io.write(f'BUS{bus_cmd_val}:CMSB:NRZ:THReshold:PRESet {param}')
# noinspection PyTypeChecker
[docs]
def get(self, bus=repcap.Bus.Default) -> enums.BusPreset:
"""
``BUS<*>:CMSB:NRZ:THReshold:PRESet`` \n
Snippet: ``value: enums.BusPreset = driver.bus.cmsb.nrz.threshold.preset.get(bus = repcap.Bus.Default)`` \n
Sets the NRZ thresholds to predefined or individually definable voltage levels.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
"""
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
response = self._core.io.query_str(f'BUS{bus_cmd_val}:CMSB:NRZ:THReshold:PRESet?')
return Conversions.str_to_scalar_enum(response, enums.BusPreset)