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 PcountCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("pcount", core, parent)
# noinspection PyTypeChecker
[docs]
def get(self, deembedding=repcap.Deembedding.Default, component=repcap.Component.Default) -> enums.DeembeddingInputPort:
"""
``DEEMbedding<*>:COMPonent<*>:PCOunt`` \n
Snippet: ``value: enums.DeembeddingInputPort = driver.deembedding.component.pcount.get(deembedding = repcap.Deembedding.Default, component = repcap.Component.Default)`` \n
Returns the number of all ports of the selected component (input ports and output ports) . The number of ports depends on
the attached probe. If a modular probe R&S RT-ZM or differential probe R&S RT-ZD is used, the number of ports is 4.
Otherwise, 2 ports are available.
:param deembedding: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Deembedding')
:param component: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Component')
:return: total_component_ports: ONE | TWO | THRee | FOUR | FIVE | SIX
"""
deembedding_cmd_val = self._cmd_group.get_repcap_cmd_value(deembedding, repcap.Deembedding)
component_cmd_val = self._cmd_group.get_repcap_cmd_value(component, repcap.Component)
response = self._core.io.query_str_with_opc(f'DEEMbedding{deembedding_cmd_val}:COMPonent{component_cmd_val}:PCOunt?')
return Conversions.str_to_scalar_enum(response, enums.DeembeddingInputPort)