5.2 KiB
5.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:48:11.814347+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 1820aad4390a7494 |
TSRAIRGo
Documentation: TSRAIRGo Event Definitions
1. Purpose
This module defines a set of Prism-based pub/sub events used for inter-module communication within the TSRAIRGo application domain. These events facilitate decoupled navigation, system state signaling (e.g., arm/disarm), and status updates across loosely coupled UI and service components. The events follow the CompositePresentationEvent<T> pattern from the Prism Library, enabling thread-safe subscription and publication across UI and background threads.
2. Public Interface
| Type | Signature | Behavior |
|---|---|---|
NavigateToDashboardEvent |
public class NavigateToDashboardEvent : CompositePresentationEvent<NavigateToDashboardArg> |
Event published to request navigation to the Dashboard view. Payload type NavigateToDashboardArg is currently empty. |
NavigateFromTSRAIRGoToDataPROEvent |
public class NavigateFromTSRAIRGoToDataPROEvent : CompositePresentationEvent<NavigateFromTSRAIRGoToDataPROArg> |
Event published to request navigation from the TSRAIRGo module to the DataPRO module. Payload type NavigateFromTSRAIRGoToDataPROArg is currently empty. |
GlobalStatusEvent |
public class GlobalStatusEvent : CompositePresentationEvent<GlobalStatusArg> |
Event published to broadcast a global status message (e.g., system health, progress, or error state). Payload type GlobalStatusArg contains a Message string property. |
TriggerEvent |
public class TriggerEvent : CompositePresentationEvent<TriggerArg> |
Event published to signal a generic trigger action. Payload type TriggerArg is currently empty. |
ArmEvent |
public class ArmEvent : CompositePresentationEvent<ArmArg> |
Event published to arm or disarm a system component (e.g., data acquisition, safety interlocks). Payload type ArmArg contains a single bool Arm property indicating the desired state (true = arm, false = disarm). |
3. Invariants
- All event types inherit from
CompositePresentationEvent<T>, meaning they support cross-thread publication and subscription (thread-safe for UI and background threads). - Payload argument classes (
*Arg) must be instantiated before publishing; null payloads are not explicitly guarded against in this module, so subscribers must handle null or validate payload contents. - For
GlobalStatusArg, theMessageproperty is nullable (string); no validation or formatting guarantees are enforced by this module. - For
ArmArg, theArmproperty is abool; no semantic validation (e.g., range checks) is performed—consumers must interprettrue/falseconsistently. - No ordering guarantees are provided for event subscribers; multiple subscribers may receive events in arbitrary order.
4. Dependencies
- Dependencies (imports):
Microsoft.Practices.Prism.Events(Prism Library v6 or earlier; note use ofMicrosoft.Practices.Prismnamespace, indicating legacy Prism version)System,System.Collections.Generic,System.Linq,System.Text,System.Threading.Tasks,System.Windows(only inTrigger.cs, likely unused—possibly leftover from template or tooling)
- Namespace usage:
- Events reside in
DTS.Common.Events(forNavigateToDashboardEvent,NavigateFromTSRAIRGoToDataPROEvent) andDTS.Common.Events.TSRAIRGo(forGlobalStatusEvent,TriggerEvent,ArmEvent).
- Events reside in
- Depended upon by:
- Unknown from source alone—consumers would subscribe to these events via the Prism
EventAggregator. Likely used by UI modules (e.g., view models, shells) and background services in the TSRAIRGo and DataPRO subsystems.
- Unknown from source alone—consumers would subscribe to these events via the Prism
5. Gotchas
- Empty payload types:
NavigateToDashboardArg,NavigateFromTSRAIRGoToDataPROArg, andTriggerArgcontain no properties. If future requirements demand passing data (e.g., destination ID, trigger parameters), modifying these types may break backward compatibility if consumers rely on default instantiation. - Namespace inconsistency:
NavigateToDashboardEventandNavigateFromTSRAIRGoToDataPROEventare inDTS.Common.Events, while others are inDTS.Common.Events.TSRAIRGo. This suggests possible refactoring in progress or legacy grouping; developers should verify intended scoping. - Unused
System.Windowsreference:Trigger.csimportsSystem.Windowsbut does not use it—may indicate dead code or accidental inclusion. - No documentation on event semantics: The source provides no guidance on when each event should be published (e.g., pre- vs. post-condition), leading to potential misuse (e.g., publishing
ArmEventwithArm=falsewhen system is already disarmed). - No versioning or deprecation markers: No indication of whether these events are stable, experimental, or deprecated.
None identified from source alone beyond the above.