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 SconditionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("scondition", core, parent)
[docs]
def set(self, search: str, subaddress_optor: enums.ConditionOperator) -> None:
"""
``SEARch:TRIGger:MILStd:CMD:SCONdition`` \n
Snippet: ``driver.search.trigger.milstd.cmd.scondition.set(search = 'abc', subaddress_optor = 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('subaddress_optor', subaddress_optor, DataType.Enum, enums.ConditionOperator))
self._core.io.write(f'SEARch:TRIGger:MILStd:CMD:SCONdition {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.ConditionOperator:
"""
``SEARch:TRIGger:MILStd:CMD:SCONdition`` \n
Snippet: ``value: enums.ConditionOperator = driver.search.trigger.milstd.cmd.scondition.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:CMD:SCONdition? {param}')
return Conversions.str_to_scalar_enum(response, enums.ConditionOperator)