This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
---
source_files:
- DataPRO/IService/Classes/Arm/ArmCheckActions.cs
- DataPRO/IService/Classes/Arm/ArmCheckResults.cs
- DataPRO/IService/Classes/Arm/ArmStatus.cs
generated_at: "2026-04-17T15:40:20.854454+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "2263754ec2fc9923"
---
# Documentation: ARM Status and Check Classes
## 1. Purpose
This module provides data structures for managing the arming lifecycle of Data Acquisition System (DAS) units. It consists of three classes: `ArmCheckActions` configures which diagnostic checks to perform during the arming process; `ArmCheckResults` stores the outcomes of those diagnostic checks; and `ArmStatus` tracks the real-time operational state of an armed DAS unit, including armed/triggered/recording states, voltage readings, sample progress, and fault information. These classes serve as data transfer objects between the arming service layer and DAS communication interfaces.
---
## 2. Public Interface
### ArmCheckActions
**Namespace:** `DTS.DASLib.Service`
**Implements:** `IArmCheckActions`
A configuration object specifying which diagnostic checks should be performed during the arm process.
| Property | Type | Description |
|----------|------|-------------|
| `PerformBatteryVoltageCheck` | `bool` | Enable/disable battery voltage check. Default: `false` |
| `PerformInputVoltageCheck` | `bool` | Enable/disable input voltage check. Default: `false` |
| `PerformSensorIdCheck` | `bool` | Enable/disable sensor ID verification. Default: `false` |
| `PerformEventLineCheck` | `bool` | Enable/disable event line check. Default: `false` |
| `PerformSquibResistanceCheck` | `bool` | Enable/disable squib resistance measurement. Default: `false` |
| `PerformTiltSensorCheck` | `bool` | Enable/disable tilt sensor check. Default: `false` |
| `PerformTemperatureCheck` | `bool` | Enable/disable temperature check. Default: `false` |
| `PerformClockSyncCheck` | `bool` | Enable/disable clock synchronization check. Default: `false` |
**Constructor:**
- `ArmCheckActions()` — Initializes all check flags to `false`.
---
### ArmCheckResults
**Namespace:** `DTS.DASLib.Service`
**Implements:** `IArmCheckResults`
A container for diagnostic check results collected during the arm process.
| Property | Type | Description |
|

View File

@@ -0,0 +1,24 @@
---
source_files:
- DataPRO/IService/Classes/BaseInput/SLICEBaseInputValues.cs
- DataPRO/IService/Classes/BaseInput/SLICE.Base.Input.Reader.cs
- DataPRO/IService/Classes/BaseInput/BaseInputValues.cs
generated_at: "2026-04-17T15:40:18.236415+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "7a9567feeb5e574d"
---
# Documentation: BaseInput Module
## 1. Purpose
This module provides infrastructure for reading and representing base unit input power diagnostics for SLICE/TDAS hardware devices. It consists of a data model (`BaseInputValues` and derived `SLICEBaseInputValues`) for storing voltage, battery, and temperature readings, and a reader class (`SLICEBaseInputReader`) that communicates with hardware to populate those values. The module is used by `DiagnosticsService.Diagnose` to capture hardware state for monitoring and display purposes.
---
## 2. Public Interface
### `BaseInputValues` (class)
**Namespace:** `DTS.DASLib.Service`
**

View File

@@ -0,0 +1,33 @@
---
source_files:
- DataPRO/IService/Classes/CAN/CANConfig.cs
- DataPRO/IService/Classes/CAN/CANModuleConfig.cs
generated_at: "2026-04-17T15:40:12.991077+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ee9e17e59c3434b9"
---
# Documentation: CAN Configuration Module
## 1. Purpose
This module provides XML-serializable configuration management for CAN (Controller Area Network) data acquisition system modules. It exists to persist and retrieve hardware module configurations—including serial numbers, test metadata, recording parameters, and channel definitions—to/from XML files stored in a `DASConfigs` subdirectory relative to the executing assembly. The module serves as the configuration persistence layer for DAS (Data Acquisition System) hardware, enabling test configurations to survive application restarts.
---
## 2. Public Interface
### CANConfig Class
**Namespace:** `DTS.DASLib.Service`
| Member | Signature | Description |
|--------|-----------|-------------|
| `Modules` | `Dictionary<string, CANModuleConfig> Modules { get; }` | Read-only accessor for the internal module dictionary, keyed by serial number string. |
| `FileName` | `string FileName { get; }` | Read-only accessor for the full path to the configuration file. |
| `CANConfig()` | Constructor | Default constructor. Initializes an empty configuration with no file association. |
| `CANConfig(string fileName, bool deleteIfPresent)` | Constructor | Loads configuration from `{ExecutingAssemblyLocation}\DASConfigs\{fileName}`. If `deleteIfPresent` is true, deletes existing file; otherwise reads and deserializes it. |
| `SetModule(CANModuleConfig module)` | `void SetModule(CANModuleConfig module)` | Adds a new module or updates an existing one (keyed by `module.SerialNumber`). |
| `GetModule(CANModuleConfig module)` | `CANModuleConfig GetModule(CANModuleConfig module)` | Returns existing module by serial number, or adds the passed module if not found and returns it. |
| `GetSchema()` | `XmlSchema GetSchema()` | Returns `null`. Required by

View File

