init
This commit is contained in:
60
docs/ai/DataPRO/IService/StateMachine/States.md
Normal file
60
docs/ai/DataPRO/IService/StateMachine/States.md
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/IService/StateMachine/States/Arm.cs
|
||||
- DataPRO/IService/StateMachine/States/Arming.cs
|
||||
- DataPRO/IService/StateMachine/States/Realtime.cs
|
||||
- DataPRO/IService/StateMachine/States/Download.cs
|
||||
- DataPRO/IService/StateMachine/States/HardwareDiscovery.cs
|
||||
- DataPRO/IService/StateMachine/States/Prepare.cs
|
||||
- DataPRO/IService/StateMachine/States/ConfigureStart.cs
|
||||
- DataPRO/IService/StateMachine/States/RealtimeStart.cs
|
||||
- DataPRO/IService/StateMachine/States/Configure.cs
|
||||
- DataPRO/IService/StateMachine/States/Diagnose.cs
|
||||
- DataPRO/IService/StateMachine/States/DownloadStart.cs
|
||||
- DataPRO/IService/StateMachine/States/HardwareDiscoveryStart.cs
|
||||
generated_at: "2026-04-17T16:34:18.361174+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "916778b8f4ae68d3"
|
||||
---
|
||||
|
||||
# State Machine States Module Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module implements the concrete state classes for a Data Acquisition System (DAS) service state machine within the `DTS.DASLib.Service.StateMachine` namespace. It defines individual state behaviors and state transition logic for the system's operational lifecycle, including hardware discovery, configuration, diagnosis, arming, real-time operation, and data download phases. The states follow a polymorphic design pattern with two class hierarchies: simple states (`DASState`) and state selectors (`DASStateSelector`) that determine the next state transition.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Simple States (inherit from `DASState`)
|
||||
|
||||
#### `Realtime` (public)
|
||||
```csharp
|
||||
public override State State => State.Realtime;
|
||||
```
|
||||
A terminal state representing real-time data acquisition mode. No custom entry behavior is defined in this class.
|
||||
|
||||
---
|
||||
|
||||
### State Selectors (inherit from `DASStateSelector`)
|
||||
|
||||
#### `Configure` (public)
|
||||
```csharp
|
||||
public override State State => State.Configure;
|
||||
public override IDASState StateSelector();
|
||||
public bool AllowApplyConfig();
|
||||
```
|
||||
- **`StateSelector()`**: Returns `States.Instance.ConfigureStart` if `AllowApplyConfig()` returns `true`; otherwise returns `States.Instance.Configure`.
|
||||
- **`AllowApplyConfig()`**: Currently returns `true` unconditionally. Source contains TODO comments indicating future logic for channel resolution validation.
|
||||
|
||||
---
|
||||
|
||||
#### `ConfigureStart` (public)
|
||||
```csharp
|
||||
public override State State => State.ConfigureStart;
|
||||
public override IDASState StateSelector();
|
||||
public override Action OnEntry { get; }
|
||||
private void ApplyConfig();
|
||||
``
|
||||
75
docs/ai/DataPRO/IService/StateMachine/StatusAndParameters.md
Normal file
75
docs/ai/DataPRO/IService/StateMachine/StatusAndParameters.md
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/IStatusInfo.cs
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/IStatusParameters.cs
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/GlobalStatusParameters.cs
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/Status.cs
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/GlobalStatusInformation.cs
|
||||
generated_at: "2026-04-17T16:03:17.837339+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "2686f48e66f3b9e3"
|
||||
---
|
||||
|
||||
# StatusAndParameters
|
||||
|
||||
### Purpose
|
||||
This module defines the status and parameter tracking infrastructure for a state machine that manages data acquisition system operations. It provides interfaces and concrete implementations for tracking hardware discovery, configuration, realtime operation, diagnostics, and download states, including thread-safe tracking of device power states and operational modes.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**IStatusInfo** (interface)
|
||||
- `void Reset()` - Resets status information to default state.
|
||||
|
||||
**IStatusParameters** (interface)
|
||||
- `void Reset()` - Resets parameters to default state.
|
||||
|
||||
**GlobalStatusParameters** : IStatusParameters
|
||||
- `bool AllowUDPMulticast { get; set; }` - Default: `true`
|
||||
- `bool DisableAutoSense { get; set; }` - Default: `SensorConstants.DisableAutoSense`
|
||||
- `void Reset()` - Resets both properties to defaults.
|
||||
|
||||
**GlobalStatusInformation** : IStatusInfo
|
||||
- `IDASCommunication[] GetUnitsInRealtime()` - Returns array of devices currently in realtime mode.
|
||||
- `void AddUnitInRealtime(IDASCommunication device)` - Adds device to realtime list (no-op if already present).
|
||||
- `IDASCommunication[] GetUnitsInArm()` - Returns array of devices currently in arm mode.
|
||||
- `void AddUnitInArm(IDASCommunication device)` - Adds device to arm list (no-op if already present).
|
||||
- `IDASCommunication[] GetUnitsAtLowPower()` - Returns array of devices at low power.
|
||||
- `void AddUnitAtLowPower(IDASCommunication das)` - Adds to low power list; removes from high power list if present.
|
||||
- `IDASCommunication[] GetUnitsAtHighPower()` - Returns array of devices at high power.
|
||||
- `void AddUnitAtHighPower(IDASCommunication das)` - Adds to high power list; removes from low power list if present.
|
||||
- `bool ExcitationOn { get; set; }` - Default: `false`
|
||||
- `void Reset()` - Clears all lists and sets `ExcitationOn` to false.
|
||||
|
||||
**Status**
|
||||
- `HardwareDiscoveryParameters HardwareDiscoveryParams` - Field, instantiated inline.
|
||||
- `HardwareDiscoveryStatusInfo HardwareDiscoveryStatusInfo` - Field, instantiated inline.
|
||||
- `GlobalStatusInformation GlobalStatusInformation` - Field, instantiated inline.
|
||||
- `GlobalStatusParameters GlobalStatusParameters` - Field, instantiated inline.
|
||||
- `ConfigureStatusInformation ConfigureStatus` - Field, instantiated inline.
|
||||
- `ConfigureStatusParameters ConfigureParameters` - Field, instantiated inline.
|
||||
- `RealtimeStatusInformation RealtimeStatus` - Field, instantiated inline.
|
||||
- `RealtimeParameters RealtimeParams` - Field, instantiated inline.
|
||||
- `DiagnoseParameters DiagnoseParams` - Field, instantiated inline.
|
||||
- `DownloadParameters DownloadParams` - Field, instantiated inline.
|
||||
- `DownloadStatusInformation DownloadStatusInfo` - Field, instantiated inline.
|
||||
- `void Reset()` - Calls Reset() on most (but not all) child objects.
|
||||
|
||||
### Invariants
|
||||
- `GlobalStatusInformation` uses a single static lock object (`MyLock`) for thread-safety on all list operations.
|
||||
- A device cannot be in both low power and high power lists simultaneously; adding to one removes from the other.
|
||||
- A device can exist in multiple operational mode lists (e.g., both realtime and arm lists) - these are independent.
|
||||
- `Status.Reset()` does NOT call Reset on `DownloadParams` or `DownloadStatusInfo`.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on**:
|
||||
- `DTS.Common.Enums.Sensors` (for `SensorConstants.DisableAutoSense`)
|
||||
- `DTS.Common.Interface.DASFactory` (for `IDASCommunication`)
|
||||
- **Depended on by**: Unclear from source alone - likely the main state machine orchestration layer.
|
||||
|
||||
### Gotchas
|
||||
- **Incomplete Reset**: `Status.Reset()` does not reset `DownloadParams` or `DownloadStatusInfo`, which could lead to stale state if not handled elsewhere.
|
||||
- **Missing type definitions**: Several types referenced in `Status` class (`HardwareDiscoveryParameters`, `HardwareDiscoveryStatusInfo`, `ConfigureStatusInformation`, `ConfigureStatusParameters`, `RealtimeStatusInformation`, `RealtimeParameters`, `DiagnoseParameters`, `DownloadParameters`, `DownloadStatusInformation`) are not defined in the provided source files.
|
||||
- **Field vs Property**: `Status` class exposes fields rather than properties for status/parameter objects, which may limit binding or serialization scenarios.
|
||||
|
||||
---
|
||||
@@ -0,0 +1,212 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/Configure/GroupChannelWithMeta.cs
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/Configure/ConfigureStatusParameters.cs
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/Configure/ConfigureStatusInformation.cs
|
||||
generated_at: "2026-04-17T15:41:27.157987+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "0a25ce0aa4784f4b"
|
||||
---
|
||||
|
||||
# Documentation: Configure State Machine Module
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides the configuration state machine for Data Acquisition System (DAS) units, managing the complete lifecycle of hardware configuration including channel resolution, sensor-to-hardware mapping, configuration application, and diagnostic preparation. It serves as the orchestration layer between high-level test setup definitions and low-level hardware communication, supporting both automatic channel resolution (via EID lookup) and manual channel assignment with validation.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `ConfigureStatusParameters` (Class)
|
||||
**Namespace:** `DTS.DASLib.Service.StateMachine`
|
||||
**Implements:** `IStatusParameters`
|
||||
|
||||
Configuration options container for the configure state machine.
|
||||
|
||||
#### Properties
|
||||
|
||||
| Property | Type | Default | Description |
|
||||
|----------|------|---------|-------------|
|
||||
| `RequireIdFoundForSensorsWithIds` | `bool` | `true` | Requires that sensors with IDs have their EID found during resolution |
|
||||
| `AllowMissingSensors` | `bool` | `false` | Permits channels without assigned sensors |
|
||||
| `AllowSensorsOutOfPosition` | `bool` | `true` | Allows sensors on different channels than originally specified |
|
||||
| `AllowSensorIdToBlankChannel` | `bool` | `false` | Permits assigning sensors with EIDs to unassigned hardware channels |
|
||||
| `TestSetupConfiguration` | `ITestSetup` | `null` | The test setup containing channel/group definitions |
|
||||
| `TurnOffExcitation` | `bool` | `false` | Triggers excitation shutdown process |
|
||||
| `UnitsToConfigure` | `IDASCommunication[]` | empty array | Target DAS units for configuration |
|
||||
| `DoStrictCheck` | `bool` | `true` | Enables strict validation during configuration |
|
||||
| `EventConfig` | `bool` | `true` | Writes to event/diagnostic file stores (SLICE legacy feature) |
|
||||
| `DummyConfig` | `bool` | `false` | Configures units without actual data collection |
|
||||
| `MaxAAF` | `double[]` | empty array | Maximum Anti-Alias Filter values for SLICE/TDAS |
|
||||
| `ConfigureDigitalOutputs` | `bool` | `true` | Whether to apply digital output configuration |
|
||||
| `TurnOffAAFRealtime` | `bool` | `true` | Disables AAF for realtime mode (performance optimization) |
|
||||
| `ResetHardwareEventLines` | `bool` | `false` | Resets hardware event lines before configuration |
|
||||
| `PrepareForDiagnostics` | `bool` | `false` | Enables excitation/switch preparation for diagnostics |
|
||||
| `SkipTurnOnPower` | `bool` | `false` | Skips power-on step to maintain low-power state |
|
||||
| `SetConfiguration` | `bool` | `true` | Whether to apply configuration at all |
|
||||
| `DiscardDiagnostics` | `bool` | `true` | Discards diagnostics during configuration |
|
||||
| `DSPFilterType` | `DSPFilterType` | from collection | DSP filter configuration |
|
||||
| `SampleRateLookup` | `IReadOnlyDictionary<string, double>` | empty | Serial number to sample rate mapping |
|
||||
| `AAFRateLookup` | `IReadOnlyDictionary<string, float>` | empty | Serial number to AAF rate mapping |
|
||||
|
||||
#### Delegates
|
||||
|
||||
| Delegate | Signature | Description |
|
||||
|----------|-----------|-------------|
|
||||
| `GetSensorDelegate` | `ISensorData(IGroupChannel)` | Retrieves sensor data for a group channel |
|
||||
| `GetSensorCalibrationDelegate` | `ISensorCalibration(ISensorData, ExcitationVoltageOption)` | Retrieves calibration for sensor/excitation combo |
|
||||
| `GetDatabaseIdDelegate` | `int(IDASCommunication)` | Retrieves database ID for a DAS unit |
|
||||
| `SetSensorCalibrationDelegate` | `void(ISensorData, ISensorCalibration)` | Sets calibration on a sensor |
|
||||
|
||||
#### Methods
|
||||
|
||||
- **`ConfigureStatusParameters()`** - Constructor; initializes `DSPFilterType` from `DSPFilterCollection`
|
||||
- **`void Reset()`** - Resets all properties to default values
|
||||
- **`string ToString()`** - Returns formatted string of all parameter values
|
||||
|
||||
---
|
||||
|
||||
### `ConfigureStatusInformation` (Class)
|
||||
**Namespace:** `DTS.DASLib.Service.StateMachine`
|
||||
**Implements:** `IStatusInfo`
|
||||
|
||||
Runtime status tracking and orchestration for the configuration process.
|
||||
|
||||
#### Nested Types
|
||||
|
||||
**`StatusValues` (Enum)**
|
||||
```
|
||||
ApplyingConfiguration, AutoResolvingChannels, ManuallyResolvedChannels,
|
||||
Completed, Cancelling, Cancelled, ChannelOutOfPosition, NoChannelsAssigned,
|
||||
AllChannelsResolved, EIDNotFound, ApplyConfigFailed, AppliedConfiguration,
|
||||
PrepareForDiagnostics, PrepareForDiagnosticsFailed, PrepareForDiagnosticsSuccess,
|
||||
LowPower, LowPowerSuccess, LowPowerFailure
|
||||
```
|
||||
|
||||
**`InvalidAssignmentException` (Exception)**
|
||||
- `Reasons` enum: `BlankChannel, NoSensor, ChannelDisabled, SensorNotFound, IncompatibleHardware, ChannelAlreadyAssigned, EID_Locked, EIDRequiredAndMissing, ChannelNotAssigned`
|
||||
- Properties: `IGroupChannel GroupChannel`, `Reasons Reason`
|
||||
|
||||
**`SensorCompatiblilityResponse` (Enum)** - `internal`
|
||||
```
|
||||
Compatible, DigitalInputNotSupportedOnHWChannel, DigitalInputModeNotSupportedOnHWChannel,
|
||||
BridgeModeNotSupportedOnHWChannel, SquibFireModeNotSupportedOnHWChannel,
|
||||
NoSupportedExcitationOnHWChannel
|
||||
```
|
||||
|
||||
#### Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `NoChannelsAssigned` | `bool` | `true` when no channels are assigned |
|
||||
| `AllChannelsResolved` | `bool` | `true` when all channels are resolved |
|
||||
| `ChannelsOutOfPosition` | `bool` | `true` when channels are on different hardware than specified |
|
||||
| `HaveAppliedConfigAllUnits` | `bool` | `true` when all target units are configured |
|
||||
| `UnitsConfigured` | `IDASCommunication[]` | Successfully configured units |
|
||||
| `CancelEvent` | `ManualResetEvent` | Signals cancel request |
|
||||
| `DoneEvent` | `ManualResetEvent` | Signals work completion |
|
||||
| `CompleteAction` | `ActionCompleteDelegate` | Completion callback |
|
||||
| `ProgressAction` | `SetProgressValueDelegate` | Progress notification callback |
|
||||
| `StatusAction` | `StatusIntDelegate` | Status notification callback |
|
||||
| `StatusExAction` | `StatusExIntDelegate` | Extended status notification callback |
|
||||
|
||||
#### Methods
|
||||
|
||||
- **`Task Cancel()`** - Async; sets cancel event, waits for task completion, reports `Cancelling` then `Cancelled` status
|
||||
- **`void ApplyConfig()`** - Starts configuration process; checks `TurnOffExcitation` flag first; runs configuration in background task
|
||||
- **`void TurnOffExcitation()`** - Initiates low-power mode on all DAS units; runs in background task
|
||||
- **`void ManuallyResolveChannel(IGroupChannel channel, IDASChannel hardwareChannel)`** - Manually assigns a sensor channel to hardware; validates compatibility and throws `InvalidAssignmentException` on failure
|
||||
- **`void ManuallyUnresolveChannel(IGroupChannel channel)`** - Removes manual channel assignment; throws if channel not assigned or EID-locked
|
||||
- **`void Reset()`** - Resets all status properties to defaults
|
||||
|
||||
---
|
||||
|
||||
### `GroupChannelWithMeta` (Class)
|
||||
**Namespace:** `DTS.DASLib.Service.StateMachine.StatusAndParameters.Configure`
|
||||
**Access:** `internal`
|
||||
|
||||
Helper class for tracking channel resolution state.
|
||||
|
||||
#### Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `ChannelConflict` | `bool` | Channel has conflicting assignment |
|
||||
| `ConflictingChannel` | `IGroupChannel` | Reference to conflicting channel |
|
||||
| `Channel` | `IGroupChannel` | The group channel being tracked |
|
||||
| `Group` | `IGroup` | Parent group reference |
|
||||
| `MissingID` | `bool` | EID not found during resolution |
|
||||
| `MissingSensor` | `bool` | No sensor assigned to channel |
|
||||
| `EIDOutOfPlace` | `bool` | EID found on different hardware than expected |
|
||||
| `HWNotFound` | `bool` | Hardware channel not found |
|
||||
| `HWChannelIncompatible` | `bool` | Hardware incompatible with sensor |
|
||||
| `DASChannel` | `IDASChannel` | Resolved hardware channel |
|
||||
| `AssignedByEID` | `bool` | Channel was auto-assigned via EID lookup |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
1. **Mutual Exclusion of Channel State**: A channel exists in either `_resolvedChannels` or `_unresolvedChannels`, never both simultaneously. Methods `AddResolvedChannel` and `AddUnresolvedChannel` both remove from the opposite list before adding.
|
||||
|
||||
2. **Thread-Safe Unit Tracking**: The `UnitsConfigured` array is modified exclusively through `AddConfiguredDevice`, which uses a static lock object (`MyLock`) to prevent race conditions.
|
||||
|
||||
3. **EID Lock Immutability**: Channels assigned via EID (`AssignedByEID = true`) cannot be manually unresolved or reassigned to different hardware.
|
||||
|
||||
4. **Task Synchronization**: `CancelEvent` and `DoneEvent` coordinate task lifecycle; `DoneEvent` is reset at the start of `ApplyConfig` and set upon completion.
|
||||
|
||||
5. **Configuration Bypass**: If `SetConfiguration` is `false`, the configuration application step is skipped entirely, proceeding directly to power/diagnostic preparation.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This Module Depends On
|
||||
|
||||
| Namespace | Purpose |
|
||||
|-----------|---------|
|
||||
| `DTS.Common.Interface.Channels` | Channel interfaces (`IDASChannel`, `AnalogInputDASChannel`, `OutputSquibChannel`, `OutputTOMDigitalChannel`) |
|
||||
| `DTS.Common.Interface.DASFactory` | DAS communication and configuration interfaces (`IDASCommunication`, `IDASFactory`) |
|
||||
| `DTS.Common.Interface.DASFactory.Config` | Configuration data structures |
|
||||
| `DTS.Common.Interface.Sensors` | Sensor interfaces (`ISensorData`, `ISensorCalibration`) |
|
||||
| `DTS.Common.Interface.StatusAndProgressBar` | Status/callback delegates |
|
||||
| `DTS.Common.Interface.TestSetups.TestSetupsList` | Test setup interfaces (`ITestSetup`) |
|
||||
| `DTS.Common.Interface.Groups.GroupList` | Group/channel interfaces (`IGroup`, `IGroupChannel`) |
|
||||
| `DTS.Common.Classes.DSP` | DSP filter types and collections |
|
||||
| `DTS.Common.Enums` | `ExcitationVoltageOptions`, `DSPFilterType` |
|
||||
| `DTS.Common.Utilities.Logging` | `APILogger` for exception logging |
|
||||
| `DTS.DASLib.Service.StateMachine.StatusAndParameters.Configure` | `GroupChannelWithMeta` (same namespace) |
|
||||
|
||||
### External Service Dependencies (instantiated within)
|
||||
|
||||
| Service | Usage |
|
||||
|---------|-------|
|
||||
| `DiagnosticsService` | Prepare units for diagnostic mode |
|
||||
| `ArmingService` | Enter low-power mode |
|
||||
| `ConfigurationService` | Apply hardware configuration |
|
||||
|
||||
### Global State Dependencies
|
||||
|
||||
- **`States.Instance.Configure`** - Configuration state access
|
||||
- **`States.Instance.ConfigureStart`** - Alternate state access path
|
||||
- **`States.Instance.Configure.Status.GlobalStatusInformation`** - Global status tracking (e.g., `ExcitationOn` flag)
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Dual State Access Paths**: The code accesses `States.Instance.Configure` and `States.Instance.ConfigureStart` interchangeably. The relationship between these two paths is unclear from source alone—this may indicate a refactoring artifact or intentional state sharing.
|
||||
|
||||
2. **Hardcoded Timing Constants**: `PREPARE_SPIN_TIME` (200ms) and `EXPECTED_PREPARE_TIME` (8000ms) are hardcoded in `PrepareForDiagnostics`. These may not be appropriate for all hardware configurations.
|
||||
|
||||
3. **Cancel Latency**: The `Cancel` method includes a fixed 100ms `Thread.Sleep` to "simulate time spent waiting for cancel to be acknowledged." This may cause unexpected delays in time-sensitive scenarios.
|
||||
|
||||
4. **Exception Re-throw Pattern**: In `PrepareForDiagnostics`, exceptions are caught and re-thrown with `throw ex`, which destroys the original stack trace. This should be `throw` instead.
|
||||
|
||||
5. **Legacy SLICE Features**: The `EventConfig` property references a "legacy feature of sliceware" for multiple file stores. Not all units support this, but the source does not indicate which units do.
|
||||
|
||||
6. **Delegate Nullability**: Several delegate properties (`GetSensorAction`, `GetCalibrationAction`, `GetDatabaseIdAction`, `SetSensorCalibrationAction`) are not validated for null before invocation. Callers must ensure these are set.
|
||||
|
||||
7. **Array Initialization Pattern**: Properties like `MaxAAF`, `UnitsToConfigure`, `SampleRateLookup`, and `AAFRateLookup` are initialized to empty collections rather than null, but the source does not document whether consumers should replace these or modify them in-place.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/Diagnose/DiagnoseParameters.cs
|
||||
generated_at: "2026-04-17T16:27:45.386214+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "05feb9b6c5cdbded"
|
||||
---
|
||||
|
||||
# Diagnose
|
||||
|
||||
### Purpose
|
||||
This module defines `DiagnoseParameters`, a configuration and state-tracking class used by a state machine during diagnostic operations. It controls diagnostic flow behavior (whether to proceed to realtime mode after completion) and tracks whether all units have passed diagnostic checks.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**
|
||||
@@ -0,0 +1,64 @@
|
||||
---
|
||||
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
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/HardwareDiscovery/HardwareDiscoveryParameters.cs
|
||||
generated_at: "2026-04-17T15:41:51.740392+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "6758fa7750cb111c"
|
||||
---
|
||||
|
||||
# HardwareDiscoveryParameters Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`HardwareDiscoveryParameters` is a configuration data class used by a state machine to control hardware discovery behavior for DAS (Data Acquisition System) devices. It encapsulates all parameters needed for discovering, connecting to, and validating hardware components—including IP address ranges to scan, known device types (TDAS vs SLICE), connection timeouts, hardware validation checks, and callback delegates for querying device metadata. This class serves as the input specification for the hardware discovery state within a larger state machine workflow.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Properties
|
||||
|
||||
| Property | Type | Default | Description |
|
||||
|----------|------|---------|-------------|
|
||||
| `ReadIds` | `bool` | `false` | Controls whether device IDs should be read during discovery. |
|
||||
| `Addresses` | `string[]` | `new string[0]` | Explicit IP addresses to connect to. If not specified in known TDAS or SLICE lists, connection will be attempted as both device types. |
|
||||
| `AddressRanges` | `Tuple<string, string>[]` | `new Tuple<string, string>[0]` | IP address ranges to ping. Each tuple defines a range from the first address up to the 4th byte of the second address. Responding IPs are added to connection candidates. |
|
||||
| `KnownTDASIPAddresses` | `string[]` | `new string[0]` |
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/Realtime/RealtimeParameters.cs
|
||||
- DataPRO/IService/StateMachine/StatusAndParameters/Realtime/RealtimeStatusInformation.cs
|
||||
generated_at: "2026-04-17T15:41:52.943128+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "6c622a99f8df2e9c"
|
||||
---
|
||||
|
||||
# Documentation: Realtime State Machine Components
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides the parameter configuration and status management components for a realtime data acquisition state machine. `RealtimeParameters` serves as a data transfer object holding all configuration needed to initiate realtime polling operations across DAS (Data Acquisition System) hardware units. `RealtimeStatusInformation` manages the runtime state of realtime operations, including thread synchronization primitives, callback handling, and the orchestration of starting/stopping realtime data collection via the `RealtimeService`.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### RealtimeParameters (implements `IStatusParameters`)
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `UnitsToStartRealtime` | `List<IDASCommunication>` | Collection of DAS communication units to start realtime mode on. |
|
||||
| `RealtimeDelayBetweenPollsInMilliSecond` | `int` | Delay interval between polling cycles in milliseconds. |
|
||||
| `AllowMultipleSampleRealtime` | `bool` | Flag indicating whether multiple sample realtime mode is permitted. |
|
||||
| `UseSingleSampleMode` | `bool` | Flag to enable single sample mode (uses `StartActivePolling` instead of `Start`). |
|
||||
| `ModuleIndices` | `List<int>` | List of module array indices for realtime operations. |
|
||||
| `IdasToActiveChannels` | `Dictionary<IDASCommunication, byte[]>` | Maps each DAS unit to its active channel configuration. |
|
||||
| `RealtimeSampleRate` | `double` | Sample rate for realtime acquisition. |
|
||||
| `RealtimeSampleRateAAFilterRatio` | `byte` | Ratio used to calculate Anti-Alias Filter frequency. |
|
||||
| `SliceTurnOffAAFRealtime` | `bool` | Flag to disable AAF for Slice hardware during realtime. |
|
||||
| `Reset()` | `
|
||||
Reference in New Issue
Block a user