103 lines
4.6 KiB
Markdown
103 lines
4.6 KiB
Markdown
|
|
---
|
||
|
|
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() //
|