@@ -0,0 +1,282 @@
---
source_files:
- DataPRO/IService/Classes/Channels/OutputDASChannel.cs
- DataPRO/IService/Classes/Channels/AnalogOutputDASChannel.cs
- DataPRO/IService/Classes/Channels/DigitalOutputDASChannel.cs
- DataPRO/IService/Classes/Channels/InputDASChannel.cs
- DataPRO/IService/Classes/Channels/AnalogInputDASChannelComparer.cs
- DataPRO/IService/Classes/Channels/TimestampDASChannel.cs
- DataPRO/IService/Classes/Channels/StreamInputDASChannel.cs
- DataPRO/IService/Classes/Channels/OutputTOMDigitalChannel.cs
- DataPRO/IService/Classes/Channels/CANInputDASChannel.cs
- DataPRO/IService/Classes/Channels/UARTInputDASChannel.cs
- DataPRO/IService/Classes/Channels/StreamOutputDASChannel.cs
- DataPRO/IService/Classes/Channels/DASChannel.cs
- DataPRO/IService/Classes/Channels/OutputSquibChannel.cs
generated_at: "2026-04-17T15:31:20.768905+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a9fb92d5e6adaff0"
---
# DAS Channel Classes Documentation
## 1. Purpose
This module provides a class hierarchy for representing data acquisition system (DAS) channels, supporting both input and output channel types with specialized implementations for various hardware interfaces (CAN, UART, Streaming, Squib, Timestamp). The hierarchy enables XML serialization/deserialization for configuration persistence, tracks channel ownership through module and DAS relationships, and provides configuration validation through the `IsConfigured()` method. Channels serve as the fundamental unit of measurement and control in the DAS architecture.
---
## 2. Public Interface
### DASChannel (Base Class)
**Namespace:** `DTS.DASLib.Service`
**Implements:** `IDASChannel`, `IXmlSerializable`
**Constructors:**
- `DASChannel(DASModule owner, int channelNumber)` — Initializes channel with owning module and module-relative channel number; sets `ConfigurationMode` to `Normal`, `EventStartTime` to `DateTime.Now`, `DiagnosticsMode` to `false`.
- `DASChannel()` — Parameterless constructor for serialization.
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `SetupEID` | `string` | Setup event identifier. |
| `DataCollectionEID` | `string` | Data collection event identifier. |
| `ConfigurationMode` | `DFConstantsAndEnums.ConfigMode` | Configuration mode setting. |
| `DiagnosticsMode` | `bool` | Whether channel is in diagnostics mode. |
| `ModuleChannelNumber` | `int` | Channel number relative to owning module. |
| `AbsoluteDisplayOrder` | `int` | Display ordering; defaults to 1. |
| `UnitConverision` | `double` | Unit conversion factor; defaults to 1D. |
| `AtCapacity` | `bool` | Capacity indicator. |
| `CapacityOutputIsBasedOn` | `double` | Capacity basis value. |
| `SensitivityUnits` | `SensorConstants.SensUnits` | Sensitivity units; defaults to `NONE`. |
| `OwningModule` | `DASModule` | Back-reference to containing module (`[XmlIgnore]`). |
| `Number` | `byte` | Stack channel number relative to owning DAS (computed via `DASInfo.MapModuleArrayIndexAndChannelNum2DASChannel`). |
| `IDs` | `IEID[]` | Array of EID identifiers (`[XmlIgnore]`). |
| `EventStartTime` | `DateTime` | Event timestamp. |
| `LevelTriggerSeen` | `bool` | Level trigger registration flag. |
| `IsoChannelName` | `string` | ISO channel name. |
| `ChannelGroupName` | `string` | Channel group name. |
| `UserCode` | `string` | User-defined code. |
| `UserChannelName` | `string` | User-defined channel name. |
| `LinearSensorCalibration` | `string` | Linear calibration data. |
| `QualificationSamples` | `int` | Number of samples for qualification. |
| `LevelTriggerT0AdjustmentSamples` | `int?` | T0 adjustment for time alignment; null indicates no direct level trigger. |
| `IdType` | `int` | Identifier type; defaults to `DEFAULT_ID_TYPE` (0). |
| `UserValue1`, `UserValue2`, `UserValue3` | `string` | User-defined values. |
**Methods:**
- `virtual bool IsConfigured()` — Returns `false` by default; overridden by subclasses.
- `bool CanReProgram()` — Returns true if channel is reprogrammable (checks `OwningModule.OwningDAS.DASInfo.Modules[0].IsProgrammable`).
- `virtual void WriteXml(XmlWriter writer)` — Serializes channel to XML.
- `virtual void WriteXmlCRC32(XmlWriter writer)` — Serializes subset of fields for CRC32 calculation.
- `virtual void ReadXml(XmlReader reader)` — Deserializes channel from XML.
- `virtual void WriteElementStart(XmlWriter writer)` — Writes opening XML element with xsi:type attribute.
- `virtual void WriteElementEnd(XmlWriter writer)` — Writes closing XML element.
- `virtual void HandleElement(XmlReader reader)` — Handles individual XML elements during deserialization.
- `XmlSchema GetSchema()` — Returns `null` (IXmlSerializable requirement).
**Constants:**
- `DEFAULT_ID_TYPE = 0`
- `BRIDGE_ID_TYPE = 1`
- `IEPE_ID_TYPE = 2`
- `BRIDGE_G5_ID_TYPE = 3`
---
### OutputDASChannel
**Inherits:** `DASChannel`
**Constructors:**
- `OutputDASChannel(DASModule owner, int channelNumber)`
- `OutputDASChannel()`
---
### InputDASChannel
**Inherits:** `DASChannel`
**Constructors:**
- `InputDASChannel(DASModule owner, int channelNumber)`
- `InputDASChannel()`
---
### AnalogOutputDASChannel
**Inherits:** `OutputDASChannel`
**Constructors:**
- `AnalogOutputDASChannel(DASModule owner, int channelNumber)`
- `AnalogOutputDASChannel()`
---
### DigitalOutputDASChannel
**Inherits:** `OutputDASChannel`
**Constructors:**
- `DigitalOutputDASChannel(DASModule owner, int channelNumber)`
- `DigitalOutputDASChannel()`
---
### TimestampDASChannel
**Inherits:** `InputDASChannel`
**Constructors:**
- `TimestampDASChannel(DASModule owner, int channelNumber)`
- `TimestampDASChannel()`
**Methods:**
- `override bool IsConfigured()` — Always returns `true`.
- `override string ToString()` — Returns descriptive string based on `OwningModule.ModuleType()` and `ModuleChannelNumber`.
**Constants:**
- `MARKER = "MARKER"`
- `SEC_H = "SECONDS_HIGH"`
- `SEC_L = "SECONDS_LOW"`
- `NANOS_H = "NANOSECONDS_HIGH"`
- `NANOS_L = "NANOSECONDS_LOW"`
- `RSVD = "RESERVED"`
---
### StreamInputDASChannel
**Inherits:** `InputDASChannel`
**Constructors:**
- `StreamInputDASChannel(DASModule owner, int channelNumber)`
- `StreamInputDASChannel()`
**Properties:**
| Property | Type | Default |
|----------|------|---------|
| `SerialNumber` | `string` | — |
| `HardwareChannelName` | `string` | — |
| `UDPAddress` | `string` | `string.Empty` |
**Methods:**
- `override bool IsConfigured()` — Returns `true` if `SerialNumber` is not null or empty.
- `override string ToString()` — Returns `$"Stream{ModuleChannelNumber}"`.
- `override void WriteXml(XmlWriter writer)`
- `override void HandleElement(XmlReader reader)`
---
### StreamOutputDASChannel
**Inherits:** `OutputDASChannel`
**Constructors:**
- `StreamOutputDASChannel(DASModule owner, int channelNumber)`
- `StreamOutputDASChannel()`
**Properties:**
| Property | Type | Default |
|----------|------|---------|
| `SerialNumber` | `string` | — |
| `HardwareChannelName` | `string` | — |
| `UDPProfileName` | `string` | `UDPStreamProfile.CH10_ANALOG_2HDR.ToString()` |
| `UDPTimeChannelId` | `ushort` | — |
| `UDPDataChannelId` | `ushort` | — |
| `IRIGTimeDataPacketIntervalMs` | `ushort` | — |
| `TMATSIntervalMs` | `ushort` | `StreamOutputRecord.DEFAULT_TMATS_INTERVAL_MS` |
| `UDPAddress` | `string` | `string.Empty` |
| `UDPTmNSConfig` | `uint[]` | `new uint[8]` |
**Methods:**
- `override bool IsConfigured()` — Returns `true` if `SerialNumber` is not null or empty.
- `override string ToString()` — Returns `$"Stream{ModuleChannelNumber}"`.
- `override void WriteXml(XmlWriter writer)`
- `override void HandleElement(XmlReader reader)`
---
### CANInputDASChannel
**Inherits:** `InputDASChannel`
**Constructors:**
- `CANInputDASChannel(DASModule owner, int channelNumber)` — Sets `SerialNumber` from `owner.SerialNumber()`.
- `CANInputDASChannel()`
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `SerialNumber` | `string` | Sensor serial number. |
| `HardwareChannelName` | `string` | Hardware channel name. |
| `IsFD` | `bool` | CAN FD mode flag. |
| `ArbBaseBitrate` | `int` | Arbitration base bitrate. |
| `ArbBaseSJW` | `int` | Arbitration base SJW. |
| `DataBitrate` | `int` | Data bitrate. |
| `DataSJW` | `int` | Data SJW. |
| `FileType` | `string` | File type identifier. |
**Methods:**
- `override bool IsConfigured()` — Returns `true` if `SerialNumber` is not null or empty.
- `override string ToString()` — Returns `$"CAN{ModuleChannelNumber}"`.
- `override void WriteXml(XmlWriter writer)`
- `override void HandleElement(XmlReader reader)`
---
### UARTInputDASChannel
**Inherits:** `InputDASChannel`
**Constructors:**
- `UARTInputDASChannel(DASModule owner, int channelNumber)`
- `UARTInputDASChannel()`
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `SerialNumber` | `string` | Sensor serial number. |
| `HardwareChannelName` | `string` | Hardware channel name. |
| `BaudRate` | `uint` | Baud rate setting. |
| `DataBits` | `uint` | Data bits setting. |
| `StopBits` | `StopBits` | Stop bits enumeration. |
| `Parity` | `Parity` | Parity enumeration. |
| `FlowControl` | `Handshake` | Flow control enumeration. |
| `DataFormat` | `UartDataFormat` | Data format enumeration. |
**Methods:**
- `override bool IsConfigured()` — Returns `true` if `SerialNumber` is not null or empty.
- `override string ToString()` — Returns `$"UART{ModuleChannelNumber}"`.
- `override void WriteXml(XmlWriter writer)`
- `override void HandleElement(XmlReader reader)`
---
### OutputTOMDigitalChannel
**Inherits:** `DigitalOutputDASChannel`
**Constructors:**
- `OutputTOMDigitalChannel(XmlReader reader)` — Initializes `IDs` array and calls `ReadXml(reader)`.
- `OutputTOMDigitalChannel(DASModule owner, int channelNumber)`
- `OutputTOMDigitalChannel()`
**Properties:**
| Property | Type | Default |
|----------|------|---------|
| `OutputMode` | `DigitalOutputModes` | `DigitalOutputModes.NONE` |
| `DelayMS` | `double` | `0D` |
| `LimitDuration` | `bool` | `false` |
| `DurationMS` | `double` | `0D` |
| `DigitalChannelDescription` | `string` | `""` |
| `LastModifiedBy` | `string` | `""` |
| `LastModified` | `DateTime` | — |
| `LocalOnly` | `bool` | `false` |
| `HardwareChannelName` | `string` | — |
| `Version` | `int` | — |
| `Date` | `DateTime` | — |
**Methods:**
- `override bool IsConfigured()` — Returns `true` if `OutputMode != DigitalOutputModes.NONE` and `DigitalChannelDescription` is not empty.
- `override void WriteXml(XmlWriter writer)`
- `override void WriteXmlCRC32(XmlWriter writer)`
- `override void HandleElement(XmlReader reader)`
---
### OutputSquibChannel
**Inherits:** `AnalogOutputDASChannel`, `IComparable`
**Constructors:

View File

