This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/Model/PSDReportSettingsModel.cs
generated_at: "2026-04-16T13:39:22.438752+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b9213b8d6a0e210e"
---
# Documentation: PSDReportSettingsModel
## 1. Purpose
`PSDReportSettingsModel` is a data model class that encapsulates configuration settings for Power Spectral Density (PSD) report generation. It stores filter parameters (low-pass and high-pass), windowing configuration, and data range settings. The class implements `INotifyPropertyChanged` via `BasePropertyChanged` to support MVVM data binding and notifies a parent view model of changes through the `IPSDReportSettingsModel` interface.
---
## 2. Public Interface
### Properties
| Property | Type | Default Value | Description |
|----------|------|---------------|-------------|
| `Parent` | `IPSDReportSettingsViewModel` | `null` | Reference to the parent view model. Setter includes equality check to avoid redundant assignments. |
| `CanPublishChanges` | `bool` | `true` | Controls whether property changes trigger `Parent.PublishChanges()` notification. |
| `LowPassFilterEnabled` | `bool` | `false` | Enables/disables low-pass filter. Setting this sets `ReadData = true`. |
| `LowPassFilterFrequency` | `double` | `2000` | Low-pass filter cutoff frequency in Hz. |
| `LowPassFilterType` | `PassFilterType` | `PassFilterType.Butterworth` | Type of low-pass filter algorithm. |
| `LowPassFilterOrder` | `int` | `8` | Order of the low-pass filter. |
| `HighPassFilterEnabled` | `bool` | `false` | Enables/disables high-pass filter. |
| `HighPassFilterFrequency` | `double` | `5` | High-pass filter cutoff frequency in Hz. |
| `HighPassFilterType` | `PassFilterType` | `PassFilterType.Butterworth` | Type of high-pass filter algorithm. |
| `HighPassFilterOrder` | `int` | `8` | Order of the high-pass filter. |
| `WindowWidth` | `WindowWidth` | `WindowWidth.FortyNinetySix` | Width of the analysis window. |
| `WindowType` | `WindowType` | `WindowType.Hanning` | Window function type for spectral analysis. |
| `WindowAveragingType` | `WindowAveragingType` | `WindowAveragingType.Averaging` | Averaging method for window processing. |
| `WindowOverlappingPercent` | `double` | `50` | Percentage of overlap between consecutive windows. |
| `ShowEnvelope` | `bool` | `false` | Controls whether envelope is displayed. |
| `IsSaved` | `bool` | *(unclear)* | Read-only property. Initialization/setter not visible in source. |
| `ReadData` | `bool` | `false` | Flag indicating data should be re-read. |
| `DataStart` | `double` | `0D` | Start position for data range. |
| `DataEnd` | `double` | `0D` | End position for data range. |
### Methods
| Method | Signature | Description |
|--------|-----------|-------------|
| `OnPropertyChanged` | `override void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event and conditionally calls `Parent.PublishChanges()` unless the property is `CanPublishChanges`, `Parent`, or `ReadData`. |
### Events
| Event | Type | Description |
|-------|------|-------------|
| `PropertyChanged` | `PropertyChangedEventHandler` | Override of base event; raised when any property value changes. |
---
## 3. Invariants
1. **Change Notification Behavior**: All property changes except `CanPublishChanges`, `Parent`, and `ReadData` will call `Parent?.PublishChanges()` if `CanPublishChanges` is `true`.
2. **ReadData Side Effect**: Setting any of the following properties automatically sets `ReadData = true` before the property value is updated:
- `LowPassFilterEnabled`, `LowPassFilterFrequency`, `LowPassFilterType`, `LowPassFilterOrder`
- `HighPassFilterEnabled`, `HighPassFilterFrequency`, `HighPassFilterType`, `HighPassFilterOrder`
- `WindowWidth`, `WindowType`, `WindowAveragingType`, `WindowOverlappingPercent`, `ShowEnvelope`
- `DataStart`, `DataEnd`
3. **Parent Assignment Guard**: The `Parent` setter will not raise `OnPropertyChanged` if `_parent != null && _parent.Equals(value)` is true.
4. **CanPublishChanges Default**: Initialized to `true`, meaning change notifications are published by default.
---
## 4. Dependencies
### This Module Depends On
- `DTS.Common.Enums.Viewer.Reports` — Provides `PassFilterType`, `WindowWidth`, `WindowType`, `WindowAveragingType` enums
- `DTS.Common.Interface` — Provides `IPSDReportSettingsModel` and `IPSDReportSettingsViewModel` interfaces
- `Common.Base.BasePropertyChanged` — Base class providing `SetProperty` method and `INotifyPropertyChanged` infrastructure (namespace not fully qualified in source)
### Consumers
- Any module referencing `IPSDReportSettingsModel` (exact consumers not determinable from this source alone)
---
## 5. Gotchas
1. **IsSaved Property Has No Visible Setter**: The `IsSaved` property has only a getter defined with no backing field or initializer visible. Its value source is unclear from this source alone—it may be computed elsewhere or require partial class definition.
2. **Parent Setter Equality Logic**: The condition `if (_parent != null && _parent.Equals(value))` means:
- If `_parent` is `null`, the assignment proceeds even if `value` is also `null`
- This differs from typical null-coalescing patterns and may result in redundant `OnPropertyChanged` calls when setting `Parent` to `null` multiple times
3. **ReadData Set Before SetProperty**: For filter and window properties, `ReadData = true` is set *before* calling `SetProperty`. This means `ReadData` will be `true` by the time `OnPropertyChanged` fires for the original property, which could affect any listeners checking `ReadData` during change notification.
4. **CanPublishChanges Does Not Set ReadData**: Unlike other boolean flags like `LowPassFilterEnabled`, setting `CanPublishChanges` does not set `ReadData = true`. This is intentional but inconsistent with other property behaviors.

View File

@@ -0,0 +1,57 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T13:38:42.196012+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "86a096c3d5cd87e0"
---
# Documentation: DTS.Viewer.PSDReportSettings Assembly Configuration
## 1. Purpose
This file provides assembly-level metadata for the `DTS.Viewer.PSDReportSettings` component within the DTS Viewer application. It exists to embed standard .NET assembly attributes—such as version information, copyright, COM visibility settings, and a unique identifier—into the compiled output. This is a boilerplate configuration file typically auto-generated by the .NET Framework project template and does not contain executable logic.
## 2. Public Interface
This file does not expose any public functions, classes, or methods. It exclusively defines assembly-level attributes via the `assembly` directive.
**Defined Assembly Attributes:**
| Attribute | Value |
|-----------|-------|
| `AssemblyTitle` | `"DTS.Viewer.PSDReportSettings"` |
| `AssemblyDescription` | `""` (empty) |
| `AssemblyConfiguration` | `""` (empty) |
| `AssemblyCompany` | `""` (empty) |
| `AssemblyProduct` | `"DTS.Viewer.PSDReportSettings"` |
| `AssemblyCopyright` | `"Copyright © 2021"` |
| `AssemblyTrademark` | `""` (empty) |
| `AssemblyCulture` | `""` (empty) |
| `ComVisible` | `false` |
| `Guid` | `"82faae11-3be9-4223-beb8-8a53643866f8"` |
| `AssemblyVersion` | `"1.0.0.0"` |
| `AssemblyFileVersion` | `"1.0.0.0"` |
## 3. Invariants
- **COM Visibility**: All types within this assembly are not visible to COM components by default (`ComVisible(false)`). To expose a specific type to COM, `ComVisible(true)` must be explicitly applied to that type.
- **Version Consistency**: Both `AssemblyVersion` and `AssemblyFileVersion` are fixed at `1.0.0.0`. These values will not automatically increment with builds unless manually updated or the project is migrated to a different versioning scheme.
- **Assembly Identity**: The `Guid` attribute value `82faae11-3be9-4223-beb8-8a53643866f8` uniquely identifies this assembly's type library if it were to be exposed to COM.
## 4. Dependencies
**This module depends on:**
- `System.Reflection` - Provides the `AssemblyTitleAttribute`, `AssemblyDescriptionAttribute`, and related metadata attribute classes.
- `System.Runtime.CompilerServices` - Included by default; unused in this file but commonly required for compiler-specific attributes.
- `System.Runtime.InteropServices` - Provides the `ComVisibleAttribute` and `GuidAttribute` classes for COM interop configuration.
**What depends on this module:**
- Unclear from source alone. This assembly appears to be a library or plugin within the larger `DTS Viewer` solution, likely providing settings or configuration for PSD (presumably "Process Specification Diagram" or a similar domain-specific acronym) report generation.
## 5. Gotchas
- **Empty Metadata**: `AssemblyDescription`, `AssemblyCompany`, `AssemblyConfiguration`, and `AssemblyTrademark` are all empty strings. This may hinder automated tooling that relies on assembly metadata for documentation or licensing checks.
- **Hardcoded Version**: The version is manually set to `1.0.0.0`. The commented-out line `// [assembly: AssemblyVersion("1.0.*")]` suggests automatic build numbering was considered but not enabled.
- **Legacy Project Format**: The presence of an explicit `AssemblyInfo.cs` with these attributes suggests a .NET Framework-style project (pre-SDK-style). Modern SDK-style projects typically auto-generate this information, which could lead to conflicts if this project is ever migrated.

