Files
DP44/docs/ai/DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO.md
2026-04-17 14:55:32 -04:00

18 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/TemplateZone.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/CalculatedValueClass.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/LevelTriggerChannel.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/TestObjectChannel.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/TemplateRegion.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/IsoCode.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/TestEngineerDetails.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/TestSetting.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/HardwareChannel.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/TestObjectMetaData.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/CustomerDetails.cs
DataPRO/Modules/DatabaseImporter/DatabaseImport/ISO/LabratoryDetails.cs
2026-04-17T15:45:33.440998+00:00 zai-org/GLM-5-FP8 1 b4d75a90ad9bddba

DatabaseImport.ISO Module Documentation

1. Purpose

This module provides data entity classes for the DatabaseImport system, representing domain objects used in crash test data management according to ISO standards. It handles template definitions (zones, regions), channel configurations (test object channels, hardware channels, calculated values, level triggers), metadata management (test objects, test setups, engineer/lab/customer details), and ISO code generation for channel identification. These entities serve as DTOs (Data Transfer Objects) that map directly to database rows and support serialization for persistence and interchange.


2. Public Interface

TemplateZone

public class TemplateZone

Represents a zone within a test template containing regions.

Constructors:

  • TemplateZone(string template, string name, string picture, string description) — Initializes with explicit values.
  • TemplateZone(DataRow dr) — Initializes from a database row; automatically loads TemplateRegions via TemplateRegion.GetAllRegions().

Properties:

  • string TemplateName { get; } — Read-only template identifier.
  • string ZoneName { get; } — Zone name; defaults to "Default zone" if DBNull.
  • string Picture { get; set; } — Picture path/identifier.
  • string Description { get; } — Zone description; defaults to empty string if DBNull.
  • TemplateRegion[] TemplateRegions { get; set; } — Array of regions; setter clears and repopulates internal list.

TemplateRegion

public class TemplateRegion

Represents a region within a template zone with location and positioning data.

Constructors:

  • TemplateRegion(string templateName, string zoneName, bool bLocalOnly) — Initializes with template/zone names and local-only flag.
  • TemplateRegion(DataRow dr) — Initializes from a database row.

Properties:

  • string TemplateName { get; }, string TemplateZone { get; } — Parent identifiers.
  • int RegionNumber { get; set; }, string RegionName { get; set; }, string RegionDescription { get; set; } — Region identification.
  • string TestObject { get; set; }, string Position { get; set; } — Association data.
  • string MainLocation { get; set; }, string FineLocation1/2/3 { get; set; } — Location hierarchy.
  • string PhysicalDimension { get; set; }, string Direction { get; set; }, string FilterClass { get; set; } — Physical properties.
  • bool LocalOnly { get; } — Whether region is local-only.
  • System.Drawing.Point UpperLeft { get; set; }, LowerRight { get; set; } — Bounding coordinates.

Static Methods:

  • internal static TemplateRegion[] GetAllRegions(string templateName, string zoneName) — Retrieves all regions from database via stored procedure sp_TemplateRegionsGet.

CalculatedValueClass

public class CalculatedValueClass

Represents a calculated/derived channel (sums, averages, IRTRACC calculations).

Constructor:

  • CalculatedValueClass(DataRow dr) — Initializes from database row using DbOperations.CalculatedChannels.Fields enum.

Properties:

  • int Id { get; set; } — Defaults to -1.
  • Operations Operation { get; set; } — Calculation type; defaults to Operations.SUM.
  • string CalculatedValueCode { get; set; } — Defaults to "???????????????X".
  • string[] InputChannelIds { get; set; } — Input channel identifiers.
  • byte[] InputChannelIdsBlob { get; set; } — UTF-8 encoded, list-separator-delimited blob of channel IDs.
  • string CFCForInputChannels { get; set; }, string ChannelFilterClassForOutput { get; set; } — Filter classes.
  • string TestSetupName { get; set; }, string Name { get; set; } — Identification.

Nested Enum:

  • OperationsSUM = 1, AVERAGE = 2, IRTRACC3D = 3, IRTRACC3D_ABDOMEN = 4, IRTRACC3D_LOWERTHORAX = 5.

LevelTriggerChannel

public class LevelTriggerChannel

Stores level trigger threshold configuration for a channel.

