LifConversionSnapshot

LifConversionSnapshot is the serializable wiring-only helper used by LifPreset. It mirrors RfConfigSnapshot: it captures the subset of a LIF conversion topology that belongs to a stored preset — the per-stage input wiring and FINAL marker — without the hardware-owned state a live topology also carries. Deliberately excluded are each stage’s conversion operation and harmonic order: those are device-identity settings, always read from the owning LifFreqConversionStage’s own SettingsStorage snapshot, never persisted inside a preset. See Key invariants on LIF Acquisition and Visualization for why that split is load-bearing. The snapshot is value-typed and freely copied between the conversion table model, the preset bar, and the persistence layer.

laserKey records which LifLaser the wiring was captured against, but it is provenance only — applying a preset substitutes the current active laser key rather than trusting the stored one, so a saved preset still applies cleanly after the laser hardware is swapped. fromNodes builds a snapshot from the inputs/isFinal fields of an already-joined BC::LifConv::Node list, discarding op/harmonic; toNodes is the inverse, rejoining a snapshot’s wiring with op/harmonic values supplied through caller callbacks (in practice backed by per-stage SettingsStorage hardware snapshots — see lifConversionNodesFromSnapshot on LifFreqConversionStage for the non-callback equivalent used outside the data/hardware/ layering boundary).

Serialization is performed by the free functions in the BC::Loadout namespace declared alongside HardwareLoadout: lifConversionScalarsMap flattens the snapshot’s scalar (laser-key) field, and lifConversionWiringArray flattens its per-stage wiring table. LoadoutManager writes these maps under each LIF preset’s lifConversionScalars and lifConversionWiring QSettings sub-groups; see LoadoutManager for the storage layout and LIF Acquisition and Visualization (Frequency conversion) for the user-facing preset model.

API Reference

struct LifConversionSnapshot

Serializable snapshot of the persistable wiring of a LIF frequency-conversion topology.

Mirrors RfConfigSnapshot: captures only the per-experiment-editable subset of a BC::LifConv::Node list — the input wiring and FINAL marker for each stage — plus the hwKey of the active LifLaser the wiring was captured against. op/harmonic order are hardware-owned and are not part of the snapshot; toNodes() joins them back in via caller-supplied callbacks (in practice backed by per-stage SettingsStorage hardware snapshots).

laserKey is provenance only: it records which laser the wiring was captured against. Applying a preset should substitute the current active laser key rather than trusting the stored one.

Public Functions

std::vector<BC::LifConv::Node> toNodes(const std::function<BC::LifConv::Op(const QString&)> &opOf, const std::function<int(const QString&)> &harmonicOf) const

Rebuild a node list from this snapshot’s wiring, joining in op/ via the supplied callbacks.

Parameters:
  • opOf – Returns the conversion operation for a given stageKey.

  • harmonicOf – Returns the harmonic order for a given stageKey.

Public Members

std::vector<BC::LifConv::StageWiring> wiring
QString laserKey

Public Static Functions

static LifConversionSnapshot fromNodes(const std::vector<BC::LifConv::Node> &nodes, const QString &laserKey)

Build a snapshot from the wiring/isFinal fields of nodes.

struct StageWiring

Per-stage wiring captured by a LifConversionSnapshot.

The input references and FINAL marker for one conversion node, keyed by the stage’s hwKey. Excludes op/ those are hardware identity / registered settings (see LifFreqConversionStage::conversionOp() and harmonicOrder()), not per-experiment wiring.

Public Members

QString stageKey
std::vector<InputRef> inputs

NHG -> 1 entry; SFG/DFG -> 2 entries.

bool isFinal = {false}