signal_generator_mixin
¶
A mixin class providing common methods and attributes for signal generators.
ExtendedSourceDeviceConstants
dataclass
¶
ExtendedSourceDeviceConstants(
amplitude_range: ParameterBounds,
offset_range: ParameterBounds,
frequency_range: ParameterBounds,
sample_rate_range: ParameterBounds,
square_duty_cycle_range: ParameterBounds | None = None,
pulse_width_range: ParameterBounds | None = None,
ramp_symmetry_range: ParameterBounds | None = None,
)
Class to hold source device constants.
ParameterBounds
¶
Bases: NamedTuple
The upper and lower bounds of a parameter.
SignalGeneratorMixin
¶
Bases: _ExtendableMixin, ABC, Generic[_SignalGeneratorFunctionsTypeVar, _SourceDeviceConstantsTypeVar]
A mixin class which adds methods and properties for generating signals.
source_device_constants
abstractmethod
property
¶
source_device_constants: _SourceDeviceConstantsTypeVar
The constants defining what functions and memory sizes are allowed for the device.
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, _P], _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: |
|---|
generate_burst
abstractmethod
¶
generate_burst() -> None
Generate a burst of waveforms by forcing trigger.
generate_function
abstractmethod
¶
generate_function(
frequency: float,
function: _SignalGeneratorFunctionsTypeVar,
amplitude: float,
offset: float,
channel: str = "all",
output_signal_path: SignalGeneratorOutputPathsBase | None = None,
termination: Literal["FIFTY", "HIGHZ"] = "FIFTY",
duty_cycle: float = 50.0,
polarity: Literal["NORMAL", "INVERTED"] = "NORMAL",
symmetry: float = 50.0,
) -> None
Generate a predefined waveform given the following parameters.
| Parameters: |
|
|---|
get_waveform_constraints
abstractmethod
¶
get_waveform_constraints(
function: SignalGeneratorFunctionBase | None = None,
waveform_length: int | None = None,
frequency: float | None = None,
output_signal_path: str = "DIR",
load_impedance: LoadImpedanceAFG = HIGHZ,
) -> ExtendedSourceDeviceConstants
Get the constraints that restrict the waveform to certain parameter ranges.
| Parameters: |
|
|---|
setup_burst
abstractmethod
¶
setup_burst(
frequency: float,
function: _SignalGeneratorFunctionsTypeVar,
amplitude: float,
offset: float,
burst_count: int,
channel: str = "all",
output_signal_path: SignalGeneratorOutputPathsBase | None = None,
termination: Literal["FIFTY", "HIGHZ"] = "FIFTY",
duty_cycle: float = 50.0,
polarity: Literal["NORMAL", "INVERTED"] = "NORMAL",
symmetry: float = 50.0,
) -> None
Set up the device for sending a burst of waveforms given the following parameters.
| Parameters: |
|
|---|