Source code for RsSmbv.Implementations.Source.Bb.Dme.Id.Code

from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ......Internal.Utilities import trim_str_response


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

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

[docs] def get_state(self) -> bool: """ ``[SOURce<HW>]:[BB]:DME:ID:CODE:STATe`` \n Snippet: ``value: bool = driver.source.bb.dme.id.code.get_state()`` \n No help available """ response = self._core.io.query_str('SOURce<HwInstance>:BB:DME:ID:CODE:STATe?') return Conversions.str_to_bool(response)
[docs] def set_state(self, state: bool) -> None: """ ``[SOURce<HW>]:[BB]:DME:ID:CODE:STATe`` \n Snippet: ``driver.source.bb.dme.id.code.set_state(state = False)`` \n No help available """ param = Conversions.bool_to_str(state) self._core.io.write(f'SOURce<HwInstance>:BB:DME:ID:CODE:STATe {param}')
[docs] def get_value(self) -> str: """ ``[SOURce<HW>]:[BB]:DME:ID:CODE`` \n Snippet: ``value: str = driver.source.bb.dme.id.code.get_value()`` \n Sets the coding of the COM/ID signal by the international short name of the airport (e.g. MUC for the Munich airport) . The COM/ID tone is sent according to the selected code, see 'Morse code settings'. If no coding is set, the COM/ID tone is sent uncoded (key down) . :return: code: string """ response = self._core.io.query_str('SOURce<HwInstance>:BB:DME:ID:CODE?') return trim_str_response(response)
[docs] def set_value(self, code: str) -> None: """ ``[SOURce<HW>]:[BB]:DME:ID:CODE`` \n Snippet: ``driver.source.bb.dme.id.code.set_value(code = 'abc')`` \n Sets the coding of the COM/ID signal by the international short name of the airport (e.g. MUC for the Munich airport) . The COM/ID tone is sent according to the selected code, see 'Morse code settings'. If no coding is set, the COM/ID tone is sent uncoded (key down) . :param code: string """ param = Conversions.value_to_quoted_str(code) self._core.io.write(f'SOURce<HwInstance>:BB:DME:ID:CODE {param}')