from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class RasterCls:
"""
| Commands in total: 8
| Subgroups: 1
| Direct child commands: 6
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("raster", core, parent)
@property
def export(self):
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
if not hasattr(self, '_export'):
from .Export import ExportCls
self._export = ExportCls(self._core, self._cmd_group)
return self._export
[docs]
def get_state(self) -> bool:
"""
``RASTer:STATe`` \n
Snippet: ``value: bool = driver.raster.get_state()`` \n
Activates the raster processing.
:return: state: OFF | ON
"""
response = self._core.io.query_str_with_opc('RASTer:STATe?')
return Conversions.str_to_bool(response)
[docs]
def set_state(self, state: bool) -> None:
"""
``RASTer:STATe`` \n
Snippet: ``driver.raster.set_state(state = False)`` \n
Activates the raster processing.
:param state: OFF | ON
"""
param = Conversions.bool_to_str(state)
self._core.io.write_with_opc(f'RASTer:STATe {param}')
# noinspection PyTypeChecker
[docs]
def get_source(self) -> enums.SignalSource:
"""
``RASTer:SOURce`` \n
Snippet: ``value: enums.SignalSource = driver.raster.get_source()`` \n
Selects the waveform to be processed to a raster image.
:return: source: C1W1 | C1W2 | C1W3 | C2W1 | C2W2 | C2W3 | C3W1 | C3W2 | C3W3 | C4W1 | C4W2 | C4W3 | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | R1 | R2 | R3 | R4
"""
response = self._core.io.query_str_with_opc('RASTer:SOURce?')
return Conversions.str_to_scalar_enum(response, enums.SignalSource)
[docs]
def set_source(self, source: enums.SignalSource) -> None:
"""
``RASTer:SOURce`` \n
Snippet: ``driver.raster.set_source(source = enums.SignalSource.AJ1)`` \n
Selects the waveform to be processed to a raster image.
:param source: C1W1 | C1W2 | C1W3 | C2W1 | C2W2 | C2W3 | C3W1 | C3W2 | C3W3 | C4W1 | C4W2 | C4W3 | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | R1 | R2 | R3 | R4
"""
param = Conversions.enum_scalar_to_str(source, enums.SignalSource)
self._core.io.write_with_opc(f'RASTer:SOURce {param}')
[docs]
def get_hsync(self) -> float:
"""
``RASTer:HSYNc`` \n
Snippet: ``value: float = driver.raster.get_hsync()`` \n
Sets the horizontal frequency of the video signal. It is the line frequency, the repetition rate of horizontal lines.
"""
response = self._core.io.query_str_with_opc('RASTer:HSYNc?')
return Conversions.str_to_float(response)
[docs]
def set_hsync(self, hsync: float) -> None:
"""
``RASTer:HSYNc`` \n
Snippet: ``driver.raster.set_hsync(hsync = 1.0)`` \n
Sets the horizontal frequency of the video signal. It is the line frequency, the repetition rate of horizontal lines.
:param hsync: 0.1 to 10E+6
"""
param = Conversions.decimal_value_to_str(hsync)
self._core.io.write_with_opc(f'RASTer:HSYNc {param}')
[docs]
def get_vsync(self) -> float:
"""
``RASTer:VSYNc`` \n
Snippet: ``value: float = driver.raster.get_vsync()`` \n
Sets the vertical frequency (refresh rate) if averaging is active.
"""
response = self._core.io.query_str_with_opc('RASTer:VSYNc?')
return Conversions.str_to_float(response)
[docs]
def set_vsync(self, vsync: float) -> None:
"""
``RASTer:VSYNc`` \n
Snippet: ``driver.raster.set_vsync(vsync = 1.0)`` \n
Sets the vertical frequency (refresh rate) if averaging is active.
:param vsync: 0.1 to 10E+9
"""
param = Conversions.decimal_value_to_str(vsync)
self._core.io.write_with_opc(f'RASTer:VSYNc {param}')
[docs]
def get_offset(self) -> float:
"""
``RASTer:OFFSet`` \n
Snippet: ``value: float = driver.raster.get_offset()`` \n
Sets the time between the acquisition start and the image start.
"""
response = self._core.io.query_str_with_opc('RASTer:OFFSet?')
return Conversions.str_to_float(response)
[docs]
def set_offset(self, horiz_offs: float) -> None:
"""
``RASTer:OFFSet`` \n
Snippet: ``driver.raster.set_offset(horiz_offs = 1.0)`` \n
Sets the time between the acquisition start and the image start.
:param horiz_offs: 0 to 100E+24
"""
param = Conversions.decimal_value_to_str(horiz_offs)
self._core.io.write_with_opc(f'RASTer:OFFSet {param}')
[docs]
def get_averaging(self) -> bool:
"""
``RASTer:AVERaging`` \n
Snippet: ``value: bool = driver.raster.get_averaging()`` \n
Enables the averaging, which improves the image quality by averaging multiple acquisitions. A stable and precise trigger
condition is required to get exact results.
"""
response = self._core.io.query_str_with_opc('RASTer:AVERaging?')
return Conversions.str_to_bool(response)
[docs]
def set_averaging(self, averaging: bool) -> None:
"""
``RASTer:AVERaging`` \n
Snippet: ``driver.raster.set_averaging(averaging = False)`` \n
Enables the averaging, which improves the image quality by averaging multiple acquisitions. A stable and precise trigger
condition is required to get exact results.
:param averaging: OFF | ON
"""
param = Conversions.bool_to_str(averaging)
self._core.io.write_with_opc(f'RASTer:AVERaging {param}')
def clone(self) -> 'RasterCls':
"""
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 = RasterCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group