<feed xmlns='http://www.w3.org/2005/Atom'>
<title>labUI.git/ui/code_templates.py, branch main</title>
<subtitle>Data acquisition program written in Python for use with serial communication devices.
</subtitle>
<id>https://git.kolset.xyz/labUI.git/atom?h=main</id>
<link rel='self' href='https://git.kolset.xyz/labUI.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.kolset.xyz/labUI.git/'/>
<updated>2026-06-10T05:18:43Z</updated>
<entry>
<title>Derived channels: signal display names as vars, auto-update template code, None op</title>
<updated>2026-06-10T05:18:43Z</updated>
<author>
<name>Christian Kolset</name>
<email>christian.kolset@gmail.com</email>
</author>
<published>2026-06-10T05:18:43Z</published>
<link rel='alternate' type='text/html' href='https://git.kolset.xyz/labUI.git/commit/?id=91b0b613f0b58498315ef91f6a541dd1089b88de'/>
<id>urn:sha1:91b0b613f0b58498315ef91f6a541dd1089b88de</id>
<content type='text'>
- Variable names derived from signal display name (e.g. "Acceleration X" → acceleration_x)
  instead of raw channel ID; all auto-names lowercase with underscores
- Template code auto-updates x[0]/x[1] refs to named vars as sources are added/changed;
  stops updating once user edits the code manually
- Derivative wrt-channel mode uses separate template with x[1] substituted to channel var
- Added "None" passthrough operation (result = x[0])
- source_names persisted in .labdaq profiles

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Fix custom_script execution + add templates for expression/function kinds</title>
<updated>2026-06-10T04:35:40Z</updated>
<author>
<name>Christian Kolset</name>
<email>christian.kolset@gmail.com</email>
</author>
<published>2026-06-10T04:35:40Z</published>
<link rel='alternate' type='text/html' href='https://git.kolset.xyz/labUI.git/commit/?id=d396692de571445537e617ac31627d7bd7ab84aa'/>
<id>urn:sha1:d396692de571445537e617ac31627d7bd7ab84aa</id>
<content type='text'>
- custom_script now uses exec-style (assign to `result`) matching the
  built-in templates — previously auto-wrapped in def compute() which
  had no return statement, causing state and channel vars to silently fail
- function kind unchanged: auto-wraps body as def compute(x,t); use return
- Add SCRIPT_TEMPLATES for expression, function, custom_script kinds;
  shown automatically when user switches to a script kind (replacing stale
  code from previous kind)
- New channels default to template when no saved code exists

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Scripting: named signal vars, shared vars dict, control scripts, code templates</title>
<updated>2026-06-10T04:14:20Z</updated>
<author>
<name>Christian Kolset</name>
<email>christian.kolset@gmail.com</email>
</author>
<published>2026-06-10T04:14:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kolset.xyz/labUI.git/commit/?id=7aec470acd69e9c1810b40aa5eea9b96b9eb73ad'/>
<id>urn:sha1:7aec470acd69e9c1810b40aa5eea9b96b9eb73ad</id>
<content type='text'>
- Named variables in expressions: source channel IDs injected as Python
  identifiers alongside x[] (e.g. write `A0 * 2` instead of `x[0] * 2`)
- Shared `vars` dict on SignalProcessor accessible from all expressions,
  functions, and control scripts; persisted in .labdaq profiles
- Per-derived-channel `state` dict for persistent computation state in
  custom scripts
- Control widgets gain optional on_action_script (Python snippet with
  value, vars, channels, math in scope); syntax-checked in editor dialog
- Built-in derived kinds (derivative, rms, power, etc.) now show their
  Python implementation as read-only code previews; "Edit as Custom Script"
  converts to custom_script kind with template pre-filled

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
