11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T04:56:56.352649+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 8e151bb0bac120f4 |
DatabaseExport
Documentation: DatabaseExport Module (Version 57)
1. Purpose
This module provides data structures and serialization utilities for exporting and managing test configuration data in Version 57 of the database schema. It defines core channel types (DASChannel, DASOutputChannel, DigitalOutputDASChannel, OutputSquibChannel, OutputTOMDigitalChannel) used to represent hardware I/O configurations, along with supporting classes for custom channels (CustomChannel, CustomChannelList), serialized application settings (SerializedSettings), and graph configuration (TestGraph). The module enables persistence of user-defined test setups—including channel assignments, thresholds, and hardware-specific modes—by mapping them to database-compatible formats (e.g., SQL string encodings for thresholds and channel lists). It serves as a legacy compatibility layer for older database versions, preserving backward compatibility with prior schema definitions.
2. Public Interface
DASChannel
- Type:
class - Attributes:
[Serializable] - Description: Base class for all DAS (Data Acquisition System) channels. No public members defined.
OutputDASChannel : DASChannel
- Type:
class - Attributes:
[Serializable] - Description: Base class for output channels.
DigitalOutputDASChannel : OutputDASChannel
- Type:
class - Attributes:
[Serializable] - Description: Represents a digital output channel.
OutputTOMDigitalChannel : DigitalOutputDASChannel
- Type:
class - Attributes:
[Serializable] - Description: Base class for SQUIB digital output channels.
- Nested Enum:
DigitalOutputModeNONE = 0FVLH = 1 << 0(5V, low-to-high transition)FVHL = 1 << 1(5V, high-to-low transition)CCNO = 1 << 2(contact closure, normally open)CCNC = 1 << 3(contact closure, normally closed)
OutputSquibChannel
- Type:
class - Attributes:
[Serializable()] - Description: Base class for SQUIB output channels.
- Nested Enums:
SquibFireModeNONE = 1 << 0CAP = 1 << 1(capacitor discharge)CONSTANT = 1 << 2(constant current discharge)AC = 1 << 3(AC discharge)
SquibMeasurementTypeNONE = 0CURRENT = 1 << 0INIT_SIGNAL = 1 << 1VOLTAGE = 1 << 2
SerializedSettings
- Type:
sealed class - Nested Enum:
Keys
Contains 120+ static string-based keys for global settings (e.g.,ExportINIFile,DefaultIsoChannelSensorCompatibilityLevel,RealtimeSampleRates,SLICE6_PowerSetting,SPSINDEX_0throughSPSINDEX_23, etc.). - Public Properties (selected examples):
ExportINIFile:string
Gets/sets the path to the export INI file (default:""). UsesSettingsDB.GetGlobalValue/SetGlobalValue.IsoChannelSensorCompatibilityLevel:IsoChannelSensorCompatibilityLevels
Gets/sets the default compatibility level for ISO channels (default:Warn). Parses from string viaSettingsDB.TestSetupAutomaticMode:bool
Gets/sets whether Test Setup defaults to automatic mode (default:false).TestSetupDefaultCommonStatusLine:bool
Gets/sets whether to show a common status line in Test Setup (default:true).TestSetupAutomaticProgressDelayMS:int
Gets/sets delay (ms) before automatic progress in Test Setup (default:0).ISOSupportLevel:ISOSupportLevels
Gets/sets ISO support mode (default:ISO_ONLY). Enum values:ISO_ONLYTRANSITORYNO_ISO
CustomChannel : IComparable<CustomChannel>
- Type:
class - Description: Wrapper for
MMEPossibleChannelsto support user-defined (non-ISO13499) channels. Mirrors database tables without modifying the core ISO schema. - Properties:
Channel:MMEPossibleChannels(read-only)TestObject,Position,MainLocation,FinLoc1,FinLoc2,FinLoc3,PhysicalDimension,Direction,FilterClass:
Getters/setters that propagate changes toChannelviaSet_*methods (e.g.,Channel.Set_Test_Object(...)).Text1:string→Channel.Text_L1Remarks:string→Channel.Remarks
- Methods:
CustomChannel(MMEPossibleChannels channel, bool newChannel = true)
Constructor initializes backing fields fromISO13499FileDb.IsoDb, catchingExpiredISOFieldExceptionin_expiredErrors.CompareTo(CustomChannel other):int
Compares byText1(ordinal string comparison).GetValues():Dictionary<string, string>
Returns all channel fields as key-value pairs (keys:DbOperations.MMETables.MMEPossibleChannelsFields.*enum names; values: string representations).
CustomChannelList
- Type:
class - Description: Singleton list of all custom channels loaded from
ISO13499FileDb.IsoDb. - Properties:
List:CustomChannelList(static, thread-safe singleton)AllChannels:CustomChannel[]
Returns all channels (lazy-loaded viaPopulateChannelsIfNecessary()).
- Methods:
PopulateChannelsIfNecessary():void
Loads channels fromISO13499FileDb.IsoDb.GetSQLPossibleChannels(), wraps each inCustomChannel, sorts byText1.
TestGraph
- Type:
class - Description: Represents a test graph configuration, including channels, thresholds, and axis ranges.
- Constants:
SEPARATOR = "§"CURRENT_SUFFIX = "_CU"
- Properties:
GraphName,GraphDescription:stringUseDomainMin/Max,DomainMin/Max,UseRangeMin/Max,RangeMin/Max:bool/doubleThresholds:double[]Channels:TestObjectChannel[]
Returns channels currently assigned to the graph (filtered by presence in_groups/_addedGroups).AvailableChannels:TestObjectChannel[]
Returns all channels available for assignment (from_groups/_addedGroups, including SQUIB Current/Voltage variants).
- Methods:
GetThresholdsSQL():string
Encodes thresholds as{(t1)§(t2)§...}.SetThresholdsFromSQL(string sThresholds):void
Parses{(t1)§(t2)§...}into_thresholds.GetChannelsForSQL():string
Encodes channel IDs as{(id1)§(id2)§...}after resolving channel IDs (handles SQUIB Current suffix_CU).SetChannelsFromSQL(string sChannels):void
Parses channel IDs and populates_channelsviaAddChannel.GetTestGraphKey(TestObjectChannel ch):string
Generates key:<Serial>_<Name>_<Type>; appends_CUfor SQUIB Current channels.
3. Invariants
- Channel Serialization:
- Thresholds and channel lists are encoded as SQL-compatible strings using
{...}delimiters and§separators. - SQUIB Current channels are uniquely identified by appending
"_CU"to their graph key (seeGetTestGraphKey).
- Thresholds and channel lists are encoded as SQL-compatible strings using
- CustomChannel Consistency:
- Setting any property (e.g.,
TestObject,Position) immediately propagates the value to the underlyingChannelobject viaSet_*methods. CustomChannelinstances are compared only byText1(ordinal comparison).
- Setting any property (e.g.,
- Singleton Safety:
CustomChannelList.Listuses double-checked locking (lock(MyLock)) for thread-safe initialization.
- Settings Persistence:
- All
SerializedSettingsproperties delegate toSettingsDB.GetGlobalValue*/SetGlobalValue*methods (e.g.,GetGlobalValueBool,SetGlobalValueInt). - Enum properties fall back to defaults on parse failure.
- All
4. Dependencies
Internal Dependencies
ISO13499FileDb.IsoDb: Used byCustomChannelto resolve ISO fields (e.g.,GetMainLocationByIso,GetFilterClassByIso).DbOperations.MMETables.*: Enumerations for field names (e.g.,MMEPossibleChannelsFields.ID).Test.Module.Channel.Sensor.BridgeType: Used inTestGraph.AddChannelsto detect SQUIB sensors (BridgeType.SQUIB).SensorsCollection.SensorsList: Used inTestGraphto retrieve sensor metadata (e.g.,IsDigitalOutput(),Bridgetype).SettingsDB: Static class for global settings persistence (used bySerializedSettings).TestTemplate,TestTestObject,TestObjectChannel: Referenced but not defined in these files (assumed to be in other modules).
External Dependencies
System(core types:SerializableAttribute,Enum,string,List<T>,Dictionary<TKey,TValue>,CultureInfo,StringBuilder,Linq).
Dependents
- Likely consumed by:
- Database export/import logic (e.g., saving/loading test setups).
- Test Setup UI (for channel assignment, graph configuration).
- Settings persistence layer (e.g.,
SerializedSettingsusage).
5. Gotchas
- SQUIB Channel Handling:
TestGraphdynamically adds SQUIB Current and Voltage channels toAvailableChannelsif not already present. The Current variant is uniquely keyed with"_CU"suffix.ContainsCurrentChannelchecks for"_CU"suffix, butContainsVoltageChanneldoes not—this asymmetry may cause issues if Voltage channels are later renamed or re-keyed.
- Channel ID Resolution:
GetChannelsForSQL()refreshes_channelsby resolving againstAvailableChannels(to handle ID changes post-creation). This may silently drop channels if their keys no longer resolve.
CustomChannelConstructor:MMEPossibleChannelsis copied ifnewChannel == true(vianew MMEPossibleChannels(channel)), but shared otherwise. This could lead to unintended side effects if the originalchannelis mutated.ExpiredISOFieldExceptionis caught and stored in_expiredErrors, but this list is not exposed—consumers cannot detect or handle expired fields.
- Settings Parsing:
SerializedSettingsproperties useEnum.TryParsewith fallback to defaults. If the stored string is invalid (e.g.,"UNKNOWN"), the default is used silently—no logging or error is raised.
- Hardcoded Delimiters:
TestGraphuses"§"as a separator. If this character appears in channel IDs or threshold values, parsing will break.
- Missing Type Safety:
- Thresholds are hardcoded as
doubleinSetThresholdsFromSQL, but the comment notes future extensibility. No validation ensures only doubles are stored.
- Thresholds are hardcoded as
CustomChannelListInitialization:_dictChannels(commented out) suggests a previous attempt to cache by ISO code. Its removal may impact performance if lookups by ISO code are frequent.
None identified from source alone.
(Note: The above "gotchas" are inferred from code structure and behavior—not external documentation.)