Source code for rsrtx.Implementations.FormatPy.Data

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Types import DataType
from ...Internal.ArgSingleList import ArgSingleList
from ...Internal.ArgSingle import ArgSingle
from ... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DataCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("data", core, parent)

[docs] def set(self, format_py: enums.DataFormat=None, length: int=None) -> None: """ ``FORMat[:DATA]`` \n Snippet: ``driver.formatPy.data.set(format_py = enums.DataFormat.ASCii, length = 1)`` \n Selects the data type that is used for transmission of data from analog channels, math and reference waveforms, and some measurement results from the instrument to the controlling computer. The command sets the data format for the following query commands: \n - method ``RsRtx.channel.waveform.data.values.get()`` - method ``RsRtx.calculate.math.data.values.get()`` - method ``RsRtx.refCurve.data.values.get()`` - method ``RsRtx.export.histogram.data()`` - method ``RsRtx.export.measurement.data()`` - method ``RsRtx.measurement.track.data.values.get()`` """ param = ArgSingleList().compose_cmd_string(ArgSingle('format_py', format_py, DataType.Enum, enums.DataFormat, is_optional=True), ArgSingle('length', length, DataType.Integer, None, is_optional=True)) self._core.io.write(f'FORMat:DATA {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self) -> enums.DataFormat: """ ``FORMat[:DATA]`` \n Snippet: ``value: enums.DataFormat = driver.formatPy.data.get()`` \n Selects the data type that is used for transmission of data from analog channels, math and reference waveforms, and some measurement results from the instrument to the controlling computer. The command sets the data format for the following query commands: \n - method ``RsRtx.channel.waveform.data.values.get()`` - method ``RsRtx.calculate.math.data.values.get()`` - method ``RsRtx.refCurve.data.values.get()`` - method ``RsRtx.export.histogram.data()`` - method ``RsRtx.export.measurement.data()`` - method ``RsRtx.measurement.track.data.values.get()`` """ response = self._core.io.query_str(f'FORMat:DATA?') return Conversions.str_to_scalar_enum(response, enums.DataFormat)