init
This commit is contained in:
80
docs/ai/Common/DTS.Common.DAS.Concepts/DAS.md
Normal file
80
docs/ai/Common/DTS.Common.DAS.Concepts/DAS.md
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.IIsoCodeAware.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.ISerialNumberAware.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.IEngineeringUnitAware.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DecimationMethod.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.IInversionAware.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DTS.DAS.Concepts.IVoltageInsertAware.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.ILevelTriggerable.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.Data.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.DAS.Concepts.IShuntAware.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Channel.IDecimatable.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/DAS.Id.cs
|
||||
generated_at: "2026-04-17T15:30:10.771807+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "699480c930d40828"
|
||||
---
|
||||
|
||||
# Documentation: DTS.DAS.Concepts.DAS
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides the core abstract representations and interfaces for Data Acquisition System (DAS) channels within the DTS framework. It defines the conceptual building blocks for channel metadata awareness (serial numbers, ISO codes, engineering units, inversion state), calibration concepts (shunt and cal signal awareness, voltage insertion), data handling (decimation, channel data storage), and channel identification. The module serves as a contract layer that concrete DAS implementations must satisfy, enabling polymorphic treatment of different data acquisition hardware.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Classes
|
||||
|
||||
#### `Channel<DataType>` (abstract)
|
||||
**Namespace:** `DTS.DAS.Concepts.DAS`
|
||||
**File:** `DAS.Channel.cs`
|
||||
**Base:** `DTS.Utilities.Exceptional`
|
||||
|
||||
An abstract generic representation of a DAS channel. The generic type parameter `DataType` specifies the data type contained by channels of this DAS.
|
||||
|
||||
```csharp
|
||||
public abstract class Channel<DataType> : Exceptional
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### `Data<DatumType>` (abstract)
|
||||
**Namespace:** `DTS.DAS.Concepts.DAS.Channel`
|
||||
**File:** `DAS.Channel.Data.cs`
|
||||
**Base:** `DTS.Utilities.ExceptionalList<DatumType>`
|
||||
|
||||
Abstract representation of a list of channel data.
|
||||
|
||||
**Constructors:**
|
||||
```csharp
|
||||
protected Data()
|
||||
protected Data(int capacity)
|
||||
protected Data(IEnumerable<DatumType> collection)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### `Id` (sealed)
|
||||
**Namespace:** `DTS.Common.DAS.Concepts.DAS`
|
||||
**File:** `DAS.Id.cs`
|
||||
**Base:** `DTS.Common.Utilities.Exceptional`
|
||||
**Implements:** `IComparable<Id>`, `IEquatable<Id>`
|
||||
|
||||
A string-based identifier type with case-insensitive comparison semantics.
|
||||
|
||||
**Constructors:**
|
||||
```csharp
|
||||
public Id(string value)
|
||||
```
|
||||
|
||||
**Properties:**
|
||||
```csharp
|
||||
// No public properties; value is accessed via ToString() or implicit conversion
|
||||
```
|
||||
|
||||
**Operators
|
||||
39
docs/ai/Common/DTS.Common.DAS.Concepts/DAS/Channel.md
Normal file
39
docs/ai/Common/DTS.Common.DAS.Concepts/DAS/Channel.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/Channel/LevelTriggerTypes.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/Channel/Channel.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/Channel/TimestampPartTypes.cs
|
||||
- Common/DTS.Common.DAS.Concepts/DAS/Channel/Data.cs
|
||||
generated_at: "2026-04-17T16:02:26.602478+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "f01712407c9d73cd"
|
||||
---
|
||||
|
||||
# Channel
|
||||
|
||||
### Purpose
|
||||
This module provides core abstractions and type definitions for Data Acquisition System (DAS) channels. It defines the fundamental building blocks for representing channel data, trigger conditions, and timestamp parsing within the DTS DAS architecture. The module serves as a conceptual foundation layer that other DAS components build upon.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**`LevelTriggerTypes`** (enum, Flags)
|
||||
- A bitwise flag enumeration defining trigger condition types for level-based triggering.
|
||||
- Values:
|
||||
- `NONE = 0x00` - No trigger condition
|
||||
- `OutsideWindow = 0x01` - Trigger when outside a defined window
|
||||
- `InsideWindow = 0x02` - Trigger when inside a defined window
|
||||
- `LessThan = 0x04` - Trigger when value is less than threshold
|
||||
- `GreaterThan = 0x08` - Trigger when value is greater than threshold
|
||||
|
||||
**`TimestampPartTypes`** (enum, Flags)
|
||||
- A bitwise flag enumeration identifying components of a timestamp, with `TypeConverter` support for UI binding.
|
||||
- Values:
|
||||
- `Marker = 1 << 0` - Marker bit
|
||||
- `Seconds_High = 1 << 1` - High bits of seconds field
|
||||
- `Seconds_Low = 1 << 2` - Low bits of seconds field
|
||||
- `Nanoseconds_High = 1 << 3` - High bits of nanoseconds field
|
||||
- `Nanoseconds_Low = 1 << 4` - Low bits of nanoseconds field
|
||||
- `Reserved = 1 << 5` - Reserved bits
|
||||
|
||||
**`Channel<TDataType>`
|
||||
56
docs/ai/Common/DTS.Common.DAS.Concepts/Interfaces.md
Normal file
56
docs/ai/Common/DTS.Common.DAS.Concepts/Interfaces.md
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/ITriggerable.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/IDataCollectionEnabled.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/ICalibratable.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/ILargeDataAware.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/IRealtimeable.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/IGpioEnabled.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/IDownloadEnabled.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Interfaces/IArmable.cs
|
||||
generated_at: "2026-04-17T15:32:37.442181+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "1681496bcdfa352d"
|
||||
---
|
||||
|
||||
# Documentation: DTS.Common.DAS.Concepts Interfaces
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module defines a set of interfaces that describe the core capabilities of Data Acquisition System (DAS) hardware devices. These interfaces model behaviors such as arming, triggering, calibration, data collection, real-time sampling, GPIO control, and data download. The design enables polymorphic treatment of different hardware models (TSR, HEADS, NASCAR variants) while allowing type-specific implementations where necessary. The interfaces are intended to be composed together to describe complete device capabilities.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Interfaces
|
||||
|
||||
#### `ITriggerable`
|
||||
**Namespace:** `DTS.Common.DAS.Concepts`
|
||||
|
||||
```csharp
|
||||
public interface ITriggerable
|
||||
{
|
||||
void Trigger();
|
||||
}
|
||||
```
|
||||
A minimal interface describing an object that can be triggered. The `Trigger()` method initiates the trigger action on the implementing object.
|
||||
|
||||
---
|
||||
|
||||
#### `IArmable`
|
||||
**Namespace:** `DTS.Common.DAS.Concepts`
|
||||
|
||||
```csharp
|
||||
public interface IArmable
|
||||
{
|
||||
void Arm();
|
||||
void Disarm();
|
||||
ArmStatus ArmStatus { get; }
|
||||
AvailableArmModes ArmMode { get; }
|
||||
}
|
||||
```
|
||||
Describes an object that can be armed and disarmed. Implementers must provide:
|
||||
- `Arm()` — transitions the device to an armed state
|
||||
- `Disarm()` — transitions the device to a
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
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-17T16:22:35.617754+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "fda666571e5cc4ab"
|
||||
---
|
||||
|
||||
# Channel
|
||||
|
||||
1. **Purpose**
|
||||
This module defines a set of fine-grained interfaces (mixins) used to compose data acquisition system (DAS) channel behaviors. It allows channels to opt into specific capabilities—such as linearization, triggering, decimation, and calibration checks—without enforcing a rigid monolithic class hierarchy. These interfaces define the "awareness" of a channel regarding specific hardware or configuration concepts.
|
||||
|
||||
2. **Public Interface**
|
||||
* `ITimestampAware`: Defines timestamp configuration.
|
||||
* `TimestampPartTypes TimestampPartType { get; set; }`
|
||||
* `ILinearized`: Defines linearization capabilities.
|
||||
* `DTS.Common.Classes.Sensors.LinearizationFormula LinearizationFormula { get; set; }`
|
||||
* `IIsoCodeAware`: Defines ISO code association.
|
||||
* `string IsoCode { get; set; }`
|
||||
* `ISerialNumberAware`: Defines serial number association.
|
||||
* `string SerialNumber { get; set; }`
|
||||
* `IInversionAware`: Defines signal inversion state.
|
||||
* `bool IsInverted { get; set; }`
|
||||
* `IEngineeringUnitAware`: Defines engineering unit description.
|
||||
* `string EngineeringUnits { get; set; }`
|
||||
* `ICalSignalAware`: Defines calibration signal measurements.
|
||||
* `double MeasuredCalSignalMv { get; set; }`
|
||||
* `double TargetCalSignalM
|
||||
38
docs/ai/Common/DTS.Common.DAS.Concepts/Properties.md
Normal file
38
docs/ai/Common/DTS.Common.DAS.Concepts/Properties.md
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common.DAS.Concepts/Properties/AssemblyInfo.cs
|
||||
generated_at: "2026-04-17T16:26:29.249568+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "cac7441424bad40e"
|
||||
---
|
||||
|
||||
# Properties
|
||||
|
||||
### Purpose
|
||||
This module contains assembly metadata for the `DTS.DAS.Concepts` assembly. It is a build-time configuration file that defines version information, copyright, and COM visibility settings for the assembly. It does not contain executable logic or types.
|
||||
|
||||
### Public Interface
|
||||
No public types, functions, or methods are defined in this module. The file contains only assembly-level attributes:
|
||||
- `AssemblyTitle`: Set to `"DTS.DAS.Concepts"`
|
||||
- `AssemblyDescription`: Empty
|
||||
- `AssemblyCompany`: `"DTS"`
|
||||
- `AssemblyProduct`: `"DTS.DAS.Concepts"`
|
||||
- `AssemblyCopyright`: `"Copyright © DTS 2008"`
|
||||
- `ComVisible`: `false`
|
||||
- `Guid`: `"9b6f7402-27d3-4cc9-9ff3-3cfe16e0b429"`
|
||||
- `AssemblyVersion`: `"1.06.0081"`
|
||||
- `AssemblyFileVersion`: `"1.06.0081"`
|
||||
|
||||
### Invariants
|
||||
- COM visibility is explicitly set to `false`, meaning types in this assembly are not visible to COM components by default.
|
||||
- The assembly version and file version are synchronized at `"1.06.0081"`.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on**: `System.Reflection`, `System.Runtime.InteropServices` (standard .NET Framework assemblies).
|
||||
- **Depended on by**: Cannot be determined from this file alone.
|
||||
|
||||
### Gotchas
|
||||
- The `AssemblyTitle` attribute value (`"DTS.DAS.Concepts"`) differs from the module path name (`DTS.Common.DAS.Concepts`). This discrepancy may cause confusion when referencing the assembly.
|
||||
|
||||
---
|
||||
124
docs/ai/Common/DTS.Common.DAS.Concepts/Test.md
Normal file
124
docs/ai/Common/DTS.Common.DAS.Concepts/Test.md
Normal file
@@ -0,0 +1,124 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.Channel.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.Channel.Sensor.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.Channel.Sensor.Bridge.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.Channel.Sensor.SensorUnits.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.Channel.Sensor.ZeroMethod.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.RecordingMode.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Test.Module.Channel.Sensor.ExcitationVoltage.cs
|
||||
generated_at: "2026-04-17T15:32:50.545450+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "b632931e43678d7e"
|
||||
---
|
||||
|
||||
# Documentation: DTS.DAS.Concepts Test Module Hierarchy
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides a hierarchical container structure for Data Acquisition System (DAS) concepts related to test configuration. It defines enumerations and utility methods for sensor configuration (bridge types, coupling modes, excitation voltages, sensitivity units, zero methods) and module recording modes. The structure follows a nested partial class pattern where `Test.Module.Channel.Sensor` serves as the primary namespace for sensor-related concepts, while `Test.Module` contains module-level configuration. All container classes are designed as static containers with private constructors and are not intended for instantiation.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Test.Module (sealed partial class)
|
||||
Container for DTS generic module concepts. Not instantiable.
|
||||
|
||||
#### Methods
|
||||
- **`public static RecordingMode GetRecordingModeFromString(string recordingMode)`**
|
||||
- Converts a string representation of a recording mode enumeration into its corresponding `RecordingMode` enum value.
|
||||
- Throws `Exception` if the string cannot be parsed.
|
||||
|
||||
#### Enums
|
||||
- **`RecordingMode`** - All available recording mode options.
|
||||
- `InvalidArmMode = 0` - Invalid mode, cannot be used
|
||||
- `CircularBuffer = 1` - Circular buffer mode (constant recording, trigger)
|
||||
- `RecorderMode = 2` - Recorder mode (start, trigger)
|
||||
- `AutoCircularBufferMode = 4` - Constant recording, trigger, rearm after data collected
|
||||
- `AutoRecorderMode = 5` - Recorder mode (start, trigger) rearm after data collected
|
||||
- `ImmediateMode = 0x06` - Purpose unclear from source
|
||||
- `HighPowerRecorderMode = 0x07` - Purpose unclear from source
|
||||
- `LowPowerRecorderMode = 0x08` - Purpose unclear from source
|
||||
- `ContinuousRecorderMode = 0x09` - Purpose unclear from source
|
||||
- `HybridRecorderMode = 0x0A` - Purpose unclear from source
|
||||
- `MultiHybridRecorderMode = 0x0B` - Purpose unclear from source
|
||||
|
||||
---
|
||||
|
||||
### Test.Module.Channel (sealed partial class)
|
||||
Container for DTS generic channel concepts. Not instantiable.
|
||||
|
||||
---
|
||||
|
||||
### Test.Module.Channel.Sensor (sealed partial class)
|
||||
Container for DTS generic sensor concepts. Not instantiable.
|
||||
|
||||
#### Enums
|
||||
- **`CouplingModes`** - IEPE Coupling modes
|
||||
- `AC` - Description: "AC"
|
||||
- `DC` - Description: "AC/DC"
|
||||
|
||||
- **`BridgeType`** - All available bridge types (bit-shifted values)
|
||||
- `IEPE = 1 << 0` - Sensor uses IEPE setup
|
||||
- `QuarterBridge = 1 << 1` - Sensor uses quarter bridge setup
|
||||
- `HalfBridge = 1 << 2` - Sensor uses half bridge setup
|
||||
- `FullBridge = 1 << 3` - Sensor has full bridge setup
|
||||
- `DigitalInput = 1 << 4`
|
||||
- `SQUIB = 1 << 5`
|
||||
- `TOMDigital = 1 << 6`
|
||||
|
||||
- **`SensUnits`** - All available Sensitivity Unit types
|
||||
- `NONE = 0` - No Sensitivity Units (Polynomial Sensor)
|
||||
- `mV = 1` - Sensitivity expressed in mV with output at Capacity EU
|
||||
- `mVperV = 2` - Excitation proportional sensitivity expressed in mV/V with output at Capacity EU
|
||||
- `mVperVperEU = 3` - Excitation proportional sensitivity expressed in mV/V/EU
|
||||
- `mVperEU = 4` - Sensitivity expressed in mV/EU
|
||||
|
||||
- **`ZeroMethodType`** - All available zero method types
|
||||
- `AverageOverTime = 0` - Calculate electrical zero using an average over time
|
||||
- `UsePreEventDiagnosticsZero = 1` - Calculate zero using time in pre-event
|
||||
- `None = 2` - Calculate zero using injected value
|
||||
|
||||
- **`OriginalZeroMethodType`** - Original version of zero method types (for legacy compatibility)
|
||||
- `AverageOverTime` - Calculate electrical zero using an average over time
|
||||
- `UsePreCalZero` - Calculate zero using time in pre-event
|
||||
- `None` - Calculate zero using injected value
|
||||
|
||||
- **`ExcitationVoltageOption`** - All available excitation voltages
|
||||
- `Undefined = 1` - Undefined excitation voltage (0.0V)
|
||||
- `Volt2 = 2` - 2.0V
|
||||
- `Volt2_5 = 4` - 2.5V
|
||||
- `Volt3 = 8` - 3.0V
|
||||
- `Volt5 = 16` - 5.0V
|
||||
- `Volt10 = 32` - 10.0V
|
||||
- `Volt1 = 64` - 1.0V
|
||||
|
||||
#### Methods
|
||||
- **`public static double GetExcitationVoltageMagnitudeFromEnum(ExcitationVoltageOption target)`**
|
||||
- Converts an `ExcitationVoltageOption` enum value to its associated numeric voltage magnitude.
|
||||
- Throws `Exception` on failure.
|
||||
|
||||
- **`public static ExcitationVoltageOption GetExcitationVoltageEnumFromMagnitude(double magnitude)`**
|
||||
- Converts a voltage magnitude (double) to the corresponding `ExcitationVoltageOption` enum value.
|
||||
- Throws `NotSupportedException` if the magnitude doesn't match a known option.
|
||||
|
||||
#### Nested Classes
|
||||
- **`VoltageMagnitudeAttribute`** (extends `System.Attribute`)
|
||||
- Attribute for specifying the numerical magnitude of an enum field's representation.
|
||||
- Constructor: `VoltageMagnitudeAttribute(double value)`
|
||||
- Property: `Value` (double) - Returns the voltage magnitude.
|
||||
|
||||
- **`VoltageMagnitudeAttributeCoder`** (extends `AttributeCoder<ExcitationVoltageOption, VoltageMagnitudeAttribute, double>`)
|
||||
- Utility class for manipulating voltage option enumeration-attached magnitude values.
|
||||
- Constructor: `VoltageMagnitudeAttributeCoder()`
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
1. **Container Non-Instantiability**: `Module`, `Channel`, and `Sensor` classes all have private constructors and are not intended for instantiation. They serve solely as static containers for nested types.
|
||||
|
||||
2
|
||||
218
docs/ai/Common/DTS.Common.DAS.Concepts/Test/Module.md
Normal file
218
docs/ai/Common/DTS.Common.DAS.Concepts/Test/Module.md
Normal file
@@ -0,0 +1,218 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Module/RecordingMode.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Module/TiltAxes.cs
|
||||
generated_at: "2026-04-17T15:41:18.940422+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "db7767b693a54948"
|
||||
---
|
||||
|
||||
# Documentation: Test.Module (TiltAxes & RecordingMode)
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides utilities for managing tilt sensor configuration and recording mode conversions within the DTS DAS (Data Acquisition System) Concepts framework. It handles the translation of raw ADC tilt sensor data into engineering units (degrees), manages axis orientation configurations (including axis inversion and ordering), and provides string-to-enum conversion for recording modes. The module is part of a larger `Test` partial class hierarchy and serves as a bridge between hardware-level sensor readings and application-level tilt calculations.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### RecordingMode.cs
|
||||
|
||||
#### `Test.Module.GetRecordingModeFromString`
|
||||
```csharp
|
||||
public static DFConstantsAndEnums.RecordingMode GetRecordingModeFromString(string recordingMode)
|
||||
```
|
||||
Converts a string representation of a recording mode enumeration into its corresponding `DFConstantsAndEnums.RecordingMode` enum value. Throws an `Exception` with a descriptive message if parsing fails (including handling for null input).
|
||||
|
||||
---
|
||||
|
||||
### TiltAxes.cs
|
||||
|
||||
#### Nested Classes
|
||||
|
||||
##### `TiltAxis`
|
||||
A data container class with the following properties:
|
||||
| Property | Type | Default |
|
||||
|----------|------|---------|
|
||||
| `AxisNumber` | `int` | - |
|
||||
| `CurrentTilt` | `double` | - |
|
||||
| `Label` | `string` | - |
|
||||
| `Inversion` | `int` | `1` |
|
||||
| `IsIgnored` | `bool` | `false` |
|
||||
| `MountedOffset` | `double` | `0.0` |
|
||||
| `TargetOffset` | `double` | `0.0` |
|
||||
|
||||
##### `TiltAxesHelper`
|
||||
A helper class for managing tilt axis configurations.
|
||||
|
||||
**Constructors:**
|
||||
```csharp
|
||||
public TiltAxesHelper() // Default constructor, initializes 3 axes
|
||||
public TiltAxesHelper(string TiltAxes, double MountOffsetAxisOne, double MountOffsetAxisTwo,
|
||||
double TargetAxisOne, double TargetAxisTwo, double LevelTolerance,
|
||||
int AxisIgnored, bool UseForTiltCalculation)
|
||||
```
|
||||
|
||||
**Properties:**
|
||||
- `Dictionary<int, TiltAxis> AxisConfigurations` - Dictionary of axis configurations
|
||||
- `TiltAxis AxisOne` / `TiltAxis AxisTwo` - References to the two active axes
|
||||
- `double LevelTolerance` - Default: `0.5`
|
||||
|
||||
**Methods:**
|
||||
```csharp
|
||||
public string AxesToString() // Returns string representation of axes with polarity
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### Enumerations
|
||||
|
||||
##### `TiltAxesSimple`
|
||||
```csharp
|
||||
public enum TiltAxesSimple { XYZ = 0, XZY = 1, YXZ = 2, YZX = 3, ZXY = 4, ZYX = 5 }
|
||||
```
|
||||
|
||||
##### `TiltAxesPolarity`
|
||||
```csharp
|
||||
public enum TiltAxesPolarity { PPP = 0, PPN = 1, PNP = 2, PNN = 3, NPP = 4, NPN = 5, NNP = 6, NNN = 7 }
|
||||
```
|
||||
|
||||
##### `TiltSensorCalAttributes`
|
||||
Enumeration with 18 calibration attributes for tilt sensors (indices 0-17), including gains, zeros, and dominant axis calibration values.
|
||||
|
||||
##### `AxisLabel`
|
||||
```csharp
|
||||
public enum AxisLabel { X = 0, Y = 1, Z = 2 }
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### Static Methods
|
||||
|
||||
##### `SimplifyTiltAxes`
|
||||
```csharp
|
||||
public static TiltAxesSimple SimplifyTiltAxes(TiltAxes axes)
|
||||
```
|
||||
Removes 'I' (inversion) markers from a `TiltAxes` enum value and returns the simplified `TiltAxesSimple` equivalent.
|
||||
|
||||
##### `GetTiltAxesFromString`
|
||||
```csharp
|
||||
public static TiltAxes GetTiltAxesFromString(string tiltAxes)
|
||||
```
|
||||
Converts a string representation to a `TiltAxes` enum value. Throws an `Exception` on parse failure.
|
||||
|
||||
##### `GetPolaritiesFromTiltAxes`
|
||||
```csharp
|
||||
public static int[] GetPolaritiesFromTiltAxes(TiltAxes ta)
|
||||
```
|
||||
Returns an `int[3]` where each element is `-1` (inverted) or `1` (not inverted) based on the 'I' markers in the enum name.
|
||||
|
||||
##### `GetBoolPolaritiesFromTiltAxes`
|
||||
```csharp
|
||||
public static bool[] GetBoolPolaritiesFromTiltAxes(TiltAxes tiltAxes)
|
||||
```
|
||||
Returns a `bool[3]` where `true` indicates an inverted axis.
|
||||
|
||||
##### `GetTiltDegreesEU`
|
||||
```csharp
|
||||
public static double[] GetTiltDegreesEU(short[] tiltSensorADC, double[] tiltSensorCals)
|
||||
public static double[] GetTiltDegreesEU(short[] tiltSensorADC, double[] tiltSensorCals,
|
||||
TiltAxes axes, int ignoredAxis, float[] mountOffsetAxis)
|
||||
```
|
||||
Converts raw ADC values to tilt degrees in engineering units. Returns `double[3]` with X, Y, Z tilt values. Ignored axis values are set to `double.NaN`. Uses 3 decimal places of precision (`SIGNIFICANT_DIGITS = 1000`).
|
||||
|
||||
##### `GetTiltZeroData`
|
||||
```csharp
|
||||
public static double[] GetTiltZeroData(short[] tiltSensorADC, double[] tiltSensorCals, int dominantAxis)
|
||||
```
|
||||
Retrieves zero calibration data based on the dominant axis and its polarity.
|
||||
|
||||
##### `GetDominantTiltAxis`
|
||||
```csharp
|
||||
public static int GetDominantTiltAxis(short[] tiltSensorADC)
|
||||
```
|
||||
Returns the index of the axis with the largest absolute ADC value.
|
||||
|
||||
##### `GetTiltGains`
|
||||
```csharp
|
||||
public static double[] GetTiltGains(double[] tiltSensorCals)
|
||||
```
|
||||
Returns gain values for all three axes. Defaults to `1.0` if gain is `0`.
|
||||
|
||||
##### `GetAxisLabelFromTiltAxes`
|
||||
```csharp
|
||||
public static AxisLabel[] GetAxisLabelFromTiltAxes(TiltAxes tiltAxes)
|
||||
public static AxisLabel[] GetAxisLabelFromTiltAxes(string tiltAxes)
|
||||
```
|
||||
Extracts axis labels from a `TiltAxes` configuration.
|
||||
|
||||
##### `ConvertBoolToInvertString`
|
||||
```csharp
|
||||
public static string ConvertBoolToInvertString(bool isInverted)
|
||||
```
|
||||
Returns `"I"` if inverted, empty string otherwise.
|
||||
|
||||
##### `GetOrientationLabelFromAxisInfo`
|
||||
```csharp
|
||||
public static string GetOrientationLabelFromAxisInfo(string[] axisLabels, bool[] invertAxis)
|
||||
```
|
||||
Builds an orientation label string from axis labels and inversion flags.
|
||||
|
||||
##### `GetTiltAxesFromAxisInfo`
|
||||
```csharp
|
||||
public static TiltAxes GetTiltAxesFromAxisInfo(string[] axisLabels, bool[] invertAxis)
|
||||
```
|
||||
Constructs a `TiltAxes` enum from axis labels and inversion flags.
|
||||
|
||||
##### `GetMountOffsetsOrTargetsFromAxisInfo`
|
||||
```csharp
|
||||
public static float[] GetMountOffsetsOrTargetsFromAxisInfo(float[] perAxisValue, int axisToIgnore)
|
||||
```
|
||||
Extracts mount offsets or targets for the two non-ignored axes. Returns `float[2]`.
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **Array Sizes**: `tiltSensorADC` must contain exactly 3 elements. `tiltSensorCals` must contain at least 18 elements (indexed by `TiltSensorCalAttributes`).
|
||||
- **Ignored Axis Values**: Valid values are `1`, `2`, or `3`. A value of `0` is treated as `3`.
|
||||
- **Precision**: Tilt degree calculations are rounded to 3 decimal places using `SIGNIFICANT_DIGITS = 1000`.
|
||||
- **Gain Default**: If a gain calibration value is `0`, it defaults to `1.0` to prevent division by zero.
|
||||
- **Dictionary Keys**: `TiltAxesHelper.AxisConfigurations` uses keys `1`, `2`, and `3` (1-indexed), not `0`, `1`, `2`.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This module depends on:
|
||||
- `DTS.Common.Enums.DASFactory` - For `DFConstantsAndEnums.RecordingMode` and `TiltAxes` enum
|
||||
- `DTS.Common.Utilities` - For `DegreesFromADC.GetDegrees()` method
|
||||
- `System`, `System.Collections.Generic`, `System.Linq`, `System.Text`
|
||||
|
||||
### Consumers:
|
||||
- Unknown from source alone. The partial class structure (`Test.Module`) suggests this is consumed by other components within the `DTS.Common.DAS.Concepts` namespace.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
### Critical Bugs in `TiltAxesHelper` Constructor
|
||||
|
||||
1. **Bug: `AxisTwo` never assigned in default case**
|
||||
```csharp
|
||||
else
|
||||
{
|
||||
AxisOne = AxisConfigurations[1];
|
||||
AxisOne = AxisConfigurations[2]; // BUG: Should be AxisTwo
|
||||
}
|
||||
```
|
||||
When `AxisIgnored` is not `1` or `2`, `AxisTwo` remains `null` and `AxisOne` is assigned twice.
|
||||
|
||||
2. **Bug: `TargetAxisTwo` assigned to wrong property**
|
||||
```csharp
|
||||
AxisOne.TargetOffset = TargetAxisOne;
|
||||
AxisOne.TargetOffset = TargetAxisTwo; // BUG: Should be AxisTwo.TargetOffset
|
||||
```
|
||||
`AxisTwo.TargetOffset` is never set; `Axis
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Module/Channel/Sensor/SensorUnits.cs
|
||||
- Common/DTS.Common.DAS.Concepts/Test/Module/Channel/Sensor/ExcitationVoltage.cs
|
||||
generated_at: "2026-04-17T15:40:36.715938+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "383041d9dd8bd8c1"
|
||||
---
|
||||
|
||||
# Documentation: Test.Module.Channel.Sensor (SensorUnits & ExcitationVoltage)
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module defines sensor-related enumerations and conversion utilities within the `DTS.Common.DAS.Concepts` namespace. It provides the `SensUnits` enumeration for specifying sensitivity unit types (e.g., mV, mV/V, mV/V/EU) used in sensor configurations, and offers static helper methods for converting between `ExcitationVoltageOptions.ExcitationVoltageOption` enum values and their associated numeric voltage magnitudes. This is part of a larger partial class hierarchy modeling test module channel configurations.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Enum: `Test.Module.Channel.Sensor.SensUnits`
|
||||
|
||||
Defined in `SensorUnits.cs`:
|
||||
|
||||
| Member | Value | Description Attribute | Purpose |
|
||||
|--------|-------|----------------------|---------|
|
||||
| `NONE` | 0 | "NONE" | No Sensitivity Units (Polynomial Sensor) |
|
||||
| `mV` | 1 | "mV" | Sensitivity expressed in mV with output at Capacity EU |
|
||||
| `mVperV` | 2 | "mV/V" | Excitation proportional sensitivity expressed in mV/V with output at Capacity EU |
|
||||
| `mVperVperEU` | 3 | "mV/V/EU" | Excitation proportional sensitivity expressed in mV/V/EU |
|
||||
| `mVperEU` | 4 | "mV/EU" | Sensitivity expressed in mV/EU |
|
||||
|
||||
---
|
||||
|
||||
### Static Methods (defined in `ExcitationVoltage.cs`)
|
||||
|
||||
#### `GetExcitationVoltageMagnitudeFromEnum`
|
||||
|
||||
```csharp
|
||||
public static double GetExcitationVoltageMagnitudeFromEnum(
|
||||
ExcitationVoltageOptions.ExcitationVoltageOption target)
|
||||
```
|
||||
|
||||
Converts an `ExcitationVoltageOptions.ExcitationVoltageOption` enum value to its associated numeric voltage magnitude (in volts). Uses `ExcitationVoltageOptions.VoltageMagnitudeAttributeCoder.DecodeAttributeValue()` internally.
|
||||
|
||||
**Returns:** The `double` magnitude associated with the specified voltage option.
|
||||
|
||||
**Throws:** `ArgumentException` with message "encountered problem attempting to get excitation voltage magnitude from enum" if decoding fails.
|
||||
|
||||
---
|
||||
|
||||
#### `GetExcitationVoltageEnumFromMagnitude`
|
||||
|
||||
```csharp
|
||||
public static ExcitationVoltageOptions.ExcitationVoltageOption GetExcitationVoltageEnumFromMagnitude(
|
||||
double magnitude)
|
||||
```
|
||||
|
||||
Converts a numeric voltage magnitude to the corresponding `ExcitationVoltageOptions.ExcitationVoltageOption
|
||||
Reference in New Issue
Block a user