Skip to content

Waveform Designer#1710

Open
bennthomsen wants to merge 54 commits into
QCoDeS:mainfrom
bennthomsen:feature/designer
Open

Waveform Designer#1710
bennthomsen wants to merge 54 commits into
QCoDeS:mainfrom
bennthomsen:feature/designer

Conversation

@bennthomsen
Copy link
Copy Markdown

@bennthomsen bennthomsen commented Feb 13, 2026

This PR adds a web-based Waveform Designer to broadbean — a Django-powered application for visually creating,
editing, sequencing, and uploading waveform sequences to arbitrary waveform generators (AWGs). It also introduces a
hardware instrument abstraction layer with a registry-based factory pattern for AWGs and oscilloscopes.

Note: This branch depends on JSONserialisation PR#1695, lut PR#1696, plotly_plotting PR#1694, and main. The changes described below are only those unique to this branch.

##Waveform Designer App
(src/broadbean/designer/)

A full Django application providing five main interfaces:

  1. Designer — Visual editor for waveform elements with support for ramp, sine, gaussian, exponential, wait-until,
    and custom segment types. Each segment supports up to 2 markers with configurable delay/duration.
  2. Sequencer — Compose saved elements into sequences with position ordering, trigger inputs, repetitions, goto
    logic, and per-channel flags (A–D).
  3. Upload & Capture — Upload sequences to AWG hardware and capture oscilloscope traces. Includes a mock mode for
    hardware-free testing.
  4. Parametric Generator — Generate sequences with parametrically swept parameters (amplitude, frequency, duration,
    multi-parameter).
  5. Instruments — Configure AWG, Scope, and LUT settings with VISA address, driver type, channel parameters, etc.

The designer exposes REST API endpoints for programmatic access to elements, sequences, configurations, upload, and
capture. It creates a local SQLite database to manage and store the generated waveforms and instrument configs

##Instrument Abstraction Layer
(src/broadbean/instruments/)

  • base/awg.py — ArbitraryWaveformGenerator abstract base class defining the upload/trigger/configure interface
  • base/scope.py — Scope ABC for oscilloscope implementations
  • base/mock_state.py — Shared mock state for simulating AWG→Scope data flow
  • mock.py — MockAWG and MockScope for testing without hardware
  • awg/tektronix.py — Tektronix AWG70001A/70002A driver (via QCoDeS)
  • scope/tektronix.py — Tektronix DPO70000/DPO7200 driver (via QCoDeS)
  • registry.py — Central InstrumentRegistry with decorator-based registration (@InstrumentRegistry.register_awg)
  • qcodes_base.py — Base class for QCoDeS-based instrument drivers

##Factory Interfaces
(src/broadbean/interface/)

  • AWGFactory and ScopeFactory for creating instrument instances from configuration
  • Convenience functions create_mock_awg / create_mock_scope

##Supporting Infrastructure

  • src/broadbean/config.py — Dataclass-based Config base with JSON/YAML serialization
  • Django models — WaveformElement, WaveformSequence, AWGConfiguration, ScopeConfiguration, LUTConfiguration, etc.
  • Django admin — Full admin integration for all models
  • Static assets — CSS (Bootstrap, FontAwesome, custom), JS (Plotly, custom modules for
    designer/sequencer/upload/instruments)
  • Templates — HTML templates for all five interfaces with a shared base layout

##Changes to Existing Code

  • src/broadbean/sequence.py — Added TypedDict types (ChannelArrays, ForgedElement) for stronger typing of forged
    sequence data. Fixed flags handling (already a list, removed unnecessary .tolist() call). Removed unused import.
  • pyproject.toml — Added [designer] and [hardware] optional dependency groups, broadbean-designer CLI entry point,
    and setuptools package-data configuration for templates/static/migrations/CSV files.
  • docs/ — Added waveform designer documentation (user guide + adding new instruments guide), example JSON data
    files, and updated docs/conf.py for markdown support.
  • .gitignore — Added entries for designer-related files.

Installation

Designer only (mock instruments)

pip install broadbean[designer]

With hardware support (Tektronix AWGs/Scopes via QCoDeS)

pip install broadbean[designer, hardware]

Run the designer

broadbean-designer runserver

benn-thomsen and others added 30 commits February 2, 2026 11:32
benn-thomsen and others added 24 commits February 12, 2026 22:45
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.

3 participants