from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AnalogCls:
"""
| Commands in total: 62
| Subgroups: 6
| Direct child commands: 4
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("analog", core, parent)
@property
def bias(self):
"""
| Commands in total: 3
| Subgroups: 1
| Direct child commands: 2
"""
if not hasattr(self, '_bias'):
from .Bias import BiasCls
self._bias = BiasCls(self._core, self._cmd_group)
return self._bias
@property
def envelope(self):
"""
| Commands in total: 47
| Subgroups: 7
| Direct child commands: 12
"""
if not hasattr(self, '_envelope'):
from .Envelope import EnvelopeCls
self._envelope = EnvelopeCls(self._core, self._cmd_group)
return self._envelope
@property
def offset(self):
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
if not hasattr(self, '_offset'):
from .Offset import OffsetCls
self._offset = OffsetCls(self._core, self._cmd_group)
return self._offset
@property
def power(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_power'):
from .Power import PowerCls
self._power = PowerCls(self._core, self._cmd_group)
return self._power
@property
def ppsMarker(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_ppsMarker'):
from .PpsMarker import PpsMarkerCls
self._ppsMarker = PpsMarkerCls(self._core, self._cmd_group)
return self._ppsMarker
@property
def setting(self):
"""
| Commands in total: 4
| Subgroups: 0
| Direct child commands: 4
"""
if not hasattr(self, '_setting'):
from .Setting import SettingCls
self._setting = SettingCls(self._core, self._cmd_group)
return self._setting
[docs]
def get_state(self) -> bool:
"""
``[SOURce<HW>]:IQ:OUTPut:ANALog:STATe`` \n
Snippet: ``value: bool = driver.source.iq.output.analog.get_state()`` \n
Activates the specified analog I/Q output. Note: Interdependencies
The following functions cannot be activated simultaneously. They deactivate each other. \n
- The internal baseband generator ([:SOURce<hw>]:BB:<DigStd>:STATe) and the external digital baseband input (method ``RsSmbv.source.bbin.state()`` )
- The external digital baseband input (method ``RsSmbv.source.bbin.state()`` ) and digital output (method ``RsSmbv.source.iq.output.digital.state()`` ) because they share the same physical connectors (Dig I/Q and the HS Dig I/Q) .
- The digital output (method ``RsSmbv.source.iq.output.digital.state()`` ) and the output of analog I/Q signals:
\n
- If [:SOURce<hw>]:IQ:SOURce BASeband, method ``RsSmbv.source.iq.state()`` + OUTPut<hw>:STATe or
- method ``RsSmbv.source.iq.output.analog.state()``
:return: state: 1 | ON | 0| OFF
"""
response = self._core.io.query_str('SOURce<HwInstance>:IQ:OUTPut:ANALog:STATe?')
return Conversions.str_to_bool(response)
[docs]
def set_state(self, state: bool) -> None:
"""
``[SOURce<HW>]:IQ:OUTPut:ANALog:STATe`` \n
Snippet: ``driver.source.iq.output.analog.set_state(state = False)`` \n
Activates the specified analog I/Q output. Note: Interdependencies
The following functions cannot be activated simultaneously. They deactivate each other. \n
- The internal baseband generator ([:SOURce<hw>]:BB:<DigStd>:STATe) and the external digital baseband input (method ``RsSmbv.source.bbin.state()`` )
- The external digital baseband input (method ``RsSmbv.source.bbin.state()`` ) and digital output (method ``RsSmbv.source.iq.output.digital.state()`` ) because they share the same physical connectors (Dig I/Q and the HS Dig I/Q) .
- The digital output (method ``RsSmbv.source.iq.output.digital.state()`` ) and the output of analog I/Q signals:
\n
- If [:SOURce<hw>]:IQ:SOURce BASeband, method ``RsSmbv.source.iq.state()`` + OUTPut<hw>:STATe or
- method ``RsSmbv.source.iq.output.analog.state()``
:param state: 1 | ON | 0| OFF
"""
param = Conversions.bool_to_str(state)
self._core.io.write(f'SOURce<HwInstance>:IQ:OUTPut:ANALog:STATe {param}')
# noinspection PyTypeChecker
[docs]
def get_mode(self) -> enums.IqOutMode:
"""
``[SOURce<HW>]:IQ:OUTPut:[ANALog]:MODE`` \n
Snippet: ``value: enums.IqOutMode = driver.source.iq.output.analog.get_mode()`` \n
Determines the mode for setting the output parameters.
:return: mode: FIXed | VARiable | VATTenuated FIXed Locks the I/Q output settings VARiable Unlocks the settings VATTenuated Attenuates the signal with the value set with the method ``RsSmbv.source.iq.output.analog.power.att_digital()`` .
"""
response = self._core.io.query_str('SOURce<HwInstance>:IQ:OUTPut:ANALog:MODE?')
return Conversions.str_to_scalar_enum(response, enums.IqOutMode)
[docs]
def set_mode(self, mode: enums.IqOutMode) -> None:
"""
``[SOURce<HW>]:IQ:OUTPut:[ANALog]:MODE`` \n
Snippet: ``driver.source.iq.output.analog.set_mode(mode = enums.IqOutMode.FIXed)`` \n
Determines the mode for setting the output parameters.
:param mode: FIXed | VARiable | VATTenuated FIXed Locks the I/Q output settings VARiable Unlocks the settings VATTenuated Attenuates the signal with the value set with the method ``RsSmbv.source.iq.output.analog.power.att_digital()`` .
"""
param = Conversions.enum_scalar_to_str(mode, enums.IqOutMode)
self._core.io.write(f'SOURce<HwInstance>:IQ:OUTPut:ANALog:MODE {param}')
[docs]
def preset(self) -> None:
"""
``[SOURce<HW>]:IQ:OUTPut:[ANALog]:PRESet`` \n
Snippet: ``driver.source.iq.output.analog.preset()`` \n
Sets the default settings (``*RST`` values specified for the commands) .
Not affected are: \n
- The state set with the method ``RsSmbv.source.iq.output.analog.state()`` .
- If SCONfiguration:EXTernal:PBEHaviour 1, the I/Q ouptput type set with the method ``RsSmbv.source.iq.output.analog.type_py()`` .
"""
self._core.io.write(f'SOURce<HwInstance>:IQ:OUTPut:ANALog:PRESet')
[docs]
def preset_with_opc(self, opc_timeout_ms: int = -1) -> None:
"""
``[SOURce<HW>]:IQ:OUTPut:[ANALog]:PRESet`` \n
Snippet: ``driver.source.iq.output.analog.preset_with_opc()`` \n
Sets the default settings (``*RST`` values specified for the commands) .
Not affected are: \n
- The state set with the method ``RsSmbv.source.iq.output.analog.state()`` .
- If SCONfiguration:EXTernal:PBEHaviour 1, the I/Q ouptput type set with the method ``RsSmbv.source.iq.output.analog.type_py()`` .
Same as preset, but waits for the operation to complete before continuing further. Use the RsSmbv.utilities.opc_timeout_set() to set the timeout value.
:param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call.
"""
self._core.io.write_with_opc(f'SOURce<HwInstance>:IQ:OUTPut:ANALog:PRESet', opc_timeout_ms)
# noinspection PyTypeChecker
[docs]
def get_type_py(self) -> enums.IqOutType:
"""
``[SOURce<HW>]:IQ:OUTPut:[ANALog]:TYPE`` \n
Snippet: ``value: enums.IqOutType = driver.source.iq.output.analog.get_type_py()`` \n
Sets the type of the analog signal.
"""
response = self._core.io.query_str('SOURce<HwInstance>:IQ:OUTPut:ANALog:TYPE?')
return Conversions.str_to_scalar_enum(response, enums.IqOutType)
[docs]
def set_type_py(self, type_py: enums.IqOutType) -> None:
"""
``[SOURce<HW>]:IQ:OUTPut:[ANALog]:TYPE`` \n
Snippet: ``driver.source.iq.output.analog.set_type_py(type_py = enums.IqOutType.DAC)`` \n
Sets the type of the analog signal.
"""
param = Conversions.enum_scalar_to_str(type_py, enums.IqOutType)
self._core.io.write(f'SOURce<HwInstance>:IQ:OUTPut:ANALog:TYPE {param}')
def clone(self) -> 'AnalogCls':
"""
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 = AnalogCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group