from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from ....Internal.RepeatedCapability import RepeatedCapability
from .... import enums
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class SourceCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
Repeated Capability Setting:
.. code-block:: python
# Range: Nr1 .. Nr2 \n
driver.bus.flxRay.source.repcap_jitterSource_set(repcap.JitterSource.Nr1)
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("source", core, parent)
self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_jitterSource_get', 'repcap_jitterSource_set', repcap.JitterSource.Nr1)
def repcap_jitterSource_set(self, jitterSource: repcap.JitterSource) -> None:
"""
Repeated Capability default value numeric suffix.
This value is used, if you do not explicitely set it in the child set/get methods, or if you leave it to JitterSource.Default.
Default value after init: JitterSource.Nr1
"""
self._cmd_group.set_repcap_enum_value(jitterSource)
def repcap_jitterSource_get(self) -> repcap.JitterSource:
"""
Returns the current default repeated capability for the child set/get methods.
"""
# noinspection PyTypeChecker
return self._cmd_group.get_repcap_enum_value()
[docs]
def set(self, sources: enums.SignalSource, bus=repcap.Bus.Default, jitterSource=repcap.JitterSource.Default) -> None:
"""
``BUS<*>:FLXRay:SOURce<*>`` \n
Snippet: ``driver.bus.flxRay.source.set(sources = enums.SignalSource.AJ1, bus = repcap.Bus.Default, jitterSource = repcap.JitterSource.Default)`` \n
Sets the input channel of the bus signal, or of the data and enable lines in case of a LOGic source type.
:param sources: NONE | C1W1 | C2W1 | C3W1 | C4W1 | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | R1 | R2 | R3 | R4 | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 \n
- C1W1 | C2W1 | C3W1 | C4W1: Always available
- NONE: Only available for SOURce2 (enable line)
- M1 | M2 | M3 | M4 | R1 | R2 | R3 | R4: Only available if the trigger source is one of the input channels but not the serial bus.
- D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15: Only available if BUSb:FLXRay:SRCType is set to LOGic.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
:param jitterSource: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Source')
"""
param = Conversions.enum_scalar_to_str(sources, enums.SignalSource)
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
jitterSource_cmd_val = self._cmd_group.get_repcap_cmd_value(jitterSource, repcap.JitterSource)
self._core.io.write(f'BUS{bus_cmd_val}:FLXRay:SOURce{jitterSource_cmd_val} {param}')
# noinspection PyTypeChecker
[docs]
def get(self, bus=repcap.Bus.Default, jitterSource=repcap.JitterSource.Default) -> enums.SignalSource:
"""
``BUS<*>:FLXRay:SOURce<*>`` \n
Snippet: ``value: enums.SignalSource = driver.bus.flxRay.source.get(bus = repcap.Bus.Default, jitterSource = repcap.JitterSource.Default)`` \n
Sets the input channel of the bus signal, or of the data and enable lines in case of a LOGic source type.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
:param jitterSource: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Source')
:return: sources: NONE | C1W1 | C2W1 | C3W1 | C4W1 | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | R1 | R2 | R3 | R4 | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 \n
- C1W1 | C2W1 | C3W1 | C4W1: Always available
- NONE: Only available for SOURce2 (enable line)
- M1 | M2 | M3 | M4 | R1 | R2 | R3 | R4: Only available if the trigger source is one of the input channels but not the serial bus.
- D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15: Only available if BUSb:FLXRay:SRCType is set to LOGic.
"""
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
jitterSource_cmd_val = self._cmd_group.get_repcap_cmd_value(jitterSource, repcap.JitterSource)
response = self._core.io.query_str(f'BUS{bus_cmd_val}:FLXRay:SOURce{jitterSource_cmd_val}?')
return Conversions.str_to_scalar_enum(response, enums.SignalSource)
def clone(self) -> 'SourceCls':
"""
Clones the group by creating new object from it and its whole existing subgroups.
Also copies all the existing default Repeated Capabilities setting,
which you can change independently without affecting the original group.
"""
new_group = SourceCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group