Constructors:

  • LevelTriggerChannel(LevelTriggerChannel copy) — Copy constructor.
  • LevelTriggerChannel(DataRow dr) — Initializes from database row using DbOperations.LevelTriggers.Fields.

Properties:

  • string TestSetupName, string GroupSerialNumber, string TestObjectChannelId, string HardwareChannelId, string SensorSerialNumber — Association identifiers.
  • bool GreaterThanEnabled { get; set; } — Defaults to true.
  • double GreaterThanThresholdEU, double LessThanThresholdEU — Threshold values in Engineering Units.
  • bool LessThanEnabled, bool TriggerBetweenBounds, bool TriggerOutsideBounds — Trigger mode flags.
  • double InsideUpperLevelEU, double InsideLowerLevelEU, double OutsideUpperLevelEU, double OutsideLowerLevelEU — Boundary values.

TestObjectChannel

public class TestObjectChannel : TestObjectTemplateChannel, IComparable<TestObjectChannel>

Represents a channel on a test object with metadata and hardware association.

Constructor:

  • TestObjectChannel(TestObjectTemplateChannel copy, ISO.TestObject testObject, ISO.TestObjectTemplate template)

Properties:

  • bool Disabled { get; set; } — Whether channel is excluded from data collection.
  • int ChannelIdx { get; set; } — Defaults to CHANNEL_IDX_UNKNOWN (-1).
  • string SensorSerialNumber — Via property bag; sensor association.
  • string HardwareId — Via property bag; parses and normalizes format.
  • SquibChannelTypes SquibChannelType { get; set; } — Squib channel classification.
  • ISO.TestObject TestObject { get; } — Parent test object.

Methods:

  • int CompareTo(TestObjectChannel right) — Compares by DisplayOrder, then Name, then TestObject serial number.
  • string GetGraphId() — Returns ID with current suffix for squib current channels.
  • string GetId() — Returns composite ID: {SerialNumber}_{MMEChannelType}_{ChannelId}.
  • string GetIdWithSpecificChannelId(long id) — Returns ID with specified channel ID.

Nested Enum:

  • SquibChannelTypesNone, Voltage, Current.

Constants:

  • const int CHANNEL_IDX_UNKNOWN = -1

IsoCode

public class IsoCode

Represents a 16-character ISO channel code with positional fields.

Constructor:

  • IsoCode(string isoCode) — Pads/truncates to 16 characters; pads with '?' if short.

Properties:

  • string StringRepresentation { get; set; } — Full 16-character code.

Static Methods:

  • static string GetString(MMEPossibleChannels channel, bool careAboutTestTimeFields) — Generates ISO code from channel; masks test object and filter class with '?' if careAboutTestTimeFields is false.
  • static string GetString(string testObject, string position, string main, string floc1, string floc2, string floc3, string physdim, string dir, string fc) — Concatenates parameters into code string.

TestEngineerDetails

public class TestEngineerDetails

Stores test engineer contact information.

Constructors:

  • TestEngineerDetails()
  • TestEngineerDetails(DataRow dr)
  • TestEngineerDetails(TestEngineerDetails copy)
  • TestEngineerDetails(ITestEngineerDetailsDbRecord testEngineerDetailsDbRecord)

Properties:

  • string TestEngineerName, TestEngineerPhone, TestEngineerFax, TestEngineerEmail — Default to "NOVALUE".
  • string Name, bool LocalOnly, DateTime LastModified, string LastModifiedBy, int Version — Record metadata.

Static Methods:

  • static void DeleteAllTestEngineerDetails() — Deletes all records via DTS.Common.Storage.DbOperations.TestEngineerDetailsDelete().
  • static TestEngineerDetails[] GetAllTestEngineerDetails() — Retrieves all records.

CustomerDetails

public class CustomerDetails

Stores customer information for tests.

Constructors:

  • CustomerDetails(), CustomerDetails(DataRow dr), CustomerDetails(CustomerDetails copy)

Properties:

  • string CustomerName, string CustomerTestRefNumber — Default to string.Empty.
  • string ProjectRefNumber, string CustomerOrderNumber, string CustomerCostUnit — Default to "NOVALUE".
  • string Name, bool LocalOnly, DateTime LastModified, string LastModifiedBy, int Version.

Static Methods:

  • static CustomerDetails ReadXML(XmlElement root) — Deserializes from XML.
  • static void DeleteCustomerDetails(string name = null) — Deletes records via DTS.Common.Storage.DbOperations.CustomerDetailsDelete().

