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

89 lines
3.2 KiB
Markdown

---
source_files:
- Common/DTS.Common.DataModel/Common/StatusHelpers.cs
- Common/DTS.Common.DataModel/Common/TestObjectHelper.cs
- Common/DTS.Common.DataModel/Common/ChannelHelper.cs
- Common/DTS.Common.DataModel/Common/TestSetupCollection.cs
generated_at: "2026-04-17T15:36:25.187144+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5be6ced2d64c64b8"
---
# Documentation: DTS.Common.DataModel.Common
## 1. Purpose
This module provides utility classes and helpers for managing test configurations, channel naming, status reporting, and test setup collections within the DTS data model layer. It serves as a common utility layer that bridges the data model with UI concerns (progress reporting), database operations (test setup persistence), and hardware abstraction (channel/sensor information). The module centralizes test setup caching with CRC-based staleness detection and provides formatting utilities for channel identification in warning messages.
---
## 2. Public Interface
### StatusHelpers
**Delegate:**
```csharp
public delegate void SetProgressValueDelegate(IDASCommunication idas, double progressValue, TSRAIRGoStatus.StatusTypes? status);
```
A delegate type for setting progress values on DAS communication objects.
**Methods:**
```csharp
public static void SetStatus2(IDASCommunication das, int progressValue, TSRAIRGoStatus.StatusTypes? status, SetProgressValueDelegate setProgressValue)
```
Invokes the provided delegate with the given DAS object, progress value, and status. This is a pass-through method that delegates the actual status-setting logic to the caller-provided callback.
---
### TestObjectHelper
**Constants:**
```csharp
public const double TDC_LEGACY_TOM_CUTOFF_SPS = 8000;
```
The sample rate breakpoint (8000 SPS) for TDC software filters on TOM channels. Above this threshold, CFC 1000 filter is used; at or below, TDC uses 1/5 of SPS.
```csharp
public const double TDC_LEGACY_TOM_HIGH_FILTER = 1650D;
```
The default filter value (CFC1000) in TDC for TOM channels recorded at sample rates greater than 8000 SPS.
---
### ChannelHelper (static class)
**Methods:**
```csharp
public static string GetWarningChannelName(IGroupChannel groupChannel)
```
Constructs a formatted warning channel name string. The format depends on `TestSetupOrder`:
- If `TestSetupOrder >= 0`: uses `TestSetupOrder` as prefix
- Otherwise: uses `GroupChannelOrder` as prefix
If `GetChannelName(SerializedSettings.ISOViewMode)` returns a non-empty name, appends `'name'`. Otherwise, appends `''` followed by `Sensor` (if `SensorValid`) and `Hardware` (if `HardwareValid`) in parentheses.
---
### TestSetupCollection
**Properties:**
```csharp
public static List<string> TestSetupIds { get; }
```
Returns a copy of the test setup ID list. Thread-safe via `TestSetupListLock`.
```csharp
public static object TestSetupListLock { get; }
```
A static lock object for thread-safe access to internal collections. Initialized to `new object()`.
```csharp
public static TestTemplate[] TestSetups { get; }
```
Returns a copy of the actual test templates array. Thread-safe via `TestSetupListLock`.
```csharp
public static string[] TestSetupList { get; }
```
Returns an array of test setup names. Lazily initializes the internal list if null or empty. Filters templates by `IsComplete ==