81 lines
7.7 KiB
Markdown
81 lines
7.7 KiB
Markdown
|
|
---
|
|||
|
|
source_files:
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportSavedChangesStatusEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/StatusAndProgressBarEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportSummaryRunTestEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportTestSetupChangedEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/AssignedChannelsChangedEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportHardwareScanRunEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportSummaryImportEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportReadFileFinishedEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportArmedRunTestEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportHardwareScanFinishedEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/EIDMappingEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportReadFileStatusEvent.cs
|
|||
|
|
- Common/DTS.CommonCore/Events/TTSImport/TTSImportReadXMLFileEvent.cs
|
|||
|
|
generated_at: "2026-04-16T02:48:30.472302+00:00"
|
|||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
|||
|
|
schema_version: 1
|
|||
|
|
sha256: "429a14fc6889c232"
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# TTS Import Events Module Documentation
|
|||
|
|
|
|||
|
|
## 1. Purpose
|
|||
|
|
This module defines a set of Prism-based events used for inter-component communication within the TTS (Time-to-Sync) import workflow. These events coordinate state transitions and data flow across UI steps (e.g., Read File, Hardware Scan, Summary) and background operations (e.g., file parsing, hardware pinging), enabling loose coupling between view models and services in the application’s import pipeline. The events are published and subscribed to using the `CompositePresentationEvent<T>` base class from Prism, supporting cross-thread delivery and subscription lifetime management.
|
|||
|
|
|
|||
|
|
## 2. Public Interface
|
|||
|
|
|
|||
|
|
### Event Classes
|
|||
|
|
All events inherit from `CompositePresentationEvent<T>` and are defined in the `DTS.Common.Events` or `DTS.Common.Events.TTSImport` namespaces.
|
|||
|
|
|
|||
|
|
| Event Name | Payload Type | Behavior |
|
|||
|
|
|------------|--------------|----------|
|
|||
|
|
| `TTSImportSavedChangesStatusEvent` | `bool` | Indicates whether changes have been saved (`true`) or not (`false`). |
|
|||
|
|
| `StatusAndProgressBarEvent` | `StatusAndProgressBarEventArgs` | Updates status text and/or progress bar UI elements. *(Note: `StatusAndProgressBarEventArgs` is defined in `DTS.Common.Classes` but not included in source; behavior inferred from remarks.)* |
|
|||
|
|
| `TTSImportSummaryRunTestEvent` | `ITTSSetup` | Triggered by the Summary step to instruct the page to execute the test. |
|
|||
|
|
| `TTSImportTestSetupChangedEvent` | `ITTSSetup` | Published whenever the current `ITTSSetup` instance is modified. |
|
|||
|
|
| `AssignedChannelsChangedEvent` | `ITTSSetup` | Published whenever the set of channels assigned to the test setup changes. |
|
|||
|
|
| `TTSImportHardwareScanRunEvent` | `ITTSSetup` | Triggered by the Hardware Scan step to initiate hardware pinging. |
|
|||
|
|
| `TTSImportSummaryImportEvent` | `ITTSSetup` | Published by the Summary step when the Import button is clicked. |
|
|||
|
|
| `TTSImportReadFileFinishedEvent` | `ITTSSetup` | Published by the Read File step upon completion of file reading. |
|
|||
|
|
| `TTSImportHardwareScanFinishedEvent` | `List<IDASHardware>` | Published by the page to notify the Hardware Scan view model to refresh the list of DAS (Data Acquisition System) hardware. |
|
|||
|
|
| `EIDMappingEvent` | `IDictionary<string, string>` | Published when a mapping from sensor IDs to hardware channel IDs is determined. Keys = sensor IDs, values = hardware channel IDs. |
|
|||
|
|
| `TTSImportReadFileStatusEvent` | `ReadFileStatusArg` | Reports success/failure of file read: `Status` indicates outcome; `TTSSetup` contains parsed setup if successful; `ErrorMessage` contains failure reason if `Status` is `false`. |
|
|||
|
|
| `TTSImportReadXMLFileRequestEvent` | `TTSImportReadXMLFileRequestArg` | Requests XML file parsing: `FilePath` and `TestSetup` (preliminary) are provided. |
|
|||
|
|
| `TTSImportReadXMLFileResponseEvent` | `TTSImportReadXMLFileResponseEventArg` | Response to XML read request: includes updated `ITestSetup`, `TTSSetup`, `Errors[]`, and `LevelTriggers[]`. |
|
|||
|
|
|
|||
|
|
### Argument Classes
|
|||
|
|
| Class | Fields | Purpose |
|
|||
|
|
|-------|--------|---------|
|
|||
|
|
| `ReadFileStatusArg` | `bool Status`, `ITTSSetup TTSSetup`, `string ErrorMessage` | Encapsulates result of file read operation. |
|
|||
|
|
| `TTSImportReadXMLFileRequestArg` | `string FilePath`, `ITTSSetup TestSetup` | Request payload for XML file read. |
|
|||
|
|
| `TTSImportReadXMLLevelTrigger` | `double Threshold`, `string SensorSerialNumber` | Represents a level trigger configuration parsed from XML. |
|
|||
|
|
| `TTSImportReadXMLFileResponseEventArg` | `ITestSetup TestSetup`, `string[] Errors`, `ITTSSetup TTSSetup`, `TTSImportReadXMLLevelTrigger[] LevelTriggers` | Response payload after XML parsing. |
|
|||
|
|
|
|||
|
|
## 3. Invariants
|
|||
|
|
- All events are published using Prism’s event aggregation mechanism (`CompositePresentationEvent<T>`), implying they support thread marshaling and subscription lifetime management via `EventSubscription` tokens.
|
|||
|
|
- Payload types (`ITTSSetup`, `ITestSetup`, `IDASHardware`) are interfaces defined in external modules (`DTS.Common.Interface.*`).
|
|||
|
|
- `ReadFileStatusArg.Status == true` implies `TTSSetup != null` and `ErrorMessage == null` (or empty); `Status == false` implies `ErrorMessage != null`. *(Inferred from remarks; no explicit validation in source.)*
|
|||
|
|
- `TTSImportReadXMLFileRequestArg` and `TTSImportReadXMLFileResponseEventArg` are immutable (all properties have `private set` or are `readonly`-equivalent via constructor initialization).
|
|||
|
|
- `EIDMappingEvent` payload is a mapping from sensor ID → hardware channel ID (both `string`). Order is not guaranteed (uses `IDictionary`).
|
|||
|
|
|
|||
|
|
## 4. Dependencies
|
|||
|
|
### Dependencies *of* this module:
|
|||
|
|
- `Microsoft.Practices.Prism.Events` (Prism library for event aggregation)
|
|||
|
|
- `DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile` (provides `ITTSSetup`, `ITTSSetup` interfaces)
|
|||
|
|
- `DTS.Common.Interface.TestSetups.TestSetupsList` (provides `ITestSetup` interface)
|
|||
|
|
- `DTS.Common.Interface.DataRecorders` (provides `IDASHardware` interface)
|
|||
|
|
- `DTS.Common.Classes` (provides `StatusAndProgressBarEventArgs` for `StatusAndProgressBarEvent`)
|
|||
|
|
|
|||
|
|
### Dependencies *on* this module:
|
|||
|
|
- View models and services involved in the TTS import workflow (e.g., `ReadFileViewModel`, `HardwareScanViewModel`, `SummaryViewModel`) are expected to subscribe to these events.
|
|||
|
|
- No other modules *define* these events; this module is the sole source.
|
|||
|
|
|
|||
|
|
## 5. Gotchas
|
|||
|
|
- **Namespace inconsistency**: Most events reside in `DTS.Common.Events`, but `TTSImportTestSetupChangedEvent` and `AssignedChannelsChangedEvent` are in `DTS.Common.Events.TTSImport`. This may cause subscription failures if subscribers use incorrect namespace resolution.
|
|||
|
|
- **Ambiguous `StatusAndProgressBarEventArgs`**: The type `StatusAndProgressBarEventArgs` is referenced but not defined in the provided source; its structure and behavior cannot be determined.
|
|||
|
|
- **Redundant naming**: `TTSImportReadXMLFileRequestEvent` vs. `TTSImportReadXMLFileEvent` (not present) — the naming pattern (`*RequestEvent`/`*ResponseEvent`) is inconsistent with other events (e.g., `TTSImportReadFileStatusEvent` instead of `TTSImportReadFileRequestEvent`).
|
|||
|
|
- **No cancellation support**: Events like `TTSImportHardwareScanRunEvent` lack a cancellation token or request ID, making it difficult to handle overlapping or aborted operations.
|
|||
|
|
- **`ReadFileStatusArg` error handling**: `ErrorMessage` is only populated on failure, but its type (`string`) allows empty strings — consumers must check `Status` first to avoid misinterpreting empty messages.
|
|||
|
|
- **`ITTSSetup` vs `ITestSetup`**: Both interfaces appear in responses (e.g., `TTSImportReadXMLFileResponseEventArg`), but their relationship (inheritance, composition) is not specified in the source.
|