from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Utilities import trim_str_response
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class SpOneCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("spOne", core, parent)
[docs]
def set(self, sparam_file_path_1: str, lane=repcap.Lane.Default, component=repcap.Component.Default) -> None:
"""
``LANE<*>:EMBedding:COMPonent<*>:SPONe`` \n
Snippet: ``driver.lane.embedding.component.spOne.set(sparam_file_path_1 = 'abc', lane = repcap.Lane.Default, component = repcap.Component.Default)`` \n
Set the file name, file format and path of the S-parameter file, and load the S-parameters.
:param sparam_file_path_1: String with path and file name with extension s2p (2-port component) or s4p (4-port component) .
:param lane: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Lane')
:param component: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Component')
"""
param = Conversions.value_to_quoted_str(sparam_file_path_1)
lane_cmd_val = self._cmd_group.get_repcap_cmd_value(lane, repcap.Lane)
component_cmd_val = self._cmd_group.get_repcap_cmd_value(component, repcap.Component)
self._core.io.write_with_opc(f'LANE{lane_cmd_val}:EMBedding:COMPonent{component_cmd_val}:SPONe {param}')
[docs]
def get(self, lane=repcap.Lane.Default, component=repcap.Component.Default) -> str:
"""
``LANE<*>:EMBedding:COMPonent<*>:SPONe`` \n
Snippet: ``value: str = driver.lane.embedding.component.spOne.get(lane = repcap.Lane.Default, component = repcap.Component.Default)`` \n
Set the file name, file format and path of the S-parameter file, and load the S-parameters.
:param lane: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Lane')
:param component: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Component')
"""
lane_cmd_val = self._cmd_group.get_repcap_cmd_value(lane, repcap.Lane)
component_cmd_val = self._cmd_group.get_repcap_cmd_value(component, repcap.Component)
response = self._core.io.query_str_with_opc(f'LANE{lane_cmd_val}:EMBedding:COMPonent{component_cmd_val}:SPONe?')
return trim_str_response(response)