from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal.Types import DataType
from ......Internal.StructBase import StructBase
from ......Internal.ArgStruct import ArgStruct
from ......Internal.ArgSingleList import ArgSingleList
from ......Internal.ArgSingle import ArgSingle
from ...... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class MarginCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("margin", core, parent)
[docs]
def set(self, upper_margin: float=None, base_level: float=None, target_level: float=None, measurement=repcap.Measurement.Default, limitCheck=repcap.LimitCheck.Default) -> None:
"""
``MEASurement<*>:AMPTime:LCHeck<*>:UPPer:MARGin`` \n
Snippet: ``driver.measurement.ampTime.lcheck.upper.margin.set(upper_margin = 1.0, base_level = 1.0, target_level = 1.0, measurement = repcap.Measurement.Default, limitCheck = repcap.LimitCheck.Default)`` \n
Define the lower and upper margins for the limit check, respectively. Margins are not as strict as limits and must be
within the valid value range. The valid range is defined using the method
``RsRtx.measurement.ampTime.lcheck.valid.set()`` command.
:param base_level: Sets the base level for signals with PAM order 2
:param target_level: Sets the target level for signals with PAM order 2
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:param limitCheck: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Lcheck')
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('upper_margin', upper_margin, DataType.Float, None, is_optional=True), ArgSingle('base_level', base_level, DataType.Float, None, is_optional=True), ArgSingle('target_level', target_level, DataType.Float, None, is_optional=True))
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
limitCheck_cmd_val = self._cmd_group.get_repcap_cmd_value(limitCheck, repcap.LimitCheck)
self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:AMPTime:LCHeck{limitCheck_cmd_val}:UPPer:MARGin {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
class GetStruct(StructBase):
"""
Response structure. Fields: \n
- 1 Base_Level: float: Sets the base level for signals with PAM order 2
- 2 Target_Level: float: Sets the target level for signals with PAM order 2
"""
__meta_args_list = [
ArgStruct.scalar_float('Base_Level'),
ArgStruct.scalar_float('Target_Level')]
def __init__(self):
StructBase.__init__(self, self)
self.Base_Level: float = None
self.Target_Level: float = None
[docs]
def get(self, measurement=repcap.Measurement.Default, limitCheck=repcap.LimitCheck.Default) -> GetStruct:
"""
``MEASurement<*>:AMPTime:LCHeck<*>:UPPer:MARGin`` \n
Snippet: ``value: GetStruct = driver.measurement.ampTime.lcheck.upper.margin.get(measurement = repcap.Measurement.Default, limitCheck = repcap.LimitCheck.Default)`` \n
Define the lower and upper margins for the limit check, respectively. Margins are not as strict as limits and must be
within the valid value range. The valid range is defined using the method
``RsRtx.measurement.ampTime.lcheck.valid.set()`` command.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:param limitCheck: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Lcheck')
:return: structure: for return value, see the help for GetStruct structure arguments.
"""
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
limitCheck_cmd_val = self._cmd_group.get_repcap_cmd_value(limitCheck, repcap.LimitCheck)
return self._core.io.query_struct_with_opc(f'MEASurement{measurement_cmd_val}:AMPTime:LCHeck{limitCheck_cmd_val}:UPPer:MARGin?', self.__class__.GetStruct())