Files
2026-04-17 14:55:32 -04:00

94 lines
6.9 KiB
Markdown

---
source_files:
- Common/DTS.Common/Enums/DTS.Viewer/TestMetadata/ChannelGroups.cs
- Common/DTS.Common/Enums/DTS.Viewer/TestMetadata/TestGraphsFields.cs
- Common/DTS.Common/Enums/DTS.Viewer/TestMetadata/TestSetupFields.cs
- Common/DTS.Common/Enums/DTS.Viewer/TestMetadata/TestRunMetadataFields.cs
- Common/DTS.Common/Enums/DTS.Viewer/TestMetadata/TestModuleFields.cs
- Common/DTS.Common/Enums/DTS.Viewer/TestMetadata/TestChannelFields.cs
generated_at: "2026-04-16T03:21:56.552310+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "d809c3870c3acf47"
---
# Documentation: Test Metadata Enumerations
## 1. Purpose
This module defines a set of strongly-typed enumerations used to represent field names and groupings within test metadata structures in the DTS Viewer system. These enums serve as standardized keys for accessing, serializing, deserializing, and querying hierarchical test data—such as test runs, modules, channels, graphs, and calculated channels—across the application. They ensure consistency in data contract definitions (e.g., for JSON serialization, UI binding, or database mapping) by decoupling field identifiers from string literals, thereby reducing typos, enabling refactoring safety, and improving code readability.
## 2. Public Interface
### `ChannelGroups`
- **Namespace**: `DTS.Common.Enums.Viewer`
- **Values**:
- `Channel`
- `Graph`
- `CalculatedChannel`
- **Purpose**: Represents high-level logical groupings of channel-like entities in test metadata. Used to categorize or filter channels by type.
### `TestGraphsFields`
- **Namespace**: `DTS.Common.Enums.Viewer`
- **Values**:
- `Name`
- `HardwareChannelName`
- `Channels`
- `Channel`
- `ChannelId`
- **Purpose**: Defines the set of valid field names for objects representing a *graph* in test metadata (e.g., a named aggregation of channels for visualization or analysis).
### `TestSetupMetadataFields`
- **Namespace**: `DTS.Common.Enums.Viewer`
- **Values**:
- `Name`
- `DateOfTheTest`
- `Graphs`
- `Timestamp`
- `CalibrationBehavior`
- **Purpose**: Specifies top-level metadata fields for a *test setup*, typically describing static configuration or context of a test session.
### `TestRunMetadataFields`
- **Namespace**: `DTS.Common.Enums.Viewer`
- **Values**:
- `Id`, `Description`, `InlineSerializedData`, `Guid`, `FaultFlags`, `Software`, `SoftwareVersion`, `DataType`, `FileDate`, `FilePath`, `Modules`, `Module`, `Channels`, `CalculatedChannels`, `CalculatedChannel`
- **Purpose**: Represents the top-level fields of a *test run*—a single execution instance containing modules, channels, and calculated channels.
### `TestModuleFields`
- **Namespace**: `DTS.Common.Enums.Viewer`
- **Values**: 44 fields including:
- `SerialNumber`, `BaseSerialNumber`, `Number`, `SampleRateHz`, `NumberOfChannels`, `RecordingMode`, `RequestedPreTriggerSeconds`, `PostTriggerSeconds`, `TriggerTimestampSec`, `TriggerTimestampNanoSec`, `StartRecordSampleNumber`, `UnsubsampledNumberOfSamples`, `PTPMasterSync`, `TiltSensorAxisXDegreesPre/Post`, `TemperatureLocation1Pre/Post`, `InlineSerializedData`, etc.
- **Purpose**: Defines all known fields for a *test module*, representing a physical acquisition device (e.g., a data logger) involved in the test.
### `TestChannelFields`
- **Namespace**: `DTS.Common.Enums.Viewer`
- **Values**: 71 fields including:
- `SerialNumber`, `ChannelId`, `Description`, `ChannelGroupName`, `ChannelType`, `Number`, `HardwareChannelName`, `Sensitivity`, `ExcitationVoltage`, `ZeroMethod`, `IsSubsampled`, `AbsoluteDisplayOrder`, `LastCalibrationDate`, `CalSignalEnabled`, `ShuntEnabled`, `LinearizationFormula`, `SourceModuleSerialNumber`, `Calculation`, `IsoCode`, `UserCode`, `UserChannelName`, `SensorPolarity`, `HIC`, `UseEUScaler`, `ScaleFactorEU`, `T1`, `T2`, etc.
- **Purpose**: Enumerates all possible fields for a *test channel*, representing a single measured or computed signal (e.g., voltage, strain, temperature) during a test.
> **Note**: All enums are plain `public enum` types with no methods, properties, or attributes defined in the source.
## 3. Invariants
- **No overlap between enum namespaces**: Each enum belongs to a distinct semantic domain (e.g., `TestModuleFields` vs `TestChannelFields`), and field names may be duplicated across enums (e.g., `Channels`, `Module`, `Channel`) but refer to different contexts.
- **Field names are case-sensitive**: All enum values use PascalCase (e.g., `HardwareChannelName`, `RequestedPreTriggerSeconds`).
- **No validation or runtime enforcement**: These are *metadata keys*, not validators; the enums themselves do not enforce presence, type, or consistency of corresponding data.
- **No versioning**: Enums are not versioned; adding/removing values may break downstream consumers expecting specific keys.
## 4. Dependencies
- **Depends on**: None (self-contained; no external references in the provided source).
- **Used by**:
- Likely consumed by serialization/deserialization logic (e.g., JSON converters, DTO mappers) in higher layers (e.g., `DTS.Viewer`, `DTS.Data`).
- Likely referenced in UI binding layers (e.g., to populate dropdowns or column headers).
- Likely used in query/filter APIs (e.g., `Where(x => x[TestChannelFields.ChannelGroupName] == ChannelGroups.Channel.ToString())`).
- **Inferred consumers**: Any module that handles test metadata serialization, UI rendering, or data querying (not visible in source, but implied by naming and usage patterns).
## 5. Gotchas
- **Ambiguous field names across enums**:
- `Channels` appears in `TestRunMetadataFields` (plural, likely a collection) and `TestGraphsFields` (singular, possibly a reference or collection).
- `Module` and `CalculatedChannel` appear in `TestRunMetadataFields` (singular), while `Modules`, `CalculatedChannels` (plural) also exist—suggesting inconsistent naming for collections vs. references.
- **Redundant or overlapping fields**:
- `Channel` and `Channels` appear in both `TestRunMetadataFields` and `TestGraphsFields`, but their semantics differ (e.g., one may be a single channel object, the other a list).
- `ChannelGroupName` in `TestChannelFields` maps to values in `ChannelGroups`, but no compile-time linkage exists.
- **Missing grouping for calculated channels**: While `CalculatedChannel` is a `TestRunMetadataFields` key, `CalculatedChannels` (plural) also exists—suggesting possible inconsistency in how collections are named.
- **No documentation comments**: All enums lack XML documentation; field meanings must be inferred from naming alone (e.g., `T1`, `T2` in `TestChannelFields` are undefined).
- **Historical field bloat**: `TestChannelFields` has 71 values—indicating possible technical debt from incremental additions without cleanup.
- **None identified from source alone** for behavioral quirks (e.g., null handling, default values), as enums are pure identifiers.