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

117 lines
5.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
source_files:
- Common/DTS.Common.DataModel/Classes/Enums.cs
generated_at: "2026-04-16T03:31:47.934438+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "a8986c49f9eaee26"
---
# Classes
## Documentation: `DTS.Common.DataModel/Classes/Enums.cs`
### 1. Purpose
This module defines core enumerations used throughout the `DataPROWin7.DataModel` namespace to enforce type safety and semantic clarity for key configuration and interoperability concerns. Specifically, it standardizes:
- **`IsoChannelSensorCompatibilityLevels`**: Controls warning/error behavior when validating compatibility between ISO channels and sensors (e.g., during data import/export).
- **`SupportedExportFormats`**: Lists all export formats supported by the system, with `[Description]` attributes mapping enum values to user-facing format names (e.g., `"csv" → "CSV"`).
- **`StrictLevel`**: Defines operational modes for data validation and checkout workflows, ranging from strict enforcement (`Strict`) to permissive or expedited modes (`QuickCheckout`).
The module exists to centralize these constants, avoiding magic strings/numbers and ensuring consistent interpretation across the codebase.
---
### 2. Public Interface
#### `IsoChannelSensorCompatibilityLevels`
```csharp
public enum IsoChannelSensorCompatibilityLevels
{
DontWarn,
Warn,
DontAllow
}
```
- **Purpose**: Specifies the severity level for ISO channel-sensor compatibility mismatches.
- **Values**:
- `DontWarn`: Mismatches are silently ignored.
- `Warn`: Mismatches trigger a warning (e.g., UI alert, log entry).
- `DontAllow`: Mismatches block the operation (e.g., import/export fails).
#### `SupportedExportFormats`
```csharp
public enum SupportedExportFormats
{
[Description("CSV")] csv,
[Description("Diadem")] diadem,
[Description("ISO")] iso,
[Description("SOMAT")] somat,
[Description("TDAS")] tdas,
[Description("TSV")] tsv,
[Description("TTS")] tts,
[Description("RDF")] rdf,
[Description("TDMS")] tdms,
[Description("DDAS")] ddas,
[Description("HDF5")] hdf,
[Description("XLSX")] xlsx,
[Description("Chapter10")] chapter10, // DataPRO 3.3, IRIG 106 Chapter 10
[Description("ASC")] asc
}
```
- **Purpose**: Represents all export formats supported by the application.
- **Behavior**:
- Each value has a `[Description]` attribute specifying its display name (e.g., `csv` → `"CSV"`).
- `chapter10` is explicitly annotated as supporting *IRIG 106 Chapter 10* (a telemetry data format standard).
- **Note**: `xlsx` uses `// ReSharper disable once InconsistentNaming` to suppress naming convention warnings (likely due to casing mismatch with PascalCase guidelines).
#### `StrictLevel`
```csharp
public enum StrictLevel
{
Strict,
UpdateTable,
CheckoutOnly,
QuickCheckout
}
```
- **Purpose**: Configures the rigor of data validation and checkout operations.
- **Values**:
- `Strict`: Full validation enforced; non-compliant data rejected.
- `UpdateTable`: Validation performed, but table schemas may be updated to accommodate data.
- `CheckoutOnly`: Validation skipped; only checkout (e.g., file locking, metadata update) occurs.
- `QuickCheckout`: Minimal validation; optimized for speed (e.g., bulk operations).
---
### 3. Invariants
- **`IsoChannelSensorCompatibilityLevels`**:
- Values must be used consistently in validation logic (e.g., `DontAllow` must prevent operations, not just log warnings).
- **`SupportedExportFormats`**:
- The `[Description]` attribute value for each enum member is the canonical string representation used in UI/file dialogs.
- `chapter10` is reserved for IRIG 106 Chapter 10 exports (per inline comment).
- **`StrictLevel`**:
- `Strict` is the most restrictive mode; `QuickCheckout` is the least.
- No two modes may have identical behavior in validation/checkout logic.
---
### 4. Dependencies
- **Depends on**:
- `System.ComponentModel` (for `[Description]` attribute).
- **Depended upon**:
- Other modules in `DataPROWin7.DataModel` (inferred from namespace usage).
- Likely used by export pipelines (e.g., format selection), ISO data validation components, and checkout workflows.
- *Not directly referenced in source*, but usage is implied by the enums purpose and naming.
---
### 5. Gotchas
- **`xlsx` enum member**:
- Uses `// ReSharper disable once InconsistentNaming` to override PascalCase convention (likely due to legacy naming or external format specification requiring lowercase). This may cause confusion if developers expect consistent casing.
- **`chapter10` naming**:
- The enum value `chapter10` (lowercase) maps to `"Chapter10"` (PascalCase) via `[Description]`. Developers must use `DescriptionAttribute` to retrieve the display name, not `ToString()`.
- **Ambiguity in `StrictLevel` semantics**:
- The exact behavior differences between `UpdateTable`, `CheckoutOnly`, and `QuickCheckout` are *not specified in this file*. Implementation details (e.g., how `UpdateTable` modifies schemas) must be verified in dependent modules.
- **No validation of enum usage**:
- The enums themselves contain no runtime validation. Invalid combinations (e.g., `DontAllow` with `QuickCheckout`) must be handled by calling code.
*None identified beyond the above.*