--- source_files: - DataPRO/IService/StateMachine/StatusAndParameters/Download/DownloadParameters.cs - DataPRO/IService/StateMachine/StatusAndParameters/Download/DownloadStatusInformation.cs generated_at: "2026-04-17T15:42:14.920523+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "bd941e1c9e197388" --- # Documentation: Download State Machine Components ## 1. Purpose This module provides the parameter configuration and status management components for a download state machine within the DTS.DASLib.Service namespace. `DownloadParameters` serves as a data transfer object encapsulating all configuration, runtime parameters, and callbacks needed for download operations from DAS (Data Acquisition System) units. `DownloadStatusInformation` manages the execution state, progress reporting, and cancellation handling for asynchronous download operations, coordinating between the state machine, DAS hardware communication layer, and UI consumers through delegate callbacks. --- ## 2. Public Interface ### DownloadParameters Class **Implements:** `IStatusParameters` | Member | Signature | Description | |--------|-----------|-------------| | `ProceedWhenDone` | `bool { get; set; }` | Controls whether the state machine should remain in state after completion. Default: `false`. | | `RequireAllDASFinish` | `bool { get; set; }` | Determines whether all DAS units must complete their downloads. Default: `false`. | | `DefaultDownloadFolder` | `string { get; set; }` | Download folder path from configuration. Default: `string.Empty`. | | `DefaultUploadBinaries` | `bool { get; set; }` | Upload binaries setting from config. Default: `false`. | | `DefaultUploadExports` | `bool { get; set; }` | Upload exports setting from config. Default: `false`. | | `DefaultUploadLogs` | `bool { get; set; }` | Upload logs setting from config. Default: `false`. | | `DefaultUploadReports` | `bool { get; set; }` | Upload reports setting from config. Default: `false`. | | `DefaultUploadSetups` | `bool { get; set; }` | Upload test setups setting from config. Default: `false`. | | `DASList` | `IDASCommunication[] { get; set; }` | Array of DAS units to download from. Default: empty array. | | `CurrentTestTestId` | `string { get; set; }` | Test ID of current test. Default: `string.Empty`. | | `CurrentTestTestIdNode` | `string { get; set; }` | Test ID node of current test. Default: `string.Empty`. | | `CurrentTestTestDirectory` | `string { get; set; }` | Test directory location. Default: `string.Empty`. | | `CurrentTestOriginalTestDirectory` | `string { get; set; }` | Original test directory location. Default: `string.Empty`. | | `ROI` | `bool { get; set; }` | Indicates ROI (Region of Interest) mode. Default: `false`. | | `Recovery` | `bool { get; set; }` | Indicates Recovery mode. Default: `false`. | | `FoldersCopied` | `bool { get; set; }` | Prevents unnecessary re-copying of folders (DASConfigs, SETUP, etc.) when running from Download tile. | | `ErrorCallback` | `ErrorCallback { get; set; }` | Callback for error handling. | | `Reset` | `void Reset()` | Resets all parameters to default values. Does NOT reset `FoldersCopied`, `ProceedWhenDone`, or `RequireAllDASFinish`. | | `ToString` | `string ToString()` | Returns empty string (implementation appears incomplete). | ### DownloadStatusInformation Class **Implements:** `IStatusInfo` | Member | Signature | Description | |--------|-----------|-------------| | `StatusValues` | `enum` | Status values for consumer notification: `Preparing`, `Downloading`, `CaptureAttributes`, `Failed`, `ROIFailed`, `Completed`, `Cancelling`, `Cancelled`, `CancelledPartial`, `DownloadDirectory`, `MissingHardware`, `NoDataToDownload`, `NotAllChannelsDownloaded`, `ExistingFiles`, `CleaningUp`, `QueryEventData`. | | `CancelEvent` | `ManualResetEvent` | Signals that cancel was requested. Initialized to `false` (non-signaled). | | `DoneEvent` | `ManualResetEvent` | Signals when download operation is finished. Initialized to `false`. | | `CompleteAction` | `ActionCompleteDelegate { get; set; }` | Action invoked on completion. | | `ProgressAction` | `SetProgressValueDelegate { get; set; }` | Action invoked for progress notifications. | | `StatusAction` | `StatusIntDelegate { get; set; }` | Action invoked for status notifications. | | `StatusExAction` | `StatusExIntDelegate { get; set; }` | Action invoked for extended status notifications. | | `AllDASFinished` | `bool { get; set; }` | Indicates whether all DAS units completed download. Default: `false`. | | `Reset` | `void Reset()` | Resets status fields to defaults and nulls all delegate actions. | | `Download` | `void Download()` | Starts asynchronous download operation; returns immediately. Spawns internal task via `Task.Run()`. | | `Cancel` | `async Task Cancel()` | Requests cancellation and waits for acknowledgment. Sets `CancelEvent`, invokes `Cancelling` status, waits 100ms, then waits on `DoneEvent`, and invokes `Cancelled` status. | | `DirectoryCopy` | `bool DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs, DownloadParameters param, ref bool copied, bool uploadingData)` | Copies directory contents