152 lines
13 KiB
Markdown
152 lines
13 KiB
Markdown
|
|
---
|
|||
|
|
source_files:
|
|||
|
|
- Common/DTS.CommonCore/Enums/IsoRestrictionLevels.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/GPSSentenceTypes.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/UartDataFormat.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/NetworkSelection.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/ScriptTypes.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/InitializationTypes.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/Strings.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/MigrationResult.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/SLICE6MulticastProperties.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/RibbonTabNames.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/IsoSupportLevels.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/ImportFormats.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/TabControlOperation.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/IncludeOverwriteName.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/RibbonControlOperation.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/UICultures.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/T0Mode.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/VelocityUnit.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/ImportStatus.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/IsoViewMode.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/PopupWindowImage.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/UIItemStatus.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/DigitalOutputs.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/DigitalInputs.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/DataFlag.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/Squibs.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/SupportedExportFormatBitFlags.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/UartBaudRate.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/EnumBindingSourceExtension.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/UDPStreamProfile.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/ExcitationVoltageOptions.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/RecordingModes.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/ApplicationStatusTypes.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/ExportHeaderLine.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/StreamDigitalFilterTypes.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/CFCFilter.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/ClockSource.cs
|
|||
|
|
generated_at: "2026-04-16T02:13:09.317699+00:00"
|
|||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
|||
|
|
schema_version: 1
|
|||
|
|
sha256: "b809df2688f575c2"
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# DTS.CommonCore Enums Module Documentation
|
|||
|
|
|
|||
|
|
## 1. Purpose
|
|||
|
|
|
|||
|
|
This module defines a comprehensive set of enumerations used throughout the DTS (Data Acquisition and Test System) codebase to represent system states, configuration options, data formats, and hardware capabilities. It serves as a centralized source of truth for typed constants, enabling type safety, consistent behavior across modules, and UI integration (e.g., via `EnumDescriptionTypeConverter` and `EnumBindingSourceExtension`). These enums are foundational for configuration, data processing, device communication, and user interface rendering.
|
|||
|
|
|
|||
|
|
## 2. Public Interface
|
|||
|
|
|
|||
|
|
### Enums (No classes or methods are public *functions*; only types and static members)
|
|||
|
|
|
|||
|
|
#### Core Data & Communication
|
|||
|
|
- `GPSSentenceTypes`: Specifies supported GPS NMEA sentence types: `GPGGA`, `GPRMC`.
|
|||
|
|
- `UartDataFormat`: Defines UART data formats: `Binary`, `PlainText`, `NMEA`.
|
|||
|
|
- `UartBaudRate`: Enumerates standard UART baud rates (e.g., `_9600 = 9600`, `_115200 = 115200`) as `uint`.
|
|||
|
|
- `UDPStreamProfile`: Defines UDP streaming profiles for S6A devices (e.g., `RTCStreaming`, `DTS_UDP`, `CH10_MANUAL_CONFIG`, `UART_STREAM`), typed as `byte`.
|
|||
|
|
- `SLICE6Properties`: Specifies SLICE6 multicast autodiscovery properties: `SLICE6MulticastAddress`, `SLICE6MulticastCommandPort`, `SLICE6MulticastResponsePort`.
|
|||
|
|
|
|||
|
|
#### Import/Export & Data Formats
|
|||
|
|
- `ImportFormats`: Defines supported import file formats (e.g., `DTS_XML`, `ISF`, `TSF`, `CrashDesigner_XML`, `E2X`), values 1–9.
|
|||
|
|
- `ImportExtraStatus`: Tracks detailed import progress states (e.g., `ReadingChannels`, `ReadingCalibrations`, `NormalizingIds`).
|
|||
|
|
- `PossibleStatus`: High-level import status states: `Waiting`, `Working`, `Done`, `Failed`, `Reading`, `Importing`.
|
|||
|
|
- `SupportedExportFormatBitFlags`: Bitwise flags for export formats (e.g., `csvunfiltered = 0x1`, `isounfiltered = 0x4`, `HDFMV = 0x40000`, `Ch10FilteredEU = 0x1000000`). Marked with `[Flags]`.
|
|||
|
|
- `FtssHeaderLine` / `XLSXExportHeaderLine`: Header line constants for CSV and XLSX exports (e.g., `TestDate`, `SampleRate`, `EngineeringUnits`). Each has `[Description]` attribute for display text.
|
|||
|
|
|
|||
|
|
#### Configuration & Setup
|
|||
|
|
- `RecordingModes`: Lists all supported DAS recording modes (e.g., `CircularBuffer`, `Recorder`, `S6A_DeviceStreamingOnly`, `MultipleEventActive`, `Scheduled`, `Streaming`). Over 30 values.
|
|||
|
|
- `NonStreamingRecordingModeItemsSource`: Concrete `RecordingModeItemsSource` subclass that filters to non-streaming modes.
|
|||
|
|
- `RecordingModeItemsSource`: Abstract base class for populating UI item sources from `RecordingModes[]`.
|
|||
|
|
- `ClockSyncProfile`: Defines clock synchronization profiles (e.g., `Manual`, `Slave_E2E`, `Master_E2E_GPS`, `IRIG`, `EXT_PPS`, `GPS_PPS_OUT`). Values span `byte` range (0–255).
|
|||
|
|
- `InputClockSource`: Bitwise flags for input clock sources (`PTP`, `IRIG`, `GPS`, `1PPS`, and combinations).
|
|||
|
|
- `OutputClockSource`: Bitwise flags for output clock sources (e.g., `PTPMasterE2E`, `OnePPS`, `PTPMasterE2E_OnePPS`).
|
|||
|
|
- `T0Mode`: Defines T0 trigger modes: `DAS = 0`, `Test = 1`.
|
|||
|
|
- `VelocityUnit`: Velocity units: `KilometerPerHour = 0`, `MeterPerSecond = 1`.
|
|||
|
|
- `IsoSupportLevels`: ISO channel support levels: `ISO_ONLY`, `TRANSITORY`, `NO_ISO`.
|
|||
|
|
- `IsoViewMode`: View modes for ISO channel display: `ISOOnly`, `ISOAndUserCode`, `UserCodeOnly`, `ChannelNameOnly`.
|
|||
|
|
- `IsoViewModeStatic`: Abstract static class holding current `IsoViewMode` (`public static IsoViewMode ViewMode { get; set; }`).
|
|||
|
|
- `ExcitationVoltageOptions.ExcitationVoltageOption`: Excitation voltage options (e.g., `Volt2 = 2`, `Volt5 = 16`, `Volt10 = 32`) with `[VoltageMagnitude]` attribute.
|
|||
|
|
- `ExcitationVoltageOptions.VoltageMagnitudeAttribute`: Custom attribute storing voltage magnitude (`double Value`).
|
|||
|
|
- `ExcitationVoltageOptions.VoltageMagnitudeAttributeCoder`: Helper class to extract magnitude values.
|
|||
|
|
|
|||
|
|
#### Digital I/O & Sensors
|
|||
|
|
- `DigitalInputModes`: Digital input modes (bitwise flags): `NONE`, `TLH`, `THL`, `CCNO`, `CCNC`.
|
|||
|
|
- `DigitalOutputModes`: Digital output modes (bitwise flags): `NONE`, `FVLH`, `FVHL`, `CCNO`, `CCNC`.
|
|||
|
|
- `SquibMeasurementType`: Squib measurement options (bitwise flags): `NONE`, `CURRENT`, `INIT_SIGNAL`, `VOLTAGE`.
|
|||
|
|
- `SquibFireMode`: Squib firing modes (bitwise flags): `NONE`, `CAP`, `CONSTANT`, `AC`.
|
|||
|
|
|
|||
|
|
#### Data Quality & Processing
|
|||
|
|
- `DataFlag`: Data quality flags: `None`, `Normal`, `Saturated`, `ZeroCrossing`, `BrokenWire`, `Other`.
|
|||
|
|
- `CFCFilter`: Software filter classes (CFC = Composite Functional Characteristic): `None`, `Unfiltered`, `Class10 = 17`, `Class60 = 100`, `Class180 = 300`, `Class600 = 1000`, `Class1000 = 1650`.
|
|||
|
|
- `CFCFilterDTSFileStringConverter`: Static utility class for converting between `CFCFilter` enum and string representations (e.g., `"CFC 10"`, `"Q"`, `"0"`).
|
|||
|
|
- `StreamDigitalFilterTypes`: DSP filter profiles for S6A streaming (e.g., `NO_DSP_FILTER`, `CH10_IIR_6TH_OPTION_80X`, `ALL_RT_FIR_45T65T_OPTION_80X`).
|
|||
|
|
|
|||
|
|
#### UI & Localization
|
|||
|
|
- `UICultures`: Supported UI languages (e.g., `en_US`, `de_DE`, `ja_JP`) with `[DescriptionResource]` attributes.
|
|||
|
|
- `PopupWindowImage`: Popup dialog icon types: `Warning`, `Error`, `Question`, `Information`.
|
|||
|
|
- `UIItemStatus`: UI status indicators: `None`, `Success`, `Failed`, `Error`, `Warning`.
|
|||
|
|
- `SelectedItemsStatus`: Abstract static class managing per-object updating state via `SetUpdating(object, bool)` and `GetUpdating(object)`.
|
|||
|
|
- `RibbonTabNames`: Static class with tab name constants (`Tab1`, `Tab2`, `Tab3`), all currently `"TBD"`.
|
|||
|
|
- `TabControlOperation`: Tab control operations: `AddedItem`, `RemovedItem`.
|
|||
|
|
- `RibbonControlOperation`: Ribbon control operations: `AddedItem`, `RemovedItem`.
|
|||
|
|
- `ScriptTypes`: Script execution types: `Migration`, `Initialization`.
|
|||
|
|
- `InitializationTypes`: Initialization script types: `Aero`, `Crash`, `TSRAIR`.
|
|||
|
|
- `StringReplacementMode`: String replacement modes: `All`, `First`, `Last`.
|
|||
|
|
- `MigrationResult`: Migration operation results: `OK`, `ExceptionThrown`, `WarningAllowStreamingModesWasNotMigrated`.
|
|||
|
|
- `IncludeOverwriteName`: UI control states: `IncludedCheckBox`, `OverwriteCheckBox`, `ImportingTestSetupName`.
|
|||
|
|
- `ExportChoices`: Export configuration options: `ExportType`, `UnfilteredEUCheckBox`, `FilteredEUCheckBox`, `MVCheckBox`, `ADCCheckBox`.
|
|||
|
|
|
|||
|
|
#### Extension & Helpers
|
|||
|
|
- `EnumBindingSourceExtension`: WPF `MarkupExtension` for binding to enum values in XAML. Validates enum type and returns values (including `null` for nullable enums).
|
|||
|
|
- `HeaderLineExtension.GetDescription(Enum)`: Extension method to retrieve `[Description]` attribute text from any enum.
|
|||
|
|
|
|||
|
|
## 3. Invariants
|
|||
|
|
|
|||
|
|
- **Bitwise Flags**: Enums marked `[Flags]` (`SupportedExportFormatBitFlags`) and those with explicit bit-shifted values (`DigitalInputModes`, `DigitalOutputModes`, `SquibMeasurementType`, `SquibFireMode`, `InputClockSource`, `OutputClockSource`) must be combined using bitwise OR (`|`) and checked with bitwise AND (`&`).
|
|||
|
|
- **Numeric Values**: `UartBaudRate` values are strictly `uint` and match standard baud rates (e.g., `_9600 = 9600`). `ClockSyncProfile` values are `byte` and span 0–255, with reserved ranges commented out.
|
|||
|
|
- **Enum Descriptions**: Enums with `[TypeConverter(typeof(EnumDescriptionTypeConverter))]` rely on resource strings (via `[Description]` or `[DescriptionResource]`) for UI display. The converter must be registered in XAML or code-behind.
|
|||
|
|
- **CFC Filter Values**: `CFCFilter` uses non-sequential integer values (e.g., `Class10 = 17`, `Class60 = 100`) for compatibility with legacy DTS file formats; conversion utilities (`CFCFilterDTSFileStringConverter`) must be used for serialization/deserialization.
|
|||
|
|
- **Static State**: `IsoViewModeStatic.ViewMode` holds a *copy* of the DB value; it is not automatically synchronized. `SelectedItemsStatus` uses thread-safe locking (`lock(MyLock)`) for its internal dictionary.
|
|||
|
|
- **Null Handling**: `CFCFilterDTSFileStringConverter.GetFilterFromString` returns `CFCFilter.Unfiltered` for null/empty input or unrecognized strings.
|
|||
|
|
|
|||
|
|
## 4. Dependencies
|
|||
|
|
|
|||
|
|
### Dependencies *of* this module:
|
|||
|
|
- **DTS.Common.Converters**: Used by `EnumDescriptionTypeConverter` (applied to many enums).
|
|||
|
|
- **DTS.Common.Base.Classes**: Used by `IItemsSource` implementations (e.g., `T0ModeItemSource`, `RecordingModeItemsSource`, `ProfileSourceItemsSource`).
|
|||
|
|
- **DTS.Common.Utils**: Used by `EnumUtil.GetValuesList<T>()` (e.g., in `T0ModeItemSource`, `CFCFilterItemSource`).
|
|||
|
|
- **System.ComponentModel**: Provides `DescriptionAttribute`, `TypeConverter`.
|
|||
|
|
- **Xceed.Wpf.Toolkit.PropertyGrid.Attributes**: Provides `IItemsSource` and `ItemCollection` for property grid integration.
|
|||
|
|
- **System.Windows.Markup**: Required for `EnumBindingSourceExtension` (WPF markup extension).
|
|||
|
|
- **DTS.Common.Enums.Sensors**, **DTS.Common.Interface.Sensors.SoftwareFilters**: Referenced by `CFCFilter` for `IFilterClass` conversion.
|
|||
|
|
|
|||
|
|
### Dependencies *on* this module:
|
|||
|
|
- **DTS.CommonCore** (other modules): All enums are in `DTS.Common.Enums` namespace and are widely referenced across the codebase for configuration, state management, and UI binding.
|
|||
|
|
- **UI Layer**: WPF bindings use `EnumBindingSourceExtension` and `EnumDescriptionTypeConverter` for dropdowns and labels.
|
|||
|
|
|
|||
|
|
## 5. Gotchas
|
|||
|
|
|
|||
|
|
- **Reserved Enum Values**: `ClockSyncProfile` has commented-out P2P profiles (e.g., `Slave_P2P`, `Master_P2P`) and reserved ranges (`_TDB_*`), indicating future work or device-specific support not yet implemented.
|
|||
|
|
- **CFC Filter String Conversion**: `CFCFilterDTSFileStringConverter.GetIsoCodeFromString` and `CFCFilterToCFC` use single-letter codes (`"Q"`, `"D"`, `"C"`, `"B"`, `"A"`, `"P"`, `"S"`, `"0"`) for ISO channel codes—these must be matched exactly in downstream systems.
|
|||
|
|
- **`UICultures` Resource Keys**: `[DescriptionResource]` attributes reference keys like `"UICultures_en-US"`; these must exist in the application's resource files.
|
|||
|
|
- **`RibbonTabNames`**: All tab names are `"TBD"`; this is likely placeholder code.
|
|||
|
|
- **`T0ModeItemSource`/`CFCFilterItemSource`**: These `IItemsSource` implementations use `EnumUtil.GetValuesList<T>()`—ensure `EnumUtil` is available and correctly implemented.
|
|||
|
|
- **`SelectedItemsStatus`**: Uses `Dictionary<object, bool>`; key objects must be stable (e.g., not recreated instances) to maintain state correctly.
|
|||
|
|
- **`IsoViewModeStatic`**: The static `ViewMode` property is *not* persisted or synchronized with the database; it must be explicitly set and cleared by consumers.
|
|||
|
|
- **`ExcitationVoltageOptions`**: The `VoltageMagnitudeAttributeCoder` is a generic helper—ensure `AttributeCoder<TEnum, TAttr, TValue>` is defined and functional.
|
|||
|
|
- **`EnumBindingSourceExtension`**: For nullable enums, it prepends `null` to the value array; consumers must handle this case.
|
|||
|
|
- **`HeaderLineExtension.GetDescription`**: Falls back to `enum.ToString()` if no `[Description]` attribute is found—ensure all enums used in headers have descriptions.
|