from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class OffsetCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("offset", core, parent)
[docs]
def set(self, vertical_offset: float, measIndex=repcap.MeasIndex.Default) -> None:
"""
``MEASurement<*>:TRACk:OFFSet`` \n
Snippet: ``driver.measurement.track.offset.set(vertical_offset = 1.0, measIndex = repcap.MeasIndex.Default)`` \n
Sets or queries the offset of the track waveform. If method ``RsMxo.measurement.track.contiunous.set()`` is ON, use the
command to query the current value. If method ``RsMxo.measurement.track.contiunous.set()`` is OFF, the command sets the
offset.
:param vertical_offset: -1E+26 to 1E+26
:param measIndex: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
"""
param = Conversions.decimal_value_to_str(vertical_offset)
measIndex_cmd_val = self._cmd_group.get_repcap_cmd_value(measIndex, repcap.MeasIndex)
self._core.io.write(f'MEASurement{measIndex_cmd_val}:TRACk:OFFSet {param}')
[docs]
def get(self, measIndex=repcap.MeasIndex.Default) -> float:
"""
``MEASurement<*>:TRACk:OFFSet`` \n
Snippet: ``value: float = driver.measurement.track.offset.get(measIndex = repcap.MeasIndex.Default)`` \n
Sets or queries the offset of the track waveform. If method ``RsMxo.measurement.track.contiunous.set()`` is ON, use the
command to query the current value. If method ``RsMxo.measurement.track.contiunous.set()`` is OFF, the command sets the
offset.
:param measIndex: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:return: vertical_offset: -1E+26 to 1E+26
"""
measIndex_cmd_val = self._cmd_group.get_repcap_cmd_value(measIndex, repcap.MeasIndex)
response = self._core.io.query_str(f'MEASurement{measIndex_cmd_val}:TRACk:OFFSet?')
return Conversions.str_to_float(response)