Skip to content

Gate LED controls on rig config (LED-driver present + point to calibration file) #156

Description

@mbreiser

Summary

The LED controls we just added are unconditionally enabled and assume a specific driver. They should instead be driven by the rig config file, which should (a) declare whether the rig has an LED driver at all, and (b) point to a calibration file in the repo for the brightness→voltage mapping. (For later — not urgent.)

Current state

  • Console LED bar (arena_studio.html, v0.46): data-cmd="cledset" / cledoff — always enabled (placed outside the connect-gated fieldset, not safe-blocked).
  • Run-view "TURN OFF LED" button (v0.45): #btnLedOff — always visible, sends SET_AO_VOLTAGE 0xA0 = 5000 mV.
  • Both assume:
    • the rig has a BuckPuck LED driver on the Analog Out (0xA0) BNC, and
    • AO is in programmable mode (firmware refuses 0xA0 otherwise), and
    • the % → mV mapping is the hardcoded, approximate BUCKPUCK_CURVE in js/arena-runner-g6.js (digitized off a datasheet figure, ~few % accuracy) via the exported ledPercentToMv.

Desired (later)

  1. Rig config declares the LED driver. Extend the rig YAML io: block so a rig can state it has an LED driver (driver type + which AO channel/role). Only show/enable the Console LED bar and the Run-view TURN OFF LED button when the loaded rig declares one; grey/hide otherwise. Parsing lives in parseRigIo (js/plugin-registry.js) + Studio.applyRigIo.
  2. Rig config points to a calibration file in the repo. The rig entry should reference a per-rig calibration (measured % → mV, or mV → light) committed in the repo. Load it to drive ledPercentToMv instead of the hardcoded BUCKPUCK_CURVE, so the mapping is real/photometric per rig. Fall back to the current approximate curve when no calibration is declared.
  3. Keep one source of truth for the curve (already: ledPercentToMv is shared by the Console bar and the protocol ledDrive command).

Touch points

  • js/arena-runner-g6.jsBUCKPUCK_CURVE, ledPercentToMv, LED_OFF_MV
  • arena_studio.html — Console led-bar (cledset/cledoff), Run-view #btnLedOff, rig io: application (applyRigIo)
  • js/plugin-registry.jsparseRigIo (rig io: schema)
  • rig config files + a new calibration file location/format in the repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions