from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AttenuationCls:
"""
| Commands in total: 5
| Subgroups: 0
| Direct child commands: 5
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("attenuation", core, parent)
[docs]
def get_auto(self) -> float:
"""
``TRPRobe:SETup:ATTenuation[:AUTO]`` \n
Snippet: ``value: float = driver.trProbe.setup.attenuation.get_auto()`` \n
Queries the attenuation of the probe.
:return: prb_att_md_auto: 1E-3 to 1000
"""
response = self._core.io.query_str_with_opc('TRPRobe:SETup:ATTenuation:AUTO?')
return Conversions.str_to_float(response)
[docs]
def get_manual(self) -> float:
"""
``TRPRobe:SETup:ATTenuation:MANual`` \n
Snippet: ``value: float = driver.trProbe.setup.attenuation.get_manual()`` \n
Sets the attenuation for the connected probe if method ``RsRtx.probe.setup.attenuation.mode.set()`` is set to MANual.
"""
response = self._core.io.query_str_with_opc('TRPRobe:SETup:ATTenuation:MANual?')
return Conversions.str_to_float(response)
[docs]
def set_manual(self, prb_att_md_manual: float) -> None:
"""
``TRPRobe:SETup:ATTenuation:MANual`` \n
Snippet: ``driver.trProbe.setup.attenuation.set_manual(prb_att_md_manual = 1.0)`` \n
Sets the attenuation for the connected probe if method ``RsRtx.probe.setup.attenuation.mode.set()`` is set to MANual.
:param prb_att_md_manual: 100E-6 to 10000
"""
param = Conversions.decimal_value_to_str(prb_att_md_manual)
self._core.io.write_with_opc(f'TRPRobe:SETup:ATTenuation:MANual {param}')
# noinspection PyTypeChecker
[docs]
def get_mode(self) -> enums.AutoManualMode:
"""
``TRPRobe:SETup:ATTenuation:MODE`` \n
Snippet: ``value: enums.AutoManualMode = driver.trProbe.setup.attenuation.get_mode()`` \n
Set the mode to MANual if the instrument does not detect the probe.
"""
response = self._core.io.query_str_with_opc('TRPRobe:SETup:ATTenuation:MODE?')
return Conversions.str_to_scalar_enum(response, enums.AutoManualMode)
[docs]
def set_mode(self, prb_att_md: enums.AutoManualMode) -> None:
"""
``TRPRobe:SETup:ATTenuation:MODE`` \n
Snippet: ``driver.trProbe.setup.attenuation.set_mode(prb_att_md = enums.AutoManualMode.AUTO)`` \n
Set the mode to MANual if the instrument does not detect the probe.
:param prb_att_md: AUTO | MANual
"""
param = Conversions.enum_scalar_to_str(prb_att_md, enums.AutoManualMode)
self._core.io.write_with_opc(f'TRPRobe:SETup:ATTenuation:MODE {param}')
# noinspection PyTypeChecker
[docs]
def get_unit(self) -> enums.ProbeAttUnit:
"""
``TRPRobe:SETup:ATTenuation:UNIT`` \n
Snippet: ``value: enums.ProbeAttUnit = driver.trProbe.setup.attenuation.get_unit()`` \n
Sets the unit for the connected probe type if method ``RsRtx.probe.setup.attenuation.mode.set()`` is set to MANual.
"""
response = self._core.io.query_str_with_opc('TRPRobe:SETup:ATTenuation:UNIT?')
return Conversions.str_to_scalar_enum(response, enums.ProbeAttUnit)
[docs]
def set_unit(self, prb_att_unt: enums.ProbeAttUnit) -> None:
"""
``TRPRobe:SETup:ATTenuation:UNIT`` \n
Snippet: ``driver.trProbe.setup.attenuation.set_unit(prb_att_unt = enums.ProbeAttUnit.A)`` \n
Sets the unit for the connected probe type if method ``RsRtx.probe.setup.attenuation.mode.set()`` is set to MANual.
:param prb_att_unt: Voltage probe (V) , current probe (A) , power probe (W)
"""
param = Conversions.enum_scalar_to_str(prb_att_unt, enums.ProbeAttUnit)
self._core.io.write_with_opc(f'TRPRobe:SETup:ATTenuation:UNIT {param}')
# noinspection PyTypeChecker
[docs]
def get_def_probe(self) -> enums.DefProbeSelect:
"""
``TRPRobe:SETup:ATTenuation:DEFProbe`` \n
Snippet: ``value: enums.DefProbeSelect = driver.trProbe.setup.attenuation.get_def_probe()`` \n
Selects a predefined probe. These are probes that are not recognized automatically but the parameters of the probe are
known to the instrument.
"""
response = self._core.io.query_str_with_opc('TRPRobe:SETup:ATTenuation:DEFProbe?')
return Conversions.str_to_scalar_enum(response, enums.DefProbeSelect)
[docs]
def set_def_probe(self, select_predef_prb: enums.DefProbeSelect) -> None:
"""
``TRPRobe:SETup:ATTenuation:DEFProbe`` \n
Snippet: ``driver.trProbe.setup.attenuation.set_def_probe(select_predef_prb = enums.DefProbeSelect.FREE)`` \n
Selects a predefined probe. These are probes that are not recognized automatically but the parameters of the probe are
known to the instrument.
:param select_predef_prb: ZC10 | ZC20 | ZC30 | ZD01A100 | ZD01A1000 | ZZ80 | FREE | ZS10L | ZD02 | ZD08 | ZC02100 | ZC021000 | ZC03 | ZD002A10 | ZD002A100 | ZD003A20 | ZD003A200 | ZC3110 | ZC311 | ZC3101 | NP1544B | NP1544B50 \n
- ZC10 | ZC20 | ZC30 | ZZ80 | ZS10L | ZD02 | ZD08 | ZC03: Type of the probe
- ZD01A100 | ZD01A1000 | ZD002A10 | ZD002A100 | ZD003A20 | ZD003A200: High voltage differential probes R&S RT-ZD0xx, attenuation ratio according to the setting on the probe.A10 = 10:1A20 = 20:1A100 = 100:1A200 = 200:1A1000 = 1000:1
- ZC02100 | ZC021000: Current probes 100 A or 1000 A according to the setting on the probe.
- FREE: Any other probe that is not recognized by the instrument.
"""
param = Conversions.enum_scalar_to_str(select_predef_prb, enums.DefProbeSelect)
self._core.io.write_with_opc(f'TRPRobe:SETup:ATTenuation:DEFProbe {param}')