@@ -0,0 +1,119 @@
---
source_files:
- DataPRO/IService/Classes/Diagnostics/OptimizationValues.cs
- DataPRO/IService/Classes/Diagnostics/DiagnosticActions.cs
- DataPRO/IService/Classes/Diagnostics/DiagnosticsResultActions.cs
- DataPRO/IService/Classes/Diagnostics/DiagnosticsResult.cs
generated_at: "2026-04-17T15:38:51.449636+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "34ce6d811e6f9b1a"
---
# Diagnostics Module Documentation
## 1. Purpose
This module provides data structures and operations for managing diagnostic tests and results for Data Acquisition System (DAS) channels. It enables pre-recording validation of sensor configurations by measuring excitation voltages, offsets, noise floors, shunt deflections, bridge resistance, and squib firing characteristics. The module bridges in-memory diagnostic state with persistent database storage, supporting analog input channels, digital input channels, and output squib channels.
---
## 2. Public Interface
### `OptimizationValues` (Class)
**Namespace:** `DTS.DASLib.Service.Classes.Diagnostics`
**Implements:** `IOptimizationValues`
| Property | Type | Description |
|----------|------|-------------|
| `TransferSpeed` | `float` | Gets or sets the transfer speed value. |
---
### `DiagnosticsActions` (Class)
**Namespace:** `DTS.DASLib.Service`
**Implements:** `IDiagnosticActions`
Holds instructions for diagnosing a single DAS channel.
#### Properties
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `DASChannelNumber` | `int` | `0` | The DAS channel number for these diagnostic instructions. |
| `MeasureExcitation` | `bool` | `false` | Whether to measure excitation voltage applied to the sensor. |
| `MeasureOffset` | `bool` | `false` | Whether to measure the sensor's offset from zero. |
| `CheckDigitalState` | `bool` | `false` | Whether to check open/closed/low/high state of a digital input channel. |
| `MeasureInternalOffset` | `bool` | `false` | Whether to measure internal offset. |
| `RemoveOffset` | `bool` | `false` | Whether firmware should compensate for sensor offset. |
| `MeasureNoise` | `bool` | `false` | Whether to measure noise floor as percentage of full scale. |
| `PerformShuntCheck` | `bool` | `false` | Whether to perform an emulated shunt check. |
| `SquibFireCheck` | `bool` | `false` | Whether to run a squib fire check on the channel. |
| `PerformVoltageInsertCheck` | `bool` | `false` | Whether to perform a voltage insertion gain check (SLICE Pro). |
| `PerformCalSignalCheck` | `bool` | `false` | Whether to perform a calibration signal check. |
| `MeasureBridgeResistance` | `bool` | `false` | Whether to measure the resistance of the bridge. |
#### Methods
```csharp
public DiagnosticsActions()
```
Initializes a new instance with all diagnostic actions disabled and `DASChannelNumber` set to 0.
```csharp
public bool AllActionsDisabled()
```
Returns `true` if all diagnostic actions are disabled; otherwise `false`.
```csharp
public static void SetChannelDiagnosticActions(IDASCommunication unit, IDiagnosticActions[] actions, bool setInDb)
```
Assigns the diagnostic actions array to `unit.ChannelDiagnostics`. If `setInDb` is `true` and the database is connected, clears all existing diagnostic actions for the unit and inserts the new actions into the database.
---
### `DiagnosticsResultActions` (Static Class)
**Namespace:** `DTS.DASLib.Service.Classes.Diagnostics`
Provides static methods for managing diagnostic results on DAS units.
#### Methods
```csharp
public static void ClearChannelDiagnosticsResults(IDASCommunication unit, bool bClearDb = true)
```
Clears `unit.ChannelDiagnosticsResults` and `unit.ChannelDiagnostics` by initializing them to empty arrays. If `bClearDb` is `true` and the database is connected, clears existing diagnostics from the database for the unit.
```csharp
public static void SetChannelDiagnosticsResults(IDASCommunication unit, IDiagnosticResult[] results, bool setInDb)
```
Assigns `results` to `unit.ChannelDiagnosticsResults`. If `setInDb` is `true` and the database is connected, iterates through results and inserts them into the database based on channel type:
- `AnalogInputDASChannel` with `DigitalInputChannel == true``InsertDiagnosticsResultDigital`
- `AnalogInputDASChannel` with `DigitalInputChannel == false``InsertDiagnosticsResultAnalog`
- `OutputSquibChannel``InsertDiagnosticsResultsSquib`
---
### `DiagnosticsResult` (Class)
**Namespace:** `DTS.DASLib.Service`
**Implements:** `IDiagnosticResult`
Holds diagnostic results for a single DAS channel.
#### Key Properties
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `DASChannelNumber` | `int` | — | The channel number from which diagnostics are returned. |
| `EventNumber` | `int` | — | The event number this diagnostic is relevant for. |
| `ScalefactorMilliVoltsPerADC` | `double` | `1` | Scale factor to convert raw ADC values to millivolts. |
| `ScalefactorEngineeringUnitsPerADC` | `double` | `1` | Scale factor to convert ADC values to engineering units. |
| `ExpectedExcitationMilliVolts` | `double` | — | Factory excitation value (mandatory). |
| `MeasuredExcitationMilliVolts` | `double?` | — | Measured excitation voltage in mV. |
| `NegativeExcitation` | `bool` | — | Flag indicating if measured excitation was negative. |
| `MeasuredOffsetMilliVolts` | `double?` | — | Sensor offset from zero in mV. |
| `MeasuredInternalOffsetMilliVolts` | `double?` | — | Measured internal offset in mV. |
| `AutoZeroPercentDeviation` | `double?` | — | Deviation from zero during auto-zero (stored as absolute value). |
| `FinalOffsetADC` | `short?` | — | Offset remaining after offset removal. |
| `RemovedOffsetADC` | `int?` | — | Amount of offset removed. |
| `RemovedInternalOffsetADC

View File

@@ -0,0 +1,103 @@
---
source_files:
- DataPRO/IService/Classes/Download/UARTDownloadRequest.cs
- DataPRO/IService/Classes/Download/DownloadRequest.cs
- DataPRO/IService/Classes/Download/DownloadReport.cs
generated_at: "2026-04-17T15:40:25.049992+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "343a1296e8698928"
---
# Documentation: Download Request and Report Classes
## 1. Purpose
This module provides data structures and persistence logic for managing download requests and event reports from a Data Acquisition System (DAS) to a PC. It defines three primary classes: `DownloadRequest` for standard channel-based data downloads, `UARTDownloadRequest` for UART stream downloads, and `DownloadReport` for representing event metadata stored on a DAS device. These classes serve as the bridge between in-memory download configurations and database persistence, supporting both the query phase (discovering what events exist) and the download phase (specifying what data to retrieve).
---
## 2. Public Interface
### `UARTDownloadRequest` (implements `IUARTDownloadRequest`)
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `EventNumber` | `ushort` | Identifies which event to download data from |
| `TotalByteCount` | `ulong` | Total size of the UART data |
| `TriggerByteCount` | `ulong` | Byte offset where trigger occurred in the data stream |
| `FaultByteCount` | `ulong` | Byte offset where fault occurred in the data stream |
| `StartTimestamp` | `ulong` | Timestamp when UART stream started |
| `EndTimestamp` | `ulong` | Timestamp when UART stream ended |
| `BaudRate` | `int` | Baud rate used during UART recording |
**Static Method:**
```csharp
public static void SetWhatToDownload(IDASCommunication das, IUARTDownloadRequest request, bool bSetInDb)
```
- Sets the UART download request on the DAS communication object via `udas.WhatUARTToDownload`
- If `bSetInDb` is true and database is connected, clears existing requests and inserts the new request into the database
- Catches and logs exceptions without re-throwing
---
### `DownloadRequest` (implements `IDownloadRequest`)
**Constants:**
| Constant | Value | Description |
|----------|-------|-------------|
| `ALL_CHANNELS` | `0xFF` | Setting `DASChannelNumber` to this value downloads all channels (currently the only supported option per source comments) |
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `EventNumber` | `ushort` | Identifies which event to download data from |
| `DASChannelNumber` | `byte` | Channel identifier (must be `ALL_CHANNELS`) |
| `StartSample` | `virtual ulong` | First sample to download |
| `EndSample` | `virtual ulong` | Last sample to download |
| `SamplesToSkip` | `ulong` | Sub-sampling interval (0 or 1 = no subsampling, 2 = every other sample, etc.) |
| `StartRecordTimestampSec` | `double` | Start record timestamp in seconds |
| `TriggerTimestampSec` | `double` | Trigger timestamp in seconds |
| `StartRecordTimestampNanoSec` | `double` | Start record timestamp nanoseconds component |
| `TriggerTimestampNanoSec` | `double` | Trigger timestamp nanoseconds component |
| `PTPMasterSync` | `bool` | PTP master sync flag |
**Static Method:**
```csharp
public static void SetWhatToDownload(IDASCommunication das, IDownloadRequest request, bool bSetInDb)
```
- Logs the request details via `APILogger.Log`
- Sets the download request on `das.WhatToDownload`
- If `bSetInDb` is true and database is connected, clears existing requests and inserts the new request
- Catches and logs exceptions without re-throwing
---
### `DownloadReport` (implements `IDownloadReport`)
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `Events` | `IEventInfo[]` | Array of all events stored on the DAS |
| `UARTEvents` | `IUARTEventInfo[]` | Array of all UART events stored on the DAS |
**Nested Class: `EventInfo` (implements `IEventInfo`)**
| Property | Type | Description |
|----------|------|-------------|
| `Modules` | `IDASModule[]` | Module information addressable by `ModuleArrayIndex` |
| `EventNumber` | `int` | Event number |
| `TestGUID` | `Guid` | GUID of the corresponding event |
| `FaultFlags` | `ushort` | Fault flags |
| `FaultFlagsEx` | `ushort` | Extended fault flags |
| `ArmAttempts` | `byte` | Number of arm attempts |
| `TestTime` | `DateTime` | Timestamp of the event |
| `TestID` | `string` | ID of the event |
| `Description` | `string` | Text description stored with the event |
| `HasBeenDownloaded` | `bool` | True if event already downloaded |
| `WasTriggered` | `bool` | True if event received a trigger |
**Methods:**
```csharp
public void ClearFaults() //

View File

@@ -0,0 +1,59 @@
---
source_files:
- DataPRO/IService/Classes/InputRangeAttributes/GainDisabledAttribute.cs
- DataPRO/IService/Classes/InputRangeAttributes/MaxInputRangeAttribute.cs
- DataPRO/IService/Classes/InputRangeAttributes/GainAvailableUnmodifiedAttribute.cs
- DataPRO/IService/Classes/InputRangeAttributes/MinInputRangeAttribute.cs
- DataPRO/IService/Classes/InputRangeAttributes/FirmwareInputRangeAttribute.cs
generated_at: "2026-04-17T16:03:17.836512+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "75434fd7a99fb627"
---
# InputRangeAttributes
### Purpose
This module provides a set of custom attributes used to annotate gain-related enum values with metadata controlling input range behavior for data acquisition hardware. The attributes allow fine-grained control over gain availability, disabled states, and input range boundaries (min/max/firmware values) in millivolts, supporting different hardware configurations including modified vs unmodified Gen 3 SPS devices.
### Public Interface
**GainDisabledAttribute** : Attribute
- `GainDisabledAttribute(bool disabled)` - Constructor; marks a gain as disabled when `disabled` is true.
- `static bool IsGainDisabled(object o)` - Returns true if the object (typically an enum value) has `GainDisabledAttribute` with `_bDisabled = true`. Returns false if null, no member found, or attribute not present.
**MaxInputRangeAttribute** : Attribute
- `MaxInputRangeAttribute(double maxInputRangemV)` - Constructor; sets maximum input range in mV.
- `static double GetMaxInputRangemV(object o)` - Returns the maximum input range in mV for the given object. Returns 0D if null, no member found, or attribute not present.
**GainAvailableUnmodifiedAttribute** : Attribute
- `GainAvailableUnmodifiedAttribute(bool available)` - Constructor; marks availability for unmodified Gen 3 SPS.
- `static bool IsGainAvailableToUnmodified(object o)` - Returns true if gain is available to unmodified Gen 3 SPS. Returns true by default (if attribute not present). Returns false only if attribute is present with `available = false`.
**MinInputRangeAttribute** : Attribute
- `MinInputRangeAttribute(double minInputRangemV)` - Constructor; sets minimum input range in mV.
- `static double GetMinInputRangemV(object o)` - Returns the minimum input range in mV for the given object. Returns 0D if null, no member found, or attribute not present.
**FirmwareInputRangeAttribute** : Attribute
- `FirmwareInputRangeAttribute(double firmwareInputRangemV)` - Constructor; sets the input range value to send to firmware.
- `static double GetFirmwareInputRangemV(object o)` - Returns the firmware input range in mV for the given object. Returns 0D if null, no member found, or attribute not present.
### Invariants
- All static retrieval methods accept `object` (intended for enum values) and use reflection via `GetMember(o.ToString())`.
- Default behaviors:
- `IsGainDisabled`: returns `false` (gains are enabled by default)
- `IsGainAvailableToUnmodified`: returns `true` (available by default)
- Range getters: return `0D` if attribute not present
- All attributes are in namespace `DTS.DASLib.Service` despite folder location suggesting otherwise.
### Dependencies
- **Depends on**: `System` (for Attribute and reflection APIs)
- **Depended on by**: Unclear from source alone - likely gain-related enums in the data acquisition service layer.
### Gotchas
- **Namespace mismatch**: The namespace `DTS.DASLib.Service` does not match the folder path `DataPRO/IService/Classes/InputRangeAttributes`. A ReSharper comment suppresses namespace check.
- **FogBugz references**: Comments reference internal bug tracker URLs (e.g., `http://fogbugz/fogbugz/default.asp?10080`) which are inaccessible externally.
- **Reflection assumption**: The static methods assume `o.ToString()` returns a valid member name; if `o` is not an enum or the string doesn't match a member, methods return default values silently.
- **Typo in field name**: `FirmwareInputRangeAttribute._firmwareInputRangeAttribute` - the field name repeats the class name rather than describing the value.
---

View File

