Repository navigation
Add the waveform output contract for the analog output plugins - #20
Merged
Merged
Conversation
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
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
… 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
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
…to a folder of classes) 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
…ibute) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofshaper.py. This PR holds no extension and no waveform factory: both live in the packagepymodaq_plugins_waveform(the factory and the forms are in itswaveformsfolder), 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_settingsfills the capabilities inini_stage.WaveformOutput.from_module(module)reads the groups from a control module andcheck(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 incrementsWAVEFORM_OUTPUT_VERSION.Tests (
test_waveform_output.py, 14 tests): the contract through a fake control module liketest_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 (inpymodaq_plugins_waveform).https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
Generated by Claude Code