96 lines
7.1 KiB
Markdown
96 lines
7.1 KiB
Markdown
---
|
|
source_files:
|
|
- Common/DTS.Common.ISO/IsoMDBFile.cs
|
|
- Common/DTS.Common.ISO/ISerializableFile.cs
|
|
- Common/DTS.Common.ISO/AbstractOLEDbWrapper.cs
|
|
- Common/DTS.Common.ISO/HardwareChannel.cs
|
|
- Common/DTS.Common.ISO/IsoCode.cs
|
|
- Common/DTS.Common.ISO/TestObjectChannel.cs
|
|
- Common/DTS.Common.ISO/CalculatedValueClass.cs
|
|
- Common/DTS.Common.ISO/LevelTriggerChannel.cs
|
|
- Common/DTS.Common.ISO/TestSetting.cs
|
|
- Common/DTS.Common.ISO/TestObjectTemplate.cs
|
|
- Common/DTS.Common.ISO/MMEFilterClasses.cs
|
|
- Common/DTS.Common.ISO/MMEPositions.cs
|
|
- Common/DTS.Common.ISO/MMEFineLocations2.cs
|
|
generated_at: "2026-04-16T11:35:02.794204+00:00"
|
|
model: "zai-org/GLM-5-FP8"
|
|
schema_version: 1
|
|
sha256: "8371f072462a5521"
|
|
---
|
|
|
|
# Documentation: DTS.Common.ISO
|
|
|
|
## 1. Purpose
|
|
The `DTS.Common.ISO` namespace provides data structures and utilities for managing test configuration entities, specifically adhering to ISO 13499 (MME - Measurement of Mechanical Effects) standards. It serves as a bridge between raw database records (accessed via OLE DB/SQL) and domain objects used in the application's test setup and execution logic. The module handles the serialization of test settings, definition of hardware and calculated channels, and parsing of ISO metadata such as filter classes, positions, and fine locations.
|
|
|
|
## 2. Public Interface
|
|
|
|
### **AbstractOLEDbWrapper**
|
|
An abstract base class providing helper methods for safe database value retrieval.
|
|
* `protected static long GetLong(IDataReader reader, string field)`: Returns `long.MinValue` if the database field is `DBNull`, otherwise converts the value to `long`.
|
|
* `protected static DateTime GetDate(IDataReader reader, string field)`: Returns `DateTime.MinValue` if the database field is `DBNull`, otherwise casts to `DateTime`.
|
|
|
|
### **HardwareChannel**
|
|
Represents a physical hardware channel, inheriting from `DASChannelDBRecord`.
|
|
* `public Hardware ParentDAS`: Gets or sets the parent hardware device.
|
|
* `public static int PhysicalCompare(HardwareChannel left, HardwareChannel right)`: Comparison function based on `ChannelIdx`. Handles nulls.
|
|
* `public void Insert()`: Inserts the record into the database via `DbOperations.DASChannelsInsert`.
|
|
* `public bool IsSupported(SensorConstants.BridgeType bridge)`: Checks if a specific bridge type is supported using bitwise comparison against `SupportedBridges`.
|
|
|
|
### **IsoCodeStatics**
|
|
Static helper class for generating ISO code strings.
|
|
* `public static string GetString(MMEPossibleChannels channel, MMETestObjects container, MMEPositions position, MMEFilterClasses fc)`: Constructs an ISO code string from various metadata objects.
|
|
* `public static string GetString(MMEPossibleChannels channel, bool careAboutTestTimeFields)`: Constructs an ISO code string, optionally masking "test time" fields (TestObject, FilterClass) with placeholder characters.
|
|
* `public static string GetString(string testObject, string position, string main, string floc1, string floc2, string floc3, string physdim, string dir, string fc)`: Constructs an ISO code string from raw string components.
|
|
|
|
### **TestObjectChannel**
|
|
Represents a channel within a test object, implementing `IComparable<TestObjectChannel>` and `IGroupChannel`.
|
|
* `public bool Disabled`: Determines if the channel is used in data collection.
|
|
* `public int ChannelIdx`: Index of the channel, defaults to `CHANNEL_IDX_UNKNOWN` (-1).
|
|
* `public string SensorSerialNumber`: Serial number of the associated sensor.
|
|
* `public string HardwareId`: Physical hardware channel ID. The setter parses and reformats strings containing underscores.
|
|
* `public string GetGraphId()`: Returns the ID, appending `Constants.CURRENT_SUFFIX` if `SquibChannelType` is `Current`.
|
|
* `public string GetId()`: Returns a composite ID string (`SerialNumber_ChannelType_Id`).
|
|
* `public string GetDASId()`: Extracts the DAS ID portion from `HardwareId`.
|
|
* `public int CompareTo(TestObjectChannel right)`: Sorts by `DisplayOrder`, then `Name`, then `TestObject` serial number.
|
|
|
|
### **CalculatedValueClass**
|
|
Represents a calculated/derived channel (e.g., HIC, IRTRACC), inheriting from `CalculatedChannelRecord`.
|
|
* `public bool SupportsRealtime`: Returns true if `ViewInRealtime` is true.
|
|
* `public bool IsValid(Dictionary<string, bool> channelIdLookup)`: Validates that the channel has a name and all `InputChannelIds` exist in the provided lookup.
|
|
* `public bool ViewInRealtime`: Getter returns `false` for specific operations (`IRTRACC3D`, `HIC`), regardless of the backing field value.
|
|
* `public bool CanChangeViewInRealtime`: Returns `false` for operations that force `ViewInRealtime` to false.
|
|
* `public void ReplaceInputChannelIdAtIndex(int index, string newId)`: Modifies the input channel ID array at a specific index.
|
|
|
|
### **LevelTriggerChannel**
|
|
Defines trigger conditions based on signal levels.
|
|
* `public LevelTriggerChannel(System.Data.DataRow dr)`: Constructs the object by parsing fields from a database row using `DbOperations.LevelTriggers.Fields`.
|
|
* `public string LevelTriggerText`: Getter that generates a human-readable description of the trigger logic (e.g., "Less than X", "Trigger Inside [X, Y]").
|
|
|
|
### **TestSetting & TestSettingDictionary**
|
|
Manages test configuration settings.
|
|
* `TestSetting`
|
|
* `public string ToSerializeString()`: Serializes the setting to "Id=Value" format, escaping equals signs.
|
|
* `public static bool TryParse(string s, out TestSetting ts)`: Parses a serialized string back into a `TestSetting`.
|
|
* `TestSettingDictionary`
|
|
* `public string GetValue(int id, string defaultValue)`: Retrieves a value or returns the default.
|
|
* `public void SetValue(TestSetting setting)`: Initializes a setting in the dictionary.
|
|
* `public void SetValue(int id, string value)`: Sets a value, creating a new `TestSetting` if the ID doesn't exist.
|
|
* `public void LoadSettings(string s)`: Deserializes a string of settings into the dictionary.
|
|
|
|
### **MMEFilterClasses, MMEPositions, MMEFineLocations2**
|
|
Classes mapping to ISO 13499 metadata database tables.
|
|
* `public static [Type][] Get[Types]()`: Static method (e.g., `GetFilterClasses`, `GetPositions`) that queries the database using `DbOperations.GetISOCommand()` and returns an array of objects.
|
|
* `public static [Type] ReadXML(XmlElement node)`: Static method to instantiate the object from an XML node attribute mapping.
|
|
|
|
### **TestObjectTemplate**
|
|
Wrapper for group templates.
|
|
* `public bool IsISOMode()`: Returns `true` if `TestObjectType` does not contain specific non-ISO constants.
|
|
* `public static TestObjectTemplate GetTemplate(ref ISO13499FileDb db, string name)`: **Currently returns null.**
|
|
|
|
## 3. Invariants
|
|
|
|
* **Database Null Handling**: `AbstractOLEDbWrapper` derivatives guarantee that `DBNull` values are converted to `long.MinValue` or `DateTime.MinValue`, never throwing conversion exceptions for null fields.
|
|
* **Realtime Calculation Constraints**: For `CalculatedValueClass`, if the `Operation` is `IRTRACC3D`, `IRTRACC3D_ABDOMEN`, `IRTRACC3D_LOWERTHORAX`, or `HIC`, `ViewInRealtime` will always return `false` and `CanChangeViewInRealtime` will always return `false`.
|
|
* **HardwareChannel Comparison**: `HardwareChannel.Physical |