@@ -0,0 +1,43 @@
---
source_files:
- DataPRO/IService/Classes/PowerProInput/SLICE.PowerPro.Input.Reader.cs
generated_at: "2026-04-17T16:10:43.628352+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "583eb4dab6fcbf41"
---
# PowerProInput
### Purpose
This module provides a concrete implementation of input reading functionality for PowerPro hardware devices. It extends `SLICEBaseInputReader` to measure diagnostic channel values including input voltage, temperature, and backup battery voltage from PowerPro hardware via a communication interface.
### Public Interface
**Class: `SLICEPowerProInputReader`**
- **Constructor**: `SLICEPowerProInputReader(ICommunication comm)` - Initializes the reader with an `ICommunication` interface for hardware communication. Passes the communication object to the base class and stores it in a private readonly field.
- **Property**: `override double InputMilliVolts` - Measures the input voltage on diagnostic channel `InputVoltage_A`. Creates a `MeasurePowerProDiagnosticChannel` instance, configures it with `DeviceGroup = 0` and `DeviceID = 0`, executes synchronously, and returns the measurement converted to millivolts (multiplied by 1000.0).
- **Property**: `override double TemperatureC` - Measures the temperature in Celsius. Uses diagnostic channel `TemperatureC` with `DeviceGroup = 0` and `DeviceID = 0`. Returns the raw measurement value without conversion.
- **Property**: `override double DirectBackupMilliVolts` - Measures the backup battery voltage. Uses diagnostic channel `BatteryVoltage` with `DeviceGroup = 0` and `DeviceID = 0`. Returns the measurement converted to millivolts (multiplied by 1000.0).
### Invariants
- All measurement operations use `DeviceGroup = 0` and `DeviceID = 0` (single device assumption).
- Voltage measurements (`InputMilliVolts`, `DirectBackupMilliVolts`) are always returned in millivolts, requiring multiplication by 1000.0 from the raw measurement.
- Temperature is always returned in Celsius without scaling.
- Each property getter performs a synchronous execution call; there is no caching of measurements.
### Dependencies
**Depends on:**
- `DTS.Common.Interface.DASFactory` - Provides `ICommunication` interface
- `DTS.DASLib.Command.SLICE` - Provides `MeasurePowerProDiagnosticChannel` class and `PowerProDiagnosticChannelList` enum
- `SLICEBaseInputReader` (base class, location not shown in source)
**Depended on by:** Not determinable from source alone.
### Gotchas
- Each property access creates a new `MeasurePowerProDiagnosticChannel` instance and performs a synchronous `SyncExecute()` call. Frequent property access could impact performance.
- The hardcoded `DeviceGroup = 0` and `DeviceID = 0` values suggest this implementation only supports single

View File

