6.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:26:33.870349+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 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
-
RefreshTestRequestEventpublic class RefreshTestRequestEvent : PubSubEvent<string> { }Publishes a request to refresh a specific test, identified by its
stringtest ID. Payload is the test ID. -
ShowT0CursorEventpublic class ShowT0CursorEvent : PubSubEvent<bool> { }Publishes a request to show or hide the T0 cursor. Payload is a
bool:trueto show,falseto hide. -
TestModificationChangedEventpublic class TestModificationChangedEvent : PubSubEvent<ITestModificationModel> { }Publishes when the test modification model has changed. Payload is an
ITestModificationModelinstance representing the new/updated state. -
SetUseZeroForUnfilteredEventpublic class SetUseZeroForUnfilteredEvent : PubSubEvent<bool> { }Publishes a request to set the
UseZeroForUnfilteredproperty. Payload is abool:truemeans0is used in the isocode filter field for unfiltered cases;falsemeansPis used. -
TestModificationEventpublic 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
TestModificationArgsobject containing:DataSetDirectory: The path to the data set directory (originally passed asdtsFilePath).TestId: The ID of the modified test.
-
ShiftT0Eventpublic 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
ShiftT0EventArgumentsobject, constructed via one of two constructors:ShiftT0EventArguments(double t0, bool isInitialization): For absolute T0 time shifts. SetsT0Time = t0,T0Steps = 0,IsKeyPress = false.ShiftT0EventArguments(int steps, bool isInitialization, bool isKeyPress): For relative shifts (e.g., arrow key navigation). SetsT0Time = 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.TestIdandTestModificationArgs.DataSetDirectoryare immutable after construction (private set).ShiftT0EventArgumentshas two mutually exclusive modes of operation:- Absolute shift:
T0Time != 0,T0Steps == 0,IsKeyPress == false. - Relative shift:
T0Time == 0,T0Steps != 0,IsKeyPressreflects whether triggered by keyboard.
- Absolute shift:
ShowT0CursorEventpayload is strictly interpreted as a boolean toggle (no undefined or null values).RefreshTestRequestEventpayload 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(forITestModificationModelused inTestModificationChangedEvent).
- Dependencies on this module:
- Inferred consumers include components that handle test modification (e.g.,
DataProperTestModificationEventsummary), 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).
- Inferred consumers include components that handle test modification (e.g.,
5. Gotchas
- Ambiguous naming:
TestModificationChangedEvent’s summary says “The Data Folder changed event”, but its payload isITestModificationModel, not a folder path. This appears to be a documentation error. - Constructor overloading ambiguity:
ShiftT0EventArgumentshas two constructors that set different fields; callers must ensure correct constructor is used. Mixing usage (e.g., passingT0Timein 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.,
stringtest IDs,doubleT0 times) without built-in validation—consumers must validate inputs. IsKeyPressinShiftT0EventArgumentsis only set in the relative-shift constructor: In the absolute-shift constructor, it is alwaysfalse, which may be non-obvious.- Namespace consistency:
// ReSharper disable CheckNamespaceis present in some files but not others—suggests possible inconsistency in namespace usage across the codebase (though all events reside inDTS.Common.Events). - No versioning or deprecation markers: Events may evolve without explicit signaling (e.g., adding fields to
TestModificationArgscould break subscribers).