Source code for rsmxo.Implementations.P3Phase.Quality.Gate

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


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

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

[docs] def set(self, gate: int, power3PhaseMeas=repcap.Power3PhaseMeas.Default) -> None: """ ``P3PHase<*>:QUALity:GATE`` \n Snippet: ``driver.p3Phase.quality.gate.set(gate = 1, power3PhaseMeas = repcap.Power3PhaseMeas.Default)`` \n Selects the gate that is used for limiting the range of the 3-phase power quality measurement. Enable the gate before you assign a measurement to it (method ``RsMxo.gate.enable.set()`` =ON) . :param gate: Number of the gate to be used :param power3PhaseMeas: optional repeated capability selector. Default value: Nr1 (settable in the interface 'P3Phase') """ param = Conversions.decimal_value_to_str(gate) power3PhaseMeas_cmd_val = self._cmd_group.get_repcap_cmd_value(power3PhaseMeas, repcap.Power3PhaseMeas) self._core.io.write(f'P3PHase{power3PhaseMeas_cmd_val}:QUALity:GATE {param}')
[docs] def get(self, power3PhaseMeas=repcap.Power3PhaseMeas.Default) -> int: """ ``P3PHase<*>:QUALity:GATE`` \n Snippet: ``value: int = driver.p3Phase.quality.gate.get(power3PhaseMeas = repcap.Power3PhaseMeas.Default)`` \n Selects the gate that is used for limiting the range of the 3-phase power quality measurement. Enable the gate before you assign a measurement to it (method ``RsMxo.gate.enable.set()`` =ON) . :param power3PhaseMeas: optional repeated capability selector. Default value: Nr1 (settable in the interface 'P3Phase') :return: gate: Number of the gate to be used """ power3PhaseMeas_cmd_val = self._cmd_group.get_repcap_cmd_value(power3PhaseMeas, repcap.Power3PhaseMeas) response = self._core.io.query_str(f'P3PHase{power3PhaseMeas_cmd_val}:QUALity:GATE?') return Conversions.str_to_int(response)