@@ -0,0 +1,216 @@
---
source_files:
- DataPRO/IService/Classes/SLICE/DASConfigurationEventArg.cs
- DataPRO/IService/Classes/SLICE/SLICE6DB3.cs
- DataPRO/IService/Classes/SLICE/S6DBConnectedDevice.cs
- DataPRO/IService/Classes/SLICE/SLICEPRODB.cs
- DataPRO/IService/Classes/SLICE/SLICE6AIRBR.cs
- DataPRO/IService/Classes/SLICE/SLICE6AIRTC.cs
generated_at: "2026-04-17T15:30:50.633601+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "434d25165d2bfceb"
---
# SLICE Device Service Classes Documentation
## 1. Purpose
This module provides specialized implementations for various SLICE hardware devices (Data Acquisition Systems) within the DTS.DASLib.Service namespace. It contains device-specific classes that handle configuration, communication protocols, diagnostics, and real-time streaming for different SLICE variants including SLICE6DB3 (limited PTP support), SLICEPRODB (battery/distributor), SLICE6AIRBR (bridge recorder), and SLICE6AIRTC (thermocouple). The module also includes supporting classes for device discovery (`S6DBConnectedDevice`) and configuration event handling (`DASConfigurationArg`).
---
## 2. Public Interface
### DASConfigurationArg
**Namespace:** `DTS.DASLib.Service`
**Implements:** `IDASConfigurationArg`
| Member | Signature | Description |
|--------|-----------|-------------|
| `DAS` | `IDASCommunication DAS { get; private set; }` | Gets the DAS communication interface associated with this configuration event. |
| `BlankConfigurationRead` | `bool BlankConfigurationRead { get; private set; }` | Indicates whether a blank configuration was read (used during emergency downloads with blank filestore). |
| `ConfigurationFailedValidation` | `bool ConfigurationFailedValidation { get; private set; }` | Indicates whether the configuration failed validation. |
| Constructor | `DASConfigurationArg(IDASCommunication das, bool blankRead, bool failedValidation)` | Constructs a new configuration argument with the specified DAS, blank read status, and validation status. |
---
### SLICE6DB3\<T\>
**Namespace:** `DTS.DASLib.Service`
**Base Class:** `SLICE6DB<T>`
**Constraint:** `where T : IConnection, new()`
A limited version of SLICE6DB without IEEE1588/PTP support.
| Member | Signature | Description |
|--------|-----------|-------------|
| `SetClockSyncConfig` | `override void SetClockSyncConfig(ServiceCallback callback, object userData, ClockSyncProfile profile)` | No-op implementation that immediately reports success. |
| `GetClockSyncStatus` | `override void GetClockSyncStatus(ServiceCallback callback, object userData)` | No-op implementation that immediately reports success. |
| `SetPTPDomainID` | `override void SetPTPDomainID(ServiceCallback callback, object userData, byte domainID)` | No-op implementation that stores domainID in functionData and reports success. |
| `GetPTPDomainID` | `override void GetPTPDomainID(ServiceCallback callback, object userData)` | No-op implementation that immediately reports success. |
---
### S6DBConnectedDevice
**Namespace:** `DTS.DASLib.Service.Classes.SLICE`
**Implements:** `IDASConnectedDevice`
Describes a device connected to a S6DB as determined by `QAUTIL_QUERY_MAC_IP_TABLE`.
| Member | Signature | Description |
|--------|-----------|-------------|
| `DeviceType` | `HardwareTypes DeviceType { get; }` | The device type, defaults to `HardwareTypes.SLICE6_Base`. Changes to `HardwareTypes.SLICE6_AIR` if SerialNumber starts with "S6A". |
| `Port` | `int Port { get; private set; }` | The port the device is on (0-based, positive values valid, default -1). |
| `SpotOnPort` | `int SpotOnPort { get; private set; }` | Position on the chain/port (0-based, positive values valid, default -1). |
| `PhysicalAddress` | `PhysicalAddress PhysicalAddress { get; private set; }` | MAC address of the device. |
| `IPAddress` | `string IPAddress { get; private set; }` | IP address reported by device (default empty string). |
| `SerialNumber` | `string SerialNumber { get; private set; }` | Serial number of device (default empty string). |
| `Location` | `string Location { get; private set; }` | Location of device (default empty string). |
| `Version` | `string Version { get; private set; }` | Version of device (default empty string). |
| Constructor | `S6DBConnectedDevice(int port, int spotOnPort, PhysicalAddress physicalAddress, string ipAddress, string serialNumber, string location, string version)` | Constructs a new connected device record with all parameters. |
---
### SLICEPRODB\<T\>
**Namespace:** `DTS.DASLib.Service`
**Base Class:** `SLICE6DB<T>`
**Implements:** `IDownloadActions`
**Constraint:** `where T : IConnection, new()`
| Member | Signature | Description |
|--------|-----------|-------------|
| `QueryConnectedDevices` | `override void QueryConnectedDevices()` | No functionality for SLICEPRO DB; sets connected devices to empty array. |
| `IsSlice6Distributor` | `override bool IsSlice6Distributor()` | Returns `false`. |
| `IsBattery` | `override bool IsBattery()` | Returns `true`. |
| `SupportsTemperatureCheck` | `protected override bool SupportsTemperatureCheck { get; }` | Returns `true`. |
| `SupportsTiltCheck` | `protected override bool SupportsTiltCheck { get; }` | Returns `true`. |
| `SupportsClockSyncCheck` | `protected override bool SupportsClockSyncCheck { get; }` | Returns `true`. |
| `SupportsTimeSynchronization` | `public override bool SupportsTimeSynchronization { get; }` | Returns `false`. |
| `InitMinProto` | `public override void InitMinProto()` | Initializes protocol limitations dictionary with minimum protocol version 1 for supported commands and `byte.MaxValue` for unsupported commands (PTP, temperature log, tilt queries, Ethernet MAC table). |
| `AsyncQueryConfiguration` | `protected override void AsyncQueryConfiguration(object configAsyncInfo)` | Initializes minimum protocol, creates default config from info, and reports success. |
---
### SLICE6AIRBR\<T\>
**Namespace:** `DTS.DASLib.Service`
**Base Class:** `SLICE6_Base<T>`
**Implements:** `IAlignUDPToPPSAware`
**Constraint:** `where T : IConnection, new()`
Bridge recorder variant of SLICE6 AIR.
| Member | Signature | Description |
|--------|-----------|-------------|
| `AlignUDPToPPS` | `bool AlignUDPToPPS { get; set; }` | Gets or sets UDP to PPS alignment flag. |
| `SupportsRemoveLeapSeconds` | `public override bool SupportsRemoveLeapSeconds { get; }` | Returns `true`. |
| `SupportsADCSamplesPerPacket` | `public override bool SupportsADCSamplesPerPacket { get; }` | Returns `true`. |
| `RequiresNon0QualificationSamples` | `protected override bool RequiresNon0QualificationSamples { get; }` | Returns `true`. |
| `DASIndex` | `int DASIndex { get; set; }` | The order of this DAS among multiple DAS (default -1). |
| `SetIsStreamingSupported` | `public override void SetIsStreamingSupported(bool supported)` | Always sets `IsStreamingSupported = true`. |
| `InitMinProto` | `public override void InitMinProto()` | Initializes extensive protocol limitations dictionary for SLICE6 AIR BR. |
| `MaxSampleRateHz` | `protected override uint MaxSampleRateHz { get; }` | Lazy-loaded max sample rate, queries device via `QuerySystemAttributeSLICE6`. Falls back to 50000 on error. |
| `MakeConfigModuleFromInfoModule` | `protected override DASModule MakeConfigModuleFromInfoModule(InfoResult.Module infoModule)` | Creates DASModule with channels supporting FullBridge and HalfBridge types (no IEPE). |
| `AsyncConfigure` | `protected override void AsyncConfigure(object configAsyncInfo)` | Complex configuration method handling UDP alignment, leap seconds, ADC samples per packet, channel configuration, bridge modes, coupling, and level triggers. |
| `GetIsStreaming` | `public override bool GetIsStreaming()` | Returns true if `DASArmStatus.ReceivedInvalidModeDuringSetup` or `DASArmStatus.IsInRealtime`. |
---
### SLICE6AIRTC\<T\>
**Namespace:** `DTS.DASLib.Service`
**Base Class:** `SLICE6_Base<T>`
**Implements:** `IAlignUDPToPPSAware`, `IDASReconfigure`, `ITCDiagnosticResults`, `IUARTDownloadActions`, `IUARTDownload`
**Constraint:** `where T : IConnection, new()`
Thermocouple variant of SLICE6 AIR with UART download support.
| Member | Signature | Description |
|--------|-----------|-------------|
| `WhatUARTToDownload` | `IUARTDownloadRequest WhatUARTToDownload { get; set; }` | Gets or sets the UART download request. |
| `SetWhatUARTToDownload` | `void SetWhatUARTToDownload(IUARTDownloadRequest request, bool bSetInDb = true)` | Sets what to download via `UARTDownloadRequest.SetWhatToDownload`. |
| `BaudRate` | `uint BaudRate { get; private set; }` | UART baud rate setting. |
| `DataBits` | `uint DataBits { get; private set; }` | UART data bits setting. |
| `StopBits` | `StopBits StopBits { get; private set; }` | UART stop bits setting. |
| `Parity` | `Parity Parity { get; private set; }` | UART parity setting. |
| `FlowControl` | `Handshake FlowControl { get; private set; }` | UART flow control setting. |
| `DataFormat` | `UartDataFormat DataFormat { get; private set; }` | UART data format setting. |
| `TCDiagnosticResults` | `ITCDiagnosticResult[] TCDiagnosticResults { get; private set; }` | Array of 24 thermocouple diagnostic results. |
| `ClearTCDiagnosticResults` | `void ClearTCDiagnosticResults()` | Clears diagnostic results to empty array. |
| `SetTCDiagnosticResults` | `void SetTCDiagnosticResults(ITCDiagnosticResult[] results)` | Sets diagnostic results array. |
| `IsSlice6AirTc` | `public override bool IsSlice6AirTc()` | Returns `true`. |
| `GetMaxFileLengthTMATS` | `public override int GetMaxFileLengthTMATS()` | Returns `32000`. |
| `UARTDownload` | `public void UARTDownload(ServiceCallback callback, object userData)` | Returns error "Not supported". |
| `QueryUARTDownload` (explicit) | `void IUARTDownloadActions.QueryUARTDownload(ServiceCallback callback, object userData, int eventIndex, TDASServiceSetupInfo setupInfo)` | Queries UART download availability. |
| `GetUARTSettings` (explicit) | `void IUARTDownloadActions.GetUARTSettings(ServiceCallback callback, object userData)` | Retrieves UART settings via `QuerySystemAttributeSLICE6AIR`. |
| `SetUARTSettings` (explicit) | `void IUARTDownloadActions.SetUARTSettings(ServiceCallback callback, object userData, uint baudRate, uint dataBits, uint stopBits, uint parity, uint flowControl)` | Sets UART settings via `SetSystemAttributeSLICE6AIR`. |
| `SetMaxModuleCount` (explicit) | `void IDASReconfigure.SetMaxModuleCount(int count)` | Sets the maximum module count. |
| `GetMaxModuleCount` (explicit) | `int IDASReconfigure.GetMaxModuleCount()` | Gets the cached maximum module count. |
| `GetStackChannelConfigTypes` | `public override int[] GetStackChannelConfigTypes()` | Queries arm attribute for stack channel config types. |
| `InitMinProto` | `public override void InitMinProto()` | Initializes protocol limitations for SLICE6 AIR TC including UART settings commands. |
| `GetRTChannelIndices` | `protected override byte[] GetRTChannelIndices(RealTimeAsyncPacket packet)` | Returns channel indices based on `_maxModuleCount`: 8 channels (0 modules), 16 channels (1 module), or 24 channels (2+ modules). |
| `GetRealtimeSamplesClass` | `protected override IGetRealtimeSamples GetRealtimeSamplesClass(ICommunication iCommunication, bool bPolling = false)` | Returns `RealtimeStreamingNextSamples` with `SignedData = true` if streaming supported, otherwise falls back to base implementation. |
---
## 3. Invariants
- **S6DBConnectedDevice.Port** and **SpotOnPort**: Only positive values are valid; default is -1 (invalid state).
- **S6DBConnectedDevice.DeviceType**: Defaults to `HardwareTypes.SLICE6_Base` but changes to `HardwareTypes.SLICE6_AIR` if SerialNumber starts with "S6A".
- **SLICEPRODB**: Always returns `false` for `IsSlice6Distributor()` and `true` for `IsBattery()`.
- **SLICEPRODB**: `QueryConnectedDevices()` always sets an empty connected devices array.
- **SLICE6AIRBR/SLICE6AIRTC**: `SetIsStreamingSupported()` always sets `IsStreamingSupported = true` regardless of parameter.
- **SLICE6AIRTC.TCDiagnosticResults**: Initialized with 24 elements (indexed 0-23).
- **SLICE6AIRTC.GetRTChannelIndices**: Returns 8, 16, or 24 channel indices based on `_maxModuleCount` value.
- **SLICE6DB3**: All clock sync and PTP methods are no-ops that immediately report success without performing actual operations.
- **Protocol limitations**: Commands with `byte.MaxValue` protocol version are unsupported; commands with `MIN_PROTOCOL_VER` (1) are supported.
---
## 4. Dependencies
### External Dependencies (Imports):
- `DTS.Common.Interface.Connection` - Connection interfaces (`IConnection`)
- `DTS.Common.Interface.DASFactory` - DAS factory interfaces (`IDASCommunication`, `IDASConfigurationArg`, `ICommunication`, `IDASConnectedDevice`, `IDASReconfigure`, `ITCDiagnosticResult`, `IUARTDownload`, `IUARTDownloadActions`, `IUARTDownloadRequest`)
- `DTS.Common.Interface.DASFactory.Config` - Configuration types (`DASModule`, `DASChannel`, `AnalogInputDASChannel`, `StreamOutputDASChannel`, `UARTInputDASChannel`)
- `DTS.Common.Interface.Communication` - Communication interfaces
- `DTS.Common.Enums.DASFactory` - Enums and constants (`DFConstantsAndEnums`, `ProtocolLimitedCommands`, `ModuleType`)
- `DTS.Common.Enums.Hardware` - Hardware type enums (`HardwareTypes`)
- `DTS.Common.Enums.Sensors` - Sensor enums (`SensorConstants.BridgeType`)
- `DTS.Common.Constant.DASSpecific` - DAS-specific constants (`SLICE6AIRBR`, `SLICE6AIRTC`)
- `DTS.Common.ICommunication` - Communication types (`InfoResult`, `RealTimeAsyncPacket`)
- `DTS.Common.Utilities.Logging` - Logging (`APILogger`)
- `DTS.Common.Utils` - Utility functions (`Utils.IsZero`, `Utils.AlmostEqual`)
- `DTS.Common.Classes.DASFactory` - DAS factory classes
- `DTS.Common.Enums` - General enums
- `DTS.DASLib.Command.SLICE` - SLICE command classes (`QuerySystemAttributeSLICE6`, `SetSystemAttributeSLICE6AIR`, `QueryChannelShuntResults`, `RetrieveSampleAverage`, `QueryArmAttribute`)
- `DTS.DASLib.Command.SLICE.RealtimeCommands` - Realtime command classes (`RealtimeStreamingNextSamples`)
- `DTS.DASLib.Command` - Base command classes (`AbstractCommandBase`)
- `DTS.DASLib.Service.Interfaces` - Service interfaces (`IDownloadActions`)
- `System.Net.NetworkInformation` - `PhysicalAddress` class
- `System.IO.Ports` - Serial port enums (`StopBits`, `Parity`, `Handshake`)
- `System.Collections.Generic`
### Inferred Dependents:
- Classes inherit from `SLICE6DB<T>` and `SLICE6_Base<T>` (not provided in source), suggesting a class hierarchy for SLICE device implementations.
- `SliceServiceAsyncInfo`, `SliceConfigServiceAsyncInfo`, `QueryDownloadAsyncInfo`, `SetUARTSettingsAsyncInfo`, `SliceUARTDownloadState` are used but not defined in provided source.
---
## 5. Gotchas
1. **SLICE6DB3 PTP No-ops**: The `SetClockSyncConfig`, `GetClockSyncStatus`, `SetPTPDomainID`, and `GetPTPDomainID` methods in `SLICE6DB3` are no-ops that immediately call `Success()` without performing any actual device communication. Code expecting real PTP functionality will silently succeed without effect.
2. **SLICEPRODB IsBattery Ambiguity**: The `IsBattery()` method returns `true` with the comment "um maybe?", indicating uncertainty about the correctness of this implementation.
3. **SLICE6AIRBR SetIsStreamingSupported Ignores Parameter**: The `SetIsStreamingSupported(bool supported)` method ignores its parameter and always sets `IsStreamingSupported = true`.
4. **SLICE6AIRTC UARTDownload Not Supported**: The `UARTDownload` method immediately returns an error "Not supported" despite the class implementing `IUARTDownload`.
5. **SLICE6AIRTC GetIsStreaming Dual Condition**: The streaming status check uses `DASArmStatus.ReceivedInvalidModeDuringSetup || DASArmStatus.IsInRealtime` - the comment references bug 18852 indicating this is a workaround for unreliable status detection.
6. **SLICE6AIRTC Failure Threshold**: UART settings methods track `straightFailures` and only report errors after exceeding `PERMITTED_FAILURES` (constant not defined in provided source), otherwise silently succeeding on failure.
7. **SLICE6AIRBR MaxSampleRateHz Fallback**: On error querying max sample rate, returns hardcoded 50000 Hz with a log message, potentially masking device communication issues.
8. **S6DBConnectedDevice Default Values**: Port and SpotOnPort default to -1 (invalid), and string properties default to empty strings. Consumers must check validity before use.
9. **SLICE6AIRTC S6ATCConfigAttributes No-ops**: The nested `S6ATCConfigAttributes` class overrides `ConfigureCoupling`, `ConfigureBridge`, and `ConfigureBridgeResistance` as no-ops, which could cause confusion if bridge configuration is expected.

View File

