Source code for rsrtx.Implementations.Bus.Cmsb.Frame.Cell.Crgb

from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CrgbCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, color: int, bus=repcap.Bus.Default, busFrameNull=repcap.BusFrameNull.Default, busCellNull=repcap.BusCellNull.Default) -> None: """ ``BUS<*>:CMSB:FRAMe<*>:CELL<*>:CRGB`` \n Snippet: ``driver.bus.cmsb.frame.cell.crgb.set(color = 1, bus = repcap.Bus.Default, busFrameNull = repcap.BusFrameNull.Default, busCellNull = repcap.BusCellNull.Default)`` \n Selects a cell's color representation in the honeycomb display. :param color: ARGB value of the color to be used for the table entry. ARGB=Opacity(alpha) valuered valuegreen valueblue value, in hexadecimal or decimal format. :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') :param busFrameNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Frame') :param busCellNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Cell') """ param = Conversions.decimal_value_to_str(color) bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) busFrameNull_cmd_val = self._cmd_group.get_repcap_cmd_value(busFrameNull, repcap.BusFrameNull) busCellNull_cmd_val = self._cmd_group.get_repcap_cmd_value(busCellNull, repcap.BusCellNull) self._core.io.write(f'BUS{bus_cmd_val}:CMSB:FRAMe{busFrameNull_cmd_val}:CELL{busCellNull_cmd_val}:CRGB {param}')
[docs] def get(self, bus=repcap.Bus.Default, busFrameNull=repcap.BusFrameNull.Default, busCellNull=repcap.BusCellNull.Default) -> int: """ ``BUS<*>:CMSB:FRAMe<*>:CELL<*>:CRGB`` \n Snippet: ``value: int = driver.bus.cmsb.frame.cell.crgb.get(bus = repcap.Bus.Default, busFrameNull = repcap.BusFrameNull.Default, busCellNull = repcap.BusCellNull.Default)`` \n Selects a cell's color representation in the honeycomb display. :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') :param busFrameNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Frame') :param busCellNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Cell') :return: color: ARGB value of the color to be used for the table entry. ARGB=Opacity(alpha) valuered valuegreen valueblue value, in hexadecimal or decimal format. """ bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) busFrameNull_cmd_val = self._cmd_group.get_repcap_cmd_value(busFrameNull, repcap.BusFrameNull) busCellNull_cmd_val = self._cmd_group.get_repcap_cmd_value(busCellNull, repcap.BusCellNull) response = self._core.io.query_str(f'BUS{bus_cmd_val}:CMSB:FRAMe{busFrameNull_cmd_val}:CELL{busCellNull_cmd_val}:CRGB?') return Conversions.str_to_int(response)