from .......Internal.Core import Core
from .......Internal.CommandsGroup import CommandsGroup
from .......Internal import Conversions
from ....... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class PositionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("position", core, parent)
[docs]
def set(self, position: int, math=repcap.Math.Default, fftTimeline=repcap.FftTimeline.Default) -> None:
"""
``CALCulate:MATH<*>:FFT:SPECtrogram:TIMeline<*>:POSition`` \n
Snippet: ``driver.calculate.math.fft.spectrogram.timeline.position.set(position = 1, math = repcap.Math.Default, fftTimeline = repcap.FftTimeline.Default)`` \n
Defines the position of one of the two possible time lines in a spectrogram. The time line must be enabled first, using
the method ``RsRtx.calculate.math.fft.spectrogram.timeline.state.set()`` command.
:param position: The position of the time line is defined by the index of the data acquisition in the history. How many acquisitions are available depends on the history settings.
:param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math')
:param fftTimeline: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Timeline')
"""
param = Conversions.decimal_value_to_str(position)
math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math)
fftTimeline_cmd_val = self._cmd_group.get_repcap_cmd_value(fftTimeline, repcap.FftTimeline)
self._core.io.write_with_opc(f'CALCulate:MATH{math_cmd_val}:FFT:SPECtrogram:TIMeline{fftTimeline_cmd_val}:POSition {param}')
[docs]
def get(self, math=repcap.Math.Default, fftTimeline=repcap.FftTimeline.Default) -> int:
"""
``CALCulate:MATH<*>:FFT:SPECtrogram:TIMeline<*>:POSition`` \n
Snippet: ``value: int = driver.calculate.math.fft.spectrogram.timeline.position.get(math = repcap.Math.Default, fftTimeline = repcap.FftTimeline.Default)`` \n
Defines the position of one of the two possible time lines in a spectrogram. The time line must be enabled first, using
the method ``RsRtx.calculate.math.fft.spectrogram.timeline.state.set()`` command.
:param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math')
:param fftTimeline: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Timeline')
:return: position: The position of the time line is defined by the index of the data acquisition in the history. How many acquisitions are available depends on the history settings.
"""
math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math)
fftTimeline_cmd_val = self._cmd_group.get_repcap_cmd_value(fftTimeline, repcap.FftTimeline)
response = self._core.io.query_str_with_opc(f'CALCulate:MATH{math_cmd_val}:FFT:SPECtrogram:TIMeline{fftTimeline_cmd_val}:POSition?')
return Conversions.str_to_int(response)