@@ -0,0 +1,208 @@
---
source_files:
- DataPRO/IService/Classes/SLICEService/SLICE Service.TriggerCheck.cs
- DataPRO/IService/Classes/SLICEService/SLICE Service.cs
- DataPRO/IService/Classes/SLICEService/SLICE Service.Public.cs
generated_at: "2026-04-17T15:33:52.687420+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "8cfeb92a23080dfc"
---
# SLICE Service Module Documentation
## 1. Purpose
The `Slice<T>` class is a generic partial class that serves as the primary service abstraction for DTS data acquisition system (DAS) hardware communication. It implements multiple interfaces (`IDASCommunication`, `IConfigurationActions`, `IDiagnosticsActions`, `ITriggerCheckActions`, `IRealTimeActions`, `IArmActions`, `IDownloadActions`) to provide a unified API for configuring, arming, monitoring, and downloading data from various SLICE hardware variants. The class is designed with a generic type parameter `T` constrained to `IConnection`, enabling support for different transport mechanisms (USB, Ethernet) while sharing common functionality.
---
## 2. Public Interface
### Trigger Check Actions (from `ITriggerCheckActions`)
| Method | Signature | Description |
|--------|-----------|-------------|
| `PreStartTriggerCheck` | `void ITriggerCheckActions.PreStartTriggerCheck(ServiceCallback callback, object userData)` | Asynchronously prepares hardware for trigger check by setting start record and trigger polarity attributes if supported. |
| `PostStartTriggerCheck` | `void ITriggerCheckActions.PostStartTriggerCheck(ServiceCallback callback, object userData)` | Immediately reports success; no additional post-processing performed. |
| `StartTriggerCheck` | `void ITriggerCheckActions.StartTriggerCheck(ServiceCallback callback, object userData)` | Asynchronously initializes hardware input lines and checks for shorted trigger/start inputs. Returns error "TriggerInputShorted" or "StartInputShorted" if detected. |
| `DoStartCheck` | `void ITriggerCheckActions.DoStartCheck(ServiceCallback callback, object userData)` | Asynchronously checks start record input status and updates `ArmStatus.IsArmed` and `ArmStatus.IsRecording`. |
| `DoTriggerCheck` | `void ITriggerCheckActions.DoTriggerCheck(ServiceCallback callback, object userData)` | Asynchronously executes trigger check; callback may be null. |
| `DoTriggerCheckSync` | `void ITriggerCheckActions.DoTriggerCheckSync()` | Synchronously checks trigger/start input status and sets `ArmStatus` with `IsTriggered`, `IsArmed`, `IsTriggerShorted`, `IsStartShorted`. |
| `CancelTriggerCheck` | `void ITriggerCheckActions.CancelTriggerCheck(ServiceCallback callback, object userData)` | Asynchronously cancels trigger check operation. |
### Protected/Virtual Methods (Trigger Check)
| Method | Signature | Description |
|--------|-----------|-------------|
| `AsyncPreStartTriggerCheck` | `protected virtual void AsyncPreStartTriggerCheck(object asyncInfo)` | Worker method that sets `StartRecordPolarity` and `TriggerPolarity` system attributes based on `InvertStart` and `InvertTrigger` properties. |
| `AsyncStartTriggerCheck` | `protected virtual void AsyncStartTriggerCheck(object asyncInfo)` | Worker method that executes `InitializeHardwareLines` command and validates input states. |
### Core Service Methods (from main partial class)
| Method | Signature | Description |
|--------|-----------|-------------|
| `LaunchAsyncWorker` | `public void LaunchAsyncWorker(string Invoker, WaitCallback cb, object asyncInfo)` | Queues an async work item to the thread pool. Throws `NotConnectedException` if not connected, or `Exception` if queue fails. |
| `GetRequestedRange` | `protected static double GetRequestedRange(AnalogInputDASChannel analog, double MvPerEU)` | Calculates requested range for analog channel, adjusting for nonlinear polynomial formulas. |
| `SetRemoveSeconds` | `protected void SetRemoveSeconds()` | Sets leap second removal attribute if `ProtocolLimitedCommands.RemoveLeapSeconds` is supported. |
| `GetExtendedFaultFlags` | `protected virtual QATSExtendedFault[] GetExtendedFaultFlags()` | Queries extended fault flags from arm attributes; returns array of active faults. |
| `SetADCSamplesPerPacket` | `protected void SetADCSamplesPerPacket(int adcPerPacket)` | Configures ADC samples per packet via `S6A_IrigStreamBufferConfig` system attribute. |
| `SurfaceApplicationError` | `protected static void SurfaceApplicationError(string msg)` | Surfaces error to application via `PageErrorEvent.SurfaceApplicationError`. |
### Public Properties (from SLICE Service.Public.cs)
| Property | Type | Description |
|----------|------|-------------|
| `ConfigData` | `IConfigurationData` | Public configuration data accessor. |
| `ChannelDiagnostics` | `IDiagnosticActions[]` | Array of channel diagnostic actions. |
| `ChannelDiagnosticsResults` | `IDiagnosticResult[]` | Array of channel diagnostic results. |
| `ModuleDiagnosticsResults` | `IModuleDiagnosticsResult[]` | Module-level diagnostic results. |
| `TriggerResult` | `ITriggerCheckResult` | Public trigger check result. |
| `RealtimeDASChannels` | `List<int>` | List of real-time DAS channels. |
| `TiltAxisData` | `List<double>` | Tilt axis data for real-time display. |
| `DASFlashEraseStatus` | `FlashEraseStatus` | Flash erase operation status. |
| `DASArmStatus` | `IArmStatusData` | Current arm status data. |
| `AutoArmStatus` | `DFConstantsAndEnums.CommandStatus` | Auto-arm operation status (default: `StatusNoError`). |
| `DASClockSyncStatus` | `IDictionary<InputClockSource, bool>` | Clock sync status per input source. |
| `WhatToDownload` | `virtual IDownloadRequest` | Download request specification. |
| `EventInfo` | `IDownloadReport` | Event download report. |
| `EventDownloadedStatus` | `bool[]` | Per-event download status array. |
| `EventGuids` | `Guid[]` | Event GUID array. |
| `FaultFlags` | `ushort[]` | Event fault flags. |
| `ArmAttempts` | `byte[]` | Event arm attempt counts. |
| `InvertTrigger` | `bool` | Trigger polarity inversion flag. |
| `InvertStart` | `bool` | Start record polarity inversion flag. |
| `IgnoreShortedStart` | `bool` | Flag to ignore shorted start input. |
| `IgnoreShortedTrigger` | `bool` | Flag to ignore shorted trigger input. |
| `SerialNumber` | `string` | Device serial number (inherited). |
| `MACAddress` | `string` | Device MAC address. |
| `FirstUseDate` | `DateTime?` | First use date; null if not used since calibration. |
| `IsFirstUseDateSupported` | `bool` | Whether hardware supports first use date. |
| `IsStreamingSupported` | `bool` | Whether streaming feature is supported. |
| `ExcitationStatus` | `ExcitationStatus` | Current excitation status (default: `Unknown`). |
| `RecordId` | `int` | Record ID (default: `INVALID_IDASCOMMUNICATION_RECORD_ID`). |
### Hardware Identification Methods
| Method | Signature | Description |
|--------|-----------|-------------|
| `GetHardwareType` | `public virtual HardwareTypes GetHardwareType()` | Returns hardware type based on serial number prefix ("BA5"→Nano, "BA0"→Micro, "SG5"→SLICE1_G5Stack). |
| `SupportsTriggerInversion` | `public virtual bool SupportsTriggerInversion()` | Returns `true` (overrideable). |
| `SupportsStartInversion` | `public virtual bool SupportsStartInversion()` | Returns `true` (overrideable). |
| `IsEthernetDistributor` | `public virtual bool IsEthernetDistributor()` | Returns `false`. |
| `IsSlice6Distributor` | `public virtual bool IsSlice6Distributor()` | Returns `false`. |
| `IsBattery` | `public virtual bool IsBattery()` | Returns `false`. |
| `IsTSRAIR` | `public virtual bool IsTSRAIR()` | Returns `false`. |
| `IsSlice6Air` | `public virtual bool IsSlice6Air()` | Returns `false`. |
| `IsSlice6AirTc` | `public virtual bool IsSlice6AirTc()` | Returns `false`. |
### Arm Status Methods
| Method | Signature | Description |
|--------|-----------|-------------|
| `GetIsInArm` | `public bool GetIsInArm()` | Returns `DASArmStatus.IsArmed` or `false` if null. |
| `GetIsInRealtime` | `public bool GetIsInRealtime()` | Returns `DASArmStatus.IsInRealtime` or `false` if null. |
| `GetIsStreaming` | `public virtual bool GetIsStreaming()` | Returns `false`; overrideable for streaming-capable hardware. |
| `SetInArm` | `public void SetInArm(bool WriteToDb)` | Sets `IsArmed = true` in arm status. |
| `SetInRealtime` | `public void SetInRealtime(bool WriteToDb, bool ExitRealtimeIfPossible)` | Sets realtime mode; queries arm status first and may exit realtime mode. |
| `SetDASArmStatus` | `public void SetDASArmStatus(IArmStatusData status, bool bSetInDb)` | Sets arm status with optional DB persistence. |
| `SetDASArmStatus` | `public void SetDASArmStatus()` | Persists current `DASArmStatus` to DB; queries `MaxEventsPossible` for TSR AIR devices. |
### Nested Classes
| Class | Purpose |
|-------|---------|
| `SliceServiceAsyncInfo` | Base async info container with `callback`, `userData`, `functionData`, `PreOrPost`, `MaxTimeout`. Methods: `Error()`, `Progress()`, `NewData()`, `Success()`, `Cancel()`. |
| `SliceServiceQueryConfigAsyncInfo` | Extends `SliceServiceAsyncInfo` with `CRC`, `ConfigString`, `ReadIds`, `DeviceScaleFactors`, `DifferentModuleCountsAreOK`. |
| `SliceServiceQueryTestSetupAsyncInfo` | Extends `SliceServiceAsyncInfo` with `TestSetupGuid`. |
| `SliceServiceSetTestSetupAsyncInfo` | Extends `SliceServiceAsyncInfo` with `TestSetupXML`. |
| `AutoDetectServiceAsyncInfo` | Extends `SliceServiceAsyncInfo` with `QueryConfiguration` flag. |
| `GainCodesSLICE6IEPE` | Enum with 16 gain codes (G1-G16) with attributes for input ranges. |
### Hardware Subclasses
| Class | Connection Type | Hardware Type |
|-------|-----------------|---------------|
| `WinUSBSlice` | WINUSB | SLICE_Base |
| `CDCUSBSlice` | WINUSB | SLICE2 |
| `WinUSBSlice1_5` | WINUSB | SLICE1_5 |
| `WinUSBSlice6` | WINUSB | SLICE6 |
| `WinUSBSlice6Air` | WINUSB | SLICE6_AIR |
| `WinUSBSlice6AirBridge` | WINUSB | SLICE6_AIR_BR |
| `WinUSBTsrAir` | WINUSB | DIR/DKR (based on hardware revision) |
| `WinUSBSlice6AirThermocoupler` | WINUSB | SLICE6_AIR_TC |
| `EthernetSlice` | Ethernet | SLICE_Base |
| `EthernetSlice2` | Ethernet | SLICE2 |
| `EthernetSlice6` | Ethernet | SLICE6_Base |
| `EthernetSlice6Air` | Ethernet | S6A_EthernetRecorder or SLICE6_AIR |
| `EthernetSlice6AirBridge` | Ethernet | SLICE6_AIR_BR |
| `EthernetSlice6DB` | Ethernet | SLICE6DB or SLICE6DB_InDummy |
| `EthernetPowerPro` | Ethernet | PowerPro |
| `EthernetTsrAir` | Ethernet | TSR_AIR or TSR_AIR_RevB |
| `EthernetSlice6DB3` | Ethernet | SLICE6DB3 |
| `EthernetSlicePRODB` | Ethernet | SLICE_Pro_Distributor |
| `EthernetSlice1_5` | Ethernet | SLICE1_5 |
| `EthernetSliceDB` | Ethernet | SliceDB |
| `EthernetSlice6AirThermocoupler` | Ethernet | SLICE6_AIR_TC |
---
## 3. Invariants
1. **Connection Requirement**: `LaunchAsyncWorker` requires `Connected == true`; otherwise throws `NotConnectedException`.
2. **Type Constraint**: Generic type `T` must implement `IConnection` and have a parameterless constructor (`new()`).
3. **Async Info Type Safety**: Methods like `AsyncPreStartTriggerCheck`, `AsyncStartTriggerCheck`, `AsyncDoTriggerCheck`, `AsyncDoStartCheck`, and `AsyncCancelTriggerCheck` perform type checking with `is SliceServiceAsyncInfo` and return early if type mismatch.
4. **Command Support Checks**: Hardware-specific commands (e.g., `InitHardwareInputLines`, `RemoveLeapSeconds`, `ADCSamplesPerPacket`, `ExtendedFaultIds`) are only executed if `IsCommandSupported` returns `true`.
5. **Equality Based on SerialNumber**: Two `Slice<T>` instances are equal if and only if their `SerialNumber` properties are equal (case-sensitive).
6. **Arm Status Null Safety**: Methods like `GetIsInArm()` and `GetIsInRealtime()` return `false` if `DASArmStatus` is null rather than throwing.
7. **MaxEventsPossible Query**: For TSR AIR devices, `MaxEventsPossible` is set to 0 before querying to trigger calculation per firmware requirements.
---
## 4. Dependencies
### Direct Dependencies (Imports)
| Namespace | Purpose |
|-----------|---------|
| `DTS.DASLib.Command.SLICE` | SLICE command classes (`InitializeHardwareLines`, `SetSystemAttribute`, `QueryArmAttribute`, `QueryEventAttribute`, `QuerySystemAttribute`, `SetSystemAttributeSLICE6AIR`, `QueryArmAndTriggerStatus`, `EndRealtimeMode`) |
| `DTS.Common.ICommunication` | Communication interfaces (`ServiceCallback`, `ServiceCallbackData`) |
| `DTS.Common.Utilities.Logging` | Logging via `APILogger` |
| `DTS.Common.Interface.Connection` | Connection interfaces (`IConnection`, `EthernetConnection`, `WINUSBConnection`) |
| `DTS.Common.Classes.Connection` | Connection implementations |
| `DTS.Common.Enums.DASFactory` | Enums (`DFConstantsAndEnums`, `ProtocolLimitedCommands`, `AttributeTypes`, `QATSExtendedFault`) |
| `DTS.Common.Interface.DASFactory` | DAS factory interfaces (`IDASCommunication`, `IConfigurationActions`, `IDiagnosticsActions`, `ITriggerCheckActions`, `IRealTimeActions`, `IArmActions`, `IDownloadActions`) |
| `DTS.Common.Enums` | General enums (`ExcitationStatus`, `InputClockSource`, `ClockSyncProfile`) |
| `DTS.Common.Enums.Sensors` | Sensor enums (`NonLinearStyles`) |
| `DTS.Common.Enums.Hardware` | Hardware enums (`HardwareTypes`) |
| `DTS.Common.Events` | Event classes (`PageErrorEvent`) |
| `DTS.Common.DASResource` | DAS resource classes (`AnalogInputDASChannel`) |
| `DTS.Common.Interface.DASFactory.Diagnostics` | Diagnostic interfaces |
| `DTS.Common.Interface.DASFactory.ARM` | ARM interfaces (`IArmStatusData`, `IArmCheckActions`, `IArmCheckResults`, `IOptimizationValues`) |
| `DTS.Common.Interface.DASFactory.Download` | Download interfaces (`IDownloadRequest`, `IDownloadReport`) |
| `DTS.Common.Interface.DASFactory.Config` | Configuration interfaces (`IConfigurationData`) |
| `DTS.DASLib.Service.Classes.Diagnostics` | Diagnostic implementation classes |
| `DTS.DASLib.Command.SLICE.RealtimeCommands` | Real-time command classes |
### Depended On By
*Not determinable from source alone* - The module exposes interfaces that other components would consume, but no direct consumers are shown in these files.
---
## 5. Gotchas
1. **Silent Failures in AsyncPreStartTriggerCheck**: The `AsyncPreStartTriggerCheck` method catches all exceptions and only logs them via `APILogger.Log`, then calls `info.Success()`. This means polarity configuration failures are not surfaced to the caller.
2. **Null Callback Handling**: `DoTriggerCheck` accepts a null `callback` parameter and creates `SliceServiceAsyncInfo` as null in that case. The `AsyncDoTriggerCheck` method uses null-conditional operators (`info?.Success()`) to handle this.
3. **Hardware Revision Query Side Effect**: `WinUSBTsrAir.GetHardwareType()` and `EthernetTsrAir.GetHardwareType()` call `QueryHardwareRevision()` if `_hardwareRevision` equals `UNKNOWN_REVISION`, which may cause I/O during what appears to be a simple property getter.
4. **KeepAliveReset Requirement**: Several Ethernet subclasses (`EthernetSlice6`, `EthernetSlice6Air`, `EthernetSlice6AirBridge`, `EthernetTsrAir`, `EthernetSlice6AirThermocoupler`) set `RequiresKeepAliveReset = true` on the transport, indicating these devices require special connection handling.
5. **TSR AIR Protocol Removal**: `WinUSBTsrAir` constructor removes `PTPSyncStatus` and `PTPTimestamp` from `TSRAIR_MinimumProtocols`, indicating USB-connected TSR AIR devices do not support network time sync.
6. **Multiple Sample Realtime Flag**: Different subclasses set `_bSupportsMultipleSampleRealtime` differently (WinUSBSlice/EthernetSlice = true, most others = false), affecting real-time data handling behavior.
7. **SetInRealtime Queries Hardware**: `SetInRealtime` executes `QueryArmAndTriggerStatus` synchronously before setting status, which may have performance implications.
8. **MaxEventsPossible Calculation Requirement**: For TSR AIR devices, the firmware requires setting `MaxEventsPossible` to 0 before querying to trigger internal calculation (per comment referencing case 26817).

