HardwareSetting#
- class HardwareSetting#
Bases:
MmParameterHardwareSettingstores per-hardware per-channel settings and bindings.Each row identifies a hardware device (
HardwareID), a channel (ChannelNumber), a settingName, and its value. Values can be provided either as a literalDefaultValue(stored as TEXT) or by referencing aVariableListentry viaVariableID, in which case the effective value will be resolved dynamically.Schema (columns, types, defaults):
Column
Type
Default
HardwareID
int64
1
ChannelNumber
int64
1
Name
string
Memory
Type
string
double
DefaultValue
string
1000
VariableID
int64
0
Foreign keys:
HardwareID→HardwareList(ID)
Join conditions:
(none)
Flags:
Property
Value
IsIncludeDefaultEntry
false
IsFirstColumnUnique
false
IsTriggerJoinOnRight
false
IsTriggerJoinOnLeft
false
- Constructor Summary
- HardwareSetting()#
- Method Summary
- defineSchema()#
- readSetting(hwId)#
Read effective values for all settings of a hardware device.
Returns a table with columns
Name,ChannelNumber,VariableID,ValuewhereValueis resolved fromVariableListwhenVariableID!= 0, otherwise equalsDefaultValuecast to its declared type.
- readSettingID(hwId, settingName, channelNumber)#
Read the row ID for a specific hardware setting and channel.
- Returns:
Row ID (0 if not found)
- Return type:
double
- readSettingValue(hwId, settingName, channelNumber)#
Read the literal default value for a hardware setting.
- Returns:
DefaultValue (TEXT); caller may cast based on type
- Return type:
string
- readSettingVariable(hwId, settingName, channelNumber)#
Read the bound variable ID for a hardware setting.
- Returns:
Variable ID (0 if not bound)
- Return type:
double
- updateSettingValue(hwId, settingName, value, channelNumber)#
Upsert a literal default value for a hardware setting.
- Parameters:
hwId (
double) – Hardware IDsettingName (
string) – Setting name (e.g.,"SamplingRate")value (
string or numeric) – New literal value (stored as TEXT)channelNumber (
double, optional) – Channel index (1-based)
- updateSettingVariable(hwId, settingName, varNameOrId, channelNumber)#
Bind a hardware setting to a variable.
- Parameters:
hwId (
double) – Hardware IDsettingName (
string) – Setting namevarNameOrId (
double or string) – VariableIDor variableNamechannelNumber (
double, optional) – Channel index (1-based)