Source code for rsmxo.Implementations.Export.Waveform

from typing import List

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from ....Internal.Utilities import trim_str_response
from .... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class WaveformCls:
	"""
	| Commands in total: 13
	| Subgroups: 2
	| Direct child commands: 9
	"""

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

	@property
	def autoNaming(self):
		"""
		| Commands in total: 3
		| Subgroups: 0
		| Direct child commands: 3
		"""
		if not hasattr(self, '_autoNaming'):
			from .AutoNaming import AutoNamingCls
			self._autoNaming = AutoNamingCls(self._core, self._cmd_group)
		return self._autoNaming

	@property
	def data(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_data'):
			from .Data import DataCls
			self._data = DataCls(self._core, self._cmd_group)
		return self._data

	# noinspection PyTypeChecker
[docs] def get_scope(self) -> enums.ExportScope: """ ``EXPort:WAVeform:SCOPe`` \n Snippet: ``value: enums.ExportScope = driver.export.waveform.get_scope()`` \n Defines the part of the waveform record that has to be stored. :return: scope: DISPlay | ALL | CURSor | GATE | MANual \n - DISPlay: Waveform data that is displayed in the diagram. - ALL: Complete waveform, which is usually longer than the displayed waveform. - CURSor: Data between the cursor lines if a cursor measurement is defined for the source waveform. - GATE: Data included in the measurement gate if a gated measurement is defined for the source waveform. - MANual: Saves the data between user-defined start and stop values to be set with EXPort:WAVeform:STARt and EXPort:WAVeform:STOP. """ response = self._core.io.query_str('EXPort:WAVeform:SCOPe?') return Conversions.str_to_scalar_enum(response, enums.ExportScope)
[docs] def set_scope(self, scope: enums.ExportScope) -> None: """ ``EXPort:WAVeform:SCOPe`` \n Snippet: ``driver.export.waveform.set_scope(scope = enums.ExportScope.ALL)`` \n Defines the part of the waveform record that has to be stored. :param scope: DISPlay | ALL | CURSor | GATE | MANual \n - DISPlay: Waveform data that is displayed in the diagram. - ALL: Complete waveform, which is usually longer than the displayed waveform. - CURSor: Data between the cursor lines if a cursor measurement is defined for the source waveform. - GATE: Data included in the measurement gate if a gated measurement is defined for the source waveform. - MANual: Saves the data between user-defined start and stop values to be set with EXPort:WAVeform:STARt and EXPort:WAVeform:STOP. """ param = Conversions.enum_scalar_to_str(scope, enums.ExportScope) self._core.io.write(f'EXPort:WAVeform:SCOPe {param}')
# noinspection PyTypeChecker
[docs] def get_cursor_set(self) -> enums.Cursor: """ ``EXPort:WAVeform:CURSorset`` \n Snippet: ``value: enums.Cursor = driver.export.waveform.get_cursor_set()`` \n Sets the cursor set to be used for limited data export if method ``RsMxo.export.waveform.scope()`` is set to CURSor. :return: cursor_set: CURSOR1 | CURSor1 | CURSOR2 | CURSor2 | CURSOR3 | CURSor3 | CURSOR4 | CURSor4 """ response = self._core.io.query_str('EXPort:WAVeform:CURSorset?') return Conversions.str_to_scalar_enum(response, enums.Cursor)
[docs] def set_cursor_set(self, cursor_set: enums.Cursor) -> None: """ ``EXPort:WAVeform:CURSorset`` \n Snippet: ``driver.export.waveform.set_cursor_set(cursor_set = enums.Cursor.CURSOR1)`` \n Sets the cursor set to be used for limited data export if method ``RsMxo.export.waveform.scope()`` is set to CURSor. :param cursor_set: CURSOR1 | CURSor1 | CURSOR2 | CURSor2 | CURSOR3 | CURSor3 | CURSOR4 | CURSor4 """ param = Conversions.enum_scalar_to_str(cursor_set, enums.Cursor) self._core.io.write(f'EXPort:WAVeform:CURSorset {param}')
[docs] def get_gate(self) -> float: """ ``EXPort:WAVeform:GATE`` \n Snippet: ``value: float = driver.export.waveform.get_gate()`` \n Selects the gate to be used for limited data export if method ``RsMxo.export.waveform.scope()`` is set to GATE. """ response = self._core.io.query_str('EXPort:WAVeform:GATE?') return Conversions.str_to_float(response)
[docs] def set_gate(self, meas_gate: float) -> None: """ ``EXPort:WAVeform:GATE`` \n Snippet: ``driver.export.waveform.set_gate(meas_gate = 1.0)`` \n Selects the gate to be used for limited data export if method ``RsMxo.export.waveform.scope()`` is set to GATE. :param meas_gate: Number of the gate to be applied to exported data. """ param = Conversions.decimal_value_to_str(meas_gate) self._core.io.write(f'EXPort:WAVeform:GATE {param}')
[docs] def get_start(self) -> float: """ ``EXPort:WAVeform:STARt`` \n Snippet: ``value: float = driver.export.waveform.get_start()`` \n Sets the start time value of the waveform section for export, if method ``RsMxo.export.waveform.scope()`` is set to Manual. :return: start: -1E+26 to 1E+26 """ response = self._core.io.query_str('EXPort:WAVeform:STARt?') return Conversions.str_to_float(response)
[docs] def set_start(self, start: float) -> None: """ ``EXPort:WAVeform:STARt`` \n Snippet: ``driver.export.waveform.set_start(start = 1.0)`` \n Sets the start time value of the waveform section for export, if method ``RsMxo.export.waveform.scope()`` is set to Manual. :param start: -1E+26 to 1E+26 """ param = Conversions.decimal_value_to_str(start) self._core.io.write(f'EXPort:WAVeform:STARt {param}')
[docs] def get_stop(self) -> float: """ ``EXPort:WAVeform:STOP`` \n Snippet: ``value: float = driver.export.waveform.get_stop()`` \n Sets the end time value of the waveform section for export, if method ``RsMxo.export.waveform.scope()`` is set to Manual. :return: stop: -1E+26 to 1E+26 """ response = self._core.io.query_str('EXPort:WAVeform:STOP?') return Conversions.str_to_float(response)
[docs] def set_stop(self, stop: float) -> None: """ ``EXPort:WAVeform:STOP`` \n Snippet: ``driver.export.waveform.set_stop(stop = 1.0)`` \n Sets the end time value of the waveform section for export, if method ``RsMxo.export.waveform.scope()`` is set to Manual. :param stop: -1E+26 to 1E+26 """ param = Conversions.decimal_value_to_str(stop) self._core.io.write(f'EXPort:WAVeform:STOP {param}')
[docs] def save(self) -> None: """ ``EXPort:WAVeform:SAVE`` \n Snippet: ``driver.export.waveform.save()`` \n Saves the waveform to the file specified with method ``RsMxo.export.waveform.name()`` . """ self._core.io.write(f'EXPort:WAVeform:SAVE')
[docs] def save_and_wait(self, opc_timeout_ms: int = -1) -> None: """ ``EXPort:WAVeform:SAVE`` \n Snippet: ``driver.export.waveform.save_and_wait()`` \n Saves the waveform to the file specified with method ``RsMxo.export.waveform.name()`` . Same as save, but waits for the operation to complete before continuing further. Use the RsMxo.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'EXPort:WAVeform:SAVE', opc_timeout_ms)
[docs] def abort(self) -> None: """ ``EXPort:WAVeform:ABORt`` \n Snippet: ``driver.export.waveform.abort()`` \n Aborts a running waveform export, which was started with method ``RsMxo.export.waveform.save()`` . """ self._core.io.write(f'EXPort:WAVeform:ABORt')
[docs] def abort_and_wait(self, opc_timeout_ms: int = -1) -> None: """ ``EXPort:WAVeform:ABORt`` \n Snippet: ``driver.export.waveform.abort_and_wait()`` \n Aborts a running waveform export, which was started with method ``RsMxo.export.waveform.save()`` . Same as abort, but waits for the operation to complete before continuing further. Use the RsMxo.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'EXPort:WAVeform:ABORt', opc_timeout_ms)
# noinspection PyTypeChecker
[docs] def get_source(self) -> List[enums.SignalSource]: """ ``EXPort:WAVeform:SOURce`` \n Snippet: ``value: List[enums.SignalSource] = driver.export.waveform.get_source()`` \n Selects the waveform or waveforms to be exported to file. :return: sources: Possible waveform sources are: Analog signals: C1,C2,...,C8 Digital signals: D0,D1,D2,...,D15 Math waveforms: M1,M2,M3,M4,M5 Reference waveforms: R1,R2,R3,R4 Spectrum traces: SPECMAXH1,SPECMINH1,SPECNORM1,SPECAVER1,SPECMAXH2,SPECMINH2,SPECNORM2,SPECAVER2,SPECMAXH3,SPECMINH3,SPECNORM3,SPECAVER3,SPECMAXH4,SPECMINH4,SPECNORM4,SPECAVER4 Tracks: TRK1,TRK2,TRK3, ...,TRK24 Analog channels of connected scopes (ScopeSync) : OnC1,OnC2, ... ,OnC8 (n = 2 to 11) Power waveforms: PA1QPOWER | PA2QPOWER | ... | PA6QPOWER | PA1HPOWER1 | PA2HPOWER1 | ... | PA6HPOWER1| | PA1SPOWER | PA2SPOWER | ... | PA6SPOWER | PA1IPOWER | PA2IPOWER | ... | PA6IPOWER | PA1OPOWER1 | PA2OPOWER1 | ... | PA6OPOWER1 | PA1OPOWER2 | PA2OPOWER2 | ... | PA6OPOWER2 | PA1OPOWER3 | PA2OPOWER3 | ... | PA6OPOWER3 | PA1TOPOWER | PA2TOPOWER | ... | PA6TOPOWER | PA1SOA | PA2SOA | ... | PA6SOA """ response = self._core.io.query_str('EXPort:WAVeform:SOURce?') return Conversions.str_to_list_enum(response, enums.SignalSource)
[docs] def set_source(self, sources: List[enums.SignalSource]) -> None: """ ``EXPort:WAVeform:SOURce`` \n Snippet: ``driver.export.waveform.set_source(sources = [SignalSource.C1, SignalSource.XY4])`` \n Selects the waveform or waveforms to be exported to file. :param sources: Possible waveform sources are: Analog signals: C1,C2,...,C8 Digital signals: D0,D1,D2,...,D15 Math waveforms: M1,M2,M3,M4,M5 Reference waveforms: R1,R2,R3,R4 Spectrum traces: SPECMAXH1,SPECMINH1,SPECNORM1,SPECAVER1,SPECMAXH2,SPECMINH2,SPECNORM2,SPECAVER2,SPECMAXH3,SPECMINH3,SPECNORM3,SPECAVER3,SPECMAXH4,SPECMINH4,SPECNORM4,SPECAVER4 Tracks: TRK1,TRK2,TRK3, ...,TRK24 Analog channels of connected scopes (ScopeSync) : OnC1,OnC2, ... ,OnC8 (n = 2 to 11) Power waveforms: PA1QPOWER | PA2QPOWER | ... | PA6QPOWER | PA1HPOWER1 | PA2HPOWER1 | ... | PA6HPOWER1| | PA1SPOWER | PA2SPOWER | ... | PA6SPOWER | PA1IPOWER | PA2IPOWER | ... | PA6IPOWER | PA1OPOWER1 | PA2OPOWER1 | ... | PA6OPOWER1 | PA1OPOWER2 | PA2OPOWER2 | ... | PA6OPOWER2 | PA1OPOWER3 | PA2OPOWER3 | ... | PA6OPOWER3 | PA1TOPOWER | PA2TOPOWER | ... | PA6TOPOWER | PA1SOA | PA2SOA | ... | PA6SOA """ param = Conversions.enum_list_to_str(sources, enums.SignalSource) self._core.io.write(f'EXPort:WAVeform:SOURce {param}')
[docs] def get_name(self) -> str: """ ``EXPort:WAVeform:NAME`` \n Snippet: ``value: str = driver.export.waveform.get_name()`` \n Sets the path, the filename and the file format of the export file. The setting is used for save-as operations that do not use the autonaming settings. :return: name: String with path and filename with extension .ref, .csv, .zip, or .h5. Extension .ref is provided for single waveform export only, while .zip is for export of multiple waveforms in REF format. CSV can be used for export of single waveforms, and multiple analog channels. For local storage, the path is always /home/storage/userData. """ response = self._core.io.query_str('EXPort:WAVeform:NAME?') return trim_str_response(response)
[docs] def set_name(self, name: str) -> None: """ ``EXPort:WAVeform:NAME`` \n Snippet: ``driver.export.waveform.set_name(name = 'abc')`` \n Sets the path, the filename and the file format of the export file. The setting is used for save-as operations that do not use the autonaming settings. :param name: String with path and filename with extension .ref, .csv, .zip, or .h5. Extension .ref is provided for single waveform export only, while .zip is for export of multiple waveforms in REF format. CSV can be used for export of single waveforms, and multiple analog channels. For local storage, the path is always /home/storage/userData. """ param = Conversions.value_to_quoted_str(name) self._core.io.write(f'EXPort:WAVeform:NAME {param}')
def clone(self) -> 'WaveformCls': """ 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 = WaveformCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group