from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ......Internal.Types import DataType
from ......Internal.ArgSingleList import ArgSingleList
from ......Internal.ArgSingle import ArgSingle
from ...... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class TchnCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("tchn", core, parent)
[docs]
def set(self, search: str, tlp_tc_number: enums.BusPcieNumber) -> None:
"""
``SEARch:TRIGger:PCIE:TLP:TCHN`` \n
Snippet: ``driver.search.trigger.pcie.tlp.tchn.set(search = 'abc', tlp_tc_number = enums.BusPcieNumber.ANY)`` \n
Sets the traffic class to be searched for in the transaction layer type.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('tlp_tc_number', tlp_tc_number, DataType.Enum, enums.BusPcieNumber))
self._core.io.write(f'SEARch:TRIGger:PCIE:TLP:TCHN {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.BusPcieNumber:
"""
``SEARch:TRIGger:PCIE:TLP:TCHN`` \n
Snippet: ``value: enums.BusPcieNumber = driver.search.trigger.pcie.tlp.tchn.get(search = 'abc')`` \n
Sets the traffic class to be searched for in the transaction layer type.
:param search: ANY | ZERO | ONE | TWO | THREE | FOUR | FIVE | SIX | SEVEN
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:PCIE:TLP:TCHN? {param}')
return Conversions.str_to_scalar_enum(response, enums.BusPcieNumber)