--- source_files: - DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/View/PSDReportSettingsView.xaml.cs generated_at: "2026-04-16T11:00:59.568454+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "5b2351e33ed49693" --- # Documentation: PSDReportSettingsView ## 1. Purpose `PSDReportSettingsView` is a WPF view component that provides the user interface for configuring Power Spectral Density (PSD) report settings within the DTS Viewer application. It implements `IPSDReportSettingsView` and serves as the presentation layer for report configuration, exposing selectable options for spectral analysis parameters such as FFT window widths. ## 2. Public Interface | Member | Signature | Description | |--------|-----------|-------------| | Constructor | `public PSDReportSettingsView()` | Initializes the view by calling `InitializeComponent()`, which loads the associated XAML layout. | | Property | `public List AvailableWindowWidths` | Returns a new list containing valid FFT window size options: `{ 512, 1024, 2048, 4096, 8192 }`. Each access creates a new list instance. | **Implemented Interface:** - `IPSDReportSettingsView` (from `DTS.Common.Interface`) ## 3. Invariants - **Window width values are fixed**: The `AvailableWindowWidths` property always returns the same five integer values (512, 1024, 2048, 4096, 8192), representing power-of-two FFT sizes. - **New instance per access**: `AvailableWindowWidths` creates and returns a new `List` on every property getter invocation; it does not cache the collection. - **XAML initialization required**: The constructor must call `InitializeComponent()` before the view can be used, as this is a code-behind for a XAML file. ## 4. Dependencies **This module depends on:** - `DTS.Common.Interface` — Provides the `IPSDReportSettingsView` interface that this class implements. - `System.Collections.Generic` — Provides `List` for the window widths collection. - `Xceed.Wpf.Toolkit.PropertyGrid.Attributes` — Imported but **not used** in the visible source code. - The corresponding XAML file (`PSDReportSettingsView.xaml`) — Paired via WPF partial class mechanism. **What depends on this module:** - Unclear from source alone. Consumers would reference this view through the `IPSDReportSettingsView` interface, likely a presenter or view model following a MVP/MVVM pattern. ## 5. Gotchas - **Unused import**: The `Xceed.Wpf.Toolkit.PropertyGrid.Attributes` namespace is imported but no attributes or types from it are used in the visible code. This may be dead code or intended for future use. - **Commented-out members**: Three properties (`AvailablePassFilterTypes`, `AvailableWindowAveragingTypes`, `AvailableWindowTypes`) and their backing fields are fully commented out. These referenced `IItemsSource` and enum item source classes from `DTS.Common.Enums.Viewer.Reports`. This suggests either: - Incomplete refactoring - Features moved elsewhere - Work-in-progress that was disabled - **Allocation on every access**: The `AvailableWindowWidths` property allocates a new `List` on every call. If accessed frequently (e.g., in UI binding update loops), this could cause unnecessary garbage collection pressure. Consider caching if performance becomes an issue. - **Interface contract unclear**: The `IPSDReportSettingsView` interface definition is not provided, so the expected contract beyond what's implemented here is unknown.