Files
2026-04-17 14:55:32 -04:00

104 lines
11 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
source_files:
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/ChannelSelectionCountNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/ChannelsModificationNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/ChannelSelectionChangeNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphChannelReadCalcProgressChangedEvent.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphChannelsReadCompletedNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/DataFileSelectedEvent.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/TestLoadedCountNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphLoadedCountNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/TestSummaryCountNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphClearNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphSelectedEventCountNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphSelectedChannelCountNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphSelectedChannelsNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/GraphSelectedEventsNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/ChannelsModificationLineFitNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/TestSummaryChangeNotification.cs
- Common/DTS.Common/Events/DTS.Viewer/ViewerTestSummary/DataFolderChangedEvent.cs
generated_at: "2026-04-16T03:26:54.981028+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "efa128df50cbdb70"
---
# ViewerTestSummary Events Module Documentation
## 1. Purpose
This module defines a suite of Prism `PubSubEvent<T>`-based notification events used within the DTS Viewer (specifically for the *ViewerTestSummary* component) to decouple state changes in test channel, event, graph, and summary selection from UI components and view models. These events enable loose coupling between data-loading, selection, and UI-update logic—particularly important given the modules role in supporting both standard test viewers and reuse for PSD reports (as indicated by issue #24417 comments). Events cover changes in data file/folder selection, counts of loaded/selected items, progress updates during data reading/calculation, and modifications to channel selections (including line-fit operations).
## 2. Public Interface
All types are `public` and reside in `DTS.Common.Events`. Each inherits from `PubSubEvent<T>` (Prism.Events), meaning they are intended for subscription/publishing via an `IEventAggregator`.
### Event Classes & Payload Types
| Event Class | Payload Type | Description |
|-------------|--------------|-------------|
| `ChannelSelectionCountNotification` | `int` | Notifies when the count of selected test channels changes. |
| `ChannelsModificationNotification` | `List<ITestChannel>` | Notifies when the set of selected test channels is modified (e.g., added/removed). |
| `ChannelSelectionChangeNotification` | `List<ITestChannel>` | Notifies when the selected test channel list changes (semantically similar to `ChannelsModificationNotification`, but distinct event). |
| `GraphChannelReadCalcProgressChangedEvent` | `GraphChannelReadCalcProgressChangedEventArgs` | Reports progress during graph channel read/calculation. |
| `GraphChannelsReadCompletedNotification` | `GraphChannelsReadCompletedNotificationArgs` | Signals completion of reading graph channels. |
| `DataFileSelectedEvent` | `DataFileSelectionArg` | Signals selection of a specific data file (avoids triggering `DataFolderChangedEvent` subscribers). |
| `TestLoadedCountNotification` | `TestLoadedCountNotificationArg` | Notifies when the count of loaded tests changes. |
| `GraphLoadedCountNotification` | `GraphLoadedCountNotificationArg` | Notifies when the count of loaded graphs changes. |
| `TestSummaryCountNotification` | `TestSummaryCountNotificationArg` | Notifies when the count of test summaries changes. |
| `GraphClearNotification` | `GraphClearNotificationArg` | Signals that a graph has been cleared. |
| `GraphSelectedEventCountNotification` | `GraphSelectedEventCountNotificationArg` | Notifies when the count of selected events in a graph changes. |
| `GraphSelectedChannelCountNotification` | `GraphSelectedChannelCountNotificationArg` | Notifies when the count of selected channels in a graph changes. |
| `GraphSelectedChannelsNotification` | `GraphSelectedChannelsNotificationArg` | Notifies when the set of selected channels in a graph changes. |
| `GraphSelectedEventsNotification` | `GraphSelectedEventsNotificationArg` | Notifies when the set of selected events in a graph changes. |
| `ChannelsModificationLineFitNotification` | `LineFitArgs` | Notifies that a line-fit operation is requested on a specific channel over a range of indices. |
| `TestSummaryChangeNotification` | `TestSummaryChangeNotificationArg` | Notifies when the list of selected test summaries changes. |
| `DataFolderChangedEvent` | `DataFolderSelectionArg` | Signals a change in the selected data folder (triggers broader updates). |
### Payload Class Definitions
| Payload Class | Key Properties | Notes |
|---------------|----------------|-------|
| `GraphChannelReadCalcProgressChangedEventArgs` | `string ProgressMessage`, `double ProgressPercent`, `IBaseViewModel GraphVM` | Used for progress reporting; `GraphVM` identifies the associated graph view model. |
| `GraphChannelsReadCompletedNotificationArgs` | `bool IsReadCompleted`, `IBaseViewModel GraphVM` | `IsReadCompleted` indicates success/failure of read operation. |
| `DataFileSelectionArg` | `string File`, `IBaseViewModel ParentVM` | `File` is the selected file path; `ParentVM` supports reuse for PSD reports. |
| `TestLoadedCountNotificationArg` | `int LoadedCount`, `IBaseViewModel ParentVM` | `LoadedCount` reflects number of loaded tests; `ParentVM` enables scoping. |
| `GraphLoadedCountNotificationArg` | `int LoadedCount`, `IBaseViewModel ParentVM` | `LoadedCount` reflects number of loaded graphs. |
| `TestSummaryCountNotificationArg` | `int SummaryCount`, `IBaseViewModel ParentVM` | `SummaryCount` reflects number of summaries. |
| `GraphClearNotificationArg` | `bool GraphClear`, `IBaseViewModel ParentVM` | `GraphClear` likely indicates whether the graph is now empty. |
| `GraphSelectedEventCountNotificationArg` | `int SelectedEventCount`, `IBaseViewModel ParentVM` | `SelectedEventCount` reflects number of selected events. |
| `GraphSelectedChannelCountNotificationArg` | `int SelectedChannelCount`, `IBaseViewModel ParentVM` | `SelectedChannelCount` reflects number of selected channels. |
| `GraphSelectedChannelsNotificationArg` | `List<ITestChannel> SelectedChannels`, `IBaseViewModel ParentVM` | `SelectedChannels` is the current set of selected channels. |
| `GraphSelectedEventsNotificationArg` | `BindingList<ITestEvent> SelectedEvents`, `IBaseViewModel ParentVM` | `SelectedEvents` uses `BindingList<T>` (supports UI binding). |
| `LineFitArgs` | `ITestChannel Channel`, `ulong StartIndex`, `ulong EndIndex` | Immutable; constructor enforces non-null `Channel`. |
| `TestSummaryChangeNotificationArg` | `List<ITestSummary> SummaryList`, `IBaseViewModel ParentVM`, `int TotalSummaryCount` | `SummaryList` is the new selection; `TotalSummaryCount` may include unselected summaries. |
| `DataFolderSelectionArg` | `string Path`, `string File`, `bool SetSelected`, `bool SelectAll`, `IBaseViewModel ParentVM` | `SetSelected` controls UI selection; `SelectAll` controls whether to auto-select all tests (e.g., for export). |
## 3. Invariants
- All events are *notifications* (i.e., fire-and-forget); no return value or cancellation is expected.
- `GraphSelectedEventsNotificationArg.SelectedEvents` is a `System.ComponentModel.BindingList<ITestEvent>`; subscribers may rely on its change notification capabilities.
- `LineFitArgs` is immutable: its properties are read-only and set only via constructor.
- `DataFileSelectedEvent` is *distinct* from `DataFolderChangedEvent`—publishing one does not imply publishing the other (see comment in `DataFileSelectedEvent.cs`).
- All payload classes with `ParentVM` properties use `IBaseViewModel` to support scoping for reuse (e.g., PSD reports), implying that event handlers should respect `ParentVM` to avoid cross-view interference.
- `DataFolderSelectionArg.SetSelected` defaults to `false`; `SelectAll` defaults to `false`.
- `ChannelsModificationNotification` and `ChannelSelectionChangeNotification` both carry `List<ITestChannel>` but are separate events—subscribers must distinguish them intentionally.
## 4. Dependencies
### Dependencies *of* this module:
- **Prism.Events**: All events inherit from `PubSubEvent<T>`.
- **DTS.Common.Interface**:
- `ITestChannel`, `ITestEvent`, `ITestSummary` (from `DTS.Common.Interface`)
- `IBaseViewModel` (from `DTS.Common.Base`)
- **DTS.Common.Base**: Provides `IBaseViewModel` and `GraphChannelReadCalcProgressChangedEventArgs`.
### Dependencies *on* this module:
- Any module/view model that needs to react to viewer state changes (e.g., UI updates, data loading, graph rendering) will subscribe to these events.
- Specifically, components handling test summary views, graph rendering, and data file/folder navigation likely depend on this module.
## 5. Gotchas
- **Ambiguous naming**: `ChannelsModificationNotification` and `ChannelSelectionChangeNotification` both carry `List<ITestChannel>` and have near-identical summaries ("The selected Test Summary list changed event" / "The number of selected Graphs changed event"). Their distinct existence suggests semantic differences (e.g., one for *additions/removals*, one for *reordering*), but this is not documented in the source.
- **Inconsistent summaries**: Several event summaries incorrectly describe the event (e.g., `GraphLoadedCountNotification` says "The number of selected Tests changed event" instead of graphs). This may mislead developers.
- **`DataFileSelectedEvent` vs `DataFolderChangedEvent`**: The comment in `DataFileSelectedEvent.cs` explicitly warns against triggering `DataFolderChangedEvent` subscribers—subscribers must not assume these events are interchangeable.
- **`TestSummaryChangeNotificationArg.TotalSummaryCount`**: Not clarified whether this includes only summaries in `SummaryList` or all available summaries.
- **`GraphClearNotificationArg.GraphClear`**: The boolean name suggests a flag, but its meaning (e.g., `true` = cleared vs. `true` = *not* cleared) is ambiguous without implementation context.
- **No validation on payloads**: Payload classes have no validation (e.g., `ProgressPercent` could be outside [0,100], `SelectedChannels` could be null). Subscribers must defensively handle invalid values.
- **No ordering guarantees**: Events may be published in any order (e.g., `GraphChannelsReadCompletedNotification` may fire before `GraphChannelReadCalcProgressChangedEvent` completes).
- **None identified from source alone** for: thread-safety, lifecycle management, or disposal requirements.