Files

147 lines
10 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDiagView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITestsView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IStatsView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ICursorView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabItemView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IPropertyView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerShellView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IGraphPropertyView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelVerticalView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelHorizontalView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/GroupChannelReadCalcDelegate.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDiagViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IStatsViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ICursorViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITestsViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IPropertyViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerModule.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IPSDReportModule .cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IGraphPropertyViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelVerticalViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelHorizontalViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabItemViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerShellViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainLiteView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainViewerView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ISelectedDataViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainLiteViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainViewModel.cs
generated_at: "2026-04-16T02:21:13.869650+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "fed47436f7c090f0"
---
# DTS.Viewer
## Documentation: Viewer Interface Module (`DTS.Common.Interface` Viewer Subspace)
---
### 1. **Purpose**
This module defines a set of interfaces that collectively establish the contract for the *view layer* of the DTS Viewer application, following a MVVM (Model-View-ViewModel) pattern. It provides strongly-typed abstractions for UI components (e.g., tabs, panels, properties, diagnostics, statistics), their corresponding view models, and shell-level hosting structures. These interfaces serve as the foundational abstraction layer between UI implementation (e.g., WPF views) and business logic (view models and modules), enabling modular composition, testability, and decoupled development. The interfaces are grouped into *view* and *view model* pairs (e.g., `ITabView`/`ITabViewModel`) and are used by Prism-based modules (`IViewerModule`, `IPSDReportModule`) to manage application lifecycle and region context.
---
### 2. **Public Interface**
#### **View Interfaces (all inherit `IBaseView`)**
| Interface | Description |
|-----------|-------------|
| `ITabView` | Represents a tab container view. |
| `IDiagView` | Represents a diagnostics view. |
| `ITestsView` | Represents a tests view. |
| `IStatsView` | Represents a statistics view. |
| `ICursorView` | Represents a cursor view (likely for time/frequency cursor markers). |
| `IViewerView` | Represents the main viewer view (note: `IViewerViewModel` incorrectly documents its view as `ITestsView` in summary; actual property is `IViewerView`). |
| `ITabItemView` | Represents an individual tab item within a tab container. |
| `IPropertyView` | Represents a property display/edit view. |
| `IViewerShellView` | Represents the top-level shell/container view for the viewer application. |
| `IGraphPropertyView` | Represents a graph-specific property view. |
| `IDockPanelVerticalView` | Represents a vertically-oriented dock panel view. |
| `IDockPanelHorizontalView` | Represents a horizontally-oriented dock panel view. |
| `IMainLiteView` | Extends `IBaseView` and exposes named WPF regions (`MainShell`, `MainRegion`, `NavigationRegion`, `HorizontalTabRegion`, `VerticalTabRegion`) for layout composition. |
| `IMainViewerView` | Extends `IBaseView`; currently has no members (commented-out region properties suggest possible future or legacy use). |
#### **ViewModel Interfaces (all inherit `IBaseViewModel`)**
| Interface | Description |
|-----------|-------------|
| `ITabViewModel` | ViewModel for `ITabView`; exposes `View` property of type `ITabView`. |
| `IDiagViewModel` | ViewModel for `IDiagView`; exposes `View` property of type `IDiagView`. |
| `ITestsViewModel` | ViewModel for `ITestsView`; exposes `View` property of type `ITestsView`. |
| `IStatsViewModel` | ViewModel for `IStatsView`; exposes `View` property of type `IStatsView`. |
| `ICursorViewModel` | ViewModel for `ICursorView`; exposes `View` property of type `ICursorView`. |
| `IViewerViewModel` | ViewModel for `IViewerView`; exposes `View` property of type `IViewerView`. |
| `IPropertyViewModel` | ViewModel for `IPropertyView`; exposes `View` property of type `IPropertyView`. |
| `IGraphPropertyViewModel` | ViewModel for `IGraphPropertyView`; exposes `View` property of type `IGraphPropertyView`. |
| `IDockPanelVerticalViewModel` | ViewModel for `IDockPanelVerticalView`; exposes `View` property of type `IDockPanelVerticalView`. |
| `IDockPanelHorizontalViewModel` | ViewModel for `IDockPanelHorizontalView`; exposes `View` property of type `IDockPanelHorizontalView`. |
| `ITabItemViewModel` | ViewModel for `ITabItemView`; exposes `View` (`ITabItemView`) and `Parent` (`ITabViewModel`). |
| `IViewerShellViewModel` | ViewModel for `IViewerShellView`; exposes `View`, `ContextMainRegion`, and `GetRegions()` (returns `List<FrameworkElement>`). |
| `IMainLiteViewModel` | ViewModel for `IMainView` (note: interface declares `IMainView`, but no `IMainView` interface is defined in this file set); exposes `View`, region contexts (`ContextMainRegion`, etc.), and `GetRegions()`. |
| `IMainViewerViewModel` | ViewModel for `IBaseView`; exposes `View`, region contexts, and `GetRegions()`. |
| `ISelectedDataViewModel` | Manages selected data file/folder state; exposes `SelectedDataFolder`, `SelectedDataFile`, and `SelectAndIncludeDataFile(string file)`. |
#### **Delegate**
| Delegate | Signature | Description |
|----------|-----------|-------------|
| `SetReadCalcProgressValueDelegate` | `delegate void(string message = "", double value = -1D)` | Used to report progress during read/calculation operations. |
#### **Module Interfaces (Prism `IModule`)**
| Interface | Description |
|-----------|-------------|
| `IViewerModule` | Extends `IModule`; defines `StartSession(bool standalone, string pluginFolder = "")` for initializing the viewer module. |
| `IPSDReportModule` | Extends `IModule`; defines `StartSession(bool standalone, string pluginFolder = "")` for initializing the PSD report module. |
---
### 3. **Invariants**
- **All view interfaces inherit `IBaseView`** — implies a common base contract for UI components (though `IBaseView` itself is not defined here).
- **All view model interfaces inherit `IBaseViewModel`** — implies a common base contract for view models.
- **Each `IXXXViewModel` interface exposes a read-only `View` property of type `IXXXView`** — enforcing a strict one-to-one pairing between view and view model.
- **`ITabItemViewModel` is the only interface with a non-`View` property (`Parent: ITabViewModel`)** — indicating hierarchical containment.
- **Region context properties (`ContextMainRegion`, `ContextNavigationRegion`, etc.) are of type `object`** — allowing flexible assignment of arbitrary view instances or data contexts.
- **`GetRegions()` returns `List<FrameworkElement>`** — used to register or query WPF UI regions (e.g., for Prism region management).
- **`ISelectedDataViewModel` is *not* tied to a view/view model pair** — it is a standalone interface for data selection state, likely consumed by multiple view models.
---
### 4. **Dependencies**
#### **Internal Dependencies**
- **`DTS.Common.Base`**: All interfaces depend on `IBaseView` and `IBaseViewModel` (defined elsewhere in `DTS.Common.Base`).
- **`Microsoft.Practices.Prism.Modularity`**: `IViewerModule` and `IPSDReportModule` depend on Prisms `IModule` interface.
#### **External Dependencies**
- **WPF (`System.Windows`, `System.Windows.Controls`)**: Used in `IMainLiteView`, `IMainViewerView`, `IViewerShellViewModel`, `IMainLiteViewModel`, and `IMainViewerViewModel` via `FrameworkElement`, `StackPanel`, `ContentControl`.
#### **Consumers (Inferred)**
- **Prism-based modules** (`IViewerModule`, `IPSDReportModule`) likely implement these interfaces to register views and view models with the shell.
- **View implementations** (e.g., WPF `UserControl`s) will implement the `I*View` interfaces.
- **ViewModel implementations** will implement the `I*ViewModel` interfaces and bind to their corresponding views.
- **`ISelectedDataViewModel`** is likely injected into or consumed by multiple view models (e.g., `ITestsViewModel`, `IViewerViewModel`) to manage data selection state.
---
### 5. **Gotchas**
- **`IViewerViewModel` summary comment is misleading**: The XML doc says `/// Gets the Tests View.`, but the property is `IViewerView View { get; }`. This is likely a copy-paste error in documentation.
- **`IMainLiteViewModel` references `IMainView`**, but no `IMainView` interface is defined in this file set — only `IMainLiteView` and `IMainViewerView` exist. This may indicate an incomplete or missing interface definition.
- **`IMainViewerView` has no members**: Its region properties are commented out, suggesting it may be a placeholder or legacy artifact.
- **No explicit validation or ordering guarantees**: Interfaces define *what* is exposed, not *how* or *when* (e.g., no guarantees about `SelectAndIncludeDataFile` atomicity or thread-safety).
- **Delegate `SetReadCalcProgressValueDelegate` has no documented usage context**: Its purpose is clear (progress reporting), but its integration point (e.g., which view model exposes it) is not specified here.
- **No `using` directives for `System.Collections.Generic` or `System.Windows` in some files** — implies reliance on global aliases or implicit usings (e.g., via `DTS.Common.Base`), but this is not visible in the source.
None identified beyond the above.