131 lines
7.1 KiB
Markdown
131 lines
7.1 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.Common/Enums/DASFactory/WakeupTriggers.cs
|
||
|
|
- Common/DTS.Common/Enums/DASFactory/UseCasesTSRAIR.cs
|
||
|
|
- Common/DTS.Common/Enums/DASFactory/S6DBDiagnosticChannelList.cs
|
||
|
|
- Common/DTS.Common/Enums/DASFactory/ConstantsAndEnums.cs
|
||
|
|
generated_at: "2026-04-16T03:21:12.809680+00:00"
|
||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "c58d9167734fa176"
|
||
|
|
---
|
||
|
|
|
||
|
|
# DASFactory
|
||
|
|
|
||
|
|
## Documentation: DASFactory Enumerations Module
|
||
|
|
|
||
|
|
### 1. Purpose
|
||
|
|
This module defines core enumerations used throughout the DAS (Data Acquisition System) factory configuration and diagnostics subsystem. It centralizes type-safe representations of device types, wakeup triggers, use cases, and diagnostic channel identifiers for the DAS family (e.g., TSR, G5, SLICE variants), enabling consistent interpretation of device capabilities, operational modes, and health monitoring across the codebase. The enums are designed for serialization, localization (via `EnumDescriptionTypeConverter`), and tight coupling to hardware-specific channel mappings.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### 2. Public Interface
|
||
|
|
|
||
|
|
#### `enum WakeupTriggers`
|
||
|
|
- **Namespace**: `DTS.Common.Enums.DASFactory`
|
||
|
|
- **Underlying type**: `int` (default)
|
||
|
|
- **Members**:
|
||
|
|
- `MotionDetect`: Represents a motion-detection-based wakeup trigger.
|
||
|
|
- **Attributes**:
|
||
|
|
- `[TypeConverter(typeof(EnumDescriptionTypeConverter))]` enables localized description extraction via `DescriptionAttribute`.
|
||
|
|
- `MotionDetect` has `[Description("WakeupTriggers_MotionDetect")]`.
|
||
|
|
|
||
|
|
#### `enum UseCasesTSRAIR : byte`
|
||
|
|
- **Namespace**: `DTS.Common.Enums.DASFactory`
|
||
|
|
- **Underlying type**: `byte`
|
||
|
|
- **Members**:
|
||
|
|
- `AEROSPACE`: Standard aerospace use case.
|
||
|
|
- `AEROSPACE_with_motion`: Aerospace use case with motion-triggered acquisition.
|
||
|
|
- `VIBRATION`: Vibration monitoring use case.
|
||
|
|
- `SCHEDULED`: Scheduled periodic acquisition.
|
||
|
|
- `INTERVAL`: Interval-based acquisition.
|
||
|
|
- `STREAMING`: Continuous streaming mode.
|
||
|
|
- `PRETRIGGER_TEST`: Pretrigger diagnostic/test mode.
|
||
|
|
- **Attributes**:
|
||
|
|
- `[TypeConverter(typeof(EnumDescriptionTypeConverter))]`
|
||
|
|
- Each member has a `[Description(...)]` attribute with a string key (e.g., `"Aerospace"`, `"Aerospace with motion"`).
|
||
|
|
|
||
|
|
#### `enum S6DBDiagnosticChannelList`
|
||
|
|
- **Namespace**: `DTS.Common.Enums.DASFactory`
|
||
|
|
- **Underlying type**: `int` (default)
|
||
|
|
- **Members**:
|
||
|
|
- **Base channels** (matching legacy "Base" channels):
|
||
|
|
- `InputVoltage = 0`
|
||
|
|
- `BackupVoltage = 1`
|
||
|
|
- `TemperatureC = 2`
|
||
|
|
- `BatterySoc = 3`
|
||
|
|
- **Extended diagnostic channels**:
|
||
|
|
- `DiagInputVoltage = 100`
|
||
|
|
- `DiagMcuTemperature = 101`
|
||
|
|
- `DiagChargerPower = 102`
|
||
|
|
- `DiagChargerInputCurrent = 103`
|
||
|
|
- `DiagEnv_1_Temperature = 104`
|
||
|
|
- `DiagEnv_1_Humidity = 105`
|
||
|
|
- `DiagEnv_2_Temperature = 106`
|
||
|
|
- `DiagEnv_2_Humidity = 107`
|
||
|
|
- `DiagEnv_3_Temperature = 108`
|
||
|
|
- `DiagEnv_3_Humidity = 109`
|
||
|
|
- `DiagEnv_4_Temperature = 110`
|
||
|
|
- `DiagEnv_4_Humidity = 111`
|
||
|
|
- `DiagEnv_5_Temperature = 112`
|
||
|
|
- `DiagEnv_5_Humidity = 113`
|
||
|
|
- `DiagBatterySoc = 114`
|
||
|
|
- `DiagBatteryPackVoltage = 115`
|
||
|
|
- `DiagBatteryPackCurrent = 116`
|
||
|
|
- `DiagBatteryFgTemperature = 117`
|
||
|
|
- `DiagBatteryThermistor1Temperature = 118`
|
||
|
|
- `DiagBatteryThermistor2Temperature = 119`
|
||
|
|
- **Notes**:
|
||
|
|
- Commented-out `DiagChargerDischargeCurrent = 104` is superseded by `DiagEnv_1_Temperature = 104`.
|
||
|
|
- `DiagEnv_X_Temperature`/`DiagEnv_X_Humidity` map to 5 environmental sensor zones.
|
||
|
|
|
||
|
|
#### `enum ConstantsAndEnums.DASType`
|
||
|
|
- **Namespace**: `DTS.Common.Enums.DASFactory.ConstantsAndEnums`
|
||
|
|
- **Underlying type**: `int` (default)
|
||
|
|
- **Members**:
|
||
|
|
- `NONE`, `HID_SLICE`, `WINUSB_SLICE`, `G5`, `SIM`, `TOM`, `DIM`, `TSR`, `HEADS`, `MINIDAU`, `ETHERNET_SLICE`, `ETHERNET_RIBEYE`, `SLICE_DB`, `TSR2`, `ETHERNET_TDAS`, `CDCUSB_SLICE`, `ETHERNET_SLICE2`, `WINUSB_SLICE1_5`, `ETHERNET_SLICE1_5`, `ETHERNET_SLICE6`, `ETHERNET_SLICE6AIR`, `WINUSB_SLICE6`, `WINUSB_SLICE6AIR`, `ETHERNET_SLICE6DB`, `SERIAL_TDAS`
|
||
|
|
- **Purpose**: Identifies the physical/logical device type in the system.
|
||
|
|
|
||
|
|
#### `enum ConstantsAndEnums.VoltageStatusColor`
|
||
|
|
- **Namespace**: `DTS.Common.Enums.DASFactory.ConstantsAndEnums`
|
||
|
|
- **Underlying type**: `int` (default)
|
||
|
|
- **Members**:
|
||
|
|
- `Green`, `Red`, `Yellow`, `Off`
|
||
|
|
- **Purpose**: Represents voltage status indicator colors (likely for UI or status reporting).
|
||
|
|
|
||
|
|
#### Constants (in `ConstantsAndEnums`)
|
||
|
|
- `EVENT_NUMBER_PRETEST_DIAG = -1`: Identifier for pre-test diagnostic events.
|
||
|
|
- `EVENT_NUMBER_POSTTEST_DIAG = -2`: Identifier for post-test diagnostic events.
|
||
|
|
- `EVENT_NUMBER_MEASURE_BRIDGE = -3`: Identifier for bridge measurement events.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### 3. Invariants
|
||
|
|
- **Channel numbering**: `S6DBDiagnosticChannelList` uses disjoint ranges:
|
||
|
|
- Base channels: `[0, 3]`
|
||
|
|
- Extended diagnostic channels: `[100, 119]`
|
||
|
|
- No overlap between ranges.
|
||
|
|
- **Use case enum**: `UseCasesTSRAIR` is explicitly typed as `byte`, implying storage/serialization efficiency (e.g., for protocol payloads).
|
||
|
|
- **Event number constants**: Negative values (`-1`, `-2`, `-3`) are reserved for special diagnostic events, implying positive values are used for standard measurement events.
|
||
|
|
- **Localization contract**: All enums use `EnumDescriptionTypeConverter`, requiring `DescriptionAttribute` on all members for correct behavior. Missing attributes may cause runtime errors during localization/description resolution.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### 4. Dependencies
|
||
|
|
- **Imports/uses**:
|
||
|
|
- `DTS.Common.Base.Classes` (only referenced in `WakeupTriggers.cs`; purpose unclear from source).
|
||
|
|
- `DTS.Common.Converters.EnumDescriptionTypeConverter` (used by `WakeupTriggers` and `UseCasesTSRAIR`).
|
||
|
|
- `System.ComponentModel` (for `DescriptionAttribute` and `TypeConverter`).
|
||
|
|
- **Depended on by**:
|
||
|
|
- Other modules in the `DTS.Common` library (e.g., device configuration, diagnostics, and protocol layers) likely consume these enums.
|
||
|
|
- `DASType` is used to distinguish device-specific behavior (e.g., in device drivers or factory test logic).
|
||
|
|
- `S6DBDiagnosticChannelList` is likely used in data logging, telemetry, and health-monitoring components.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### 5. Gotchas
|
||
|
|
- **Channel ID conflict**: `DiagChargerDischargeCurrent = 104` is commented out but `DiagEnv_1_Temperature = 104` is active. If legacy code references `DiagChargerDischargeCurrent`, it will silently resolve to `DiagEnv_1_Temperature`.
|
||
|
|
- **Missing descriptions**: `ConstantsAndEnums.DASType` and `ConstantsAndEnums.VoltageStatusColor` lack `[Description]` attributes. Using `EnumDescriptionTypeConverter` on these enums may produce empty/incorrect descriptions.
|
||
|
|
- **Ambiguous `WakeupTriggers`**: Only `MotionDetect` is defined. Future triggers may require enum extension, but the current design does not support multiple triggers simultaneously (no `[Flags]` attribute).
|
||
|
|
- **No validation**: No runtime checks enforce valid ranges (e.g., casting arbitrary `int` to `S6DBDiagnosticChannelList` is allowed).
|
||
|
|
- **No documentation for `DASType` members**: Meanings of device types (e.g., `TOM`, `DIM`, `TSR2`) are not explained in source.
|