9.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:00:55.719180+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 833fa0763e07cd73 |
Viewer Interface Module Documentation
1. Purpose
This module defines the core view and view model interfaces for the DTS Viewer application’s UI layer. It establishes a contract-based architecture—following the MVVM pattern—where each interface represents a distinct UI component (e.g., tabs, panels, views, modules) and enforces a consistent relationship between view models and their corresponding views via strongly-typed View properties. The interfaces are intentionally minimal and declarative, serving as abstraction boundaries to decouple UI presentation logic from implementation details, enabling modular development and testability. The module is part of the DTS.Common.Interface namespace and relies on DTS.Common.Base for base contracts (IBaseView, IBaseViewModel) and Prism.Modularity for module lifecycle management.
2. Public Interface
View Interfaces (all inherit IBaseView)
ITabView– Marker interface for tab container views.IDiagView– Marker interface for diagnostic views.ITestsView– Marker interface for tests views.IStatsView– Marker interface for statistics views.ICursorView– Marker interface for cursor control views.IViewerView– Marker interface for main viewer content views.ITabItemView– Marker interface for individual tab item views.IPropertyView– Marker interface for property display/edit views.IGraphPropertyView– Marker interface for graph-specific property views.IDockPanelVerticalView– Marker interface for vertically docked panel views.IDockPanelHorizontalView– Marker interface for horizontally docked panel views.IViewerShellView– Marker interface for the main shell/container view.IMainLiteView– ExtendsIBaseView; defines named UI regions (MainShell,MainRegion,NavigationRegion,HorizontalTabRegion,VerticalTabRegion) asStackPanel/ContentControlelements.IMainViewerView– ExtendsIBaseView; currently has no additional members (commented-out region properties suggest future or legacy use).
View Model Interfaces (all inherit IBaseViewModel)
ITabViewModel– ProvidesITabView View { get; }.IDiagViewModel– ProvidesIDiagView View { get; }.ITestsViewModel– ProvidesITestsView View { get; }.IStatsViewModel– ProvidesIStatsView View { get; }.ICursorViewModel– ProvidesICursorView View { get; }.IViewerViewModel– ProvidesIViewerView View { get; }.IPropertyViewModel– ProvidesIPropertyView View { get; }.IGraphPropertyViewModel– ProvidesIGraphPropertyView View { get; }.IDockPanelVerticalViewModel– ProvidesIDockPanelVerticalView View { get; }.IDockPanelHorizontalViewModel– ProvidesIDockPanelHorizontalView View { get; }.ITabItemViewModel– ProvidesITabItemView View { get; }andITabViewModel Parent { get; }.IViewerShellViewModel– ProvidesIViewerShellView View { get; },List<FrameworkElement> GetRegions(), andobject ContextMainRegion { get; set; }.IMainViewerViewModel– ProvidesIBaseView View { get; },object Context*Region { get; set; }for four named regions, andList<FrameworkElement> GetRegions().IMainLiteViewModel– ProvidesIMainView View { get; }(note:IMainViewis not defined in this file),object Context*Region { get; set; }for four named regions, andList<FrameworkElement> GetRegions().ISelectedDataViewModel– Manages selected data context:string SelectedDataFolder { get; set; }string SelectedDataFile { get; set; }void SelectAndIncludeDataFile(string file)— SetsSelectedDataFileand includes it as a selected test (comment references bug #16158).
Delegate
SetReadCalcProgressValueDelegate– Signature:void(string message = "", double value = -1D)— Used to report progress for read/calculation operations.
Module Interfaces (all implement Prism.Modularity.IModule)
IExportModule–void StartSession(); bool SessionStarted { get; }IViewerModule–void StartSession(); bool SessionStarted { get; }IPSDReportModule–void StartSession(); bool SessionStarted { get; }
(All modules share identical lifecycle contracts: start session, track session state.)
3. Invariants
- View-ViewModel Pairing: Every view model interface (
*ViewModel) declares a read-onlyViewproperty whose type is the corresponding view interface (*View). - Hierarchical View Models:
ITabItemViewModelmust have aParentof typeITabViewModel. - Region Context Management:
IMainViewerViewModel,IMainLiteViewModel, andIViewerShellViewModelexposeContext*Regionproperties for four named regions (MainRegion,NavigationRegion,HorizontalTabRegion,VerticalTabRegion), implying these regions are expected to be set/updated at runtime. - Module Lifecycle: All module interfaces (
IExportModule,IViewerModule,IPSDReportModule) require explicitStartSession()invocation and expose aSessionStartedstate flag. - Base Contracts: All interfaces inherit from
IBaseView(for views) orIBaseViewModel(for view models), enforcing a common base contract (not detailed here).
4. Dependencies
- Internal Dependencies:
DTS.Common.Base(providesIBaseView,IBaseViewModel)Prism.Modularity(forIModuleinterface, used in module interfaces)
- External Dependencies:
System.Windows(used inIMainLiteViewModel,IMainViewerViewModel,IViewerShellViewModelforFrameworkElement,StackPanel,ContentControl)
- Depended Upon:
- This module is a contract layer—other modules (e.g., UI implementations, module plugins) depend on these interfaces to implement views, view models, and Prism modules.
ISelectedDataViewModelis likely consumed by data browsing/selection components.SetReadCalcProgressValueDelegateis likely used by background computation modules.
5. Gotchas
- Missing
IMainView:IMainLiteViewModelreferencesIMainView View { get; }, butIMainViewis not defined in this file (or any provided file). This is a critical dependency gap. - Redundant Module Interfaces:
IExportModule,IViewerModule, andIPSDReportModulehave identical signatures—consider if a single shared interface would suffice or if future divergence is intended. IMainViewerViewis Empty: Its region properties are commented out, suggesting incomplete or deprecated functionality.IViewerViewModelDocumentation Error: ItsViewproperty summary says “Gets the Tests View” but the type isIViewerView, notITestsView. Likely a copy-paste error in XML comments.ISelectedDataViewModel.SelectAndIncludeDataFileBehavior: The method setsSelectedDataFileand includes it as a selected test—this dual responsibility is non-obvious from the name alone.- No Validation Rules: None of the interfaces enforce validation (e.g.,
SelectedDataFilemust be non-null/non-empty), leaving this to implementations. - Delegate Default Values:
SetReadCalcProgressValueDelegateusesmessage = ""andvalue = -1Das defaults; callers should interpret-1Das “no progress update” or “indeterminate.” - No Inheritance Between View Interfaces: Despite naming (e.g.,
ITabView,ITabItemView), there is no inheritance hierarchy among view interfaces—each is independent.