Source code for rsrtx.Implementations.Layout.Histogram.Mode

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 ModeCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, histogram: str, mode: enums.HistogramLayoutMode) -> None: """ ``LAYout:HISTogram:MODE`` \n Snippet: ``driver.layout.histogram.mode.set(histogram = 'abc', mode = enums.HistogramLayoutMode.HORizontal)`` \n Defines or queries the type of histogram. :param histogram: The name of the histogram as defined using method ``RsRtx.layout.histogram.add()``. :param mode: VERTical | HORizontal \n - VERTical: Amplitude histogram (horizontal bars across amplitude) - HORizontal: Time or frequency histogram (vertical bars over time/frequencies) """ param = ArgSingleList().compose_cmd_string(ArgSingle('histogram', histogram, DataType.String), ArgSingle('mode', mode, DataType.Enum, enums.HistogramLayoutMode)) self._core.io.write_with_opc(f'LAYout:HISTogram:MODE {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, histogram: str) -> enums.HistogramLayoutMode: """ ``LAYout:HISTogram:MODE`` \n Snippet: ``value: enums.HistogramLayoutMode = driver.layout.histogram.mode.get(histogram = 'abc')`` \n Defines or queries the type of histogram. :param histogram: The name of the histogram as defined using method ``RsRtx.layout.histogram.add()``. :return: mode: VERTical | HORizontal \n - VERTical: Amplitude histogram (horizontal bars across amplitude) - HORizontal: Time or frequency histogram (vertical bars over time/frequencies) """ param = Conversions.value_to_quoted_str(histogram) response = self._core.io.query_str_with_opc(f'LAYout:HISTogram:MODE? {param}') return Conversions.str_to_scalar_enum(response, enums.HistogramLayoutMode)