from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Utilities import trim_str_response
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CorrectionCls:
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("correction", core, parent)
[docs]
def get_file(self) -> str:
"""
``[SOURce<HW>]:EFRontend:EXTDevice:CORRection:FILE`` \n
Snippet: ``value: str = driver.source.efrontend.extDevice.correction.get_file()`` \n
Selects an existing correction file, e.g. to compensate for cable losses. Selectable files have file extension s2p or uco.
:return: filename: string
"""
response = self._core.io.query_str('SOURce<HwInstance>:EFRontend:EXTDevice:CORRection:FILE?')
return trim_str_response(response)
[docs]
def set_file(self, filename: str) -> None:
"""
``[SOURce<HW>]:EFRontend:EXTDevice:CORRection:FILE`` \n
Snippet: ``driver.source.efrontend.extDevice.correction.set_file(filename = 'abc')`` \n
Selects an existing correction file, e.g. to compensate for cable losses. Selectable files have file extension s2p or uco.
:param filename: string
"""
param = Conversions.value_to_quoted_str(filename)
self._core.io.write(f'SOURce<HwInstance>:EFRontend:EXTDevice:CORRection:FILE {param}')
[docs]
def get_state(self) -> bool:
"""
``[SOURce<HW>]:EFRontend:EXTDevice:CORRection:STATe`` \n
Snippet: ``value: bool = driver.source.efrontend.extDevice.correction.get_state()`` \n
Activates correction of the RF signal for different RF signal frequencies. Activation requires loading of a valid
correction file.
:return: state: 1 | ON | 0| OFF
"""
response = self._core.io.query_str('SOURce<HwInstance>:EFRontend:EXTDevice:CORRection:STATe?')
return Conversions.str_to_bool(response)
[docs]
def set_state(self, state: bool) -> None:
"""
``[SOURce<HW>]:EFRontend:EXTDevice:CORRection:STATe`` \n
Snippet: ``driver.source.efrontend.extDevice.correction.set_state(state = False)`` \n
Activates correction of the RF signal for different RF signal frequencies. Activation requires loading of a valid
correction file.
:param state: 1 | ON | 0| OFF
"""
param = Conversions.bool_to_str(state)
self._core.io.write(f'SOURce<HwInstance>:EFRontend:EXTDevice:CORRection:STATe {param}')