from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CouplingCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("coupling", core, parent)
[docs]
def set(self, man_thres_cpl: bool, bus=repcap.Bus.Default) -> None:
"""
``BUS<*>:CMSB:MANChester:THReshold:COUPling`` \n
Snippet: ``driver.bus.cmsb.manchester.threshold.coupling.set(man_thres_cpl = False, bus = repcap.Bus.Default)`` \n
Couples the upper and lower threshold values for the Manchester and Manchester II coding standards. The values are
coupled to voltages with the same magnitude but opposite sign (positive for the upper threshold and negative for the
lower threshold) . However, if the upper threshold is set to a negative voltage or the lower threshold is set to a
positive voltage, coupling is disabled, and the other voltage (the one that was not actively set) is automatically
adjusted, to avoid an upper threshold below the lower one, or a lower threshold above the upper one.
:param man_thres_cpl: OFF | ON \n
- ON: Activates coupling of the upper and lower threshold values.
- OFF: Disables coupling of the upper and lower threshold values.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
"""
param = Conversions.bool_to_str(man_thres_cpl)
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
self._core.io.write(f'BUS{bus_cmd_val}:CMSB:MANChester:THReshold:COUPling {param}')
[docs]
def get(self, bus=repcap.Bus.Default) -> bool:
"""
``BUS<*>:CMSB:MANChester:THReshold:COUPling`` \n
Snippet: ``value: bool = driver.bus.cmsb.manchester.threshold.coupling.get(bus = repcap.Bus.Default)`` \n
Couples the upper and lower threshold values for the Manchester and Manchester II coding standards. The values are
coupled to voltages with the same magnitude but opposite sign (positive for the upper threshold and negative for the
lower threshold) . However, if the upper threshold is set to a negative voltage or the lower threshold is set to a
positive voltage, coupling is disabled, and the other voltage (the one that was not actively set) is automatically
adjusted, to avoid an upper threshold below the lower one, or a lower threshold above the upper one.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
:return: man_thres_cpl: OFF | ON \n
- ON: Activates coupling of the upper and lower threshold values.
- OFF: Disables coupling of the upper and lower threshold values.
"""
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:MANChester:THReshold:COUPling?')
return Conversions.str_to_bool(response)