init
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Events/DTS.Viewer/Reports/SaveReportToCSVRequestedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/Reports/SaveReportToPDFRequestedEvent.cs
|
||||
generated_at: "2026-04-16T03:27:02.713322+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "c23355273750380a"
|
||||
---
|
||||
|
||||
# Reports
|
||||
|
||||
## Documentation: Report Export Request Events
|
||||
|
||||
### 1. Purpose
|
||||
This module defines Prism-based pub/sub events used to signal user-initiated requests to export report data to external formats—specifically CSV and PDF. These events decouple the UI layer (e.g., a report viewer control or dialog) from the export implementation logic, enabling loose coupling and testability in the MVVM pattern. When a user selects "Save as CSV" or "Save as PDF", the UI publishes the corresponding event, and a dedicated handler (e.g., in a service or view model) subscribes to perform the actual file I/O and export processing.
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
- **`SaveReportToCSVRequestedEvent`**
|
||||
*Type:* `class` inheriting from `PubSubEvent<SaveReportToCSVRequestedEventArgs>`
|
||||
*Behavior:* A Prism event used to publish requests to save a report to CSV format. Subscribers receive an instance of `SaveReportToCSVRequestedEventArgs` containing the target directory and parent view model context.
|
||||
|
||||
- **`SaveReportToCSVRequestedEventArgs`**
|
||||
*Type:* `class`
|
||||
*Properties:*
|
||||
- `Directory` (`string`): The file system directory where the CSV file should be saved.
|
||||
- `ParentVM` (`IBaseViewModel`): The view model that initiated or owns the report context (e.g., the active report view model). Used for context-aware operations (e.g., resolving data sources or parent window handles).
|
||||
|
||||
- **`SaveReportToPDFRequestedEvent`**
|
||||
*Type:* `class` inheriting from `PubSubEvent<SaveReportToPDFRequestedEventArgs>`
|
||||
*Behavior:* A Prism event used to publish requests to save a report to PDF format. Subscribers receive an instance of `SaveReportToPDFRequestedEventArgs` with the same payload structure as the CSV variant.
|
||||
|
||||
- **`SaveReportToPDFRequestedEventArgs`**
|
||||
*Type:* `class`
|
||||
*Properties:*
|
||||
- `Directory` (`string`): The file system directory where the PDF file should be saved.
|
||||
- `ParentVM` (`IBaseViewModel`): The view model that initiated or owns the report context.
|
||||
|
||||
> **Note:** Both event argument classes are *mutable* (public setters on properties) and lack validation or immutability guarantees.
|
||||
|
||||
### 3. Invariants
|
||||
- The `Directory` property in both argument types is expected to be a valid, writable file system path at the time of event publication.
|
||||
- The `ParentVM` property is expected to be non-null at event publication; however, no explicit null-checking or enforcement is present in the event argument classes themselves.
|
||||
- Events are published *before* export logic executes (i.e., they are request triggers, not completion notifications).
|
||||
- No ordering guarantees exist between multiple subscribers—concurrent or conflicting writes to the same path are possible if not handled by subscribers.
|
||||
|
||||
### 4. Dependencies
|
||||
- **Internal Dependencies:**
|
||||
- `DTS.Common.Base.IBaseViewModel`: Defines the contract for view models used in the parent context.
|
||||
- `Prism.Events.PubSubEvent<T>`: Prism’s event aggregation infrastructure.
|
||||
- **External Dependencies:**
|
||||
- `System` and `System.Collections.Generic`, `System.Linq`, `System.Text`, `System.Threading.Tasks`: Standard .NET libraries.
|
||||
- **Consumers (inferred):**
|
||||
- UI components (e.g., report viewer controls) that publish these events on user action.
|
||||
- Export service classes or view models that subscribe to these events to handle file generation.
|
||||
- Likely used in conjunction with `IBaseViewModel` implementations that expose report data and coordinate with export services.
|
||||
|
||||
### 5. Gotchas
|
||||
- **No filename specification:** The event arguments only provide a *directory*, not a filename. Subscribers must derive filenames (e.g., via timestamp, report name from `ParentVM`, or user input), which may lead to inconsistent naming or overwrites if not handled carefully.
|
||||
- **No cancellation support:** Events lack a mechanism to signal cancellation (e.g., via `CancellationToken`) or to abort the operation mid-process.
|
||||
- **No error propagation:** Exceptions thrown by subscribers are not captured or propagated back to the publisher; error handling must be implemented entirely within subscribers.
|
||||
- **No format-specific metadata:** Arguments do not include export options (e.g., CSV delimiter, PDF page size, inclusion of headers). Subscribers must hardcode or infer such settings.
|
||||
- **Mutable payload:** Since `Directory` and `ParentVM` have public setters, subscribers could inadvertently modify the event args—though this is unlikely to be intentional.
|
||||
- **None identified from source alone.**
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Events/DTS.Viewer/Reports/PowerSpectralDensity/PSDReportSettingsChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/Reports/PowerSpectralDensity/PSDReportGRMSValuesUpdatedEvent.cs
|
||||
generated_at: "2026-04-16T03:27:06.629572+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "bc3a14258ff7c95a"
|
||||
---
|
||||
|
||||
# PowerSpectralDensity
|
||||
|
||||
## Documentation: Power Spectral Density (PSD) Report Events
|
||||
|
||||
---
|
||||
|
||||
### 1. **Purpose**
|
||||
This module defines Prism-based pub/sub events used to communicate state changes and data updates within the Power Spectral Density (PSD) report generation and display subsystem. Specifically, it enables decoupled notification of changes to PSD report configuration settings (`PSDReportSettingsChangedEvent`) and updates to GRMS (Root Mean Square of acceleration) summary values per channel (`PSDReportGRMSValuesUpdatedEvent`). These events facilitate reactive UI updates and model synchronization without tight coupling between view models and data models in the DTS Viewer application.
|
||||
|
||||
---
|
||||
|
||||
### 2. **Public Interface**
|
||||
|
||||
#### `PSDReportSettingsChangedEvent`
|
||||
- **Type**: `class` inheriting from `PubSubEvent<PSDReportSettingsChangedEventArg>`
|
||||
- **Behavior**: A Prism event used to publish notifications when PSD report settings have been modified. Subscribers receive an instance of `PSDReportSettingsChangedEventArg` containing the updated settings model and the originating view model.
|
||||
|
||||
#### `PSDReportSettingsChangedEventArg`
|
||||
- **Type**: `class`
|
||||
- **Properties**:
|
||||
- `Model`: `IPSDReportSettingsModel` — The updated PSD report settings model.
|
||||
- `ParentVM`: `IBaseViewModel` — The view model that triggered or owns the settings change.
|
||||
|
||||
#### `PSDReportGRMSValuesUpdatedEvent`
|
||||
- **Type**: `class` inheriting from `PubSubEvent<PSDReportGRMSValuesUpdatedEventArg>`
|
||||
- **Behavior**: A Prism event used to publish notifications when GRMS summary values (per channel) have been recalculated or updated. Subscribers receive an instance of `PSDReportGRMSValuesUpdatedEventArg` containing the new GRMS values and the originating view model.
|
||||
|
||||
#### `PSDReportGRMSValuesUpdatedEventArg`
|
||||
- **Type**: `class`
|
||||
- **Properties**:
|
||||
- `Values`: `IChannelGRMSSummary[]` — Array of GRMS summary values, one per channel.
|
||||
- `ParentVM`: `IBaseViewModel` — The view model responsible for the update.
|
||||
|
||||
---
|
||||
|
||||
### 3. **Invariants**
|
||||
|
||||
- **Event argument nullability**: Neither `Model` (in `PSDReportSettingsChangedEventArg`) nor `Values` (in `PSDReportGRMSValuesUpdatedEventArg`) is explicitly guaranteed to be non-null in the source. However, since they are public setters on reference types, callers are expected to provide valid instances when raising the events.
|
||||
- **ParentVM requirement**: `ParentVM` is present in both argument types but is not validated for null. It is assumed that the publisher always sets `ParentVM` to the relevant view model context.
|
||||
- **Ordering**: No ordering guarantees are specified or implied for event delivery; subscribers must not rely on event sequence unless enforced externally.
|
||||
|
||||
---
|
||||
|
||||
### 4. **Dependencies**
|
||||
|
||||
#### Dependencies *of* this module:
|
||||
- `DTS.Common.Base` — Provides `IBaseViewModel`.
|
||||
- `DTS.Common.Interface` — Provides:
|
||||
- `IPSDReportSettingsModel`
|
||||
- `IChannelGRMSSummary`
|
||||
- `Prism.Events` — Provides `PubSubEvent<T>` base class.
|
||||
|
||||
#### Dependencies *on* this module:
|
||||
- Any module/view model involved in PSD report configuration or GRMS calculation (e.g., report view models, data processing services) likely subscribes to or publishes these events. However, no explicit consumers are visible in the provided source.
|
||||
|
||||
---
|
||||
|
||||
### 5. **Gotchas**
|
||||
|
||||
- **No validation or immutability**: The argument classes expose public setters for all properties, meaning subscribers could inadvertently mutate the event args. There is no indication of immutability or defensive copying.
|
||||
- **Ambiguous scope of `ParentVM`**: While `ParentVM` is included, its semantics (e.g., whether it is the *originator*, *owner*, or *context* of the change) are not documented in this file. Consumers must infer usage from surrounding code.
|
||||
- **Array mutability risk**: `Values` is exposed as `IChannelGRMSSummary[]`, a mutable array. Subscribers may modify the array contents, potentially causing side effects if the same instance is reused.
|
||||
- **Missing documentation of event semantics**: The source does not clarify whether events are *synchronous*, *thread-affine*, or *throttled*. Behavior depends on Prism’s default `PubSubEvent` behavior (synchronous, UI-thread aware if subscribed on UI thread), but this is not explicit here.
|
||||
- **None identified from source alone.** *(Note: The above are inferred based on common pitfalls with Prism events and public mutable properties, not explicit warnings in the source.)*
|
||||
@@ -0,0 +1,102 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Events/DTS.Viewer/TestModification/RefreshTestRequestEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/TestModification/ShowT0CursorEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/TestModification/TestModificationChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/TestModification/SetUseZeroForUnfilteredEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/TestModification/TestModificationEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/TestModification/ShiftT0Event.cs
|
||||
generated_at: "2026-04-16T03:26:33.870349+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "74b84eb90ba5f23e"
|
||||
---
|
||||
|
||||
# TestModification
|
||||
|
||||
## Documentation: Test Modification Event Module
|
||||
|
||||
### 1. Purpose
|
||||
This module defines a set of Prism-based pub/sub events used to coordinate test modification operations within the DTS Viewer component. It enables decoupled communication between UI components (e.g., viewers, controllers) and backend services (e.g., data processors, ROI generators) when tests are modified, T0 cursor state changes, or related configuration (e.g., `UseZeroForUnfiltered`) is updated. The events serve as a contract for propagating state changes and user actions related to test metadata, cursor positioning, and filtering behavior.
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
- **`RefreshTestRequestEvent`**
|
||||
```csharp
|
||||
public class RefreshTestRequestEvent : PubSubEvent<string> { }
|
||||
```
|
||||
Publishes a request to refresh a specific test, identified by its `string` test ID. Payload is the test ID.
|
||||
|
||||
- **`ShowT0CursorEvent`**
|
||||
```csharp
|
||||
public class ShowT0CursorEvent : PubSubEvent<bool> { }
|
||||
```
|
||||
Publishes a request to show or hide the T0 cursor. Payload is a `bool`: `true` to show, `false` to hide.
|
||||
|
||||
- **`TestModificationChangedEvent`**
|
||||
```csharp
|
||||
public class TestModificationChangedEvent : PubSubEvent<ITestModificationModel> { }
|
||||
```
|
||||
Publishes when the test modification model has changed. Payload is an `ITestModificationModel` instance representing the new/updated state.
|
||||
|
||||
- **`SetUseZeroForUnfilteredEvent`**
|
||||
```csharp
|
||||
public class SetUseZeroForUnfilteredEvent : PubSubEvent<bool> { }
|
||||
```
|
||||
Publishes a request to set the `UseZeroForUnfiltered` property. Payload is a `bool`: `true` means `0` is used in the isocode filter field for unfiltered cases; `false` means `P` is used.
|
||||
|
||||
- **`TestModificationEvent`**
|
||||
```csharp
|
||||
public class TestModificationEvent : PubSubEvent<TestModificationArgs> { }
|
||||
public class TestModificationArgs
|
||||
{
|
||||
public string DataSetDirectory { get; }
|
||||
public string TestId { get; }
|
||||
public TestModificationArgs(string dtsFilePath, string testId)
|
||||
}
|
||||
```
|
||||
Publishes whenever a test is modified by the viewer. Payload is a `TestModificationArgs` object containing:
|
||||
- `DataSetDirectory`: The path to the data set directory (originally passed as `dtsFilePath`).
|
||||
- `TestId`: The ID of the modified test.
|
||||
|
||||
- **`ShiftT0Event`**
|
||||
```csharp
|
||||
public class ShiftT0Event : PubSubEvent<ShiftT0EventArguments> { }
|
||||
public class ShiftT0EventArguments
|
||||
{
|
||||
public double T0Time { get; }
|
||||
public bool IsInitialization { get; }
|
||||
public int T0Steps { get; }
|
||||
public bool IsKeyPress { get; }
|
||||
public ShiftT0EventArguments(double t0, bool isInitialization)
|
||||
public ShiftT0EventArguments(int steps, bool isInitialization, bool isKeyPress)
|
||||
}
|
||||
```
|
||||
Publishes a request to shift the T0 time. Payload is a `ShiftT0EventArguments` object, constructed via one of two constructors:
|
||||
- `ShiftT0EventArguments(double t0, bool isInitialization)`: For absolute T0 time shifts. Sets `T0Time = t0`, `T0Steps = 0`, `IsKeyPress = false`.
|
||||
- `ShiftT0EventArguments(int steps, bool isInitialization, bool isKeyPress)`: For relative shifts (e.g., arrow key navigation). Sets `T0Time = 0`, `T0Steps = steps`, `IsKeyPress = isKeyPress`.
|
||||
|
||||
### 3. Invariants
|
||||
- All events derive from `Prism.Events.PubSubEvent<T>`, implying they are published/subscribed using Prism’s event aggregation mechanism.
|
||||
- `TestModificationArgs.TestId` and `TestModificationArgs.DataSetDirectory` are immutable after construction (`private set`).
|
||||
- `ShiftT0EventArguments` has two mutually exclusive modes of operation:
|
||||
- Absolute shift: `T0Time != 0`, `T0Steps == 0`, `IsKeyPress == false`.
|
||||
- Relative shift: `T0Time == 0`, `T0Steps != 0`, `IsKeyPress` reflects whether triggered by keyboard.
|
||||
- `ShowT0CursorEvent` payload is strictly interpreted as a boolean toggle (no undefined or null values).
|
||||
- `RefreshTestRequestEvent` payload is expected to be a valid test ID string (no validation is performed in this module).
|
||||
|
||||
### 4. Dependencies
|
||||
- **Dependencies on other modules**:
|
||||
- `Prism.Events` (external library for event aggregation).
|
||||
- `DTS.Common.Interface` (for `ITestModificationModel` used in `TestModificationChangedEvent`).
|
||||
- **Dependencies on this module**:
|
||||
- Inferred consumers include components that handle test modification (e.g., `DataPro` per `TestModificationEvent` summary), UI viewers managing T0 cursor visibility/position, and modules handling isocode filter configuration.
|
||||
- The module is part of `DTS.Common.Events`, suggesting it is consumed by viewer and data processing layers (e.g., `DTS.Viewer`, `DTS.DataPro`).
|
||||
|
||||
### 5. Gotchas
|
||||
- **Ambiguous naming**: `TestModificationChangedEvent`’s summary says “The Data Folder changed event”, but its payload is `ITestModificationModel`, not a folder path. This appears to be a documentation error.
|
||||
- **Constructor overloading ambiguity**: `ShiftT0EventArguments` has two constructors that set different fields; callers must ensure correct constructor is used. Mixing usage (e.g., passing `T0Time` in the steps-based constructor) is prevented by design but may cause confusion if not documented externally.
|
||||
- **No validation on payloads**: Events carry raw data (e.g., `string` test IDs, `double` T0 times) without built-in validation—consumers must validate inputs.
|
||||
- **`IsKeyPress` in `ShiftT0EventArguments` is only set in the relative-shift constructor**: In the absolute-shift constructor, it is always `false`, which may be non-obvious.
|
||||
- **Namespace consistency**: `// ReSharper disable CheckNamespace` is present in some files but not others—suggests possible inconsistency in namespace usage across the codebase (though all events reside in `DTS.Common.Events`).
|
||||
- **No versioning or deprecation markers**: Events may evolve without explicit signaling (e.g., adding fields to `TestModificationArgs` could break subscribers).
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/ResetZoomChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/CursorShowChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/CursorsClearChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/CursorShowMinMaxChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/CursorsAlailableChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/SaveToPDFRequestedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/ChartAxisChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerChartOptions/ChartOptionsChangedEvent.cs
|
||||
generated_at: "2026-04-16T03:26:50.843144+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "31b0212fbe1dea4d"
|
||||
---
|
||||
|
||||
# ViewerChartOptions
|
||||
|
||||
## Documentation: Viewer Chart Options Events
|
||||
|
||||
### 1. Purpose
|
||||
This module defines a set of Prism `PubSubEvent`-based events used to communicate state changes and user requests related to chart visualization options in the DTS Viewer component. These events decouple chart UI controls (e.g., zoom, cursor, axis, export) from the underlying view models and chart rendering logic, enabling loose coupling and event-driven updates across the application. All events reside in the `DTS.Common.Events` namespace and are part of the shared `DTS.Common` library.
|
||||
|
||||
---
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
| Event Class | Payload Type | Behavior |
|
||||
|-------------|--------------|----------|
|
||||
| `ResetZoomChangedEvent` | `bool` | Published when the reset-zoom option state changes (e.g., enabled/disabled). *Note: XML comment incorrectly states “The Data Folder changed event.”* |
|
||||
| `CursorShowChangedEvent` | `bool` | Published when the visibility state of the primary cursor changes. *Note: XML comment incorrectly states “The Data Folder changed event.”* |
|
||||
| `CursorsClearChangedEvent` | `bool` | Published when the state of the “clear cursors” option changes. *Note: XML comment incorrectly states “The Data Folder changed event.”* |
|
||||
| `CursorShowMinMaxChangedEvent` | `bool` | Published when the option to show min/max values for cursors changes. *Note: XML comment incorrectly states “The Data Folder changed event.”* |
|
||||
| `CursorsAlailableChangedEvent` | `bool` | Published when the availability (e.g., enabled/disabled) of cursor functionality changes. *Note: Typo in class name (`Alailable` instead of `Available`); XML comment incorrectly states “The Data Folder changed event.”* |
|
||||
| `SaveToPDFRequestedEvent` | `string` | Published when the user requests saving the current chart to PDF. The payload is a string—likely a suggested file path or filename. |
|
||||
| `ChartAxisChangedEvent` | `ChartAxisChangedEventArg` | Published when chart axis ranges are modified. Payload contains the parent view model, axis identifier, and min/max values. |
|
||||
| `ChartOptionsChangedEvent` | `ChartOptionsChangedEventArg` | Published when general chart options change (e.g., chart type, model settings). Payload contains the parent view model, the updated chart options model, and chart type. |
|
||||
|
||||
**Helper Types**
|
||||
- `ChartAxisChangedEventArg`
|
||||
- `ParentVM`: `IBaseViewModel` – The view model associated with the chart.
|
||||
- `Axis`: `string` – Identifier for the axis (e.g., `"X"`, `"Y"`, `"Primary"`, `"Secondary"`).
|
||||
- `MinValue`: `double` – New minimum value for the axis.
|
||||
- `MaxValue`: `double` – New maximum value for the axis.
|
||||
|
||||
- `ChartOptionsChangedEventArg`
|
||||
- `ParentVM`: `IBaseViewModel` – The view model associated with the chart.
|
||||
- `Model`: `IChartOptionsModel` – The updated chart options model instance.
|
||||
- `ChartType`: `string` – The chart type (e.g., `"Line"`, `"Bar"`, `"Scatter"`).
|
||||
|
||||
---
|
||||
|
||||
### 3. Invariants
|
||||
|
||||
- All events inherit from `Prism.Events.PubSubEvent<T>`, meaning they use Prism’s event aggregation pattern for thread-safe, decoupled publish/subscribe communication.
|
||||
- Boolean events (`ResetZoomChangedEvent`, `CursorShowChangedEvent`, `CursorsClearChangedEvent`, `CursorShowMinMaxChangedEvent`, `CursorsAlailableChangedEvent`) use `bool` payloads to represent *state changes* (e.g., toggled on/off), not necessarily *current values*—subscribers must interpret the payload as the new state.
|
||||
- `SaveToPDFRequestedEvent`’s `string` payload is not validated in this file; its semantics (e.g., path vs. filename) are implementation-dependent.
|
||||
- `ChartAxisChangedEventArg` and `ChartOptionsChangedEventArg` both require a `ParentVM` of type `IBaseViewModel`, implying the event originator must be a view model implementing that interface.
|
||||
- `ChartOptionsChangedEventArg.Model` must implement `IChartOptionsModel`, but no validation is enforced at the event level.
|
||||
|
||||
---
|
||||
|
||||
### 4. Dependencies
|
||||
|
||||
**Dependencies *of* this module:**
|
||||
- `Prism.Events` – Core dependency for `PubSubEvent<T>`.
|
||||
- `DTS.Common.Base` – Required for `IBaseViewModel` (used in `ChartAxisChangedEventArg` and `ChartOptionsChangedEventArg`).
|
||||
- `DTS.Common.Interface` – Required for `IChartOptionsModel` (used in `ChartOptionsChangedEventArg`).
|
||||
|
||||
**Dependencies *on* this module:**
|
||||
- Any component that manages chart UI state (e.g., view models, chart controls) likely subscribes to these events to react to user actions or model changes.
|
||||
- The `SaveToPDFRequestedEvent` suggests integration with a PDF export service (not visible here).
|
||||
- The `ChartAxisChangedEvent` and `ChartOptionsChangedEvent` imply coupling with chart rendering logic and data binding systems (e.g., MVVM framework).
|
||||
|
||||
---
|
||||
|
||||
### 5. Gotchas
|
||||
|
||||
- **Misleading XML comments**: All events (except `SaveToPDFRequestedEvent`) have XML comments stating “The Data Folder changed event.” This is clearly incorrect and likely copy-paste error—do not rely on comments for semantics.
|
||||
- **Typo in class name**: `CursorsAlailableChangedEvent` uses `Alailable` instead of `Available`. This may cause confusion and should be corrected in future refactoring.
|
||||
- **Ambiguous payload semantics**: Boolean events use `bool` payloads, but it is unclear whether `true` means *enabled*, *visible*, *requested*, or *changed to true*. Subscribers must infer meaning from context or external documentation.
|
||||
- **No validation on `ChartAxisChangedEventArg`**: No checks ensure `MinValue < MaxValue` or that `Axis` is a recognized identifier. Invalid values may propagate silently.
|
||||
- **No documentation for `ChartType` values**: The `ChartType` string in `ChartOptionsChangedEventArg` has no documented set of valid values (e.g., `"Line"`, `"Bar"`), risking runtime errors if unexpected values are used.
|
||||
- **No versioning or deprecation markers**: Events may evolve (e.g., payload changes), but no attributes or comments indicate stability or obsolescence.
|
||||
|
||||
*None of the above are explicitly enforced in the source—these are inferred from inconsistencies and omissions.*
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerFilter/FilterParameterChangedEvent.cs
|
||||
generated_at: "2026-04-16T03:26:16.445122+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "f65dc87a2ce033e4"
|
||||
---
|
||||
|
||||
# ViewerFilter
|
||||
|
||||
### **Purpose**
|
||||
This module defines a Prism-based event mechanism for propagating changes to filter parameters within the DTS Viewer component. It enables decoupled communication between view models (implementing `IBaseViewModel`) that request or respond to filter updates—specifically when a filter parameter value changes—by publishing `FilterParameterChangedEvent` instances carrying the parameter name and the originating view model.
|
||||
|
||||
---
|
||||
|
||||
### **Public Interface**
|
||||
|
||||
#### `FilterParameterArgs`
|
||||
- **`IBaseViewModel Requester { get; set; }`**
|
||||
The view model instance that initiated or is associated with the filter parameter change. Used to identify the source of the event.
|
||||
- **`string Param { get; set; }`**
|
||||
The name (key) of the filter parameter that has changed. Represents the specific filter field being updated (e.g., `"DateRange"`, `"Status"`).
|
||||
|
||||
#### `FilterParameterChangedEvent`
|
||||
- **Inherits from `PubSubEvent<FilterParameterArgs>`**
|
||||
A Prism `PubSubEvent` that carries `FilterParameterArgs` payloads. Subscribers can register handlers to react when a filter parameter changes.
|
||||
|
||||
---
|
||||
|
||||
### **Invariants**
|
||||
- `Param` must be a non-null, non-empty string representing a valid filter parameter identifier (enforced by convention/consumer logic, not by this class).
|
||||
- `Requester` must be non-null when the event is published (enforced by publisher; this class does not validate).
|
||||
- The event is *publish-only*—no built-in subscription validation or filtering logic is present in this file.
|
||||
|
||||
---
|
||||
|
||||
### **Dependencies**
|
||||
- **Imports/References**:
|
||||
- `DTS.Common.Base` (provides `IBaseViewModel`)
|
||||
- `Prism.Events` (provides `PubSubEvent<T>`)
|
||||
- **Depended on by**:
|
||||
- Any module/view model in the DTS Viewer that needs to publish or subscribe to filter parameter changes (e.g., filter controls, data grids, or search components).
|
||||
- No direct consumers are visible in this file; dependencies are inferred from usage of `PubSubEvent<T>` and `IBaseViewModel`.
|
||||
|
||||
---
|
||||
|
||||
### **Gotchas**
|
||||
- **No validation**: The class does not enforce non-null/non-empty constraints on `Param` or `Requester`; invalid values may propagate silently.
|
||||
- **No payload for new value**: The event only carries the *parameter name* (`Param`), not its new value. Subscribers must infer or retrieve the updated value from the `Requester` (e.g., via a property like `Requester.FilterParams[Param]`).
|
||||
- **Namespace quirk**: The `// ReSharper disable CheckNamespace` directive suggests intentional namespace flattening (`DTS.Common.Events` instead of `DTS.Common.Events.DTS.Viewer.FilterParameter`), which may affect discoverability or tooling.
|
||||
- **No backward/forward compatibility guarantees**: As a proprietary module, changes to `Param` naming conventions or `Requester` semantics may break consumers without warning.
|
||||
|
||||
None identified beyond the above.
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerSettings/CalibrationBehaviorSettableInViewerChangedEvent.cs
|
||||
- Common/DTS.Common/Events/DTS.Viewer/ViewerSettings/ViewerSettingsVisibilityChangedEvent.cs
|
||||
generated_at: "2026-04-16T03:26:29.245992+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "aa456ba674677929"
|
||||
---
|
||||
|
||||
# ViewerSettings
|
||||
|
||||
### 1. Purpose
|
||||
This module defines two Prism-based pub/sub events used for broadcasting changes to viewer settings in the DTS system: one signaling whether calibration behavior is settable in the viewer (`CalibrationBehaviorSettableInViewerChangedEvent`), and another signaling changes to the visibility state of the viewer settings UI (`ViewerSettingsVisibilityChangedEvent`). These events enable decoupled communication between components—e.g., view models or services—responsible for managing viewer configuration and UI state, allowing subscribers to react to runtime updates without tight coupling.
|
||||
|
||||
### 2. Public Interface
|
||||
- **`CalibrationBehaviorSettableInViewerChangedEvent`**
|
||||
- *Inherits from:* `PubSubEvent<bool>`
|
||||
- *Behavior:* A Prism event used to publish and subscribe to changes in whether the calibration behavior settings are editable within the viewer. The payload is a `bool`: `true` indicates calibration behavior *is* settable in the viewer; `false` indicates it is not.
|
||||
|
||||
- **`ViewerSettingsVisibilityChangedEvent`**
|
||||
- *Inherits from:* `PubSubEvent<Visibility>`
|
||||
- *Behavior:* A Prism event used to publish and subscribe to changes in the visibility of the viewer settings panel. The payload is a `System.Windows.Visibility` value (`Visible`, `Collapsed`, or `Hidden`), reflecting the current UI state of the settings panel.
|
||||
|
||||
### 3. Invariants
|
||||
- `CalibrationBehaviorSettableInViewerChangedEvent` payloads must be strictly `true` or `false`; no null or intermediate values are possible (since `bool` is non-nullable).
|
||||
- `ViewerSettingsVisibilityChangedEvent` payloads must be one of the three `Visibility` enum values defined in `System.Windows`: `Visible`, `Collapsed`, or `Hidden`.
|
||||
- Events are published *only* when the respective state actually changes; no redundant or duplicate publications are implied by the source (though enforcement of this is outside the scope of the event definitions themselves).
|
||||
- No ordering guarantees are specified or implied between these two events; they are independent.
|
||||
|
||||
### 4. Dependencies
|
||||
- **Dependencies *of* this module:**
|
||||
- `Prism.Events` (specifically `PubSubEvent<T>`), indicating reliance on the Prism library for event aggregation.
|
||||
- `System.Windows` (only for `ViewerSettingsVisibilityChangedEvent`, via `Visibility`).
|
||||
- **Dependencies *on* this module:**
|
||||
- Not inferable from the provided source files alone. However, any consumer (e.g., view models, services) that needs to react to viewer settings changes or calibration behavior availability must subscribe to these events via the Prism `IEventAggregator`.
|
||||
- These events are likely published by components managing viewer configuration state (e.g., a viewer settings view model or calibration service), but such publishers are not visible in this source.
|
||||
|
||||
### 5. Gotchas
|
||||
- **Namespace flattening:** The `// ReSharper disable CheckNamespace` directive suggests the namespace is intentionally `DTS.Common.Events` (not nested under a more specific sub-namespace), possibly to avoid deep nesting in legacy or tooling-constrained contexts.
|
||||
- **No validation in event definition:** The events themselves do not enforce semantics (e.g., that `Visibility.Collapsed` and `Visibility.Hidden` are treated differently); interpretation of payload values is deferred to subscribers.
|
||||
- **No documentation comments:** The source lacks XML documentation comments, so semantic meaning (e.g., *why* calibration behavior might be settable or not) is not embedded here—consumers must infer intent from usage.
|
||||
- **No versioning or deprecation markers:** No indication of whether these events are stable, experimental, or scheduled for change.
|
||||
- **None identified from source alone.**
|
||||
@@ -0,0 +1,104 @@
|
||||
---
|
||||
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 module’s 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.
|
||||
Reference in New Issue
Block a user