Source code for rsrtx.Implementations.Power.InRush.Gate.Value

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


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

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

[docs] def set(self, value: float, pwrGate=repcap.PwrGate.Default) -> None: """ ``POWer:INRush:GATE<*>:VALue`` \n Snippet: ``driver.power.inRush.gate.value.set(value = 1.0, pwrGate = repcap.PwrGate.Default)`` \n Returns the value of the inrush current. :param value: -1000 to 1000 :param pwrGate: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Gate') """ param = Conversions.decimal_value_to_str(value) pwrGate_cmd_val = self._cmd_group.get_repcap_cmd_value(pwrGate, repcap.PwrGate) self._core.io.write(f'POWer:INRush:GATE{pwrGate_cmd_val}:VALue {param}')
[docs] def get(self, pwrGate=repcap.PwrGate.Default) -> float: """ ``POWer:INRush:GATE<*>:VALue`` \n Snippet: ``value: float = driver.power.inRush.gate.value.get(pwrGate = repcap.PwrGate.Default)`` \n Returns the value of the inrush current. :param pwrGate: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Gate') :return: value: -1000 to 1000 """ pwrGate_cmd_val = self._cmd_group.get_repcap_cmd_value(pwrGate, repcap.PwrGate) response = self._core.io.query_str(f'POWer:INRush:GATE{pwrGate_cmd_val}:VALue?') return Conversions.str_to_float(response)