7.2 KiB
7.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:49:56.440589+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 42735a65c478074f |
TestModification
Documentation: Test Modification Event Definitions
1. Purpose
This module defines a set of Prism-based event types used for communication within the DTS Viewer component related to test modification operations. These events facilitate decoupled UI and data layer interactions—such as refreshing test data, toggling or shifting the T0 cursor, updating filter behavior, and signaling when a test has been modified—enabling reactive updates across modules without tight coupling. All events inherit from CompositePresentationEvent<T> (Prism’s pub/sub mechanism), indicating they are intended for cross-view or cross-module communication in a WPF/Prism-based application.
2. Public Interface
| Event / Type | Signature | Behavior |
|---|---|---|
RefreshTestRequestEvent |
public class RefreshTestRequestEvent : CompositePresentationEvent<string> { } |
Payload is a string representing the Test ID. Subscribers use this to refresh the UI/data for the specified test. |
ShowT0CursorEvent |
public class ShowT0CursorEvent : CompositePresentationEvent<bool> { } |
Payload is a bool. true to show the T0 cursor, false to hide it. |
TestModificationChangedEvent |
public class TestModificationChangedEvent : CompositePresentationEvent<ITestModificationModel> { } |
Payload is an ITestModificationModel. Signals that the current test modification state (e.g., metadata, parameters) has changed. |
SetUseZeroForUnfilteredEvent |
public class SetUseZeroForUnfilteredEvent : CompositePresentationEvent<bool> { } |
Payload is a bool. Controls whether 0 (true) or P (false) is displayed in the isocode filter field when modifying an isocode from a filter. |
TestModificationEvent |
public class TestModificationEvent : CompositePresentationEvent<TestModificationArgs> { } |
Payload is a TestModificationArgs. Raised whenever a test is modified by the viewer (e.g., user edits metadata or parameters). Triggers downstream regeneration of ROIs (e.g., by DataPro). |
TestModificationArgs |
public class TestModificationArgs { public string DataSetDirectory { get; } public string TestId { get; } public TestModificationArgs(string dtsFilePath, string testId) { ... } } |
Encapsulates context for a test modification: dtsFilePath → DataSetDirectory, and testId. |
ShiftT0Event |
public class ShiftT0Event : CompositePresentationEvent<ShiftT0EventArguments> { } |
Payload is a ShiftT0EventArguments. Requests shifting the T0 time (cursor) either by absolute time offset or by sample/step count. |
ShiftT0EventArguments |
public class ShiftT0EventArguments { public double T0Time { get; } public bool IsInitialization { get; } public int T0Steps { get; } public bool IsKeyPress { get; } |
Contains shift parameters: • T0Time: Absolute time value (used in one constructor). • T0Steps: Number of steps/samples to shift (used in the other constructor). • IsInitialization: Whether this shift is part of initial setup. • IsKeyPress: Whether the shift was triggered by a keyboard event (left/right arrow). |
Note
: Two distinct constructors for
ShiftT0EventArgumentsexist:
- One accepting
(double t0, bool isInitialization)→ setsT0Time,IsInitialization;T0Steps = 0,IsKeyPress = false.- One accepting
(int steps, bool isInitialization, bool isKeyPress)→ setsT0Steps,IsInitialization,IsKeyPress;T0Time = 0D.
3. Invariants
- All events are non-interactive (i.e., they carry data only; no return values or side effects in the event class itself).
- Payload types are strictly typed:
RefreshTestRequestEvent→string(Test ID)ShowT0CursorEvent→boolTestModificationChangedEvent→ITestModificationModel(interface, not concrete type)SetUseZeroForUnfilteredEvent→boolTestModificationEvent→TestModificationArgsShiftT0Event→ShiftT0EventArguments
TestModificationArgs.TestIdandTestModificationArgs.DataSetDirectoryare immutable (private set;).- In
ShiftT0EventArguments,T0TimeandT0Stepsare mutually exclusive: only one is non-zero/non-default per instance. IsInitializationandIsKeyPressare independent flags; both may befalse(e.g., programmatic shifts not triggered by user input or initialization).
4. Dependencies
- External Dependency:
Microsoft.Practices.Prism.Events(Prism library) — required forCompositePresentationEvent<T>.
- Internal Dependency:
DTS.Common.Interface.ITestModificationModel— referenced inTestModificationChangedEvent. This interface must be defined elsewhere in the codebase (not included here).
- Inferred Usage:
- Events are likely published by the DTS Viewer (e.g., test editing UI) and consumed by modules like DataPro (for ROI regeneration), cursor rendering components, or filter UI logic.
- No direct consumers are listed in the source; usage must be inferred from comments (e.g.,
TestModificationEventis used by DataPro to regenerate ROI).
5. Gotchas
- Ambiguous payload semantics:
DataSetDirectoryinTestModificationArgsis initialized fromdtsFilePath, but its name suggests a directory while the parameter is nameddtsFilePath(which may be a full file path). Clarify whether this expects a directory or file path.ShiftT0EventArgumentshas two constructors with overlapping parameters (isInitialization) but different semantics. Callers must ensure correct constructor is used—mixing them may lead toT0Time = 0when a time shift was intended.
- Missing validation:
- No validation is present in
ShiftT0EventArgumentsconstructors (e.g.,stepscould be negative;T0Timecould be negative). Behavior for invalid values is undefined.
- No validation is present in
- Namespace quirk:
// ReSharper disable CheckNamespaceis present in multiple files, suggesting intentional deviation from folder-based namespace conventions. Ensure build/linting rules accommodate this.
- No documentation on event subscription/unsubscription patterns:
- Since these are Prism events, subscribers must manage thread affinity (e.g.,
ThreadOption.PublisherThreadvsUIThread) explicitly—this is not documented here.
- Since these are Prism events, subscribers must manage thread affinity (e.g.,
- No deprecation notices:
- The comment for
TestModificationEvent("this event is called currently whenever...") suggests it may be legacy or in flux. No indication of planned replacement or migration path.
- The comment for
- None identified from source alone.