Instance Methods:

  • void WriteXML(ref XmlWriter writer) — Serializes to XML.

LabratoryDetails

public class LabratoryDetails

Stores laboratory contact information. Note: class name contains typo ("Labratory" vs "Laboratory").

Constructors:

  • LabratoryDetails(), LabratoryDetails(DataRow dr)

Properties:

  • string LabratoryName, string LabratoryContactName, string LabratoryTestRefNumber, string LabratoryProjectRefNumber — Default to string.Empty.
  • string LabratoryContactPhone, string LabratoryContactFax, string LabratoryContactEmail — Default to "NOVALUE".
  • string Name, bool LocalOnly, DateTime LastModified, string LastModifiedBy, int Version.

Static Methods:

  • static LabratoryDetails ReadXML(XmlElement root) — Deserializes from XML.
  • static void DeleteLabratoryDetails() — Deletes records via DTS.Common.Storage.DbOperations.LabratoryDetailsDelete().

TestSetting

public class TestSetting

Represents a single test setting with ID, value, and default.

Constructors:

  • TestSetting(string id, string value, string defaultValue)
  • TestSetting(TestSetting copy), TestSetting(TestSetting copy, string value)

Properties:

  • string Id { get; }, string Value { get; set; }, string DefaultValue { get; } — All read-only except Value.

Methods:

  • string ToSerializeString() — Returns {Id}={Value} with separator escaping.

Static Methods:

  • static bool TryParse(string s, out TestSetting ts) — Parses serialized format.

TestSettingDictionary

public class TestSettingDictionary

Dictionary container for test settings with serialization support.

Constructor:

  • TestSettingDictionary(), TestSettingDictionary(TestSettingDictionary copy)

Methods:

  • string GetValue(string id, string defaultValue) — Returns value or default if not found.
  • void SetValue(TestSetting setting, string value) — Updates value, creates new TestSetting.
  • void SetValue(TestSetting setting) — Initializes setting in dictionary.
  • void SetValue(string id, string value) — Sets or creates setting.
  • void UnLoad() — Clears dictionary.
  • string ToSerializeString() — Serializes all settings.
  • void LoadSettings(string s) — Deserializes settings string.

HardwareChannel

public class HardwareChannel : INotifyPropertyChanged

Represents a hardware channel on a Data Acquisition System.

Constructors:

  • HardwareChannel(HardwareChannel copy, Hardware h)
  • HardwareChannel(IDataRecord reader, Hardware hardware)

Properties (all notify property changed):

  • Hardware ParentDAS — Parent hardware reference.
  • int ChannelIdx, int DASDisplayOrder, int ModuleArrayIndex — Indexing.
  • string ModuleSerialNumber — Module identifier.
  • int SupportedBridges — Defaults to 12.
  • int SupportedSquibFireModes, int SupportedExcitations, int SupportedDigitalInputModes, int SupportedDigitalOutputModes — All default to 16.
  • bool LocalOnly.

Static Methods:

  • static int PhysicalCompare(HardwareChannel left, HardwareChannel right) — Compares by ChannelIdx.

TestObjectMetaData

public class TestObjectMetaData

Metadata container for test objects.

Constructor:

  • TestObjectMetaData(char testobject) — Initializes all fields with defaults.

Properties:

  • static double Version { get; set; } — Defaults to 1.06.
  • char TestObject { get; } — Test object character code.
  • Methods: void SetProperty(MetaData meta).

Nested Enums:

  • CommentFieldsComment1, Comment2, Comment3.
  • FieldsNameOfTestObject, VelocityOfTestObject, MassOfTestObject, etc.
  • OptionFieldsOffset, BarrierWidth, BarrierHeight, etc.

MetaData

public class MetaData

Single metadata entry.

Constructor:

  • MetaData(string name, bool optional, string value, double version), MetaData(MetaData copy)

Properties:

  • string Name { get; }, bool IsOptional { get; }, double Version { get; }, string Value { get; set; }.

TestSetupMetaData

public class TestSetupMetaData

Metadata container for test setups.

Constructor:

  • TestSetupMetaData(bool requireXCrashCompatibilityForISOExports) — Initializes fields; uses empty string for certain fields if XCrash compatibility required.

