7.7 KiB
7.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:48:30.472302+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 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 viaEventSubscriptiontokens. - Payload types (
ITTSSetup,ITestSetup,IDASHardware) are interfaces defined in external modules (DTS.Common.Interface.*). ReadFileStatusArg.Status == trueimpliesTTSSetup != nullandErrorMessage == null(or empty);Status == falseimpliesErrorMessage != null. (Inferred from remarks; no explicit validation in source.)TTSImportReadXMLFileRequestArgandTTSImportReadXMLFileResponseEventArgare immutable (all properties haveprivate setor arereadonly-equivalent via constructor initialization).EIDMappingEventpayload is a mapping from sensor ID → hardware channel ID (bothstring). Order is not guaranteed (usesIDictionary).
4. Dependencies
Dependencies of this module:
Microsoft.Practices.Prism.Events(Prism library for event aggregation)DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile(providesITTSSetup,ITTSSetupinterfaces)DTS.Common.Interface.TestSetups.TestSetupsList(providesITestSetupinterface)DTS.Common.Interface.DataRecorders(providesIDASHardwareinterface)DTS.Common.Classes(providesStatusAndProgressBarEventArgsforStatusAndProgressBarEvent)
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, butTTSImportTestSetupChangedEventandAssignedChannelsChangedEventare inDTS.Common.Events.TTSImport. This may cause subscription failures if subscribers use incorrect namespace resolution. - Ambiguous
StatusAndProgressBarEventArgs: The typeStatusAndProgressBarEventArgsis referenced but not defined in the provided source; its structure and behavior cannot be determined. - Redundant naming:
TTSImportReadXMLFileRequestEventvs.TTSImportReadXMLFileEvent(not present) — the naming pattern (*RequestEvent/*ResponseEvent) is inconsistent with other events (e.g.,TTSImportReadFileStatusEventinstead ofTTSImportReadFileRequestEvent). - No cancellation support: Events like
TTSImportHardwareScanRunEventlack a cancellation token or request ID, making it difficult to handle overlapping or aborted operations. ReadFileStatusArgerror handling:ErrorMessageis only populated on failure, but its type (string) allows empty strings — consumers must checkStatusfirst to avoid misinterpreting empty messages.ITTSSetupvsITestSetup: Both interfaces appear in responses (e.g.,TTSImportReadXMLFileResponseEventArg), but their relationship (inheritance, composition) is not specified in the source.