View File

@@ -0,0 +1,86 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/Resources/TranslateExtension.cs
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/Resources/StringResources.Designer.cs
generated_at: "2026-04-16T13:38:43.337295+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5a446a4aa0389800"
---
# Documentation: DTS.Viewer.PSDReportSettings.Resources
## 1. Purpose
This module provides localization infrastructure for the PSD Report Settings UI within the DTS Viewer application. It bridges strongly-typed resource management with WPF XAML data binding. The `StringResources` class auto-generates access to localized strings (defaulting to English values such as "Envelope" and "Butterworth") for signal processing and export settings, while the `TranslateExtension` class exposes these resources directly in XAML markup.
## 2. Public Interface
### `TranslateExtension` (Class)
**Namespace:** `DTS.Viewer.PSDReportSettings`
**Inheritance:** `System.Windows.Markup.MarkupExtension`
This class allows XAML bindings to retrieve localized strings dynamically.
* **`TranslateExtension(string key)`** (Constructor)
* Initializes the extension with a specific resource key to look up.
* **`ProvideValue(IServiceProvider serviceProvider)`** (Method)
* Returns `object` (specifically a `string`).
* Looks up the string value using `StringResources.ResourceManager.GetString(_key)`.
* Returns the localized string if found.
* Returns `#stringnotfound#` if the key is null or empty.
* Returns `#stringnotfound# [key]` (appending the key name) if the lookup fails (returns null).
### `StringResources` (Class)
**Namespace:** `DTS.Viewer.PSDReportSettings.Resources`
**Visibility:** `internal`
This is a strongly-typed resource class generated by Visual Studio. It provides static properties to access localized strings.
* **`ResourceManager`** (Property)
* Returns the cached `global::System.Resources.ResourceManager` instance for this assembly.
* **`Culture`** (Property)
* Gets or sets the `global::System.Globalization.CultureInfo` used for resource lookups.
* **Resource String Properties** (Static, read-only)
* `EnvelopeHeader`: "Envelope"
* `ExportPSDHeader`: "Export"
* `ExportPSDtoCSV`: "Export PSD to CSV"
* `ExportPSDtoPDF`: "Export PSD to PDF"
* `FilterCenterFrequency`: "Center frequency"
* `FilterOrder`: "Filter order"
* `FilterSettingsHeader`: "Filters"
* `FilterType`: "Filter type"
* `FilterType_Bessel`: "Bessel"
* `FilterType_Butterworth`: "Butterworth"
* `FilterType_LinkwitzRiley`: "Linkwitz-Riley"
* `HighPassFilter`: "High pass filter"
* `Hz`: "Hz"
* `LowPassFilter`: "Low pass filter"
* `PSDSettingsHeader`: "PSD settings"
* `ShowEnvelope`: "Show Envelope"
* `WindowAveragingType`: "Averaging type"
* `WindowOverlappingPercent`: "Overlapping %"
* `WindowSettingsHeader`: "Window"
* `WindowType`: "Window type"
* `WindowWidth`: "Window width"
## 3. Invariants
* **Return Type:** `TranslateExtension.ProvideValue` is decorated with `[MarkupExtensionReturnType(typeof(string))]`, guaranteeing the return object is a string.
* **Null Safety:** `TranslateExtension.ProvideValue` will never return null. It guarantees a string return, defaulting to specific error constants if the key is missing.
* **Key Requirement:** `TranslateExtension` requires a non-null, non-empty `key` argument in its constructor to function correctly.
* **Singleton Manager:** `StringResources.ResourceManager` uses a lazy-initialization pattern to ensure only one instance of the resource manager exists.
## 4. Dependencies
* **Internal Dependencies:**
* `TranslateExtension` depends entirely on `StringResources.ResourceManager` to perform lookups.
* **External Frameworks:**
* `System.Windows.Markup`: Required for `MarkupExtension` and `IServiceProvider` (WPF).
* `System.Resources`: Required for `ResourceManager`.
* `System.Globalization`: Required for `CultureInfo`.
* **Build Dependencies:**
* `StringResources.Designer.cs` is auto-generated. It depends on a corresponding `.resx` file (likely `StringResources.resx`) existing in the project directory.
## 5. Gotchas
* **Error String Format:** If a resource key is passed to `TranslateExtension` but not found in the `.resx` file, the UI will display `#stringnotfound# [key]`. This differs from the behavior when the key argument itself is null/empty (which returns just `#stringnotfound#`).
* **Auto-Generated Code:** `StringResources.Designer.cs` contains a header warning that manual changes will be lost. Developers must edit the underlying `.resx` file to add or modify strings; editing this C# file directly is futile.
* **Visibility Mismatch:** `StringResources` is `internal`, while `TranslateExtension` is `public`. Code outside the `DTS.Viewer.PSDReportSettings` assembly cannot access the resource strings directly via the class properties, but they can access them via the XAML extension.
* **Namespace Split:** `TranslateExtension` resides in `DTS.Viewer.PSDReportSettings`, while the resources reside in `DTS.Viewer.PSDReportSettings.Resources`. This requires the `using` directive present in the source file.