Properties:

  • double Version — Defaults to 1.06.

Methods:

  • void SetProperty(MetaData meta, bool requireXCrashCompatibilityForISOExports) — Sets property with XCrash compatibility handling.

Nested Enum:

  • FieldsLabName, LaboratoryContactName, TestEngineerName, Title, MediumNoNumberOfMedia, etc.

3. Invariants

  1. IsoCode Length: IsoCode.StringRepresentation is always exactly 16 characters. Shorter strings are padded with '?'; longer strings are truncated.

  2. TemplateZone Read-Only Properties: TemplateName and Description are read-only after construction. ZoneName is read-only with a default of "" but set during construction.

  3. TemplateRegions Array Semantics: The TemplateRegions setter on TemplateZone clears the internal list before adding new values; it does not append.

  4. InputChannelIdsBlob Encoding: Always UTF-8 encoded, using CultureInfo.InvariantCulture.TextInfo.ListSeparator as delimiter.

  5. TestObjectChannel ChannelIdx: Defaults to CHANNEL_IDX_UNKNOWN (-1) when not assigned.

  6. HardwareId Parsing: If HardwareId is set with a 3-part underscore-delimited format, it is normalized by removing the third token's prefix up to 'x'.

  7. "NOVALUE" Sentinel: TestEngineerDetails, CustomerDetails, LabratoryDetails, TestObjectMetaData, and TestSetupMetaData use "NOVALUE" as a sentinel value for unset string fields. Empty string inputs are ignored (do not overwrite "NOVALUE").

  8. CalculatedValueClass Id: Defaults to -1 indicating unassigned.

  9. LevelTriggerChannel GreaterThanEnabled: Defaults to true; LessThanEnabled defaults to false.


4. Dependencies

External Dependencies (from imports):

  • System — Core framework.
  • System.Collections.Generic — Generic collections.
  • System.Data / System.Data.SqlClient — ADO.NET data access.
  • System.Drawing — Point structure for coordinates.
  • System.Text — StringBuilder, Encoding.
  • System.Xml — XML read/write.
  • System.Globalization — Culture-invariant parsing.
  • System.ComponentModel — INotifyPropertyChanged.
  • DTS.Common.Interface.TestMetaDataITestEngineerDetailsDbRecord interface.
  • DTS.Common.Storage.DbOperations — Database operations for details records.
  • DTS.Common.ConstantsCURRENT_SUFFIX constant.

Internal Dependencies (inferred):

  • DbOperations — Static class providing database access, stored procedure names via DbOperationsEnum, and field name enums (CalculatedChannels.Fields, LevelTriggers.Fields, DAS.DASChannelFields).
  • DbOperations.Connection — Database connection with QueryDataSet method.
  • TestObjectTemplateChannel — Base class for TestObjectChannel.
  • ISO.TestObject — Referenced by TestObjectChannel.
  • ISO.TestObjectTemplate — Referenced by TestObjectChannel.
  • MMEPossibleChannels — Channel definition class used by IsoCode.
  • Hardware — Hardware/DAS class referenced by HardwareChannel.

Consumers:

Unknown from source alone — these appear to be data entities consumed by higher-level import/export logic.


5. Gotchas

  1. Swallowed Exceptions: LevelTriggerChannel(DataRow) catches and silently ignores all exceptions. TemplateRegion.GetAllRegions() catches and ignores exceptions at multiple levels. This can result in partial or missing data without any indication of failure.

  2. Commented-Out Logging: Multiple files contain commented-out APILogger.Log() calls (e.g., LevelTriggerChannel, TemplateRegion, TestEngineerDetails, CustomerDetails, LabratoryDetails). This suggests logging was removed or disabled, making debugging difficult.

  3. Typo in Class Name: LabratoryDetails is misspelled (should be "Laboratory"). This typo propagates to property names (LabratoryName, LabratoryContactName, etc.) and database column names.

  4. Future Breaking Change: CalculatedValueClass documentation states it "will probably become an abstract base class in the future." Direct instantiation may break in later versions.

  5. IsoCode Padding Character: When padding short ISO codes, the class uses '?' not '0'. This differs from the default initialization which uses '0'.

  6. HardwareChannel Default Values: SupportedBridges defaults to 12 while all other "Supported*" properties default to 16. Reason unclear from source.

  7. **TestSettingDictionary Separator Inconsistency