Source code for RsSmw.Implementations.Output.State

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import enums


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

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

	# noinspection PyTypeChecker
[docs] def get_pon(self) -> enums.UnchOff: """ ``OUTPut<HW>:[STATe]:PON`` \n Snippet: ``value: enums.UnchOff = driver.output.state.get_pon()`` \n Defines the state of the RF output signal when the instrument is switched on. :return: pon: OFF | UNCHanged """ response = self._core.io.query_str('OUTPut<HwInstance>:STATe:PON?') return Conversions.str_to_scalar_enum(response, enums.UnchOff)
[docs] def set_pon(self, pon: enums.UnchOff) -> None: """ ``OUTPut<HW>:[STATe]:PON`` \n Snippet: ``driver.output.state.set_pon(pon = enums.UnchOff.OFF)`` \n Defines the state of the RF output signal when the instrument is switched on. :param pon: OFF | UNCHanged """ param = Conversions.enum_scalar_to_str(pon, enums.UnchOff) self._core.io.write(f'OUTPut<HwInstance>:STATe:PON {param}')
[docs] def get_value(self) -> bool: """ ``OUTPut<HW>:[STATe]`` \n Snippet: ``value: bool = driver.output.state.get_value()`` \n Activates the RF output signal. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('OUTPut<HwInstance>:STATe?') return Conversions.str_to_bool(response)
[docs] def set_value(self, state: bool) -> None: """ ``OUTPut<HW>:[STATe]`` \n Snippet: ``driver.output.state.set_value(state = False)`` \n Activates the RF output signal. :param state: 1 | ON | 0| OFF """ param = Conversions.bool_to_str(state) self._core.io.write(f'OUTPut<HwInstance>:STATe {param}')