View File

@@ -0,0 +1,57 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/View/PSDReportSettingsView.xaml.cs
generated_at: "2026-04-16T13:39:00.678252+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5b2351e33ed49693"
---
# Documentation: PSDReportSettingsView
## 1. Purpose
`PSDReportSettingsView` is a WPF view component providing the user interface logic for configuring PSD (Power Spectral Density) report settings. It implements `IPSDReportSettingsView` and serves as the code-behind for a XAML view, exposing configuration options for report parameters such as window widths used in spectral analysis.
## 2. Public Interface
### `PSDReportSettingsView()` (Constructor)
**Signature:** `public PSDReportSettingsView()`
Initializes the view component by calling `InitializeComponent()`, which loads the associated XAML layout.
---
### `AvailableWindowWidths`
**Signature:** `public List<int> AvailableWindowWidths { get; }`
Returns a new `List<int>` containing five predefined window width values: `{ 512, 1024, 2048, 4096, 8192 }`. These values represent FFT window sizes available for selection in the PSD report configuration.
**Note:** Creates a new list instance on every property access.
## 3. Invariants
- The class always implements the `IPSDReportSettingsView` interface.
- `AvailableWindowWidths` always returns exactly five integer values in ascending order: 512, 1024, 2048, 4096, 8192.
- The view requires `InitializeComponent()` to be called (via constructor) before the XAML elements are accessible.
## 4. Dependencies
### This module depends on:
- `DTS.Common.Interface` — provides `IPSDReportSettingsView` interface
- `System.Collections.Generic` — provides `List<T>`
- `Xceed.Wpf.Toolkit.PropertyGrid.Attributes` — imported but not visibly used in this file (likely referenced in XAML)
### What depends on this module:
- Cannot be determined from source alone (no consumers visible in this file).
## 5. Gotchas
1. **New list instance per access:** `AvailableWindowWidths` creates a new `List<int>` on every property getter call. If called frequently, this could cause unnecessary allocations. Consider caching if performance becomes a concern.
2. **Commented-out code:** Three properties (`AvailablePassFilterTypes`, `AvailableWindowAveragingTypes`, `AvailableWindowTypes`) are commented out, suggesting either:
- Features were moved elsewhere or removed
- Implementation is incomplete
- These may be defined in the XAML or a separate partial class
3. **Unused import:** `Xceed.Wpf.Toolkit.PropertyGrid.Attributes` is imported but no attributes from this namespace are used in the visible code. This may indicate usage in XAML or remnants of refactored code.

