Files
DP44/docs/ai/DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/ViewModel.md

60 lines
3.9 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/ViewModel/PSDReportMainViewModel.cs
generated_at: "2026-04-17T15:59:14.887503+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a4bc49aeb12b2337"
---
# PSDReportMainViewModel Documentation
## 1. Purpose
`PSDReportMainViewModel` serves as the primary view model coordinator for the PSD (Power Spectral Density) Report module within the DTS Viewer application. It manages navigation regions, orchestrates view loading, handles user interaction requests, and coordinates event-driven communication between child views (graphs, tests, charts, settings, and data selection components). This class acts as the central hub binding the PSD report UI regions to their respective views and view models.
---
## 2. Public Interface
### Constructor
```csharp
public PSDReportMainViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
Initializes the view model with Prism/Unity infrastructure. Resolves `IPSDReportMainViewGrid` from the container and sets itself as the DataContext.
### Properties
| Property | Type | Description |
|----------|------|-------------|
| `View` | `IBaseView` | Gets/sets the associated view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | Interaction request for displaying notifications. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Interaction request for displaying confirmations. |
| `ContextNavigationRegion` | `object` | Wraps `NavigationRegion.Content` from the view. |
| `ContextGraphsRegion` | `object` | Wraps `GraphListRegion.Content` from the view. |
| `ContextGraphListRegion` | `object` | Wraps `GraphListRegion.Content` from the view. |
| `ContextTestsRegion` | `object` | Wraps `TestsRegion.Content` from the view. |
| `ContextLegendRegion` | `object` | Wraps `LegendRegion.Content` from the view. |
| `ContextPropertyRegion` | `object` | Standalone property (no backing view region referenced). |
| `ContextChartOptionsRegion` | `object` | Wraps `ChartOptionsRegion.Content` from the view. |
| `ContextViewerSettingsRegion` | `object` | Wraps `SettingsRegion.Content` from the view. |
| `ContextReportDataSelectRegion` | `object` | Wraps `DataSelectRegion.Content` from the view. |
| `ContextGraphRegion` | `object` | Wraps `GraphRegion.Content` from the view. |
| `ContextReportChartOptionsRegion` | `object` | Wraps `ReportChartOptionsRegion.Content` from the view. |
| `ContextReportResultsRegion` | `object` | Wraps `ReportResultsRegion.Content` from the view. |
| `ConfigPath` | `string` | **Throws `NotImplementedException`** on get/set. |
| `TitleTests` | `string` | Display title for tests section. |
| `TotalSelectedTests` | `int` | Count of selected tests; updates `TitleTests` on set. |
| `TotalLoadedTests` | `int` | Count of loaded tests; updates `TitleTests` on set. |
| `TitleGraphs` | `string` | Display title for graphs section. |
| `TotalSelectedGraphs` | `int` | Count of selected graphs; updates `TitleGraphs` on set. |
| `TotalLoadedGraphs` | `int` | Count of loaded graphs; updates `TitleGraphs` on set. |
| `SelectedDataFolder` | `string` | Publishes `DataFolderChangedEvent` when set (ignores null/empty). |
| `SelectedDataFile` | `string` | Publishes `DataFolderChangedEvent` when set (ignores null/empty). |
| `DoesUserHaveEditPermission` | `bool` | Permission flag (default: `false`). |
| `ChannelCodeViewMode` | `IsoViewMode` | Publishes `ChannelCodesViewChangedEvent` on change. |
| `CalibrationBehaviorSetting` | `CalibrationBehaviors` | Publishes `CalibrationBehaviorSettingChangedEvent` on change. |
| `CalibrationBehaviorSettableInViewer` | `bool` | Controls tab selection and publishes `CalibrationBehaviorSettableInViewerChangedEvent`. |
| `SettingsVisibility` | `Visibility` | Controls settings visibility (default: `Visible`). |
| `IsBusy` | `bool` | Controls busy indicator display. |
| `IsBusyMessage` | `string` | Message displayed during