from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import enums
from ... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class BandwidthCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("bandwidth", core, parent)
[docs]
def set(self, bandwidth_limit: enums.BwLimit, channel=repcap.Channel.Default) -> None:
"""
``CHANnel<*>:BANDwidth`` \n
Snippet: ``driver.channel.bandwidth.set(bandwidth_limit = enums.BwLimit.B1500, channel = repcap.Channel.Default)`` \n
Selects the bandwidth limit for the indicated channel.
:param bandwidth_limit: FULL | B800 | B200 | B20 \n
- FULL: Use full bandwidth.
- B200 | B20: Limit to 200 MHz or 20 MHz.
- B800: Limit to 800 MHz. Available for 50 Ω coupling on scopes with ≥ 1 GHz instrument bandwith.
:param channel: optional repeated capability selector. Default value: Ch1 (settable in the interface 'Channel')
"""
param = Conversions.enum_scalar_to_str(bandwidth_limit, enums.BwLimit)
channel_cmd_val = self._cmd_group.get_repcap_cmd_value(channel, repcap.Channel)
self._core.io.write_with_opc(f'CHANnel{channel_cmd_val}:BANDwidth {param}')
# noinspection PyTypeChecker
[docs]
def get(self, channel=repcap.Channel.Default) -> enums.BwLimit:
"""
``CHANnel<*>:BANDwidth`` \n
Snippet: ``value: enums.BwLimit = driver.channel.bandwidth.get(channel = repcap.Channel.Default)`` \n
Selects the bandwidth limit for the indicated channel.
:param channel: optional repeated capability selector. Default value: Ch1 (settable in the interface 'Channel')
:return: bandwidth_limit: FULL | B800 | B200 | B20 \n
- FULL: Use full bandwidth.
- B200 | B20: Limit to 200 MHz or 20 MHz.
- B800: Limit to 800 MHz. Available for 50 Ω coupling on scopes with ≥ 1 GHz instrument bandwith.
"""
channel_cmd_val = self._cmd_group.get_repcap_cmd_value(channel, repcap.Channel)
response = self._core.io.query_str_with_opc(f'CHANnel{channel_cmd_val}:BANDwidth?')
return Conversions.str_to_scalar_enum(response, enums.BwLimit)