Skip to content

Add the waveform output contract for the analog output plugins - #20

Merged
seb5g merged 10 commits into
5.3.xfrom
feat/waveforms
Nov 23, 2026
Merged

seb5g merged 10 commits into
5.3.xfrom
feat/waveforms

Conversation

@seb5g

@seb5g seb5g commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

hardware/waveform_output.py, without any hardware dependency, shared by the analog output plugins (NI-DAQmx, Red Pitaya, MCC...) and by the applications that send them waveforms. It follows the pattern of shaper.py. This PR holds no extension and no waveform factory: both live in the package pymodaq_plugins_waveform (the factory and the forms are in its waveforms folder), which only uses what is added here.

The contract. Two versioned settings groups added to the plugin (waveform_capabilities, read only: channels, rate range, max samples, voltage range, modes, triggers, live update; waveform_output: sample rate, mode, repetitions). fill_waveform_output_settings fills the capabilities in ini_stage. WaveformOutput.from_module(module) reads the groups from a control module and check(samples) says why the instrument cannot generate what is given (wrong channel count, too many samples, rate, mode, voltage range). Evolution rule as the shaper: only add optional children, a breaking change increments WAVEFORM_OUTPUT_VERSION.

Tests (test_waveform_output.py, 14 tests): the contract through a fake control module like test_shaper.py. They pass. No hardware involved.

Next, on top of this: the NI-DAQmx multi-channel output plugin (in pymodaq_plugins_daqmx) and the extension (in pymodaq_plugins_waveform).

https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL


Generated by Claude Code

waveforms: waveforms as dataclasses of their parameters in a registry (dc, sine, square, triangle,
sawtooth, ramp, pulse, piecewise linear, array), samples for a sample rate with a whole number of
samples per period, settings generated from the fields, pint quantities accepted.

waveform_output: versioned settings groups of the plugins generating waveforms (capabilities and
user choices), read back from the control module like the shaper, with a check of what is sent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
… form

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
…t contract here

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
@seb5g seb5g changed the title Add the waveform factory and the waveform output contract Add the waveform output contract for the analog output plugins Nov 23, 2026
…to a folder of classes)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
…ibute)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
@seb5g
seb5g merged commit 219f2c4 into 5.3.x Nov 23, 2026
6 of 7 checks passed
@seb5g
seb5g deleted the feat/waveforms branch November 23, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants