from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DiagramCls:
"""
| Commands in total: 9
| Subgroups: 1
| Direct child commands: 8
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("diagram", core, parent)
@property
def rename(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_rename'):
from .Rename import RenameCls
self._rename = RenameCls(self._core, self._cmd_group)
return self._rename
[docs]
def get_crosshair(self) -> bool:
"""
``DISPlay:DIAGram:CROSshair`` \n
Snippet: ``value: bool = driver.display.diagram.get_crosshair()`` \n
If selected, a crosshair is displayed in the diagram area. A crosshair allows you to select a specific data point by its
co-ordinates.
:return: crosshair: OFF | ON
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:CROSshair?')
return Conversions.str_to_bool(response)
[docs]
def set_crosshair(self, crosshair: bool) -> None:
"""
``DISPlay:DIAGram:CROSshair`` \n
Snippet: ``driver.display.diagram.set_crosshair(crosshair = False)`` \n
If selected, a crosshair is displayed in the diagram area. A crosshair allows you to select a specific data point by its
co-ordinates.
:param crosshair: OFF | ON
"""
param = Conversions.bool_to_str(crosshair)
self._core.io.write_with_opc(f'DISPlay:DIAGram:CROSshair {param}')
[docs]
def get_grid(self) -> bool:
"""
``DISPlay:DIAGram:GRID`` \n
Snippet: ``value: bool = driver.display.diagram.get_grid()`` \n
If enabled, a grid is displayed in the diagram area.
:return: show: OFF | ON
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:GRID?')
return Conversions.str_to_bool(response)
[docs]
def set_grid(self, show: bool) -> None:
"""
``DISPlay:DIAGram:GRID`` \n
Snippet: ``driver.display.diagram.set_grid(show = False)`` \n
If enabled, a grid is displayed in the diagram area.
:param show: OFF | ON
"""
param = Conversions.bool_to_str(show)
self._core.io.write_with_opc(f'DISPlay:DIAGram:GRID {param}')
[docs]
def get_labels(self) -> bool:
"""
``DISPlay:DIAGram:LABels`` \n
Snippet: ``value: bool = driver.display.diagram.get_labels()`` \n
If enabled, labels mark values on the x- and y-axes in specified intervals in the diagram.
:return: show_labels: OFF | ON
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:LABels?')
return Conversions.str_to_bool(response)
[docs]
def set_labels(self, show_labels: bool) -> None:
"""
``DISPlay:DIAGram:LABels`` \n
Snippet: ``driver.display.diagram.set_labels(show_labels = False)`` \n
If enabled, labels mark values on the x- and y-axes in specified intervals in the diagram.
:param show_labels: OFF | ON
"""
param = Conversions.bool_to_str(show_labels)
self._core.io.write_with_opc(f'DISPlay:DIAGram:LABels {param}')
[docs]
def get_title(self) -> bool:
"""
``DISPlay:DIAGram:TITLe`` \n
Snippet: ``value: bool = driver.display.diagram.get_title()`` \n
If enabled, the tab titles of all diagrams are displayed: Diagram1, Diagram2 ... If disabled, the tab titles are not
shown except for those in a tabbed diagram. In tabbed diagrams, the tab titles are required to change the tabs.
:return: diag_title_st: OFF | ON
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:TITLe?')
return Conversions.str_to_bool(response)
[docs]
def set_title(self, diag_title_st: bool) -> None:
"""
``DISPlay:DIAGram:TITLe`` \n
Snippet: ``driver.display.diagram.set_title(diag_title_st = False)`` \n
If enabled, the tab titles of all diagrams are displayed: Diagram1, Diagram2 ... If disabled, the tab titles are not
shown except for those in a tabbed diagram. In tabbed diagrams, the tab titles are required to change the tabs.
:param diag_title_st: OFF | ON
"""
param = Conversions.bool_to_str(diag_title_st)
self._core.io.write_with_opc(f'DISPlay:DIAGram:TITLe {param}')
# noinspection PyTypeChecker
[docs]
def get_style(self) -> enums.DiagramStyle:
"""
``DISPlay:DIAGram:STYLe`` \n
Snippet: ``value: enums.DiagramStyle = driver.display.diagram.get_style()`` \n
Select the style in which the waveform is displayed.
:return: style: VECTors | DOTS \n
- VECTors: The individual data points are connected by a line.
- DOTS: Only the individual data points are displayed.
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:STYLe?')
return Conversions.str_to_scalar_enum(response, enums.DiagramStyle)
[docs]
def set_style(self, style: enums.DiagramStyle) -> None:
"""
``DISPlay:DIAGram:STYLe`` \n
Snippet: ``driver.display.diagram.set_style(style = enums.DiagramStyle.DOTS)`` \n
Select the style in which the waveform is displayed.
:param style: VECTors | DOTS \n
- VECTors: The individual data points are connected by a line.
- DOTS: Only the individual data points are displayed.
"""
param = Conversions.enum_scalar_to_str(style, enums.DiagramStyle)
self._core.io.write_with_opc(f'DISPlay:DIAGram:STYLe {param}')
[docs]
def get_yfixed(self) -> bool:
"""
``DISPlay:DIAGram:YFIXed`` \n
Snippet: ``value: bool = driver.display.diagram.get_yfixed()`` \n
If enabled, the horizontal grid lines remain in their position when the position of the curve is changed. Only the values
at the grid lines are adapted. This reflects the behavior of traditional oscilloscopes.
:return: ygrid_fixed: OFF | ON
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:YFIXed?')
return Conversions.str_to_bool(response)
[docs]
def set_yfixed(self, ygrid_fixed: bool) -> None:
"""
``DISPlay:DIAGram:YFIXed`` \n
Snippet: ``driver.display.diagram.set_yfixed(ygrid_fixed = False)`` \n
If enabled, the horizontal grid lines remain in their position when the position of the curve is changed. Only the values
at the grid lines are adapted. This reflects the behavior of traditional oscilloscopes.
:param ygrid_fixed: OFF | ON
"""
param = Conversions.bool_to_str(ygrid_fixed)
self._core.io.write_with_opc(f'DISPlay:DIAGram:YFIXed {param}')
[docs]
def get_xfixed(self) -> bool:
"""
``DISPlay:DIAGram:XFIXed`` \n
Snippet: ``value: bool = driver.display.diagram.get_xfixed()`` \n
If enabled, the vertical grid lines remain in their position when the horizontal position is changed. Only the values at
the grid lines are adapted.
:return: xgrid_fixed: OFF | ON
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:XFIXed?')
return Conversions.str_to_bool(response)
[docs]
def set_xfixed(self, xgrid_fixed: bool) -> None:
"""
``DISPlay:DIAGram:XFIXed`` \n
Snippet: ``driver.display.diagram.set_xfixed(xgrid_fixed = False)`` \n
If enabled, the vertical grid lines remain in their position when the horizontal position is changed. Only the values at
the grid lines are adapted.
:param xgrid_fixed: OFF | ON
"""
param = Conversions.bool_to_str(xgrid_fixed)
self._core.io.write_with_opc(f'DISPlay:DIAGram:XFIXed {param}')
[docs]
def get_fine_grid(self) -> bool:
"""
``DISPlay:DIAGram:FINegrid`` \n
Snippet: ``value: bool = driver.display.diagram.get_fine_grid()`` \n
If ON, the crosshair is displayed as a ruler with scale markers. If OFF, the crosshair is shown as dashed lines.
:return: show_fine_scale: OFF | ON
"""
response = self._core.io.query_str_with_opc('DISPlay:DIAGram:FINegrid?')
return Conversions.str_to_bool(response)
[docs]
def set_fine_grid(self, show_fine_scale: bool) -> None:
"""
``DISPlay:DIAGram:FINegrid`` \n
Snippet: ``driver.display.diagram.set_fine_grid(show_fine_scale = False)`` \n
If ON, the crosshair is displayed as a ruler with scale markers. If OFF, the crosshair is shown as dashed lines.
:param show_fine_scale: OFF | ON
"""
param = Conversions.bool_to_str(show_fine_scale)
self._core.io.write_with_opc(f'DISPlay:DIAGram:FINegrid {param}')
def clone(self) -> 'DiagramCls':
"""
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 = DiagramCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group