78 lines
7.3 KiB
Markdown
78 lines
7.3 KiB
Markdown
---
|
||
source_files:
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/ITimestampAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/ILinearized.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/IIsoCodeAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/ISerialNumberAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/IInversionAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/IEngineeringUnitAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/ICalSignalAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/IVoltageInsertAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/IShuntAware.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/ILevelTriggerable.cs
|
||
- Common/DTS.Common.DAS.Concepts/Interfaces/DAS/Channel/IDecimatable.cs
|
||
generated_at: "2026-04-16T02:05:30.336536+00:00"
|
||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||
schema_version: 1
|
||
sha256: "b4d2ceb184c9ded4"
|
||
---
|
||
|
||
# Documentation: DAS Channel Concept Interfaces
|
||
|
||
## 1. Purpose
|
||
|
||
This module defines a set of lightweight, composable interfaces that express *concepts*—behavioral or metadata capabilities—applicable to Data Acquisition System (DAS) channels. Each interface encapsulates a single concern (e.g., timestamping, linearization, shunt calibration awareness) to enable flexible, duck-typed composition of channel implementations without requiring deep inheritance hierarchies. These interfaces are used throughout the DAS framework to conditionally apply logic (e.g., calibration validation, decimation, inversion) based on what capabilities an object advertises at runtime.
|
||
|
||
## 2. Public Interface
|
||
|
||
All interfaces are *read-write* property containers; none define methods beyond indexers where noted.
|
||
|
||
| Interface | Property / Indexer | Type | Description |
|
||
|-----------|---------------------|------|-------------|
|
||
| `ITimestampAware` | `TimestampPartType` | `TimestampPartTypes` | Indicates which part(s) of a timestamp (e.g., sample time, acquisition time) are relevant for this channel. |
|
||
| `ILinearized` | `LinearizationFormula` | `DTS.Common.Classes.Sensors.LinearizationFormula` | Specifies the formula (e.g., polynomial, table-based) used to convert raw ADC values to engineering units. |
|
||
| `IIsoCodeAware` | `IsoCode` | `string` | Stores the ISO standard code (e.g., "ISO 6876") associated with the channel or sensor. |
|
||
| `ISerialNumberAware` | `SerialNumber` | `string` | Stores the hardware serial number of the sensor or channel. |
|
||
| `IInversionAware` | `IsInverted` | `bool` | Indicates whether the channel’s output should be inverted (e.g., for negative-slope sensors). |
|
||
| `IEngineeringUnitAware` | `EngineeringUnits` | `string` | Human-readable description of the engineering unit (e.g., "psi", "°C"). |
|
||
| `ICalSignalAware` | `MeasuredCalSignalMv` | `double` | Measured shunt-deflection voltage (in mV) during calibration verification. |
|
||
| | `TargetCalSignalMv` | `double` | Expected (target) shunt-deflection voltage (in mV) for calibration verification. |
|
||
| `IVoltageInsertionAware` | `ExpectedGain` | `double` | Expected gain (ratio of output change to input change) during voltage insertion/shunt check. |
|
||
| | `MeasuredGain` | `double` | Measured gain (ratio of output change to input change) during voltage insertion/shunt check. |
|
||
| `IShuntAware` | `MeasuredShuntDeflectionMv` | `double` | Measured shunt-deflection voltage (in mV) during shunt calibration. |
|
||
| | `TargetShuntDeflectionMv` | `double` | Target (nominal) shunt-deflection voltage (in mV) for shunt calibration. |
|
||
| `ILevelTriggerable` | `SampleAverageADC` | `double?` | Cached ADC sample average used for level-triggering; `null` if not cached. |
|
||
| | `TriggerBelowThresholdEu` | `double?` | Lower bound threshold (in engineering units); `null` disables below-threshold triggering. |
|
||
| | `TriggerAboveThresholdEu` | `double?` | Upper bound threshold (in engineering units); `null` disables above-threshold triggering. |
|
||
| | `LevelTriggerType` | `LevelTriggerTypes` | Specifies the trigger mode (e.g., rising, falling, window). |
|
||
| `IDecimatable<T>` | `PointsPerPoint` | `uint` | Number of raw data points compressed into one decimated point. |
|
||
| | `DecimationType` | `DecimationMethod` | Algorithm used for decimation (e.g., mean, min/max, median). |
|
||
| | `ToDecimatedArray()` | `T[]` | Returns a new array of decimated data using current settings. |
|
||
| | `this[long i]` | `T` | Indexer returning the *i*-th decimated value (post-decimation indexing). |
|
||
|
||
> **Note**: `IDecimatable<T>` is generic. The type parameter `T` represents the data type handled by the channel (e.g., `double`, `float`, or custom sample structs).
|
||
|
||
## 3. Invariants
|
||
|
||
- **Property semantics**: All properties are *read-write* (get/set) unless explicitly marked nullable (`?`)—in which case `null` is a valid state indicating absence or deactivation (e.g., `TriggerBelowThresholdEu = null` disables that trigger).
|
||
- **Threshold semantics**: For `ILevelTriggerable`, thresholds in engineering units (`TriggerBelowThresholdEu`, `TriggerAboveThresholdEu`) must be `null` to disable their respective triggers; non-null values are assumed valid and active.
|
||
- **Decimation indexing**: Implementations of `IDecimatable<T>` must ensure that `this[i]` returns the *i*-th element of the *decimated* sequence, not the raw data. The indexer is read-only and must reflect the current `PointsPerPoint` and `DecimationType`.
|
||
- **No implicit defaults**: Interfaces do not define default values; consumers must handle `null`, `0`, or `false` explicitly where appropriate.
|
||
|
||
## 4. Dependencies
|
||
|
||
- **Internal dependencies**:
|
||
- `DTS.Common.DAS.Concepts` namespace (inferred from `using` and namespace).
|
||
- `System` (only `ILevelTriggerable` imports `System`).
|
||
- Types `TimestampPartTypes`, `LevelTriggerTypes`, `DecimationMethod`, and `LinearizationFormula` are referenced but not defined here—likely defined in `DTS.Common.Classes.Sensors` or adjacent namespaces.
|
||
- **Consumers**: These interfaces are intended to be *implemented* by channel types (e.g., `Channel`, `SensorChannel`) elsewhere in the DAS framework. They are used for runtime type checking (e.g., `if (channel is IShuntAware) { ... }`) and dependency injection or visitor-style logic.
|
||
|
||
## 5. Gotchas
|
||
|
||
- **Naming inconsistency**: `IVoltageInsertAware` (file name) vs. `IVoltageInsertionAware` (interface name in source)—likely a typo in the file name (`IVoltageInsertionAware.cs` is correct per interface declaration).
|
||
- **Ambiguous `ILevelTriggerable` comment**: The comment about "14042 Flash Clear turns of excitation for s6" is highly specific and may be legacy documentation; its relevance to current implementations is unclear without context.
|
||
- **Missing `using` directives**: None of the interfaces import external namespaces beyond `System` in `ILevelTriggerable`, so all referenced types (`TimestampPartTypes`, `DecimationMethod`, etc.) must be in the same namespace or globally accessible—no explicit `using` is declared.
|
||
- **No validation semantics**: Interfaces impose no validation (e.g., `MeasuredShuntDeflectionMv` could be negative or NaN). Consumers must enforce domain constraints.
|
||
- **`IDecimatable<T>` indexing**: The indexer `this[long i]` is read-only and *must* return decimated values. Implementers must not conflate raw vs. decimated indexing—this is a common source of off-by-one or scale errors.
|
||
|
||
None identified beyond those noted above. |