base_source_channel

Base source channel module.

BaseSourceChannel

BaseSourceChannel(pi_control: PIControl, channel_name: str)

Bases: _ExtendableMixin, ABC

flowchart LR tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel[BaseSourceChannel] tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin[_ExtendableMixin] tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin --> tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel click tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel href "" "tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel" click tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin href "" "tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin"

Base source channel.

Parameters:
  • pi_control (PIControl) –

    A PI device.

  • channel_name (str) –

    The channel name for the source channel.

name property

name: str

Return the channel name.

num property

num: int | None

Return the channel number.

add_method classmethod

add_method(method: Callable[Concatenate[Self, _P], _T]) -> None

Add a method to the class.

This class method is best used as a decorator on functions in order to add them to a class.

Examples:

>>> from tm_devices.drivers.device import Device
>>>
>>> @Device.add_method
... def print_hello(self: Device, var: str):
...     print("Hello World!")
...     print(f"I am a {self.__class__.__name__}!")
...     print(f"My var is {var}")
Parameters:

add_property classmethod

add_property(method: Callable[Concatenate[_EM, _T" backlink-type="used-by" backlink-anchor="tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel.add_property" optional hover>_T], _T]) -> None
add_property(
    method: None = None, /, *, is_cached: bool = False
) -> Callable[[Callable[Concatenate[_EM, _P], _T]], None]
add_property(
    method: Callable[[Self], _T] | None = None, /, *, is_cached: bool = False
) -> Callable[[Callable[[Self], _T]], None] | None

Add a property to the class.

This class method is best used as a decorator on functions in order to add them to a class.

Examples:

>>> from tm_devices.drivers.device import Device
>>>
>>> @Device.add_property
... def foo(self: Device):
...     return "bar"
>>>
>>> @Device.add_property(is_cached=True)
... def foo(self: Device):
...     return self.name + self.address
Parameters:
  • method (Callable[[Self], _T] | None, default: None ) –

    The property to add to the class.

  • is_cached (bool, default: False ) –

    Whether the property is only evaluated once and cached.

set_amplitude abstractmethod

set_amplitude(value: float, absolute_tolerance: float = 0) -> None

Set the amplitude on the source channel.

Parameters:
  • value (float) –

    The amplitude value to set.

  • absolute_tolerance (float, default: 0 ) –

    The acceptable difference between two floating point values.

set_offset abstractmethod

set_offset(value: float, absolute_tolerance: float = 0) -> None

Set the offset on the source channel.

Parameters:
  • value (float) –

    The offset value to set.

  • absolute_tolerance (float, default: 0 ) –

    The acceptable difference between two floating point values.

set_state abstractmethod

set_state(value: int) -> None

Set the output state to ON/OFF (1/0) on the source channel.

Parameters:
  • value (int) –

    The output state.