from typing import List
from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class Id2ValueCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("id2Value", core, parent)
[docs]
def set(self, id_2_value: List[float], serialBus=repcap.SerialBus.Default, frame=repcap.Frame.Default) -> None:
"""
``SBUS<*>:RFFE:FORMat:FRAMe<*>:ID2Value`` \n
Snippet: ``driver.sbus.rffe.formatPy.frame.id2Value.set(id_2_value = [1.1, 2.2, 3.3], serialBus = repcap.SerialBus.Default, frame = repcap.Frame.Default)`` \n
Sets the value of the corresponding field type.
:param serialBus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Sbus')
:param frame: optional repeated capability selector. Default value: Ix1 (settable in the interface 'Frame')
"""
param = Conversions.list_to_csv_str(id_2_value)
serialBus_cmd_val = self._cmd_group.get_repcap_cmd_value(serialBus, repcap.SerialBus)
frame_cmd_val = self._cmd_group.get_repcap_cmd_value(frame, repcap.Frame)
self._core.io.write(f'SBUS{serialBus_cmd_val}:RFFE:FORMat:FRAMe{frame_cmd_val}:ID2Value {param}')
[docs]
def get(self, serialBus=repcap.SerialBus.Default, frame=repcap.Frame.Default) -> List[float]:
"""
``SBUS<*>:RFFE:FORMat:FRAMe<*>:ID2Value`` \n
Snippet: ``value: List[float] = driver.sbus.rffe.formatPy.frame.id2Value.get(serialBus = repcap.SerialBus.Default, frame = repcap.Frame.Default)`` \n
Sets the value of the corresponding field type.
:param serialBus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Sbus')
:param frame: optional repeated capability selector. Default value: Ix1 (settable in the interface 'Frame')
"""
serialBus_cmd_val = self._cmd_group.get_repcap_cmd_value(serialBus, repcap.SerialBus)
frame_cmd_val = self._cmd_group.get_repcap_cmd_value(frame, repcap.Frame)
response = self._core.io.query_bin_or_ascii_float_list(f'SBUS{serialBus_cmd_val}:RFFE:FORMat:FRAMe{frame_cmd_val}:ID2Value?')
return response