94 lines
3.9 KiB
Markdown
94 lines
3.9 KiB
Markdown
---
|
|
source_files:
|
|
- Common/DTS.Common/Classes/DASFactory/DiagnosticMessageRow.cs
|
|
- Common/DTS.Common/Classes/DASFactory/TCDiagnosticResult.cs
|
|
- Common/DTS.Common/Classes/DASFactory/CanDiagnostics.cs
|
|
- Common/DTS.Common/Classes/DASFactory/TemperatureConfig.cs
|
|
- Common/DTS.Common/Classes/DASFactory/TMSNConfig.cs
|
|
generated_at: "2026-04-17T15:36:22.888936+00:00"
|
|
model: "zai-org/GLM-5-FP8"
|
|
schema_version: 1
|
|
sha256: "cf619de901da9b9c"
|
|
---
|
|
|
|
# DTS.Common.Classes.DASFactory Module Documentation
|
|
|
|
## 1. Purpose
|
|
|
|
This module provides data structures and configuration classes for the Data Acquisition System (DAS) factory components. It encapsulates diagnostic results for hardware channels (thermocouple and CAN bus), temperature logging configuration, and TMNS (Telemetry) streaming configuration. The classes serve as data transfer objects and configuration containers that bridge hardware diagnostics with the application layer, implementing property change notification for UI binding scenarios.
|
|
|
|
---
|
|
|
|
## 2. Public Interface
|
|
|
|
### DiagnosticMessageRow
|
|
|
|
A simple data container class for diagnostic message rows, currently used for CAN BIST (Built-In Self-Test) results.
|
|
|
|
**Constructor:**
|
|
```csharp
|
|
public DiagnosticMessageRow(string field, string value, string verdict)
|
|
```
|
|
|
|
**Properties:**
|
|
- `string Field { get; set; }` - The field name being diagnosed
|
|
- `string Value { get; set; }` - The diagnostic value
|
|
- `string Verdict { get; set; }` - The pass/fail verdict
|
|
|
|
**Methods:**
|
|
- `override string ToString()` - Returns formatted string: `"Field: {Field}, Value: {Value}, Verdict: {Verdict}"`
|
|
|
|
---
|
|
|
|
### TCDiagnosticResult
|
|
|
|
Implements `ITCDiagnosticResult` to hold thermocouple channel diagnostic results with property change notification.
|
|
|
|
**Properties:**
|
|
- `string ChannelName { get; set; }` - Name of the channel (default: empty string)
|
|
- `int ChannelIndex { get; set; }` - Index of the channel (default: 0)
|
|
- `double? CurrentReading { get; set; }` - Nullable current reading value (default: null)
|
|
- `DiagnosticStatus Status { get; set; }` - Diagnostic status (default: `DiagnosticStatus.Untested`)
|
|
- `ConnectionStatuses ConnectionStatus { get; set; }` - Connection status (default: `ConnectionStatuses.NotTested`)
|
|
|
|
**Methods:**
|
|
- `void Copy(ITCDiagnosticResult source)` - Copies `ChannelName`, `CurrentReading`, `Status`, and `ConnectionStatus` from source. Does **not** copy `ChannelIndex`.
|
|
|
|
---
|
|
|
|
### CanDiagnostics
|
|
|
|
Implements `ICanDiagnosticResult` to hold CAN bus diagnostic information with property change notification.
|
|
|
|
**Properties:**
|
|
- `bool Active { get; set; }` - Whether the CAN channel is active (default: false)
|
|
- `int ChannelIndex { get; set; }` - Index of the channel (default: -1)
|
|
- `int Data { get; set; }` - Data value (default: 0)
|
|
- `int ErrorFrame { get; set; }` - Error frame count (default: 0); setting triggers `OnPropertyChanged("Errors")`
|
|
- `double Load { get; set; }` - Bus load value
|
|
- `int Overruns { get; set; }` - Overrun count (default: 0); setting triggers `OnPropertyChanged("Errors")`
|
|
- `DateTime LastUpdate { get; set; }` - Timestamp of last update (default: `DateTime.MinValue`)
|
|
- `int Errors { get; }` - Computed property: returns `1 + Overruns` if `ErrorFrame != 0`, otherwise returns `Overruns`
|
|
- `string ChannelName { get; set; }` - Name of the channel (default: empty string)
|
|
|
|
**Methods:**
|
|
- `void Copy(ICanDiagnosticResult source)` - Copies all properties except `Errors` from source
|
|
|
|
---
|
|
|
|
### TemperatureConfig
|
|
|
|
Configuration class for temperature logging channels, using a `BitArray` internally to track enabled channels.
|
|
|
|
**Constructors:**
|
|
```csharp
|
|
public TemperatureConfig()
|
|
public TemperatureConfig(ushort[] ushortArray)
|
|
```
|
|
|
|
**Properties:**
|
|
- `ushort LogEnable { get; set; }` - Logging enable flag
|
|
- `ushort LogIntervalSec { get; set; }` - Logging interval in seconds
|
|
- `ushort Channels { get; set; }` - Bitmask of enabled channels (backed by internal `BitArray`)
|
|
- `const ushort Reserved = 0` - Reserved field constant
|
|
- `bool |