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 IconditionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("icondition", core, parent)
[docs]
def set(self, search: str, info_operator: enums.ConditionOperator) -> None:
"""
``SEARch:TRIGger:MILStd:CDST:ICONdition`` \n
Snippet: ``driver.search.trigger.milstd.cdst.icondition.set(search = 'abc', info_operator = enums.ConditionOperator.EQUal)`` \n
Sets the operator for the corresponding search: \n
- CDST:ICON - specific info for the 9th to 19th bit of a command or status word.
- CMD:CCON - specific data word count or mode code pattern in a command word
- CMD:SCON - specific subaddress/mode pattern in a command word
- DATA:DCON - data pattern in a data word
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('info_operator', info_operator, DataType.Enum, enums.ConditionOperator))
self._core.io.write(f'SEARch:TRIGger:MILStd:CDST:ICONdition {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.ConditionOperator:
"""
``SEARch:TRIGger:MILStd:CDST:ICONdition`` \n
Snippet: ``value: enums.ConditionOperator = driver.search.trigger.milstd.cdst.icondition.get(search = 'abc')`` \n
Sets the operator for the corresponding search: \n
- CDST:ICON - specific info for the 9th to 19th bit of a command or status word.
- CMD:CCON - specific data word count or mode code pattern in a command word
- CMD:SCON - specific subaddress/mode pattern in a command word
- DATA:DCON - data pattern in a data word
:param search: EQUal | NEQual | LTHan | LETHan | GTHan | GETHan | INRange | OORange
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:MILStd:CDST:ICONdition? {param}')
return Conversions.str_to_scalar_enum(response, enums.ConditionOperator)