from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AcquireCls:
"""
| Commands in total: 35
| Subgroups: 5
| Direct child commands: 11
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("acquire", core, parent)
@property
def rollMode(self):
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
if not hasattr(self, '_rollMode'):
from .RollMode import RollModeCls
self._rollMode = RollModeCls(self._core, self._cmd_group)
return self._rollMode
@property
def history(self):
"""
| Commands in total: 12
| Subgroups: 1
| Direct child commands: 11
"""
if not hasattr(self, '_history'):
from .History import HistoryCls
self._history = HistoryCls(self._core, self._cmd_group)
return self._history
@property
def symbolRate(self):
"""
| Commands in total: 3
| Subgroups: 0
| Direct child commands: 3
"""
if not hasattr(self, '_symbolRate'):
from .SymbolRate import SymbolRateCls
self._symbolRate = SymbolRateCls(self._core, self._cmd_group)
return self._symbolRate
@property
def points(self):
"""
| Commands in total: 5
| Subgroups: 0
| Direct child commands: 5
"""
if not hasattr(self, '_points'):
from .Points import PointsCls
self._points = PointsCls(self._core, self._cmd_group)
return self._points
@property
def segmented(self):
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
if not hasattr(self, '_segmented'):
from .Segmented import SegmentedCls
self._segmented = SegmentedCls(self._core, self._cmd_group)
return self._segmented
[docs]
def get_available(self) -> int:
"""
``ACQuire:AVAilable`` \n
Snippet: ``value: int = driver.acquire.get_available()`` \n
Number of acquisitions that is saved in the memory and available for history viewing. It is also the number of
acquisitions in a fast segmentation acquisition series.
:return: acq_cnt: 0 to 4294967295
"""
response = self._core.io.query_str('ACQuire:AVAilable?')
return Conversions.str_to_int(response)
[docs]
def get_count(self) -> int:
"""
``ACQuire:COUNt`` \n
Snippet: ``value: int = driver.acquire.get_count()`` \n
Sets the acquisition and average count, which has a double effect: \n
- It sets the number of waveforms acquired with method ``RsMxo.run.single()`` .
- It defines the number of waveforms used to calculate the average waveform.
:return: max_acq_cnt: 1 to 16777215
"""
response = self._core.io.query_str('ACQuire:COUNt?')
return Conversions.str_to_int(response)
[docs]
def set_count(self, max_acq_cnt: int) -> None:
"""
``ACQuire:COUNt`` \n
Snippet: ``driver.acquire.set_count(max_acq_cnt = 1)`` \n
Sets the acquisition and average count, which has a double effect: \n
- It sets the number of waveforms acquired with method ``RsMxo.run.single()`` .
- It defines the number of waveforms used to calculate the average waveform.
:param max_acq_cnt: 1 to 16777215
"""
param = Conversions.decimal_value_to_str(max_acq_cnt)
self._core.io.write(f'ACQuire:COUNt {param}')
[docs]
def get_current(self) -> int:
"""
``ACQuire:CURRent`` \n
Snippet: ``value: int = driver.acquire.get_current()`` \n
Returns the current number of acquisitions that have been acquired.
:return: curr_acq_cnt: 0 to 18446744073709551615
"""
response = self._core.io.query_str('ACQuire:CURRent?')
return Conversions.str_to_int(response)
[docs]
def get_average(self) -> int:
"""
``ACQuire:AVERage`` \n
Snippet: ``value: int = driver.acquire.get_average()`` \n
Returns the current number of acquired waveforms that contribute to the average.
:return: curr_avg_cnt: 0 to 4294967295
"""
response = self._core.io.query_str('ACQuire:AVERage?')
return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs]
def get_interpolate(self) -> enums.IntpolMd:
"""
``ACQuire:INTerpolate`` \n
Snippet: ``value: enums.IntpolMd = driver.acquire.get_interpolate()`` \n
Selects the interpolation method.
:return: intpol_md: SINX | LINear | SMHD \n
- LINear: Linear interpolation between two adjacent sample points
- SINX: Interpolation with a sin(x) /x function.
- SMHD: Sample/Hold causes a histogram-like interpolation.
"""
response = self._core.io.query_str('ACQuire:INTerpolate?')
return Conversions.str_to_scalar_enum(response, enums.IntpolMd)
[docs]
def set_interpolate(self, intpol_md: enums.IntpolMd) -> None:
"""
``ACQuire:INTerpolate`` \n
Snippet: ``driver.acquire.set_interpolate(intpol_md = enums.IntpolMd.LINear)`` \n
Selects the interpolation method.
:param intpol_md: SINX | LINear | SMHD \n
- LINear: Linear interpolation between two adjacent sample points
- SINX: Interpolation with a sin(x) /x function.
- SMHD: Sample/Hold causes a histogram-like interpolation.
"""
param = Conversions.enum_scalar_to_str(intpol_md, enums.IntpolMd)
self._core.io.write(f'ACQuire:INTerpolate {param}')
# noinspection PyTypeChecker
[docs]
def get_type_py(self) -> enums.AcqMd:
"""
``ACQuire:TYPE`` \n
Snippet: ``value: enums.AcqMd = driver.acquire.get_type_py()`` \n
Sets how the waveform is built from the captured samples.
"""
response = self._core.io.query_str('ACQuire:TYPE?')
return Conversions.str_to_scalar_enum(response, enums.AcqMd)
[docs]
def set_type_py(self, acq_md: enums.AcqMd) -> None:
"""
``ACQuire:TYPE`` \n
Snippet: ``driver.acquire.set_type_py(acq_md = enums.AcqMd.AVERage)`` \n
Sets how the waveform is built from the captured samples.
:param acq_md: SAMPle | PDETect | ENVelope | AVERage
"""
param = Conversions.enum_scalar_to_str(acq_md, enums.AcqMd)
self._core.io.write(f'ACQuire:TYPE {param}')
[docs]
def get_resolution(self) -> float:
"""
``ACQuire:RESolution`` \n
Snippet: ``value: float = driver.acquire.get_resolution()`` \n
Returns the current resolution. The resolution is the time between two waveform samples in the waveform record.
It considers the processing of the captured samples including interpolation. A fine resolution with low values produces a
more precise waveform record. The resolution is the reciprocal of the sample rate. You can query the minimum and maximum
values with <command>? MIN and <command>? MAX.
:return: resolution: 1E-15 to 100
"""
response = self._core.io.query_str('ACQuire:RESolution?')
return Conversions.str_to_float(response)
[docs]
def set_resolution(self, resolution: float) -> None:
"""
``ACQuire:RESolution`` \n
Snippet: ``driver.acquire.set_resolution(resolution = 1.0)`` \n
Returns the current resolution. The resolution is the time between two waveform samples in the waveform record.
It considers the processing of the captured samples including interpolation. A fine resolution with low values produces a
more precise waveform record. The resolution is the reciprocal of the sample rate. You can query the minimum and maximum
values with <command>? MIN and <command>? MAX.
:param resolution: 1E-15 to 100
"""
param = Conversions.decimal_value_to_str(resolution)
self._core.io.write(f'ACQuire:RESolution {param}')
[docs]
def get_dresolution(self) -> float:
"""
``ACQuire:DRESolution`` \n
Snippet: ``value: float = driver.acquire.get_dresolution()`` \n
Returns the current digital resolution of the digital channels.
:return: dig_res: 1E-15 to 100
"""
response = self._core.io.query_str('ACQuire:DRESolution?')
return Conversions.str_to_float(response)
[docs]
def get_sr_real(self) -> float:
"""
``ACQuire:SRReal`` \n
Snippet: ``value: float = driver.acquire.get_sr_real()`` \n
Returns the sample rate of the waveform after HW processing. Interpolation is not considered. This value is shown in the
acquisition label above the diagram. You can query the minimum and maximum values with <command>? MIN and <command>? MAX.
:return: hw_sample_rate: 2 to ADC sample rate
"""
response = self._core.io.query_str('ACQuire:SRReal?')
return Conversions.str_to_float(response)
[docs]
def set_sr_real(self, hw_sample_rate: float) -> None:
"""
``ACQuire:SRReal`` \n
Snippet: ``driver.acquire.set_sr_real(hw_sample_rate = 1.0)`` \n
Returns the sample rate of the waveform after HW processing. Interpolation is not considered. This value is shown in the
acquisition label above the diagram. You can query the minimum and maximum values with <command>? MIN and <command>? MAX.
:param hw_sample_rate: 2 to ADC sample rate
"""
param = Conversions.decimal_value_to_str(hw_sample_rate)
self._core.io.write(f'ACQuire:SRReal {param}')
[docs]
def get_rl_real(self) -> int:
"""
``ACQuire:RLReal`` \n
Snippet: ``value: int = driver.acquire.get_rl_real()`` \n
Returns the internal record length used by the acquisition system.
:return: hw_record_len: 2 to 4294967295
"""
response = self._core.io.query_str('ACQuire:RLReal?')
return Conversions.str_to_int(response)
[docs]
def get_po_memory(self) -> bool:
"""
``ACQuire:POMemory`` \n
Snippet: ``value: bool = driver.acquire.get_po_memory()`` \n
The command returns 1 if the memory is not sufficient to process the data with the current settings. To solve the problem,
reduce the record length or use automatic record length setting.
:return: processing_out_of_memory: OFF | ON
"""
response = self._core.io.query_str('ACQuire:POMemory?')
return Conversions.str_to_bool(response)
def clone(self) -> 'AcquireCls':
"""
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 = AcquireCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group