Files

54 lines
5.2 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Events/TSRAIRGo/NavigateToDashboard.cs
- Common/DTS.CommonCore/Events/TSRAIRGo/NavigateFromTSRAIRGoToDataPRO.cs
- Common/DTS.CommonCore/Events/TSRAIRGo/GlobalStatus.cs
- Common/DTS.CommonCore/Events/TSRAIRGo/Trigger.cs
- Common/DTS.CommonCore/Events/TSRAIRGo/Arm.cs
generated_at: "2026-04-16T02:48:11.814347+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "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`, the `Message` property is nullable (`string`); no validation or formatting guarantees are enforced by this module.
- For `ArmArg`, the `Arm` property is a `bool`; no semantic validation (e.g., range checks) is performed—consumers must interpret `true`/`false` consistently.
- 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 of `Microsoft.Practices.Prism` namespace, indicating legacy Prism version)
- `System`, `System.Collections.Generic`, `System.Linq`, `System.Text`, `System.Threading.Tasks`, `System.Windows` (only in `Trigger.cs`, likely unused—possibly leftover from template or tooling)
- **Namespace usage:**
- Events reside in `DTS.Common.Events` (for `NavigateToDashboardEvent`, `NavigateFromTSRAIRGoToDataPROEvent`) and `DTS.Common.Events.TSRAIRGo` (for `GlobalStatusEvent`, `TriggerEvent`, `ArmEvent`).
- **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.
### 5. Gotchas
- **Empty payload types**: `NavigateToDashboardArg`, `NavigateFromTSRAIRGoToDataPROArg`, and `TriggerArg` contain 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**: `NavigateToDashboardEvent` and `NavigateFromTSRAIRGoToDataPROEvent` are in `DTS.Common.Events`, while others are in `DTS.Common.Events.TSRAIRGo`. This suggests possible refactoring in progress or legacy grouping; developers should verify intended scoping.
- **Unused `System.Windows` reference**: `Trigger.cs` imports `System.Windows` but 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 `ArmEvent` with `Arm=false` when 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.