from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class TdrtCls:
"""
| Commands in total: 23
| Subgroups: 4
| Direct child commands: 7
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("tdrt", core, parent)
@property
def default(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_default'):
from .Default import DefaultCls
self._default = DefaultCls(self._core, self._cmd_group)
return self._default
@property
def pulse(self):
"""
| Commands in total: 4
| Subgroups: 0
| Direct child commands: 4
"""
if not hasattr(self, '_pulse'):
from .Pulse import PulseCls
self._pulse = PulseCls(self._core, self._cmd_group)
return self._pulse
@property
def signal(self):
"""
| Commands in total: 6
| Subgroups: 5
| Direct child commands: 0
"""
if not hasattr(self, '_signal'):
from .Signal import SignalCls
self._signal = SignalCls(self._core, self._cmd_group)
return self._signal
@property
def calibration(self):
"""
| Commands in total: 5
| Subgroups: 2
| Direct child commands: 1
"""
if not hasattr(self, '_calibration'):
from .Calibration import CalibrationCls
self._calibration = CalibrationCls(self._core, self._cmd_group)
return self._calibration
[docs]
def get_state(self) -> bool:
"""
``TDRT:STATe`` \n
Snippet: ``value: bool = driver.tdrt.get_state()`` \n
Activates or deactivates the TDR/TDT measurements.
:return: state: OFF | ON
"""
response = self._core.io.query_str_with_opc('TDRT:STATe?')
return Conversions.str_to_bool(response)
[docs]
def set_state(self, state: bool) -> None:
"""
``TDRT:STATe`` \n
Snippet: ``driver.tdrt.set_state(state = False)`` \n
Activates or deactivates the TDR/TDT measurements.
:param state: OFF | ON
"""
param = Conversions.bool_to_str(state)
self._core.io.write_with_opc(f'TDRT:STATe {param}')
# noinspection PyTypeChecker
[docs]
def get_type_py(self) -> enums.TdrtType:
"""
``TDRT:TYPE`` \n
Snippet: ``value: enums.TdrtType = driver.tdrt.get_type_py()`` \n
Selects the analysis type: TDR (time domain reflectometry) , TDT (time domain transmission) , or TDR/TDT (both TDR and
TDT) .
:return: type_py: TDR | TDRTdt | TDT
"""
response = self._core.io.query_str_with_opc('TDRT:TYPE?')
return Conversions.str_to_scalar_enum(response, enums.TdrtType)
[docs]
def set_type_py(self, type_py: enums.TdrtType) -> None:
"""
``TDRT:TYPE`` \n
Snippet: ``driver.tdrt.set_type_py(type_py = enums.TdrtType.TDR)`` \n
Selects the analysis type: TDR (time domain reflectometry) , TDT (time domain transmission) , or TDR/TDT (both TDR and
TDT) .
:param type_py: TDR | TDRTdt | TDT
"""
param = Conversions.enum_scalar_to_str(type_py, enums.TdrtType)
self._core.io.write_with_opc(f'TDRT:TYPE {param}')
[docs]
def get_bw(self) -> float:
"""
``TDRT:BW`` \n
Snippet: ``value: float = driver.tdrt.get_bw()`` \n
Sets the bandwidth of the DUT.
:return: bandwidth: 2E+9 to 16E+9
"""
response = self._core.io.query_str_with_opc('TDRT:BW?')
return Conversions.str_to_float(response)
[docs]
def set_bw(self, bandwidth: float) -> None:
"""
``TDRT:BW`` \n
Snippet: ``driver.tdrt.set_bw(bandwidth = 1.0)`` \n
Sets the bandwidth of the DUT.
:param bandwidth: 2E+9 to 16E+9
"""
param = Conversions.decimal_value_to_str(bandwidth)
self._core.io.write_with_opc(f'TDRT:BW {param}')
# noinspection PyTypeChecker
[docs]
def get_domain(self) -> enums.RdrtOutputDomain:
"""
``TDRT:DOMain`` \n
Snippet: ``value: enums.RdrtOutputDomain = driver.tdrt.get_domain()`` \n
Sets the domain of the x-axis: time or distance (in m or inch) . If you select distance, enter also the permittivity with
method ``RsRtx.tdrt.permittivity()`` .
:return: output_domain: MDIStance = distance in m IDIStance = distance in inch
"""
response = self._core.io.query_str_with_opc('TDRT:DOMain?')
return Conversions.str_to_scalar_enum(response, enums.RdrtOutputDomain)
[docs]
def set_domain(self, output_domain: enums.RdrtOutputDomain) -> None:
"""
``TDRT:DOMain`` \n
Snippet: ``driver.tdrt.set_domain(output_domain = enums.RdrtOutputDomain.INDistance)`` \n
Sets the domain of the x-axis: time or distance (in m or inch) . If you select distance, enter also the permittivity with
method ``RsRtx.tdrt.permittivity()`` .
:param output_domain: MDIStance = distance in m IDIStance = distance in inch
"""
param = Conversions.enum_scalar_to_str(output_domain, enums.RdrtOutputDomain)
self._core.io.write_with_opc(f'TDRT:DOMain {param}')
[docs]
def get_slength(self) -> float:
"""
``TDRT:SLENgth`` \n
Snippet: ``value: float = driver.tdrt.get_slength()`` \n
Sets the electrical length of a user-defined short. The reset value is the electrical length of the short hat is
delivered with the pulse source R&S RTO6-B7.
:return: short_length: 0 to 2E-9
"""
response = self._core.io.query_str_with_opc('TDRT:SLENgth?')
return Conversions.str_to_float(response)
[docs]
def set_slength(self, short_length: float) -> None:
"""
``TDRT:SLENgth`` \n
Snippet: ``driver.tdrt.set_slength(short_length = 1.0)`` \n
Sets the electrical length of a user-defined short. The reset value is the electrical length of the short hat is
delivered with the pulse source R&S RTO6-B7.
:param short_length: 0 to 2E-9
"""
param = Conversions.decimal_value_to_str(short_length)
self._core.io.write_with_opc(f'TDRT:SLENgth {param}')
[docs]
def get_permittivity(self) -> float:
"""
``TDRT:PERMittivity`` \n
Snippet: ``value: float = driver.tdrt.get_permittivity()`` \n
Sets the permittivity ε_r of the used DUT.
:return: permittivity: 1 to 100
"""
response = self._core.io.query_str_with_opc('TDRT:PERMittivity?')
return Conversions.str_to_float(response)
[docs]
def set_permittivity(self, permittivity: float) -> None:
"""
``TDRT:PERMittivity`` \n
Snippet: ``driver.tdrt.set_permittivity(permittivity = 1.0)`` \n
Sets the permittivity ε_r of the used DUT.
:param permittivity: 1 to 100
"""
param = Conversions.decimal_value_to_str(permittivity)
self._core.io.write_with_opc(f'TDRT:PERMittivity {param}')
# noinspection PyTypeChecker
[docs]
def get_config(self) -> enums.DisplayDiff:
"""
``TDRT:CONFig`` \n
Snippet: ``value: enums.DisplayDiff = driver.tdrt.get_config()`` \n
Selects the connection: single-ended or differential.
:return: configuration: SINGleended | DIFFerential
"""
response = self._core.io.query_str_with_opc('TDRT:CONFig?')
return Conversions.str_to_scalar_enum(response, enums.DisplayDiff)
[docs]
def set_config(self, configuration: enums.DisplayDiff) -> None:
"""
``TDRT:CONFig`` \n
Snippet: ``driver.tdrt.set_config(configuration = enums.DisplayDiff.DIFFerential)`` \n
Selects the connection: single-ended or differential.
:param configuration: SINGleended | DIFFerential
"""
param = Conversions.enum_scalar_to_str(configuration, enums.DisplayDiff)
self._core.io.write_with_opc(f'TDRT:CONFig {param}')
def clone(self) -> 'TdrtCls':
"""
Clones the group by creating new object from it and its whole existing subgroups.
Also copies all the existing default Repeated Capabilities setting,
which you can change independently without affecting the original group.
"""
new_group = TdrtCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group