View File

@@ -0,0 +1,102 @@
---
source_files:
- DataPRO/IService/Classes/TDAS Service/TDAS Service.cs
- DataPRO/IService/Classes/TDAS Service/Public.cs
- DataPRO/IService/Classes/TDAS Service/TriggerCheck.cs
generated_at: "2026-04-17T15:33:04.937990+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "cace7bc59e68c7cc"
---
# TDAS Service Documentation
## 1. Purpose
The `TDAS<T>` class is a generic data acquisition system (DAS) service implementation that provides communication, configuration, diagnostics, trigger checking, real-time operations, arming, and download functionality for TDAS hardware devices. It serves as an abstraction layer between the application and physical TDAS hardware, supporting both Ethernet and Serial connections through its generic type parameter. The class implements multiple action interfaces to provide a unified API for interacting with various TDAS hardware types (G5, TDAS Pro Rack, SIM, TOM, LabRack) identified by their serial number prefixes.
## 2. Public Interface
### Class Declaration
```csharp
public partial class TDAS<T> : Communication<T>,
IDASCommunication,
IConfigurationActions,
IDiagnosticsActions,
ITriggerCheckActions,
IRealTimeActions,
IArmActions,
IDownloadActions where T : IConnection, new()
```
### Hardware Identification Methods
| Method | Signature | Behavior |
|--------|-----------|----------|
| `GetHardwareType()` | `public HardwareTypes GetHardwareType()` | Returns hardware type based on `SerialNumber` prefix: "5M" → G5 variants, "DR" → TDAS_Pro_Rack, "SM" → SIM, "TOM" → TOM, "LR" → TDAS_LabRack. Defaults to `TDAS_Pro_Rack` for unrecognized prefixes. |
| `IsEthernetDistributor()` | `public bool IsEthernetDistributor()` | Always returns `false`. |
| `IsSlice6Distributor()` | `public bool IsSlice6Distributor()` | Always returns `false`. |
| `IsBattery()` | `public bool IsBattery()` | Always returns `false`. |
| `IsTSRAIR()` | `public bool IsTSRAIR()` | Always returns `false`. |
| `IsSlice6Air()` | `public bool IsSlice6Air()` | Always returns `false`. |
| `IsSlice6AirTc()` | `public bool IsSlice6AirTc()` | Always returns `false`. |
| `IsScheduleEventCountSupported()` | `public bool IsScheduleEventCountSupported()` | Always returns `false`. |
### Configuration Properties & Methods
| Member | Signature | Behavior |
|--------|-----------|----------|
| `ConfigData` | `public IConfigurationData ConfigData { get; set; }` | Holds configuration data for the DAS. |
| `NumberOfConfiguredChannels()` | `public int NumberOfConfiguredChannels()` | Returns `ConfigData.NumberOfConfiguredChannels()` or 0 if `ConfigData` is null. |
| `NumberOfChannels()` | `public int NumberOfChannels()` | Returns `ConfigData.NumberOfChannels()` or 0 if `ConfigData` is null. |
| `ConfigureHasBeenRun` | `public bool ConfigureHasBeenRun { get; set; }` | Tracks whether configuration has been executed. |
### Diagnostics Properties & Methods
| Member | Signature | Behavior |
|--------|-----------|----------|
| `ChannelDiagnostics` | `public IDiagnosticActions[] ChannelDiagnostics { get; set; }` | Array of channel diagnostic actions. |
| `ChannelDiagnosticsResults` | `public IDiagnosticResult[] ChannelDiagnosticsResults { get; set; }` | Array of channel diagnostic results. |
| `SetChannelDiagnosticActions()` | `public void SetChannelDiagnosticActions(IDiagnosticActions[] actions, bool setInDb = true)` | Delegates to `DiagnosticsActions.SetChannelDiagnosticActions()`. |
| `ClearChannelDiagnosticsResults()` | `public void ClearChannelDiagnosticsResults(bool bClearDb = true)` | Delegates to `DiagnosticsResultActions.ClearChannelDiagnosticsResults()`. |
| `SetChannelDiagnosticsResults()` | `public void SetChannelDiagnosticsResults(IDiagnosticResult[] results, bool setInDb)` | Delegates to `DiagnosticsResultActions.SetChannelDiagnosticsResults()`. |
| `DiagnosticsHasBeenRun` | `public bool DiagnosticsHasBeenRun { get; set; }` | Tracks whether diagnostics have been executed. |
### Arm Status Properties & Methods
| Member | Signature | Behavior |
|--------|-----------|----------|
| `DASArmStatus` | `public IArmStatusData DASArmStatus { get; set; }` | Current arm status of the DAS. |
| `AutoArmStatus` | `public DFConstantsAndEnums.CommandStatus AutoArmStatus { get; set; }` | Status of auto-arm operation. |
| `GetIsInArm()` | `public bool GetIsInArm()` | Returns `DASArmStatus.IsArmed` or `false` if `DASArmStatus` is null. |
| `GetIsInRealtime()` | `public bool GetIsInRealtime()` | Returns `DASArmStatus.IsInRealtime` or `false` if `DASArmStatus` is null. |
| `GetIsStreaming()` | `public bool GetIsStreaming()` | Always returns `false`. |
| `SetInArm()` | `public void SetInArm(bool WriteToDb)` | Sets `DASArmStatus.IsArmed = true`. |
| `SetInRealtime()` | `public void SetInRealtime(bool WriteToDb, bool ExitRealtimeIfPossible)` | Sets `DASArmStatus.IsInRealtime = true`. |
| `SetDASArmStatus()` | `public void SetDASArmStatus()` | Overload that persists current `DASArmStatus` to database. |
| `SetDASArmStatus()` | `public void SetDASArmStatus(IArmStatusData status, bool bSetInDb)` | Delegates to `ArmStatus.SetArmStatus()`. |
### Trigger Check Methods (ITriggerCheckActions)
| Method | Signature | Behavior |
|--------|-----------|----------|
| `PreStartTriggerCheck()` | `void ITriggerCheckActions.PreStartTriggerCheck(ServiceCallback callback, object userData)` | Immediately invokes success callback. No hardware interaction. |
| `PostStartTriggerCheck()` | `void ITriggerCheckActions.PostStartTriggerCheck(ServiceCallback callback, object userData)` | Immediately invokes success callback. No hardware interaction. |
| `StartTriggerCheck()` | `void ITriggerCheckActions.StartTriggerCheck(ServiceCallback callback, object userData)` | Asynchronously arms the device using `TestTrigger` or `TestTriggerBroadcast` commands depending on G5 mode. |
| `DoTriggerCheck()` | `void ITriggerCheckActions.DoTriggerCheck(ServiceCallback callback, object userData)` | Asynchronously checks trigger status using `TestAll` command with `PREV` mode. |
| `DoStartCheck()` | `void ITriggerCheckActions.DoStartCheck(ServiceCallback callback, object userData)` | Asynchronously checks if recording has started using `TestAll` command. |
| `DoTriggerCheckSync()` | `void ITriggerCheckActions.DoTriggerCheckSync()` | Throws `NotImplementedException`. |
| `CancelTriggerCheck()` | `void ITriggerCheckActions.CancelTriggerCheck(ServiceCallback callback, object userData)` | Asynchronously cancels trigger check by sending `TestTrigger.SubCommandValues.OFF` to modules. |
### Download Properties & Methods
| Member | Signature | Behavior |
|--------|-----------|----------|
| `WhatToDownload` | `public IDownloadRequest WhatToDownload { get; set; }` | Download request configuration. |
| `EventInfo` | `public IDownloadReport EventInfo { get; set; }` | Event information for download. |
| `EventDownloadedStatus` | `public bool[] EventDownloadedStatus { get; set; }` | Array tracking download status per event. |
| `EventGuids` | `public Guid[] EventGuids { get; set; }` | GUIDs for events. |
| `FaultFlags` | `public ushort[] FaultFlags { get; set; }` | Fault flags for events. |
| `ArmAttempts` | `public byte[] ArmAttempts { get; set; }` | Arm attempt counts. |
| `SetWhatToDownload()` | `public void SetWhatToDownload(IDownloadRequest request, bool bSetInDb = true)` | Delegates to `DownloadRequest.SetWhatToDownload()`. |
| `SetEventInfo()` | `public void SetEventInfo(IDownloadReport eventInfo, bool bSetInDb = true)` | Delegates to `DownloadReport.Set

View File

@@ -0,0 +1,152 @@
---
source_files:
- DataPRO/IService/Classes/TDAS/TDASServiceSetupInfo.cs
- DataPRO/IService/Classes/TDAS/TDASServiceSetupInfoLookup.cs
- DataPRO/IService/Classes/TDAS/TDASConfig.cs
- DataPRO/IService/Classes/TDAS/TDASModuleConfig.cs
generated_at: "2026-04-17T15:38:46.566937+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "48c05185bea83ad8"
---
# TDAS Configuration Module Documentation
## 1. Purpose
This module provides configuration management for TDAS (Test Data Acquisition System) hardware modules within the DataPRO system. It defines data structures for service setup information (`TDASServiceSetupInfo`, `TDASServiceSetupInfoLookup`) and implements XML-serializable configuration persistence for TDAS modules and their associated channels (`TDASConfig`, `TDASModuleConfig`). The module supports per-module configuration storage, channel management across multiple channel types, and recording mode settings for data acquisition operations.
---
## 2. Public Interface
### TDASServiceSetupInfo
**Namespace:** `DTS.DASLib.Service`
A POCO class representing static service setup parameters.
```csharp
public TDASServiceSetupInfo(
string setupDescription,
double? samplesPerSecond,
float hardwareFilterRateHz,
DFConstantsAndEnums.RecordingMode recordingMode,
bool? checkoutMode)
```
| Property | Type | Description |
|----------|------|-------------|
| `SetupDescription` | `string` | Description of the setup configuration |
| `SamplesPerSecond` | `double?` | Nullable sample rate |
| `HardwareFilterRateHz` | `float` | Anti-aliasing filter rate in Hertz |
| `RecordingMode` | `DFConstantsAndEnums.RecordingMode` | Recording mode enum value |
| `CheckoutMode` | `bool?` | Nullable checkout mode flag |
---
### TDASServiceSetupInfoLookup
**Namespace:** `DTS.DASLib.Service`
A variant of `TDASServiceSetupInfo` where sample rates and filter rates are stored as dictionaries keyed by DAS identifier, allowing per-device configuration.
```csharp
public TDASServiceSetupInfoLookup(
string setupDescription,
Dictionary<string, double> sampleRateLookup,
Dictionary<string, float> aafLookup,
DFConstantsAndEnums.RecordingMode recordingMode,
bool? checkoutMode)
```
| Property | Type | Description |
|----------|------|-------------|
| `SetupDescription` | `string` | Description of the setup configuration |
| `SamplesPerSecondLookup` | `Dictionary<string, double>` | Sample rates per DAS identifier |
| `HardwareFilterRateHzLookup` | `Dictionary<string, float>` | Filter rates per DAS identifier |
| `RecordingMode` | `DFConstantsAndEnums.RecordingMode` | Recording mode enum value |
| `CheckoutMode` | `bool?` | Nullable checkout mode flag |
---
### TDASConfig
**Namespace:** `DTS.DASLib.Service`
Implements `IXmlSerializable` for XML-based persistence of TDAS module configurations. Manages a collection of `TDASModuleConfig` objects keyed by serial number.
```csharp
public TDASConfig()
```
Default constructor.
```csharp
public TDASConfig(string fileName, bool deleteIfPresent)
```
Constructs an instance and optionally loads from or deletes an existing config file. Files are stored in a `DASConfigs` subdirectory relative to the executing assembly location.
| Parameter | Description |
|-----------|-------------|
| `fileName` | Name of the configuration file |
| `deleteIfPresent` | If `true`, deletes existing file; if `false`, reads existing file |
```csharp
public void SetModule(TDASModuleConfig module)
```
Adds or updates a module configuration in the internal dictionary keyed by `module.SerialNumber`.
```csharp
public TDASModuleConfig GetModule(TDASModuleConfig module)
```
Retrieves an existing module by serial number, or adds the provided module if not present.
```csharp
public Dictionary<string, TDASModuleConfig> Modules { get; }
```
Read-only access to the module dictionary.
```csharp
public string FileName { get; }
```
Full path to the configuration file.
**IXmlSerializable Members:**
- `XmlSchema GetSchema()` — Returns `null`.
- `void ReadXml(XmlReader reader)` — Deserializes from XML with root element `TDASConfig`.
- `void WriteXml(XmlWriter writer)` — Serializes to XML.
---
### TDASModuleConfig
**Namespace:** `DTS.DASLib.Service`
Implements `IXmlSerializable` for individual TDAS module configuration, including channel definitions.
```csharp
public TDASModuleConfig()
```
Default constructor.
```csharp
public TDASModuleConfig(string fileName)
```
Constructs an instance and loads configuration from the specified file in the `DASConfigs` subdirectory.
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `SerialNumber` | `string` | `""` | Module serial number (dictionary key) |
| `TestId` | `string` | `""` | Test identifier |
| `TestDescription` | `string` | `""` | Test description |
| `RecordingMode` | `DFConstantsAndEnums.RecordingMode` | `InvalidArmMode` | Recording mode |
| `AAFilterRateHz` | `float` | `0` | Anti-aliasing filter rate |
| `PreTriggerSeconds` | `double` | `0` | Pre-trigger duration |
| `PostTriggerSeconds` | `double` | `0` | Post-trigger duration |
| `FirmwareVersion` | `string` | `""` | Firmware version string |
| `MaxEventStorageSpaceInBytes` | `UInt64?` | `0` | Maximum event storage |
| `ModuleArrayIndex` | `int` | `0` | Module array index |
| `FileName` | `string` | — | Full path to config file (read-only) |
```csharp
public void SetChannel(OutputTOMDigitalChannel channel)
public void SetChannel(OutputSquibChannel channel)
public void SetChannel(AnalogInputDASChannel channel)
```
Adds or updates a channel in the internal dictionary keyed by `channel.Module