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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class Voip:
	"""Voip commands group definition. 7 total commands, 0 Sub-groups, 7 group commands"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._base = CommandsGroup("voip", core, parent)

	def get_enable(self) -> bool:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:ENABle \n
		Snippet: value: bool = driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.get_enable() \n
		No command help available \n
			:return: enable: No help available
		"""
		response = self._core.io.query_str('TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:ENABle?')
		return Conversions.str_to_bool(response)

	def set_enable(self, enable: bool) -> None:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:ENABle \n
		Snippet: driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.set_enable(enable = False) \n
		No command help available \n
			:param enable: No help available
		"""
		param = Conversions.bool_to_str(enable)
		self._core.io.write(f'TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:ENABle {param}')

	def get_threshold(self) -> float:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:THReshold \n
		Snippet: value: float = driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.get_threshold() \n
		Defines the trigger threshold for the VoIP input path. \n
			:return: threshold: Audio level threshold Range: -100 % to 100 %, Unit: %
		"""
		response = self._core.io.query_str('TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:THReshold?')
		return Conversions.str_to_float(response)

	def set_threshold(self, threshold: float) -> None:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:THReshold \n
		Snippet: driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.set_threshold(threshold = 1.0) \n
		Defines the trigger threshold for the VoIP input path. \n
			:param threshold: Audio level threshold Range: -100 % to 100 %, Unit: %
		"""
		param = Conversions.decimal_value_to_str(threshold)
		self._core.io.write(f'TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:THReshold {param}')

	# noinspection PyTypeChecker
	def get_mode(self) -> enums.TriggerMode:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:MODE \n
		Snippet: value: enums.TriggerMode = driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.get_mode() \n
		Selects the repetition mode of the trigger system. \n
			:return: trigger_mode: SINGle | NORMal | AUTO | FRUN
		"""
		response = self._core.io.query_str('TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:MODE?')
		return Conversions.str_to_scalar_enum(response, enums.TriggerMode)

	def set_mode(self, trigger_mode: enums.TriggerMode) -> None:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:MODE \n
		Snippet: driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.set_mode(trigger_mode = enums.TriggerMode.AUTO) \n
		Selects the repetition mode of the trigger system. \n
			:param trigger_mode: SINGle | NORMal | AUTO | FRUN
		"""
		param = Conversions.enum_scalar_to_str(trigger_mode, enums.TriggerMode)
		self._core.io.write(f'TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:MODE {param}')

	# noinspection PyTypeChecker
	def get_slope(self) -> enums.SignalSlope:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:SLOPe \n
		Snippet: value: enums.SignalSlope = driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.get_slope() \n
		Selects whether the trigger event is generated by signals rising through the threshold or falling through the threshold. \n
			:return: trigger_slope: REDGe | FEDGe REDGe Rising signal (rising edge) FEDGe Falling signal (falling edge)
		"""
		response = self._core.io.query_str('TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:SLOPe?')
		return Conversions.str_to_scalar_enum(response, enums.SignalSlope)

	def set_slope(self, trigger_slope: enums.SignalSlope) -> None:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:SLOPe \n
		Snippet: driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.set_slope(trigger_slope = enums.SignalSlope.FEDGe) \n
		Selects whether the trigger event is generated by signals rising through the threshold or falling through the threshold. \n
			:param trigger_slope: REDGe | FEDGe REDGe Rising signal (rising edge) FEDGe Falling signal (falling edge)
		"""
		param = Conversions.enum_scalar_to_str(trigger_slope, enums.SignalSlope)
		self._core.io.write(f'TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:SLOPe {param}')

	def get_offset(self) -> float:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:OFFSet \n
		Snippet: value: float = driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.get_offset() \n
		Defines a trigger offset, shifting the measured trace relative to the trigger event, so that the trace starts earlier.
		The offset is specified as a percentage of the measurement time for a single trace. \n
			:return: trigger_offset: Range: 0 % to 100 %, Unit: %
		"""
		response = self._core.io.query_str('TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:OFFSet?')
		return Conversions.str_to_float(response)

	def set_offset(self, trigger_offset: float) -> None:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:OFFSet \n
		Snippet: driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.set_offset(trigger_offset = 1.0) \n
		Defines a trigger offset, shifting the measured trace relative to the trigger event, so that the trace starts earlier.
		The offset is specified as a percentage of the measurement time for a single trace. \n
			:param trigger_offset: Range: 0 % to 100 %, Unit: %
		"""
		param = Conversions.decimal_value_to_str(trigger_offset)
		self._core.io.write(f'TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:OFFSet {param}')

	# noinspection PyTypeChecker
	def get_state(self) -> enums.ArmedState:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:STATe \n
		Snippet: value: enums.ArmedState = driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.get_state() \n
		Queries the state of the trigger system. \n
			:return: armed_state: OFF | ARMed | TRIGgered OFF The trigger system is disabled. The oscilloscope works as free-run measurement. ARMed The trigger system is armed and waits for a trigger event. TRIGgered A trigger event has occurred. The trigger system has not (yet) been rearmed.
		"""
		response = self._core.io.query_str('TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:STATe?')
		return Conversions.str_to_scalar_enum(response, enums.ArmedState)

	# noinspection PyTypeChecker
	def get_coupling(self) -> enums.TriggerCouplingDigital:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:COUPling \n
		Snippet: value: enums.TriggerCouplingDigital = driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.get_coupling() \n
		Couples the trigger settings for the VoIP input path to the trigger settings for another path. \n
			:return: trigger_coupling: NONE | DEMod | AIN No coupling, coupling to RF path or to AF path
		"""
		response = self._core.io.query_str('TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:COUPling?')
		return Conversions.str_to_scalar_enum(response, enums.TriggerCouplingDigital)

	def set_coupling(self, trigger_coupling: enums.TriggerCouplingDigital) -> None:
		"""SCPI: TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:COUPling \n
		Snippet: driver.trigger.afRf.measurement.multiEval.oscilloscope.voip.set_coupling(trigger_coupling = enums.TriggerCouplingDigital.AIN) \n
		Couples the trigger settings for the VoIP input path to the trigger settings for another path. \n
			:param trigger_coupling: NONE | DEMod | AIN No coupling, coupling to RF path or to AF path
		"""
		param = Conversions.enum_scalar_to_str(trigger_coupling, enums.TriggerCouplingDigital)
		self._core.io.write(f'TRIGger:AFRF:MEASurement<Instance>:MEValuation:OSCilloscope:VOIP:COUPling {param}')
