16 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T04:57:15.551651+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 8139d487746881b8 |
Documentation: DatabaseExport.ISO Module (Version 57)
1. Purpose
This module provides data models and utility classes for exporting test data to ISO-compliant formats, specifically targeting legacy database schema version 57. It serves as a bridge between internal data structures and standardized export formats by encapsulating database row mappings, ISO code construction logic, and metadata handling. The module supports template-based channel definitions, calculated values, level triggers, hardware configuration, and customer/test engineer metadata—enabling consistent serialization and deserialization of test setup information for interoperability with external systems.
2. Public Interface
AbstractOLEDbWrapper
GetLong(IDataReader reader, string field)
Safely extracts alongvalue from anIDataReader. Returnslong.MinValueif the field value isDBNull.Value.GetDate(IDataReader reader, string field)
Safely extracts aDateTimevalue from anIDataReader. ReturnsDateTime.MinValueif the field value isDBNull.Value.
TemplateZone
- Constructor
TemplateZone(string template, string name, string picture, string description)
Initializes a new zone with explicit values. - Constructor
TemplateZone(DataRow dr)
Initializes from a database row. SetsZoneNameto"Default zone"ifZoneNameisDBNull.Value; setsDescriptionto""ifZoneDescriptionisDBNull.Value; populatesTemplateRegionsviaTemplateRegion.GetAllRegions(). - Properties
TemplateName(read-only)ZoneName(read-only, defaults to"")Picture(read-write)Description(read-only, defaults to"")TemplateRegions(read-write array ofTemplateRegion)
TestObjectChannel
GetGraphID()
ReturnsGetId() + "_CU"ifSquibChannelType == SquibChannelTypes.Current; otherwise returnsGetId().GetId()
ReturnsGetIdWithSpecificChannelId(Channel.Id).GetIdWithSpecificChannelId(long id)
Returns formatted string:"{SerialNumber}_{MMEChannelType}_{id}".GetID()/GetIDWithSpecificChannelId(long id)
Alias methods identical toGetId()/GetIdWithSpecificChannelId(long id).CompareTo(TestObjectChannel right)
Compares byDisplayOrder, thenName, thenTestObject.SerialNumberOrOriginalSerialNumber(if both non-null). Returns1ifright == null.- Properties
SquibChannelType(SquibChannelTypesenum:None,Voltage,Current)SensorSerialNumber(read-write string, default"")HardwareId(read-write string; setter normalizes format: splits on'_', keeps first two tokens, and appends everything from first'x'in third token)TestObject(read-onlyISO.TestObject)ChannelIDX(read-writeint, initialized toCHANNEL_IDX_UNKNOWN = -1)
CalculatedValueClass
- Constructor
CalculatedValueClass(DataRow dr)
Populates properties fromDbOperations.CalculatedChannels.Fieldsenum values. SkipsDBNull.Valuefields. - Properties
Id(int, default-1)Operation(Operationsenum:SUM,AVERAGE,IRTRACC3D,IRTRACC3D_ABDOMEN,IRTRACC3D_LOWERTHORAX; defaultSUM)CalculatedValueCode(string, default"???????????????X")InputChannelIds(string[])InputChannelIdsBlob(byte[]):- Getter joins
InputChannelIdswithCultureInfo.InvariantCulture.TextInfo.ListSeparator, encodes to UTF-8. - Setter decodes UTF-8, splits by list separator, populates
_inputChannelIds.
- Getter joins
CFCForInputChannels(string, default"")ChannelFilterClassForOutput(string, default"")TestSetupName(string)Name(string)
ISOHardwareChannel
- Constructor
ISOHardwareChannel(ISOHardwareChannel copy, Hardware h)
Deep-copies configuration fromcopy, assignsParentDAS = h. - Constructor
ISOHardwareChannel(DataRow dr, Hardware hardware)
Populates fromDbOperations.DAS.DASChannelFieldsenum values. ThrowsNotSupportedExceptionfor unknown fields. - Static Method
PhysicalCompare(ISOHardwareChannel left, ISOHardwareChannel right)
Compares byChannelIdx. Returns-1/0/1for null checks. - Properties
ParentDAS(Hardware)SupportedBridges,SupportedSquibFireModes,SupportedExcitations,SupportedDigitalInputModes,SupportedDigitalOutputModes(int, defaults12,16,16,16,16)ChannelIdx,DASDisplayOrder(int)ModuleSerialNumber(string, default"")ModuleArrayIndex(int, default0)LocalOnly(bool, defaultfalse)
TemplateRegion
- Constructor
TemplateRegion(string templateName, string zoneName, bool bLocalOnly)
Initializes with explicit values. - Constructor
TemplateRegion(DataRow dr)
Populates all fields from database row, including coordinate points (UpperLeft,LowerRight). - Static Method
GetAllRegions(string templateName, string zoneName)
QueriestblTemplateRegionsviaDbOperations, returns array ofTemplateRegion. Silently ignores exceptions. - Properties
TemplateName,TemplateZone(read-only)RegionNumber,RegionName,RegionDescription,TestObject,Position,MainLocation,FineLocation1-3,PhysicalDimension,Direction,FilterClass(string)LocalOnly(read-onlybool)UpperLeft,LowerRight(System.Drawing.Point)
LevelTriggerChannel
- Constructor
LevelTriggerChannel(LevelTriggerChannel copy)
Deep-copies all properties. - Constructor
LevelTriggerChannel(DataRow dr)
Populates fromDbOperations.LevelTriggers.Fieldsenum values. Silently ignores exceptions. - Properties
TestSetupName,GroupSerialNumber,TestObjectChannelId,HardwareChannelId,SensorSerialNumber(string, defaults"")GreaterThanEnabled,LessThanEnabled(bool, defaultstrue,false)GreaterThanThresholdEU,LessThanThresholdEU(double, defaults0D)TriggerBetweenBounds,TriggerOutsideBounds(bool, defaultsfalse)InsideUpperLevelEU,InsideLowerLevelEU,OutsideUpperLevelEU,OutsideLowerLevelEU(double, defaults0D)
MMEFigures
- Constructor
MMEFigures(...)
Initializes all fields explicitly. - Static Method
GetFigures()
QueriesMMEFIGUREStable viaDbOperations.GetISOCommand(), returns array ofMMEFigures. Silently ignores exceptions during row processing. - Properties
ID,IntAuthor,IntVersion(long)TxtShortName,TxtDescription,TxtRemarks,TxtImageFile,TxtSortKey,TxtPath,Last_Change_Text,History(string)DatRevision,Last_Change(DateTime)IntPage,IntPages(ushort)BolExpired(bool)BitStdPath(bool)IntIDStdPath(long)
TestSetting & TestSettingDictionary
TestSetting- Constructor
TestSetting(string id, string value, string defaultValue) ToSerializeString()
Returns"id=value"with=replaced by"_x_"in both fields.- Static
TryParse(string s, out TestSetting ts)
Parses"id=value"format (reverses"_x_"→"="). Returnsfalseif parsing fails.
- Constructor
TestSettingDictionaryGetValue(string ID, string defaultValue)
Returns_lookup[ID].Valueif exists and non-null; otherwise_lookup[ID].DefaultValue; otherwisedefaultValue.SetValue(TestSetting setting, string value)
Replaces entry forsetting.Idwith newTestSetting(preservesId,DefaultValue, setsValue = value).SetValue(TestSetting setting)
Adds/updates entry withsetting.SetValue(string id, string value)
Adds new entry or updatesValueif key exists.ToSerializeString()/LoadSettings(string s)
Serializes/deserializes settings using"id=value"pairs separated byCultureInfo.InvariantCulture.TextInfo.ListSeparator, with internal"_X_"escaping.
TestEngineerDetails
- Constructor
TestEngineerDetails(DataRow dr)
Populates fromtblTestEngineerDetailsrow. - Static Method
GetAllTestEngineerDetails()
QueriestblTestEngineerDetails, returns array. Silently ignores exceptions. - Properties
Name,TestEngineerName,TestEngineerPhone,TestEngineerFax,TestEngineerEmail(string; setters ignore empty strings for engineer fields)LocalOnly(bool)LastModified(DateTime)LastModifiedBy(string)Version(int, default1)GetValues()
ReturnsDictionary<string, string>of all fields.
TestObjectMetaData & TestSetupMetaData
TestObjectMetaData- Constructor
TestObjectMetaData(char testobject)
Initializes properties fromFields,CommentFields,OptionFieldsenums. SetsNOVALUEdefaults (exceptVelocityOfTestObject,MassOfTestObject→""). - Properties
Version(double, default1.06)NOVALUE = "NOVALUE"TestObject(char, default'?')Properties(MetaData[])
- Constructor
TestSetupMetaData- Constructor
TestSetupMetaData(bool requireXCrashCompatibilityForISOExports)
Initializes properties fromFieldsenum. SetsNOVALUEor""based onrequireXCrashCompatibilityForISOExports. SetProperty(MetaData meta, bool requireXCrashCompatibilityForISOExports)
OverridesNOVALUE→""for specific fields ifrequireXCrashCompatibilityForISOExportsistrue.- Properties
Version(double, default1.06)NOVALUE = "NOVALUE",MEDIADEFAULT = "1/1"TestObject = '_'Properties(MetaData[])
- Constructor
MetaData- Constructor
MetaData(string name, bool optional, string value, double version) - Properties
Name,Value(string)IsOptional,Version(bool,double)
- Constructor
IsoCode
- Constructor
IsoCode(string isoCode)
Normalizes input to 16 characters (truncates or pads with'?'). - Static Methods
GetString(MMEPossibleChannels, MMETestObjects, MMEPositions, MMEFilterClasses)
Constructs 16-char ISO code from components. Uses'?'for null inputs.GetString(MMEPossibleChannels, bool careAboutTestTimeFields)
Same as above, but masksTestObjectandFilterClassto'?'ifcareAboutTestTimeFields == false.GetString(string testObject, string position, string main, string floc1, string floc2, string floc3, string physdim, string dir, string fc)
Concatenates inputs into 16-char code (no padding/truncation).
- Properties
TestObject,Position,MainLocation,FineLocation1-3,PhysicalDimension,Direction,FilterClass(read-writestring; setters enforce 1-char/4-char/2-char constraints)StringRepresentation(string):- Getter: returns full 16-char code.
- Setter: pads with
'0'if shorter than 16.
CustomerDetails
- Constructor
CustomerDetails(DataRow dr)
Populates fromtblCustomerDetailsrow. - Static Method
GetAllCustomerDetails()
QueriestblCustomerDetails, returns array. Silently ignores exceptions. - Properties
Name,CustomerName,CustomerTestRefNumber(string)ProjectRefNumber,CustomerOrderNumber,CustomerCostUnit(string; setters ignore empty strings)LocalOnly(bool)LastModified(DateTime)LastModifiedBy(string)Version(int, default1)GetValues()
ReturnsDictionary<string, string>of all fields.
3. Invariants
-
AbstractOLEDbWrapper:GetLongnever throws onDBNull; returnslong.MinValue.GetDatenever throws onDBNull; returnsDateTime.MinValue.
-
TemplateZone:ZoneNamedefaults to"Default zone"only ifDBNull.Valuein DB row; otherwise preserved.Descriptiondefaults to""ifDBNull.Valuein DB row.
-
TestObjectChannel:HardwareIdsetter enforces format: splits on'_', expects 3 tokens, and reassembles first two tokens + suffix from third token after first'x'.CompareTousesDisplayOrderas primary key;Nameas secondary;SerialNumberOrOriginalSerialNumberas tertiary (if both non-null).
-
CalculatedValueClass:InputChannelIdsBlobgetter/setter usesCultureInfo.InvariantCulture.TextInfo.ListSeparator(typically','), not locale-specific.CalculatedValueCodedefaults to"???????????????X"(15 chars +'X').
-
IsoCode:StringRepresentationsetter pads with'0'if input < 16 chars.- All individual properties enforce fixed widths:
TestObject,Position,Direction,FilterClass: 1 charMainLocation: 4 charsFineLocation1-3: 2 chars eachPhysicalDimension: 2 chars
- Total length always 16 characters.
-
TestSettingDictionary:ToSerializeStringescapesListSeparator→"_X_"in serialized values.LoadSettingspreserves existing default settings; only updatesValueif key exists.
4. Dependencies
Internal Dependencies
DbOperations(referenced viaDbOperations.GetCommand(),DbOperations.GetISOCommand(),DbOperations.CreateParam(),DbOperations.Connection.QueryDataSet()):
Provides database access utilities (SQL command creation, parameterization, query execution).ISO.TestObject(used inTestObjectChannel.TestObject):
Referenced but not defined in provided files.ISO.TestObjectTemplate(used inTestObjectChannelconstructor):
Referenced but not defined in provided files.Hardware(used inISOHardwareChannel.ParentDAS):
Referenced but not defined in provided files.MMEPossibleChannels,MMETestObjects,MMEPositions,MMEFilterClasses(used inIsoCode.GetString):
Referenced but not defined in provided files.
External Dependencies
System.Data(System.Data.OleDb,System.Data.SqlClient):
Used forIDataReader,DataRow,SqlDbType,OleDbCommand.System.Text:
Used forStringBuilder,Encoding.UTF8.System.Drawing:
Used forSystem.Drawing.PointinTemplateRegion.UpperLeft/LowerRight.System.Globalization:
Used forCultureInfo.InvariantCulture.TextInfo.ListSeparator.
Inferred Usage
TemplateRegion.GetAllRegions()andTestEngineerDetails.GetAllTestEngineerDetails()/CustomerDetails.GetAllCustomerDetails()imply database persistence layer.TestSettingDictionaryserialization suggests configuration storage/retrieval (e.g., XML, DB).CalculatedValueClassandLevelTriggerChannelimply integration with channel processing logic.
5. Gotchas
-
AbstractOLEDbWrapper.GetDate:
ReturnsDateTime.MinValueforDBNull, which may be ambiguous ifDateTime.MinValueis a valid value in the domain. Consider usingDateTime?or sentinel values. -
TestObjectChannel.HardwareIdsetter:
Mutates input by stripping characters after first'x'in the third token. This may cause data loss if'x'appears elsewhere in the hardware ID. -
CalculatedValueClass.InputChannelIdsBlob:
Uses `