Skip to content

Feature/ttl control#98

Draft
MoritzFS wants to merge 4 commits into
mainfrom
feature/ttl-control
Draft

Feature/ttl control#98
MoritzFS wants to merge 4 commits into
mainfrom
feature/ttl-control

Conversation

@MoritzFS
Copy link
Copy Markdown

Summary

  • Server: adds TTLController pydase service exposing per-channel state control (0 = forced LOW, 1 = forced HIGH, 2 = pulse-sequence CONTROL) backed by SQLite persistence and HardwareController
    raw RPC calls to the Zedboard (ttlMasks / setTTLMasks)
  • Frontend: adds a /ttl page with an ionizer-style two-button-per-channel panel (ControlButton + StateButton), editable custom labels persisted server-side, and real-time updates via
    ttl.update / ttl.label_update Socket.IO events
  • Config: adds sqlite database entry and n_ttl_channels: 32 to tests/config.yaml; local config overrides are gitignored via tests/config.local.yaml

Test plan

  • uv run pytest tests/ — all green including new TTL unit tests
  • uv run alembic upgrade head then uv run alembic downgrade -1 — migration round-trip clean
  • Navigate to /ttl — 32 channels appear
  • ControlButton blue→grey: channel goes to state 0 (or 1 if StateButton was ON)
  • StateButton while ControlButton grey: channel toggles 0↔1
  • ControlButton grey→blue: channel goes to state 2
  • Double-click label, type new name, press Enter — label persists across page reload
  • Open second browser tab — ttl.update event updates other tab in real time

Florence Berterottiere and others added 4 commits May 18, 2026 15:39
Adds server-side control of the 32 Zedboard FPGA TTL output channels.
Each channel can be set to OFF (forced LOW), ON (forced HIGH), or CONTROL
(pulse-sequence driven) using the ttlMasks / setTTLMasks RPC calls. Mask
state is persisted to SQLite so it survives hardware power cycles.

Changes:
- TTLController (pydase.DataService) registered on APIService as .ttl
- TTLRepository + ttl_mask_states SQLite table (alembic migration)
- HardwareController.get_ttl_masks() / set_ttl_masks() wrappers
- HardwareConfig.n_ttl_channels config field (default 32)
- 19 unit tests covering mask encode/decode and controller logic
- docs/ttl_server_implementation.md design reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…utton UX

Adds a dedicated /ttl page with 32-channel grid. Each channel mirrors ionizer's
ControlButton (blue=FPGA, grey=manual) + StateButton (green=ON, red=OFF) layout.
StateButton retains its value when in CONTROL mode and applies it on switch-back,
matching ionizer behaviour exactly.

Also adds server-side label persistence (TTLController.get_labels/set_label,
labels column on ttl_mask_states via migration b2c3d4e5f6a1). Labels are
editable inline via double-click and persisted to SQLite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Points down_revision to the actual HEAD of main's migration chain
instead of the branching point fc9af856df20.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add sqlite database entry and n_ttl_channels to test config, gitignore
local config overrides, and rebuild frontend bundle with TTL page included.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aferk aferk marked this pull request as draft May 18, 2026 18:02
@aferk
Copy link
Copy Markdown
Contributor

aferk commented May 18, 2026

While this is nice, ICON client and server should not become hardware/device specific.

I see three options to include this functionality, which more generally could be device configuration:

  • Create a separately running pydase service (which can be connected to ICON). Simplest, but has the downside of an additional running service and connection to the device.
  • The device itself hosts a pydase service (which can be connected to ICON) -> currently not possible, but offers configuration right out of the box.
  • Device interface (in ICON) or device offers extracting Parameter_Metadata to display, store and update the device configuration. Requires device interface to be known to ICON.

@aferk aferk added the wontfix This will not be worked on label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants