--- source_files: - DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/View/PSDReportSettingsView.xaml.cs generated_at: "2026-04-17T16:45:20.395453+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "6db79cd084924166" --- # Documentation: PSDReportSettingsView ## 1. Purpose `PSDReportSettingsView` is a WPF view component that provides the user interface for configuring PSD (Power Spectral Density) report settings. It implements the `IPSDReportSettingsView` interface and serves as the visual layer for users to select parameters such as window widths for spectral analysis. This view is part of the DTS Viewer reporting subsystem. ## 2. Public Interface ### `PSDReportSettingsView()` (Constructor) **Signature:** `public PSDReportSettingsView()` Initializes the view component by calling `InitializeComponent()`, which loads the associated XAML layout. ### `AvailableWindowWidths` (Property) **Signature:** `public List AvailableWindowWidths { get; }` Returns a hardcoded list of valid FFT window width options: `{ 512, 1024, 2048, 4096, 8196 }`. These values represent the sample counts available for windowing operations in PSD analysis. ## 3. Invariants - The `AvailableWindowWidths` property always returns a new `List` instance containing exactly five integer values: 512, 1024, 2048, 4096, and 8192. - The view must be constructed on the UI thread due to the `InitializeComponent()` call. - The class implements `IPSDReportSettingsView`, implying it is intended to be consumed through that interface by a presenter or view model. ## 4. Dependencies ### This module depends on: - `DTS.Common.Interface` - Provides the `IPSDReportSettingsView` interface that this class implements - `Xceed.Wpf.Toolkit.PropertyGrid.Attributes` - Imported but **not used** in the visible source - `System.Collections.Generic` - Provides `List` for the `AvailableWindowWidths` property ### What depends on this module: - Cannot be determined from source alone. Consumers would reference this view through the `IPSDReportSettingsView` interface. ## 5. Gotchas - **Unused import:** The `Xceed.Wpf.Toolkit.PropertyGrid.Attributes` namespace is imported but has no visible usage in the current code. This may indicate leftover references from removed functionality. - **Commented-out code:** Three properties (`AvailablePassFilterTypes`, `AvailableWindowAveragingTypes`, `AvailableWindowTypes`) are fully commented out, suggesting this view previously exposed more configuration options. The commented code references types `DTS.Common.Enums.Viewer.Reports.PassFilterTypeEnumItemSource`, `WindowAveragingTypeEnumItemSource`, and `WindowTypeEnumItemSource` that may still exist in the codebase. - **New list instance per call:** `AvailableWindowWidths` creates and returns a new `List` on every property access rather than returning a cached or static instance. This is inefficient if called frequently.