--- source_files: - Common/DTS.Common/Interface/DTS.Viewer/TestSummary/ITestSummaryListView.cs - Common/DTS.Common/Interface/DTS.Viewer/TestSummary/ITestSummaryListViewModel.cs - Common/DTS.Common/Interface/DTS.Viewer/TestSummary/ITestSummary.cs generated_at: "2026-04-16T03:07:52.259971+00:00" model: "Qwen/Qwen3-Coder-Next-FP8" schema_version: 1 sha256: "710dfe38f0bd83ca" --- # TestSummary ## Documentation: Test Summary List Module ### 1. Purpose This module defines the interface contracts for a *Test Summary List* view and its associated view model in a test data viewer application. It enables the display and management of a list of test summaries (`ITestSummary`), supporting selection tracking (`SelectedTestSummaryList`), UI binding via `ObservableCollection`, and propagation of selection changes through the `PublishSelectedTestSummaryList()` method. It serves as the data and presentation layer abstraction for a list-based UI component (e.g., a grid or list view) that shows metadata about recorded tests, including setup name, channel count, timestamps, and associated graphs/channels. --- ### 2. Public Interface #### `ITestSummaryListView` - **Inherits**: `IBaseView` - **Description**: A marker interface representing the view layer for the test summary list. No additional members defined; intended for dependency injection or view-model-to-view binding. #### `ITestSummaryListViewModel` - **Inherits**: `IBaseViewModel` - **Properties**: - `ITestSummaryListView View { get; }` Gets the associated view instance. - `ObservableCollection TestSummaryList { get; set; }` The full list of test summaries displayed in the UI; observable for collection change notifications. - `List SelectedTestSummaryList { get; set; }` The subset of `TestSummaryList` items currently selected by the user. *Not* observable; changes must be explicitly published. - **Methods**: - `void PublishSelectedTestSummaryList()` Triggers propagation of the current `SelectedTestSummaryList` to downstream consumers (e.g., via event or messaging). - `void TestSummaryList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)` Handles `CollectionChanged` events for `TestSummaryList`, likely updating internal state (e.g., `SelectedTestSummaryList`) when items are added/removed/moved. #### `ITestSummary` - **Inherits**: `IBaseClass` - **Properties**: - `string Id { get; set; }` Unique identifier for the test. - `string SetupName { get; set; }` Name of the test setup configuration. - `string Description { get; set; }` Human-readable description of the test. - `int ChannelCount { get; set; }` Number of physical channels recorded in the test. - `DateTime FileDate { get; set; }` Date the test file was created or last modified. - `DateTime TimeStamp { get; set; }` Timestamp of the test event (e.g., start time). - `string DataType { get; set; }` Type of data recorded (e.g., "Raw", "Processed"). - `bool IsSelected { get; set; }` UI state flag indicating if this item is selected in the list. - `List Graphs { get; set; }` List of graph definitions associated with this test. - `List Channels { get; set; }` List of physical channels in the test. - `List CalculatedChannels { get; set; }` List of derived/calculated channels. - `IBaseViewModel Parent { get; set; }` Reference to the parent view model in the hierarchy. - `ITestMetadata TestMetadata { get; set; }` Metadata object containing additional test details. - `CalibrationBehaviors CalibrationBehavior { get; set; }` Enumerated value indicating calibration behavior (from `DTS.Common.Enums.Sensors`). --- ### 3. Invariants - `TestSummaryList` must be an `ObservableCollection` to support UI binding and change notifications. - `SelectedTestSummaryList` is a plain `List`; selection state is *not* automatically synchronized with `TestSummaryList`. The caller must call `PublishSelectedTestSummaryList()` to propagate changes. - `TestSummaryList_CollectionChanged` must be subscribed to `TestSummaryList.CollectionChanged` to maintain consistency between the full list and the selected list. - `IsSelected` on individual `ITestSummary` instances reflects UI selection state but is *not* the source of truth for `SelectedTestSummaryList`; the latter is the authoritative list of selected items. - `Parent` on `ITestSummary` must be non-null if the summary is part of a view model hierarchy (implied by `IBaseViewModel` inheritance). --- ### 4. Dependencies #### This module depends on: - `DTS.Common.Base` (for `IBaseView`, `IBaseViewModel`, `IBaseClass`) - `System.Collections.Generic`, `System.Collections.ObjectModel`, `System.Collections.Specialized` (for collection types) - `DTS.Common.Interface.TestDefinition` (for `ITestSummary`, `ITestGraphs`, `ITestChannel`, `ITestMetadata`) - `DTS.Common.Enums.Sensors` (for `CalibrationBehaviors` enum) #### This module is depended upon by: - Likely concrete implementations of `ITestSummaryListView` (e.g., WPF `UserControl` or `Window`) - View model implementations of `ITestSummaryListViewModel` (e.g., `TestSummaryListViewModel`) - Any module responsible for publishing or consuming selected test summaries (e.g., analysis or reporting modules) --- ### 5. Gotchas - `SelectedTestSummaryList` is a `List`, not `ObservableCollection`, meaning UI selection changes (e.g., via checkboxes) must manually update this list and call `PublishSelectedTestSummaryList()` to notify consumers. - `TestSummaryList_CollectionChanged` is exposed as a public method but not declared as an event handler in the interface; callers must manually wire it to `TestSummaryList.CollectionChanged`. - `IsSelected` on `ITestSummary` is a *view-level* property (likely bound to UI controls) but does not drive `SelectedTestSummaryList`; relying on it as the source of truth for selection will cause inconsistencies. - No documentation is provided for *when* `PublishSelectedTestSummaryList()` should be called (e.g., on selection change, on save, or manually). This behavior is implementation-specific. - The relationship between `FileDate` and `TimeStamp` is ambiguous (e.g., which is more reliable for sorting?); no guidance is given. - None of the `List` properties (`Graphs`, `Channels`, `CalculatedChannels`) are initialized in the interface; implementations must ensure non-null initialization to avoid `NullReferenceException`. - None identified from source alone.