Files
DP44/enriched-partialglm/Common/DTS.CommonCore/Interface/DTS.Viewer/MainView.md

143 lines
7.3 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IMainView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IViewerMainView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IViewerMainViewGrid.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IMainViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IViewerMainViewModel.cs
generated_at: "2026-04-16T12:24:51.311433+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "95ec9f6198f586ac"
---
# Documentation: DTS.Common.Interface MainView Interfaces
## 1. Purpose
This module defines the core view and ViewModel interfaces for the main window of a DTS Viewer application. It establishes the contract for a modular, region-based UI layout using what appears to be a MVVM (Model-View-ViewModel) architecture. The interfaces support multiple UI regions (navigation, graphs, tests, legends, diagnostics, statistics, cursor, and property panels) and provide keyboard interaction handling, zoom control, and configuration management for a data visualization and analysis tool.
---
## 2. Public Interface
### View Interfaces
#### `IMainView`
```csharp
public interface IMainView : IBaseView { }
```
Marker interface for a main view component. Extends `IBaseView`. No members defined.
#### `IViewerMainView`
```csharp
public interface IViewerMainView : IBaseView { }
```
Marker interface for a viewer main view component. Extends `IBaseView`. No members defined.
#### `IViewerMainViewGrid`
```csharp
public interface IViewerMainViewGrid : IBaseView { }
```
Marker interface for a viewer main view grid component. Extends `IBaseView`. No members defined.
---
### ViewModel Interfaces
#### `IMainViewModel`
```csharp
public interface IMainViewModel : IBaseViewModel
```
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `View` | `IBaseView` | `get` | Gets the Main View instance |
| `ContextNavigationRegion` | `object` | `get; set` | Navigation region context |
| `ContextGraphRegion` | `object` | `get; set` | Graph region context |
| `ContextTestsRegion` | `object` | `get; set` | Tests region context |
| `ContextGraphsRegion` | `object` | `get; set` | Graphs region context |
| `ContextLegendRegion` | `object` | `get; set` | Legend region context |
| `ContextDiagRegion` | `object` | `get; set` | Diagnostics region context |
| `ContextStatsRegion` | `object` | `get; set` | Statistics region context |
| `ContextCursorRegion` | `object` | `get; set` | Cursor region context |
| `ContextPropertyRegion` | `object` | `get; set` | Property region context |
| `GetRegions()` | `List<FrameworkElement>` | method | Returns a list of all region FrameworkElements |
---
#### `IViewerMainViewModel`
```csharp
public interface IViewerMainViewModel : IBaseViewModel, ISelectedDataViewModel
```
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `View` | `IBaseView` | `get; set` | Gets or sets the Main View instance |
| `Standalone` | `bool` | `get; set` | Indicates if viewer is running in standalone mode |
| `ContextNavigationRegion` | `object` | `get; set` | Navigation region context |
| `ContextGraphRegion` | `object` | `get; set` | Graph region context |
| `ContextTestsRegion` | `object` | `get; set` | Tests region context |
| `ContextGraphsRegion` | `object` | `get; set` | Graphs region context |
| `ContextLegendRegion` | `object` | `get; set` | Legend region context |
| `ContextDiagRegion` | `object` | `get; set` | Diagnostics region context |
| `ContextStatsRegion` | `object` | `get; set` | Statistics region context |
| `ContextCursorRegion` | `object` | `get; set` | Cursor region context |
| `ContextPropertyRegion` | `object` | `get; set` | Property region context |
| `GetRegions()` | `List<FrameworkElement>` | method | Returns a list of all region FrameworkElements |
| `ConfigPath` | `string` | `get; set` | Path to configuration file |
| `DoesUserHaveEditPermission` | `bool` | `get; set` | User edit permission flag |
| `ZoomReset()` | `void` | method | Resets zoom to default state |
| `LeftKeyPress()` | `void` | method | Handles left arrow key press notification |
| `RightKeyPress()` | `void` | method | Handles right arrow key press notification |
| `ChannelCodeViewMode` | `Common.Enums.IsoViewMode` | `get; set` | Channel code view mode setting |
| `CalibrationBehaviorSetting` | `Common.Enums.Sensors.CalibrationBehaviors` | `get; set` | Calibration behavior configuration |
| `CalibrationBehaviorSettableInViewer` | `bool` | `get; set` | Whether calibration behavior can be set in viewer |
| `SettingsVisibility` | `Visibility` | `get` | Visibility state of settings UI |
---
## 3. Invariants
1. **Namespace Mismatch**: All interfaces are declared in namespace `DTS.Common.Interface` despite file paths suggesting `DTS.Viewer.MainView` sub-namespaces. The ReSharper disable comments indicate this is intentional.
2. **Region Context Types**: All `Context*Region` properties are typed as `object`, suggesting late binding or multiple possible region types. Implementations must handle assignment of appropriate region types.
3. **View Property Mutability**: `IMainViewModel.View` is read-only (`get`), while `IViewerMainViewModel.View` is read-write (`get; set`). Implementations must respect this difference.
4. **Inheritance Chain**:
- All view interfaces must implement `IBaseView`
- `IMainViewModel` must implement `IBaseViewModel`
- `IViewerMainViewModel` must implement both `IBaseViewModel` and `ISelectedDataViewModel`
5. **GetRegions() Contract**: Must return a non-null `List<FrameworkElement>` containing the UI regions.
---
## 4. Dependencies
### External Dependencies (Imports)
| Namespace | Usage |
|-----------|-------|
| `DTS.Common.Base` | `IBaseView`, `IBaseViewModel`, `ISelectedDataViewModel` base types |
| `System.Collections.Generic` | `List<T>` for `GetRegions()` return type |
| `System.Windows` | `FrameworkElement`, `Visibility` types |
| `Common.Enums` | `IsoViewMode` enum |
| `Common.Enums.Sensors` | `CalibrationBehaviors` enum |
### Downstream Dependencies
**Unclear from source alone** - These are interface definitions; concrete implementations and consumers are not present in the provided files.
---
## 5. Gotchas
1. **Namespace Inconsistency**: The file paths suggest namespaces like `DTS.Viewer.MainView`, but all interfaces are declared in `DTS.Common.Interface`. The `// ReSharper disable CheckNamespace` directives indicate this mismatch is known and suppressed. New developers should be aware that file location does not match declared namespace.
2. **View Property Asymmetry**: `IMainViewModel.View` is read-only while `IViewerMainViewModel.View` is read-write. This inconsistency could cause confusion when implementing or consuming these interfaces.
3. **Magic Object Types**: All region context properties use `object` type rather than specific region interfaces. The actual types expected/returned are unclear from the source alone.
4. **Duplicate Region Definitions**: Both `IMainViewModel` and `IViewerMainViewModel` define identical region properties. This suggests either parallel evolution or a design that could benefit from a shared base interface for region management.
5. **Partial Enum Paths**: The types `Common.Enums.IsoViewMode` and `Common.Enums.Sensors.CalibrationBehaviors` are referenced but their definitions are not provided, making their exact values and usage unclear from this source alone.