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


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

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

	def set(self, state: bool, fadingGroup=repcap.FadingGroup.Default, path=repcap.Path.Default) -> None:
		"""SCPI: [SOURce<HW>]:FSIMulator:DELay:GROup<ST>:PATH<CH>:CORRelation:STATe \n
		Snippet: driver.source.fsimulator.delay.group.path.correlation.state.set(state = False, fadingGroup = repcap.FadingGroup.Default, path = repcap.Path.Default) \n
		Enables correlation of the paths of the first fader. The suffix in SOURce defines the fader on which path settings the
		correlation is based. When correlation is activated, the settings of the correlation parameters, the profile, the speed
		and the lognormal parameters are the same for both paths. \n
			:param state: 0| 1| OFF| ON
			:param fadingGroup: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Group')
			:param path: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Path')"""
		param = Conversions.bool_to_str(state)
		fadingGroup_cmd_val = self._base.get_repcap_cmd_value(fadingGroup, repcap.FadingGroup)
		path_cmd_val = self._base.get_repcap_cmd_value(path, repcap.Path)
		self._core.io.write(f'SOURce<HwInstance>:FSIMulator:DELay:GROup{fadingGroup_cmd_val}:PATH{path_cmd_val}:CORRelation:STATe {param}')

	def get(self, fadingGroup=repcap.FadingGroup.Default, path=repcap.Path.Default) -> bool:
		"""SCPI: [SOURce<HW>]:FSIMulator:DELay:GROup<ST>:PATH<CH>:CORRelation:STATe \n
		Snippet: value: bool = driver.source.fsimulator.delay.group.path.correlation.state.get(fadingGroup = repcap.FadingGroup.Default, path = repcap.Path.Default) \n
		Enables correlation of the paths of the first fader. The suffix in SOURce defines the fader on which path settings the
		correlation is based. When correlation is activated, the settings of the correlation parameters, the profile, the speed
		and the lognormal parameters are the same for both paths. \n
			:param fadingGroup: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Group')
			:param path: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Path')
			:return: state: 0| 1| OFF| ON"""
		fadingGroup_cmd_val = self._base.get_repcap_cmd_value(fadingGroup, repcap.FadingGroup)
		path_cmd_val = self._base.get_repcap_cmd_value(path, repcap.Path)
		response = self._core.io.query_str(f'SOURce<HwInstance>:FSIMulator:DELay:GROup{fadingGroup_cmd_val}:PATH{path_cmd_val}:CORRelation:STATe?')
		return Conversions.str_to_bool(response)
