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

7.4 KiB
Raw Permalink Blame History

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.CommonCore/Interface/DTS.Viewer/TestSummary/ITestSummaryListView.cs
Common/DTS.CommonCore/Interface/DTS.Viewer/TestSummary/ITestSummaryListViewModel.cs
Common/DTS.CommonCore/Interface/DTS.Viewer/TestSummary/ITestSummary.cs
2026-04-16T02:33:09.531156+00:00 Qwen/Qwen3-Coder-Next-FP8 1 b60d1a2f75a9d685

TestSummary

Documentation: Test Summary List Module

1. Purpose

This module defines the interface contracts for a Test Summary List view and its associated ViewModel in a test data visualization system. It enables the display, selection, and management of test summary items—each representing a test run with associated metadata, channels, and graphs—within a list-based UI (e.g., a grid or list view). The module serves as the abstraction layer between the UI (via ITestSummaryListView) and the data/logic layer (via ITestSummaryListViewModel), supporting selection tracking, dynamic list updates (via ObservableCollection), and publishing of selected items for downstream processing.


2. Public Interface

ITestSummaryListView

  • Inherits: IBaseView
  • Description: A marker interface representing the view component for the test summary list UI. It has no additional members beyond inheritance, implying the view implementation is expected to conform to the base view contract (e.g., binding context, lifecycle hooks) but does not expose further view-specific APIs in this interface.

ITestSummaryListViewModel

  • Inherits: IBaseViewModel

  • Properties:

    • ITestSummaryListView View { get; }
      Gets the associated Shell View instance (the concrete UI control bound to this ViewModel).
    • ObservableCollection<ITestSummary> TestSummaryList { get; set; }
      The primary collection of test summary items displayed in the list. Supports change notifications via ObservableCollection<T>.
    • List<ITestSummary> SelectedTestSummaryList { get; set; }
      A separate list tracking currently selected ITestSummary items (distinct from TestSummaryList). Not observable—changes must be explicitly managed.
  • Methods:

    • void PublishSelectedTestSummaryList()
      Triggers publication (e.g., event, message, or command) of the current SelectedTestSummaryList to other parts of the system (e.g., for analysis, export, or visualization).
    • void TestSummaryList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
      Handles CollectionChanged events from TestSummaryList (e.g., item added/removed/moved). Likely updates internal state (e.g., syncs selection, refreshes UI).

ITestSummary

  • Inherits: IBaseClass
  • Properties:
    • string Id { get; set; }
      Unique identifier for the test summary.
    • string SetupName { get; set; }
      Name of the test setup/configuration used.
    • string Description { get; set; }
      Human-readable description of the test.
    • int ChannelCount { get; set; }
      Number of raw channels in the test.
    • DateTime FileDate { get; set; }
      Date the test data file was created/modified.
    • DateTime TimeStamp { get; set; }
      Timestamp of the test run (possibly when started or completed).
    • string DataType { get; set; }
      Type/classification of the test data (e.g., "Vibration", "Temperature").
    • bool IsSelected { get; set; }
      Indicates whether this item is currently selected in the UI.
    • List<ITestGraphs> Graphs { get; set; }
      Collection of graph definitions associated with this test.
    • List<ITestChannel> Channels { get; set; }
      List of raw measurement channels.
    • List<ITestChannel> CalculatedChannels { get; set; }
      List of derived/calculated channels (e.g., computed from raw channels).
    • IBaseViewModel Parent { get; set; }
      Reference to the parent ViewModel (e.g., for navigation or context).
    • ITestMetadata TestMetadata { get; set; }
      Structured metadata (e.g., test conditions, operator, equipment).
    • CalibrationBehaviors CalibrationBehavior { get; set; }
      Enumerated calibration behavior flags (from DTS.Common.Enums.Sensors).

3. Invariants

  • TestSummaryList must be an ObservableCollection<ITestSummary>; direct replacement (e.g., assigning a List<T>) is allowed by the property setter but may require manual event subscription for change notifications.
  • SelectedTestSummaryList is a plain List<ITestSummary>—no automatic synchronization with TestSummaryList or IsSelected flags is implied. Updates to selection must be handled explicitly (e.g., via TestSummaryList_CollectionChanged).
  • ITestSummaryListViewModel.TestSummaryList_CollectionChanged is expected to be subscribed to TestSummaryList.CollectionChanged events; failure to do so may result in stale selection state.
  • IsSelected on an ITestSummary instance is not guaranteed to reflect its presence in SelectedTestSummaryList unless explicitly synchronized (e.g., in TestSummaryList_CollectionChanged).
  • Parent on ITestSummary must be non-null if the item is part of a ViewModel-managed list (as Parent is used for context).

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:

  • Concrete implementations of ITestSummaryListView (e.g., WPF UserControl or Window hosting the list).
  • Concrete implementations of ITestSummaryListViewModel (e.g., a ViewModel class managing test data display).
  • Any consumer of PublishSelectedTestSummaryList() (e.g., a command handler, event listener, or service that processes selected tests).
  • Code that constructs or manipulates ITestSummary instances (e.g., test data loaders, parsers).

5. Gotchas

  • Selection Synchronization Risk: SelectedTestSummaryList and IsSelected are not automatically kept in sync. Implementations must manually update both (e.g., in TestSummaryList_CollectionChanged) to avoid inconsistencies.
  • TestSummaryList_CollectionChanged is a method, not an event: It must be called explicitly (e.g., from TestSummaryList.CollectionChanged += viewModel.TestSummaryList_CollectionChanged). It is not an event handler itself.
  • TestSummaryList setter allows reassignment: Assigning a new ObservableCollection<ITestSummary> will require re-subscribing to its CollectionChanged event; the old collections subscription is lost.
  • IsSelected is a property on ITestSummary but not used in the interface contract: Its purpose is unclear without seeing implementations—likely used by the view for UI highlighting, but not enforced by the ViewModel interface.
  • No explicit ordering guarantees: TestSummaryList order is determined by the underlying ObservableCollection<T>; no sorting or ordering logic is defined in this interface.
  • CalibrationBehaviors enum usage: Its meaning and valid values are defined externally (DTS.Common.Enums.Sensors); behavior changes based on this property are not described here.

None identified beyond the above.