7.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:08:34.664134+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 652bfa5baf405103 |
MainView
Documentation: Main View Interfaces Module
1. Purpose
This module defines a set of interfaces that establish the contract for the main view and view model layers in the DTS Viewer application, specifically supporting distinct UI modes: general Main, Viewer, and Export contexts, each with optional grid-specific variants. These interfaces enforce a consistent separation of concerns between UI presentation (views) and business logic (view models), leveraging the IBaseView and IBaseViewModel base contracts. The module enables modular UI composition—particularly for regions like navigation, graphs, diagnostics, and statistics—while supporting viewer-specific functionality such as keyboard navigation, zoom control, and configuration-dependent permissions.
2. Public Interface
All interfaces reside in the DTS.Common.Interface namespace and inherit from IBaseView or IBaseViewModel.
View Interfaces
-
IMainView
Marker interface for the primary main view. InheritsIBaseView. No additional members. -
IViewerMainView
Marker interface for the viewer-specific main view. InheritsIBaseView. No additional members. -
IExportMainView
Marker interface for the export-specific main view. InheritsIBaseView. No additional members. -
IExportMainViewGrid
Marker interface for the export-specific grid view. InheritsIBaseView. No additional members. -
IViewerMainViewGrid
Marker interface for the viewer-specific grid view. InheritsIBaseView. No additional members.
ViewModel Interfaces
-
IMainViewModel
Base view model for the general main view.IBaseView View { get; }— Gets the associated main view.object ContextNavigationRegion { get; set; }object ContextGraphRegion { get; set; }object ContextTestsRegion { get; set; }object ContextGraphsRegion { get; set; }object ContextLegendRegion { get; set; }object ContextDiagRegion { get; set; }object ContextStatsRegion { get; set; }object ContextCursorRegion { get; set; }object ContextPropertyRegion { get; set; }
— All represent region containers (e.g., for MVVM region injection or binding).List<FrameworkElement> GetRegions();— Returns a list of all region UI elements.
-
IViewerMainViewModel
View model for the viewer-specific main view. ExtendsIMainViewModelviaIBaseViewModelandISelectedDataViewModel.IBaseView View { get; set; }— Gets or sets the associated viewer main view.- All
Context*Regionproperties fromIMainViewModel. List<FrameworkElement> GetRegions();— Same semantics as above.string ConfigPath { get; set; }— Path to the viewer configuration file.bool DoesUserHaveEditPermission { get; set; }— Indicates whether the current user has edit permissions.void ZoomReset();— Resets zoom level to default.void LeftKeyPress();— Handles left arrow key press (e.g., step backward in time/data).void RightKeyPress();— Handles right arrow key press (e.g., step forward in time/data).Common.Enums.IsoViewMode ChannelCodeViewMode { get; set; }— Controls how channel codes are displayed (e.g., ISO view mode).Common.Enums.Sensors.CalibrationBehaviors CalibrationBehaviorSetting { get; set; }— Sets calibration behavior (e.g., auto, manual, off).bool CalibrationBehaviorSettableInViewer { get; set; }— Indicates if calibration behavior can be changed in the viewer UI.Visibility SettingsVisibility { get; }— Controls visibility of settings UI (read-only).
3. Invariants
- All view interfaces (
IMainView,IViewerMainView, etc.) are marker interfaces—they carry no behavioral contract beyond type identity and inheritance fromIBaseView. - All view model interfaces inherit from
IBaseViewModel, implying they must implement at least the base view model contract (e.g.,IBaseViewModellikely includesIBaseView View { get; }or similar). - The
IMainViewModelinterface enforces that all region properties (Context*Region) must be settable and gettable, andGetRegions()must return a non-null list ofFrameworkElements. - In
IViewerMainViewModel, theViewproperty is read-write (unlikeIMainViewModelwhere it is read-only), allowing dynamic view assignment or swapping. IViewerMainViewModelextendsISelectedDataViewModel, implying it must also satisfy that interface’s contract (e.g., handling selected data state), though its members are not shown here.- Region properties (
Context*Region) are typed asobject, indicating they are likely injected at runtime (e.g., via Prism regions or custom region managers), but their exact contract is not defined in this module.
4. Dependencies
Dependencies of this module:
DTS.Common.Base— ProvidesIBaseViewandIBaseViewModel, and likelyISelectedDataViewModel.System.Collections.Generic— ForList<T>.System.Windows— ForFrameworkElementandVisibility.
Dependencies on this module:
- Any module implementing or consuming main views/view models (e.g., UI shell modules, region controllers, or viewer/export modules) will depend on these interfaces.
- Likely used by modules implementing:
- View composition (e.g., Prism-based region navigation).
- Viewer-specific logic (e.g., time-series playback, zoom, keyboard handling).
- Export workflows (e.g., grid export, report generation).
ISelectedDataViewModel(fromDTS.Common.Base) is required forIViewerMainViewModel, so any consumer must also reference that base module.
5. Gotchas
- Ambiguous region semantics: All
Context*Regionproperties are typed asobject. Their expected runtime type (e.g.,RegionManager,FrameworkElement, or custom container) is not documented here—implementation details are required to avoid misuse. - Redundant view interfaces: The presence of
IMainView,IViewerMainView,IExportMainView, and their grid variants suggests a design where UI behavior is differentiated only by type, not by shared interface members. This may indicate over-fragmentation or lack of behavioral differentiation in the interface layer. - Missing documentation for inherited interfaces:
ISelectedDataViewModel(implemented byIViewerMainViewModel) is referenced but not defined in this module—its contract is unknown. GetRegions()behavior: The method returnsList<FrameworkElement>, but it is unclear whether this list is mutable, cached, or dynamically computed. Implementation may vary.SettingsVisibilityis read-only: Its value is computed (likely based on permissions or config), but no setter or documentation is provided—consumers cannot programmatically toggle settings visibility.- No versioning or deprecation markers: Interfaces like
IExportMainViewGridsuggest a grid-specific export view, but no guidance is given on whether this is deprecated or superseded by other patterns.
None identified beyond the above.