Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
27f1a32
Waveform designer extension and Waveform parameter actuator
claude Nov 23, 2026
cc0a114
Tests: the fake output actuator has no UI (the DAQ_Move UI of pymodaq…
claude Nov 23, 2026
5b34f4b
Tests: initialize the fake actuator without UI
claude Nov 23, 2026
02b85de
CI: PyQt5 is no longer supported by PyMoDAQ 5.3.x, test PyQt6 on Pyth…
claude Nov 23, 2026
64c35a4
Revert the CI matrix edit: the caller uses the reusable workflow of p…
claude Nov 23, 2026
f228a8f
Waveform designer: main() to run it alone, use its own modules manage…
claude Nov 23, 2026
df0ce16
Waveform designer: take the instruments added to the Dashboard after …
claude Nov 23, 2026
9326001
Waveform designer: Material icons
claude Nov 23, 2026
18262a5
Waveform designer: one channel to design and preview waveforms when t…
claude Nov 23, 2026
51b28e6
Waveform designer: the preview follows every change of the waveforms …
claude Nov 23, 2026
90d2a8d
Waveform designer: the repetitions are shown for the repeat mode only
claude Nov 23, 2026
c24b956
Waveform designer: named sets of waveforms saved and loaded by a mana…
claude Nov 23, 2026
59c9016
Waveform designer: the toolbar of the manager is a child of the main …
claude Nov 23, 2026
284897f
Waveform designer: delete the window of the manager with the extension
claude Nov 23, 2026
5124834
Waveform parameter actuator: its value is the one of the extension, r…
claude Nov 23, 2026
dbacad7
Waveform designer: the toolbar of the manager is shown in the window;…
claude Nov 23, 2026
fc7f280
Waveform parameter actuator: the move is requested through a signal o…
claude Nov 23, 2026
25eac4b
Waveform designer: the virtual actuators follow a parameter changed i…
claude Nov 23, 2026
b68ad73
Waveform parameter actuator: a waveform refused by the extension or b…
claude Nov 24, 2026
6c2afc4
Waveform designer: without target the virtual actuators set the param…
claude Nov 24, 2026
f648cef
Require pymodaq>=5.4.0 (move_failed status, next minor)
claude Nov 24, 2026
9be8212
color the add button
seb5g Nov 24, 2026
1bf2ea8
Merge branch 'feat/waveform-designer' of https://github.com/PyMoDAQ/p…
seb5g Nov 24, 2026
6418111
Temporarily depend on the PyMoDAQ dev branch (5.4.0 not released yet)
claude Nov 24, 2026
ce479ae
Also take pymodaq_gui, utils and data from the PyMoDAQ dev branch
claude Nov 24, 2026
7c4335f
Require Python >=3.11 (PyMoDAQ dev drops 3.10)
claude Nov 24, 2026
e50e747
Document Python 3.14 support
claude Nov 24, 2026
df0489b
Depend on the PyMoDAQ 5.4.0a0 alpha instead of the dev branch
claude Nov 24, 2026
1734afd
Address review: route moves per requester and target, harden sending …
claude Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Guidance for AI coding assistants (and humans) building on **PyMoDAQ 5.3.x** from this template.
PyMoDAQ is a Qt framework that drives lab experiments: hardware is added through small *plugins*, and PyMoDAQ
provides the GUI, threading, data model, scans and HDF5 saving. Python 3.10 to 3.13.
provides the GUI, threading, data model, scans and HDF5 saving. Python 3.11 to 3.14.

This repository is a plugin package named `pymodaq_plugins_<name>`. Rename everything that still says `template`
before publishing.
Expand Down
33 changes: 26 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,33 @@ pymodaq_plugins_waveform

Design waveforms and send them to the analog outputs and arbitrary waveform generators of the Dashboard.

This package holds the Dashboard extension that builds a waveform from the factory of ``pymodaq_plugins_utils``
(sine, square, triangle, ramp, pulse, piecewise linear, array...), shows it, and sends it to any actuator whose plugin
follows the waveform output contract of ``pymodaq_plugins_utils.hardware.waveform_output`` (NI-DAQmx analog outputs,
Red Pitaya...). It is under development: nothing is released yet.

This branch targets **PyMoDAQ 5.3.x** (Python 3.10 to 3.13).

Authors
=======

* Sebastien Weber

Instruments
===========

Actuators
+++++++++

* **WaveformParameter**: virtual actuator, created by the Waveform designer extension, that a scan moves to change one
parameter of a waveform.

Extensions
++++++++++

* **Waveform designer**: builds one waveform per channel, shows them, and sends them to any actuator whose plugin
follows the waveform output contract of ``pymodaq_plugins_utils.hardware.waveform_output`` (NI-DAQmx analog outputs,
Red Pitaya...). Sets of waveforms can be saved by name.

The package also holds the factory of waveforms (sine, square, triangle, ramp, pulse, piecewise linear, file...).
It is under development: nothing is released yet.

Requirements
============

This package needs **PyMoDAQ 5.4** (``pymodaq``, ``pymodaq_gui``, ``pymodaq_data`` ``>=5.4.0a0``) and Python 3.11 to
3.14: the virtual actuator relies on ``move_failed_signal`` of the actuator modules, only in PyMoDAQ 5.4. Until 5.4.0 is
released, install the alpha (``pip install --pre pymodaq``).
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[features] # defines the plugin features contained into this plugin
instruments = false # true if plugin contains instrument classes (else false, notice the lowercase for toml files)
extensions = false # true if plugins contains dashboard extensions
instruments = true # true if plugin contains instrument classes (else false, notice the lowercase for toml files)
extensions = true # true if plugins contains dashboard extensions
models = false # true if plugins contains models of the extensions (PID, optimizers, data mixer, sequencer, ...)
h5exporters = false # true if plugin contains custom h5 file exporters
scanners = false # true if plugin contains custom scan layout (daq_scan extensions)
Expand All @@ -21,11 +21,11 @@ keywords = [
"arbitrary waveform generator",
]
dependencies = [
"pymodaq>=5.3.7",
"pymodaq>=5.4.0a0", # the alpha is accepted since the specifier names a pre-release; replace by >=5.4.0 at the release
"pymodaq_utils>=5.3.1",
"pymodaq_gui>=5.3.0",
"pymodaq_data>=5.3.0",
"pymodaq_plugins_utils",
"pymodaq_gui>=5.4.0a0",
"pymodaq_data>=5.4.0a0",
"pymodaq_plugins_utils>=5.3.6",
]

authors = [
Expand All @@ -40,7 +40,7 @@ maintainers = [
dynamic = ["version", "urls", "entry-points", "classifiers"]
readme = "README.rst"
license = { file="LICENSE" }
requires-python = ">=3.10"
requires-python = ">=3.11"

[build-system]
requires = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
"""The actuator that a scan moves to change a parameter of a waveform of the Waveform designer extension"""
from typing import TYPE_CHECKING

from pymodaq_utils.utils import ThreadCommand

from pymodaq.control_modules.move_utility_classes import (
DAQ_Move_base, DataActuator, DataActuatorType, comon_parameters_fun)

if TYPE_CHECKING:
from pymodaq_plugins_waveform.extensions.waveform_designer import WaveformDesigner


class DAQ_Move_WaveformParameter(DAQ_Move_base):
"""A virtual actuator, created by the Waveform designer extension (and closed with it)

Its position is the value of one parameter of one waveform (the ``parameter`` setting, whose choices are set by the
extension). Moving it asks the extension to compute the waveform with this value and to send it to the output
actuator, and the move is done when the output actuator has loaded it.
"""
_controller_units = ''
is_multiaxes = False
_epsilon = 1e-12
data_actuator_type = DataActuatorType.DataActuator
params = [{'title': 'Parameter:', 'name': 'parameter', 'type': 'list', 'limits': [],
'tip': 'The parameter of a waveform that this actuator drives, listed by the extension'},
] + comon_parameters_fun(is_multiaxes, epsilon=_epsilon)

def ini_attributes(self):
self.controller: 'WaveformDesigner' = None
self.value = DataActuator(data=0.)

def ini_stage(self, controller=None):
"""The controller is the extension that created this actuator: nothing to initialize"""
self.controller = controller
return 'Waveform parameter of the Waveform designer', True

def get_actuator_value(self) -> DataActuator:
"""The value of the chosen parameter, as it is in the settings of the extension"""
self._take_value()
return self.value

def _take_value(self):
"""The value of the chosen parameter, read in the settings of the extension (the controller)"""
value = self.controller.parameter_values().get(self.settings['parameter'])
if value is not None:
self.value = DataActuator(data=value)

def close(self):
pass

def commit_settings(self, param):
if param.name() == 'parameter':
self.emit_value(self.get_actuator_value())

def move_abs(self, position: DataActuator):
"""Ask the extension (the controller, by a signal as this plugin runs in its own thread) to build and send the
waveform; ``waveform_loaded`` answers when it is done"""
position = self.check_bound(position)
self.target_value = position
self.value = position
self.controller.parameter_requested.emit(self._title, self.settings['parameter'], float(position.value()))

def waveform_loaded(self, ok: bool = True, message: str = ''):
"""Command sent by the extension once the output actuator has loaded the waveform, or refused it

A refusal is raised: the module is marked in error with the reason and the move is not done (``move_done`` is
not called), as for any actuator that cannot reach a position.
"""
if not ok:
raise ValueError(message or 'The waveform was not loaded by the output actuator')
self.move_done()

def move_rel(self, position: DataActuator):
self.move_abs(self.value + position)

def move_home(self):
self.emit_status(ThreadCommand('Update_Status', ['A waveform parameter has no home position']))

def stop_motion(self):
self.move_done()
Loading