8.4 KiB
8.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:25:22.937764+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 6b29eb45ebade668 |
TTS Import Event Documentation
1. Purpose
This module defines a set of Prism-based events used to coordinate state and workflow across the TTS (Time-to-Sync) import process in the DTS system. These events facilitate loose coupling between UI views, view models, and business logic layers during file reading, hardware scanning, test setup configuration, and import execution. They enable asynchronous communication for steps such as file parsing, hardware channel assignment, test execution triggers, and status reporting, ensuring separation of concerns and testability.
2. Public Interface
Event Classes (all inherit from PubSubEvent<TPayload> unless otherwise noted):
| Event Name | Payload Type | Description |
|---|---|---|
TTSImportSavedChangesStatusEvent |
bool |
Indicates whether changes to the current TTS import setup have been saved (true) or not (false). |
StatusAndProgressBarEvent |
StatusAndProgressBarEventArgs |
Updates status text and/or progress bar UI elements. (Note: StatusAndProgressBarEventArgs is referenced but not defined in the provided source; its structure must be inferred from usage or defined elsewhere.) |
TTSImportSummaryRunTestEvent |
ITTSSetup |
Triggered by the Summary step to instruct the page to execute a test. |
TTSImportTestSetupChangedEvent |
ITTSSetup |
Published whenever the current TTS test setup object is modified. |
AssignedChannelsChangedEvent |
ITTSSetup |
Published when the set of hardware channels assigned to sensors changes. |
TTSImportHardwareScanRunEvent |
ITTSSetup |
Triggered by the Hardware Scan step to initiate hardware pinging. |
TTSImportSummaryImportEvent |
ITTSSetup |
Published when the user clicks the Import button in the Summary step. |
TTSImportArmedRunTestEvent |
ITTSSetup |
Triggered by the Hardware Scan step to advance the workflow to the Arm step in Run Test. |
TTSImportReadFileFinishedEvent |
ITTSSetup |
Published by the Read File step to signal completion of file reading. (Note: Inherits from CompositePresentationEvent<T> instead of PubSubEvent<T>.) |
TTSImportHardwareScanFinishedEvent |
List<IDASHardware> |
Published by the page to notify the Hardware Scan view model that hardware scanning is complete, carrying the updated list of DAS hardware. |
EIDMappingEvent |
IDictionary<string, string> |
Published when sensor ID to hardware channel ID mapping is determined. Key = sensor ID, Value = hardware channel ID. |
TTSImportReadFileStatusEvent |
ReadFileStatusArg |
Reports success/failure of file reading. Payload contains Status, TTSSetup, and ErrorMessage. |
TTSImportReadXMLFileRequestEvent |
TTSImportReadXMLFileRequestArg |
Request to read an XML file. Payload includes FilePath and TestSetup. |
TTSImportReadXMLFileResponseEvent |
TTSImportReadXMLFileResponseEventArg |
Response to an XML read request. Payload includes TestSetup, Errors, TTSSetup, and LevelTriggers. |
Supporting Argument Classes (defined in source):
| Class | Fields | Description |
|---|---|---|
ReadFileStatusArg |
bool Status, ITTSSetup TTSSetup, string ErrorMessage |
Payload for TTSImportReadFileStatusEvent. Status indicates success; ErrorMessage is only meaningful when Status == false. |
TTSImportReadXMLFileRequestArg |
string FilePath, ITTSSetup TestSetup |
Payload for TTSImportReadXMLFileRequestEvent. Used to request XML file parsing. |
TTSImportReadXMLLevelTrigger |
double Threshold, string SensorSerialNumber |
Represents a level trigger configuration parsed from XML. |
TTSImportReadXMLFileResponseEventArg |
ITestSetup TestSetup, string[] Errors, ITTSSetup TTSSetup, TTSImportReadXMLLevelTrigger[] LevelTriggers |
Payload for TTSImportReadXMLFileResponseEvent. Contains parsed data and any errors encountered. |
3. Invariants
- All events use Prism’s event aggregation pattern (
PubSubEvent<T>orCompositePresentationEvent<T>), implying publish-subscribe semantics: events are published once and may be subscribed to by multiple handlers. - Events are asynchronous and decoupled; publishers do not block waiting for subscribers.
- For
TTSImportReadFileStatusEvent, theStatusfield is the authoritative indicator of success/failure;ErrorMessageis only valid whenStatus == false. - For
TTSImportReadXMLFileResponseEventArg,Errorsmay be non-empty even ifTTSSetupis populated (partial success). EIDMappingEventpayload is a mapping from sensor ID to hardware channel ID, not the reverse.TTSImportReadFileFinishedEventusesCompositePresentationEvent<T>instead ofPubSubEvent<T>, which may imply different threading or subscription behavior (e.g., thread-safe delivery, multiple subscriptions handled differently). This distinction must be respected in subscribers.
4. Dependencies
Dependencies of this module:
- Prism.Events: Core dependency for
PubSubEvent<T>andCompositePresentationEvent<T>. - DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile: Provides
ITTSSetup,ITestSetup, and related interfaces. - DTS.Common.Interface.DataRecorders: Provides
IDASHardwareandIDASinterfaces. - System.Collections.Generic: For
IDictionary<string, string>andList<T>.
Dependencies on this module:
- UI layers (views/view models) involved in TTS import workflow (e.g., Read File, Hardware Scan, Summary steps).
- Business logic components that process XML configuration files or manage hardware scanning.
- Any module that needs to react to test setup changes, file read results, or import progress.
5. Gotchas
- Inconsistent namespace usage:
TTSImportTestSetupChangedEventandAssignedChannelsChangedEventare inDTS.Common.Events.TTSImportnamespace, while most others are inDTS.Common.Events. This may cause confusion during event subscription (e.g.,eventAggregator.GetEvent<TTSImportTestSetupChangedEvent>().Subscribe(...)vs.GetEvent<TTSImportSavedChangesStatusEvent>()).
- Missing definition for
StatusAndProgressBarEventArgs:- Referenced in
StatusAndProgressBarEventbut not defined in the provided source. Its structure (e.g., properties likeStatusText,ProgressValue,IsIndeterminate) must be found elsewhere.
- Referenced in
TTSImportReadFileFinishedEventusesCompositePresentationEvent<T>:- This may have different semantics than
PubSubEvent<T>(e.g., thread affinity, subscription lifetime). Subscribers must be aware of this distinction.
- This may have different semantics than
- Ambiguity in
ITTSSetupvsITestSetup:TTSImportReadXMLFileResponseEventArgcontains bothITestSetupandITTSSetup. It is unclear whetherITTSSetupis a specialized subtype ofITestSetupor a separate interface. Misunderstanding this could lead to incorrect casting or null dereferences.
- No validation rules documented:
- While
ReadFileStatusArgincludesErrorMessage, the source does not specify what constitutes a validITTSSetupor what error conditions are expected. Validation logic (e.g., required fields in XML) is not visible here.
- While
- No ordering guarantees:
- Events are published asynchronously. Consumers must not assume a specific order of delivery (e.g.,
TTSImportTestSetupChangedEventmay arrive before or afterAssignedChannelsChangedEventafter a setup change).
- Events are published asynchronously. Consumers must not assume a specific order of delivery (e.g.,
None identified beyond the above.