8.7 KiB
8.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:10:51.158458+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | ad177a41b5582582 |
Classes
Documentation: DTS.Storage Common Storage Types
1. Purpose
This module defines core data model types and metadata used for interacting with a proprietary database in the DTS (Data Acquisition and Test System) ecosystem. It provides strongly-typed constants for table and column names, custom exception types for access control, and reflection-based utilities for mapping .NET enum values to database-specific type strings. Its role is to decouple database schema knowledge from business logic, enabling type-safe, maintainable data access across the system.
2. Public Interface
NoDBAccessException
- Signature:
public class NoDBAccessException : Exception - Behavior: A custom exception class wrapping another exception (
ex) to indicate a database access denial or failure. It preserves the original exception’s message and inner exception.
DigitalInputSettings
- Fields:
public const string Table = "tblDigitalInputSetting";public enum Fields { ... }
Enumerates column names for thetblDigitalInputSettingtable:
SettingName,SettingMode,ScaleMultiplier,LastModified,LastModifiedBy,SensorId,UserValue1,UserValue2,UserValue3,UserTags.
DbTypeAttr
- Fields:
public string DbType { get; }– Stores the database type string.
- Methods:
public static string GetDbType(object o)– Uses reflection to retrieve theDbTypestring associated with an enum value (via itsMemberInfo). Returnsnullif no attribute is found.
DAS
- Fields:
public const string Table = "tblDAS";public enum Fields { ... }
Enumerates columns fortblDAS:
SerialNumber,Type,MaxModules,MaxMemory,MaxSampleRate,MinSampleRate,FirmwareVersion,CalDate,ProtocolVersion,LastModified,LastModifiedBy,Version,LocalOnly,LastUsed,LastUsedBy,Connection,Channels,Position,ChannelTypes,Reprogramable,Reconfigurable,IsModule.public const string TableDASChannels = "tblDASChannels";public enum DASChannelFields { ... }
Enumerates columns fortblDASChannels:
HardwareId,ChannelIdx,SupportedBridges,SupportedExcitations,DASDisplayOrder,LocalOnly,SupportedDigitalInputModes,SupportedSquibFireModes,SupportedDigitalOutputModes,ModuleSerialNumber,ModuleArrayIndex.- Prototype Constants:
A large set ofpublic const stringvalues representing known DAS hardware prototypes (e.g.,"SLICE1 Prototype","G5 VDS Prototype","SLICE PRO Lab TOM"). Used for identifying device types.
MMETables
- Fields:
public const string MyType = "MyType";
Legacy table name (used up to version 1.3.496), superseded byCustomChannelType.public const string CustomChannelType = "CustomChannelType";
Intermediate table name (versions 1.3.498–1.3.515), superseded by"TYPE".public const string Id = "Id";
Legacy column name (up to 1.3.515), superseded by"ID".- Table Names & Field Enums:
MMEPossibleChannelsTable = "tblMMEPossibleChannels"
MMEPossibleChannelsFieldsenum with fields likeID,TYPE,TEST_OBJECT,POSITION,PHYSICAL_DIMENSION,DIRECTION,DEFAULT_FILTER_CLASS,TEXT_L1,TEXT_L2,VERSION,DATE,REMARKS,EXPIRED,SORTKEY,PICTURE_SHORTNAME,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY.
Several fields are annotated with[CustomChannelFieldSize(n)](not defined in this file—likely elsewhere).MMEDirectionsTable = "tblMMEDirections"
MMEDirectionsFieldsenum:s_GUID,DIRECTION,TEXT_L1,TEXT_L2,DATE,VERSION,EXPIRED,REMARKS,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY,SORTKEY.MMEFilterClassesTable = "tblMMEFilterClasses"
MMEFilterClassesFieldsenum:s_GUID,FILTER_CLASS,TEXT_L1,TEXT_L2,VERSION,DATE,REMARKS,EXPIRED,SORTKEY,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY.MMEFineLocations1Table,MMEFineLocations2Table,MMEFineLocations3Table
Corresponding enums withs_GUID, location field (FINE_LOC_1/2/3),TEXT_L1,TEXT_L2,VERSION,DATE,REMARKS,EXPIRED,SORTKEY,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY.MMEPhysicalDimensions = "tblMMEPhysicalDimensions"
MMEPhysicalDimensionFieldsenum includess_GUID,PHYSICAL_DIMENSION,TEXT_L1,TEXT_L2,DEFAULT_UNIT, dimensional exponents (LENGTH_EXP,TIME_EXP, etc.),VERSION,DATE,REMARKS,EXPIRED,SORTKEY,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY.MMEPositionsTable = "tblMMEPositions"
MMEPositionsFieldsenum:s_GUID,POSITION,TEXT_L1,TEXT_L2,VERSION,DATE,REMARKS,EXPIRED,SORTKEY,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY.MMETestObjectsTable = "tblMMETestObjects"
MMETestObjectsFieldsenum:s_GUID,TEST_OBJECT,TEXT_L1,TEXT_L2,VERSION,DATE,REMARKS,EXPIRED,SORTKEY,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY.MMEMainLocationTable = "tblMMEMainLocations"
MMEMainLocationsFieldsenum:s_GUID,TYPE,TRANS_MAIN_LOC,TEXT_L1,TEXT_L2,VERSION,DATE,REMARKS,EXPIRED,SORTKEY,PICTURE_SHORTNAME,LAST_CHANGE,LAST_CHANGE_TEXT,HISTORY.
Note
:
[CustomChannelFieldSize(n)]is referenced inMMETablesbut not defined in the provided source files. Its definition is unknown.
3. Invariants
DbTypeAttr.GetDbTypebehavior:- Only inspects the first member info (
mi[0]) returned byGetType().GetMember(o.ToString()). - Returns
nullif the object isnull, no member is found, or noDbTypeAttris applied to the enum value. - Assumes the enum value’s name matches a member name on its type (standard for
enum.ToString()).
- Only inspects the first member info (
- Table/column naming:
- Table names are hardcoded string constants (e.g.,
"tblDAS","tblMMEPossibleChannels"). - Field names in enums map directly to database column names (e.g.,
DAS.Fields.SerialNumber→"SerialNumber").
- Table names are hardcoded string constants (e.g.,
- Versioning semantics:
MyType,CustomChannelType, andIdare explicitly marked as legacy. Their usage is version-gated in the system (not enforced in this module).
- Prototype constants:
- All prototype names are exact string literals; no normalization or canonicalization is performed in this module.
4. Dependencies
- Dependencies of this module:
System(forException,Attribute,MemberInfo,Reflection).- No external libraries beyond .NET Framework base types.
- Dependencies on this module:
- Any module performing database access using these schema constants (e.g., data access layers, configuration tools, migration scripts).
- Code that uses
DbTypeAttrfor dynamic SQL generation or type mapping. - Modules handling DAS device metadata (e.g., device discovery, configuration, calibration).
- Modules managing MME (likely "Measurement Model Exchange") metadata (e.g., channel definition, test setup, reporting).
5. Gotchas
[CustomChannelFieldSize]is undefined here:
TheMMETablesenum uses[CustomChannelFieldSize(n)]attributes, but this attribute type is not defined in the provided source. Its behavior and usage are unknown.DbTypeAttr.GetDbTypeis fragile:
Relies onGetMember(o.ToString()), which may fail or return unexpected results if enum values have custom names or if reflection is blocked (e.g., in some AOT or security contexts).- Legacy table/column names are not handled programmatically:
MyType,CustomChannelType, andIdare documented as historical, but no runtime logic is present to select the correct name based on version. Consumers must manage version compatibility themselves. - Prototype strings are magic:
AllPROTOTYPEconstants are raw strings. No validation or enum-based safety prevents typos or mismatches in device type identification. - No validation in
NoDBAccessException:
The constructor accepts anyException, includingnull(thoughex.Messagewould throw ifexisnull). This may lead toNullReferenceExceptionat construction time if misused. - Case sensitivity:
Enum field names (e.g.,IDvsId) are used verbatim. Ensure database column names match exactly (case-sensitive in some DBMSs).