View File

@@ -0,0 +1,104 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportSettings/ViewModel/PSDReportSettingsViewModel.cs
generated_at: "2026-04-16T13:37:48.788166+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9dcac2937b5c346b"
---
# Documentation: PSDReportSettingsViewModel
## 1. Purpose
`PSDReportSettingsViewModel` is a Prism-based ViewModel responsible for managing Power Spectral Density (PSD) report settings within the DTS Viewer application. It serves as a mediator between graph visualization components and report settings, responding to user interactions such as channel selection and axis changes, and publishing those changes to other system components via the event aggregator. The class extends `BaseViewModel<IPSDReportSettingsModel>` and implements `IPSDReportSettingsViewModel`.
---
## 2. Public Interface
### Properties
| Property | Type | Description |
|----------|------|-------------|
| `View` | `IBaseView` | Gets or sets the associated view instance. |
| `Parent` | `IBaseViewModel` | Gets or sets the parent ViewModel reference. |
| `Model` | `IPSDReportSettingsModel` | Gets or sets the model instance. Uses `new` keyword to hide base class property. Raises `OnPropertyChanged("Model")` on set. |
| `NotificationRequest` | `InteractionRequest<Notification>` | Interaction request for displaying notifications to the user. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Interaction request for displaying confirmation dialogs. Uses `new` keyword to hide base class property. |
### Constructor
```csharp
public PSDReportSettingsViewModel(
IPSDReportSettingsView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
```
Creates a new instance, initializes the view's DataContext, and creates interaction request objects.
### Methods
```csharp
public override void Initialize()
```
Empty override. No initialization logic performed.
```csharp
public override void Initialize(object parameter)
```
Initializes the ViewModel with a parent reference (cast to `IBaseViewModel`), subscribes to events, resolves the `IPSDReportSettingsModel` from the Unity container, and sets the model's `Parent` property.
```csharp
public void PublishChanges()
```
Publishes a `PSDReportSettingsChangedEvent` with a `PSDReportSettingsChangedEventArg` containing the current `Model` and `ParentVM` reference.
---
## 3. Invariants
- **Parent Filtering**: Event handlers (`OnChartAxisChanged`, `OnGraphSelectedChannelsChanged`) ignore events where `arg.ParentVM` does not match `Parent`.
- **Publish Guard**: When handling X-axis changes, `Model.CanPublishChanges` is set to `false` before modifying `DataStart`/`DataEnd`, then restored to `true` before calling `PublishChanges()`. This prevents potential recursive event propagation.
- **Model Resolution**: The `Model` is resolved from the Unity container during `Initialize(object parameter)`, not in the constructor.
---
## 4. Dependencies
### This Module Depends On
| Namespace/Module | Usage |
|------------------|-------|
| `DTS.Common.Base` | `BaseViewModel<T>` base class |
| `DTS.Common.Events` | Event types: `GraphSelectedChannelsNotification`, `GraphClearNotification`, `ChartAxisChangedEvent`, `PSDReportSettingsChangedEvent` and their argument types |
| `DTS.Common.Interactivity` | `InteractionRequest<T>`, `Notification`, `Confirmation` |
| `DTS.Common.Interface` | `IBaseView`, `IBaseViewModel`, `IPSDReportSettingsModel`, `IPSDReportSettingsView`, `IPSDReportSettingsViewModel` |
| `Prism.Events` | `IEventAggregator` |
| `Prism.Regions` | `IRegionManager` |
| `Unity` | `IUnityContainer` for dependency resolution |
### What Depends On This Module
- **Unclear from source alone**: The module publishes `PSDReportSettingsChangedEvent`, indicating subscribers elsewhere in the system consume this ViewModel's output, but specific consumers are not visible in this file.
---
## 5. Gotchas
1. **Property Hiding**: Both `Model` and `ConfirmationRequest` use the `new` keyword to hide base class members. This can lead to unexpected behavior if the ViewModel is accessed via a base class reference.
2. **Commented-Out Code**: Several features appear incomplete or disabled:
- `Standalone` property is commented out
- Y-axis handling in `OnChartAxisChanged` is commented out
- `PublishChanges()` call in `OnGraphSelectedChannelsChanged` is commented out
- `CursorsAlailableChangedEvent` subscription is commented out
- `View.DataContext = Model` assignment in `Initialize(object parameter)` is commented out
3. **Empty `Initialize()` Override**: The parameterless `Initialize()` method is empty. All initialization logic resides in the overloaded version.
4. **Unused `OnRaiseNotification` Method**: This private method exists but is never called within the visible source. It may be wired via event subscription not shown in this file.
5. **Async Pattern Absent**: Despite importing `System.Threading.Tasks`, no async operations are performed in this class.