from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class StateCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("state", core, parent)
[docs]
def set(self, state: bool, tdRtSignal=repcap.TdRtSignal.Default) -> None:
"""
``TDRT:SIGNal<*>:STATe`` \n
Snippet: ``driver.tdrt.signal.state.set(state = False, tdRtSignal = repcap.TdRtSignal.Default)`` \n
Enables the indicated TDR/TDT signal.
:param state: OFF | ON
:param tdRtSignal: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Signal')
"""
param = Conversions.bool_to_str(state)
tdRtSignal_cmd_val = self._cmd_group.get_repcap_cmd_value(tdRtSignal, repcap.TdRtSignal)
self._core.io.write_with_opc(f'TDRT:SIGNal{tdRtSignal_cmd_val}:STATe {param}')
[docs]
def get(self, tdRtSignal=repcap.TdRtSignal.Default) -> bool:
"""
``TDRT:SIGNal<*>:STATe`` \n
Snippet: ``value: bool = driver.tdrt.signal.state.get(tdRtSignal = repcap.TdRtSignal.Default)`` \n
Enables the indicated TDR/TDT signal.
:param tdRtSignal: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Signal')
:return: state: OFF | ON
"""
tdRtSignal_cmd_val = self._cmd_group.get_repcap_cmd_value(tdRtSignal, repcap.TdRtSignal)
response = self._core.io.query_str_with_opc(f'TDRT:SIGNal{tdRtSignal_cmd_val}:STATe?')
return Conversions.str_to_bool(response)