from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CountCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("count", core, parent)
[docs]
def set(self, count: int, zone=repcap.Zone.Default) -> None:
"""
``ZONE<*>:COUNt`` \n
Snippet: ``driver.zone.count.set(count = 1, zone = repcap.Zone.Default)`` \n
Returns the number of zones. ZONE:COUNt? MAX returns the maximum number of zones that can be created.
:param count: Number of defined zones
:param zone: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Zone')
"""
param = Conversions.decimal_value_to_str(count)
zone_cmd_val = self._cmd_group.get_repcap_cmd_value(zone, repcap.Zone)
self._core.io.write(f'ZONE{zone_cmd_val}:COUNt {param}')
[docs]
def get(self, zone=repcap.Zone.Default) -> int:
"""
``ZONE<*>:COUNt`` \n
Snippet: ``value: int = driver.zone.count.get(zone = repcap.Zone.Default)`` \n
Returns the number of zones. ZONE:COUNt? MAX returns the maximum number of zones that can be created.
:param zone: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Zone')
:return: count: Number of defined zones
"""
zone_cmd_val = self._cmd_group.get_repcap_cmd_value(zone, repcap.Zone)
response = self._core.io.query_str(f'ZONE{zone_cmd_val}:COUNt?')
return Conversions.str_to_int(response)