WaveformLibrary#
- class WaveformLibrary#
Bases:
MmParameterWaveformLibrarystores serializedWaveformobjects and their parameters.Each row represents a waveform template associated with a
WaveformListID, the waveformType(class name),SamplingRate, JSON-encodedParametertable describing named parameters, and optional modulation links referencing entries inWaveformListLibrary.Schema (columns, types, defaults):
Column
Type
Default
WaveformListID
int64
1
Type
string
ConstantWave
SamplingRate
double
1000
Parameter
table
None
AmplitudeModulation
double
0
FrequencyModulation
double
0
PhaseModulation
double
0
Foreign keys:
WaveformListID→WaveformListLibrary(ID)
Join conditions:
(none; view
WaveformParametersis created for JSON expansion)Flags:
Property
Value
IsIncludeDefaultEntry
false
IsFirstColumnUnique
false
IsTriggerJoinOnRight
false
IsTriggerJoinOnLeft
false
- Constructor Summary
- WaveformLibrary()#
- Method Summary
- checkVariableBound(varID)#
Return dependent waveform lists for a given variable ID.
Scans
ParameterJSON for occurrences ofVariableIDand returns uniqueWaveformListIDvalues that reference it.- Parameters:
varID (
double) – Target variable ID- Returns:
Dependent
WaveformListIDvalues- Return type:
double or []
- createView()#
Create the SQLite view used to expand JSON parameters per row.
Creates/ensures the
WaveformParametersview which flattens the JSON-encodedParametercolumn into a rowset with columnsID(pointing to this table),Name,VariableID, andDefaultValue. Idempotent: only creates the view if it does not already exist. Used byreadParameter()to join withVariableListand resolve current values.
- defineSchema()#
- loadEntry(id)#
Instantiate a
Waveformobject from a database row.Calls
readParameter()and constructs the waveform class with parameter assignment, resolving optional modulation lists fromWaveformListLibrary.- Parameters:
id (
double) – Row ID to load- Returns:
Waveform instance populated from the database
- Return type:
- readParameter(id)#
Read waveform parameters with variable resolution.
Returns a struct combining base waveform fields with a parameter table where variable links are resolved against
VariableList.- Parameters:
id (
double) – Row ID- Returns:
Struct with fields
Type,SamplingRate, modulation IDs, and aParametertable containing columnsName,DefaultValue,VariableID,Value.- Return type:
struct