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,53 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T13:40:09.689440+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a578e8bbaedafe8e"
---
# Documentation: DTS.Viewer.PSDReportResults Assembly Configuration
## 1. Purpose
This file provides assembly-level metadata and configuration attributes for the `DTS.Viewer.PSDReportResults` component within the DTS Viewer application. It exists to embed standard identifying information—such as title, version, and copyright—into the compiled assembly manifest, and to configure COM interoperability settings. It serves as the identity definition for this specific DLL or executable within the larger system.
## 2. Public Interface
This source file does not define any public classes, methods, or functions. It strictly defines assembly-level attributes via the `assembly` keyword.
**Defined Attributes:**
* **`AssemblyTitle`**: Set to `"DTS.Viewer.PSDReportResults"`. Provides a friendly name for the assembly.
* **`AssemblyDescription`**: Set to an empty string.
* **`AssemblyConfiguration`**: Set to an empty string.
* **`AssemblyCompany`**: Set to an empty string.
* **`AssemblyProduct`**: Set to `"DTS.Viewer.PSDReportResults"`.
* **`AssemblyCopyright`**: Set to `"Copyright © 2022"`.
* **`AssemblyTrademark`**: Set to an empty string.
* **`AssemblyCulture`**: Set to an empty string. Indicates the assembly is culture-neutral.
* **`ComVisible`**: Set to `false`. Makes types in this assembly invisible to COM components.
* **`Guid`**: Set to `"486af003-0dec-4b05-a7a5-39e6ca9ec629"`. A unique identifier for the assembly's type library if exposed to COM.
* **`AssemblyVersion`**: Set to `"1.0.0.0"`. Defines the version of the assembly.
* **`AssemblyFileVersion`**: Set to `"1.0.0.0"`. Defines the file version stored in the Win32 file version resource.
## 3. Invariants
* **Version Consistency:** Both `AssemblyVersion` and `AssemblyFileVersion` are explicitly defined and must match the format `"1.0.0.0"`.
* **COM Visibility:** `ComVisible` is explicitly `false`. Types within this assembly are not intended to be accessed by unmanaged COM code unless specifically overridden on individual types.
* **Culture Neutrality:** The `AssemblyCulture` attribute is empty, enforcing that this is a culture-neutral assembly (not a satellite assembly).
## 4. Dependencies
**Imports (Internal):**
* `System.Reflection`
* `System.Runtime.CompilerServices`
* `System.Runtime.InteropServices`
**External Dependencies:**
None inferred from this file; it relies solely on standard .NET Framework libraries.
**Dependents:**
The compiled assembly `DTS.Viewer.PSDReportResults` is a dependency of the broader `DTS Viewer` application, but specific consumers cannot be determined from this file alone.
## 5. Gotchas
* **Hardcoded Version:** The version numbers (`1.0.0.0`) are hardcoded strings. If the project uses CI/CD pipelines to auto-increment versions, this file may need to be updated automatically or ignored in favor of project-level settings (in SDK-style projects).
* **Missing Metadata:** `AssemblyDescription` and `AssemblyCompany` are empty strings. This may result in sparse metadata when viewing the file properties in Windows Explorer or reflection tools.
* **Legacy Structure:** The presence of an explicit `AssemblyInfo.cs` suggests a traditional .NET Framework project structure. Modern SDK-style projects typically auto-generate this content, which can lead to build conflicts (CS0579) if the project file is updated to SDK-style without removing or disabling this file.

View File

@@ -0,0 +1,73 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/Resources/TranslateExtension.cs
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/Resources/StringResources.Designer.cs
generated_at: "2026-04-16T13:40:10.219585+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "154eee0c947eb6d0"
---
# Documentation: DTS.Viewer.PSDReportResults.Resources
## 1. Purpose
This module provides localization infrastructure for the PSD Report Results viewer within the DTS application. It bridges the gap between XAML UI definitions and localized string resources via a custom `TranslateExtension` markup extension. It allows developers to bind UI elements to resource keys declaratively, while relying on the auto-generated `StringResources` class to perform culture-aware string lookups for report-specific terminology such as "Channel Name," "Sample Rate," and export options.
## 2. Public Interface
### Class: `TranslateExtension`
**Namespace:** `DTS.Viewer.PSDReportResults`
**Inheritance:** `System.Windows.Markup.MarkupExtension`
This class is a XAML markup extension used to look up localized strings at runtime.
* **Constructor**
* `public TranslateExtension(string key)`: Initializes the extension with the resource key to be translated. The key is stored in a private readonly field `_key`.
* **Methods**
* `public override object ProvideValue(IServiceProvider serviceProvider)`: Returns the localized string corresponding to the `_key`.
* If `_key` is null or empty, it returns the constant `"#stringnotfound#"`.
* If the key is valid but no resource is found, it returns `"#stringnotfound# "` appended with the `_key`.
### Class: `StringResources`
**Namespace:** `DTS.Viewer.PSDReportResults.Resources`
**Accessibility:** `internal`
A strongly-typed resource class auto-generated by Visual Studio/ResGen. It provides access to localized strings defined in the corresponding `.resx` file.
* **Properties**
* `internal static global::System.Resources.ResourceManager ResourceManager`: Returns the cached `ResourceManager` instance responsible for looking up resources. The resource base name is `"DTS.Viewer.PSDReportResults.Resources.StringResources"`.
* `internal static global::System.Globalization.CultureInfo Culture`: Gets or sets the current `CultureInfo` used for resource lookups.
* `internal static string ChannelName`: Looks up a localized string (default: "Name").
* `internal static string ExportPSDHeader`: Looks up a localized string (default: "Export").
* `internal static string ExportPSDtoCSV`: Looks up a localized string (default: "Export PSD to CSV").
* `internal static string ExportPSDtoPDF`: Looks up a localized string (default: "Export PSD to PDF").
* `internal static string GRMS`: Looks up a localized string (default: "GRMS").
* `internal static string PSDResultsHeader`: Looks up a localized string (default: "Results").
* `internal static string SampleRate`: Looks up a localized string (default: "Sample Rate").
## 3. Invariants
1. **Return Type Guarantee:** The `TranslateExtension` class is decorated with `[MarkupExtensionReturnType(typeof(string))]`, guaranteeing that `ProvideValue` returns a `string` (despite the method signature returning `object`).
2. **Non-Null Return:** `TranslateExtension.ProvideValue` never returns null. It guarantees a string return, falling back to error indicators if the key is missing or empty.
3. **Resource Manager Singleton:** The `ResourceManager` property in `StringResources` implements a lazy-loading singleton pattern; it will only instantiate the `ResourceManager` once.
4. **Auto-Generated Constraint:** `StringResources` is marked with `DebuggerNonUserCodeAttribute` and `CompilerGeneratedAttribute`, indicating it should not be manually edited and must be regenerated when the `.resx` source changes.
## 4. Dependencies
* **Internal Dependencies:**
* `TranslateExtension` depends directly on `StringResources.ResourceManager` to perform lookups.
* **External Dependencies:**
* `System.Windows.Markup`: Required for `MarkupExtension` and `MarkupExtensionReturnTypeAttribute` (implies this is a WPF or related XAML-based UI project).
* `System.Resources`: Required for `ResourceManager`.
* `System.Globalization`: Required for `CultureInfo`.
* **Dependents:**
* XAML files within the `DTS.Viewer.PSDReportResults` assembly are the intended consumers of `TranslateExtension`.
## 5. Gotchas
1. **Differentiated Error States:** The `ProvideValue` method handles errors differently depending on the cause.
* A null/empty key returns exactly `"#stringnotfound#"`.
* A valid key that is missing from resources returns `"#stringnotfound# "` (note the trailing space) followed by the key name. Developers parsing logs or UI output should be aware of this format difference.
2. **Internal Visibility:** The `StringResources` class is `internal`. It cannot be accessed directly from outside the `DTS.Viewer.PSDReportResults` assembly. External assemblies must rely on the `TranslateExtension` (if public) or other public wrappers to access these strings.
3. **Hardcoded Fallback Strings:** The error strings `"#stringnotfound#"` are hardcoded in `TranslateExtension.cs`. They are not localized themselves (i.e., if the system language changes, these error messages remain in English/code-form).

View File

@@ -0,0 +1,59 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/View/PSDReportResultsView.xaml.cs
generated_at: "2026-04-16T13:40:29.354621+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "7dcd71bef7b7c279"
---
# Documentation: PSDReportResultsView
## 1. Purpose
This module provides a WPF view component for displaying PSD (Particle Size Distribution) report results within the DTS Viewer application. It implements the `IPSDReportResultsView` interface and serves as the presentation layer for report data, offering a grid-based UI with column header interaction and search capabilities. The view is designed to be a partial class paired with a XAML definition file.
---
## 2. Public Interface
### Class: `PSDReportResultsView`
**Implements:** `IPSDReportResultsView`
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `public PSDReportResultsView()` | Initializes a new instance of the view and calls `InitializeComponent()` to load the associated XAML. |
| Event Handler | `private void GridViewColumnHeader_OnClick(object sender, System.Windows.RoutedEventArgs e)` | Handles click events on GridView column headers. **Currently has no implementation.** |
| Event Handler | `private void GridViewColumnHeaderSearchable_OnSearch(object sender, System.Windows.RoutedEventArgs e)` | Handles search events raised by searchable column headers. **Currently has no implementation.** |
---
## 3. Invariants
- The class is declared `partial`, requiring a corresponding XAML file (`PSDReportResultsView.xaml`) to define the UI structure.
- `InitializeComponent()` must be called in the constructor; this method is auto-generated from the XAML at build time.
- The class must implement `IPSDReportResultsView` to satisfy the interface contract defined in `DTS.Common.Interface`.
---
## 4. Dependencies
### This Module Depends On:
- `DTS.Common.Interface` — Provides the `IPSDReportResultsView` interface that this view implements.
- `System.Windows` (inferred from `System.Windows.RoutedEventArgs`) — WPF framework for UI event handling.
### What Depends On This Module:
- **Cannot be determined from source alone.** Consumers of `IPSDReportResultsView` or this specific view would be defined elsewhere in the codebase (likely a presenter, view model, or navigation service).
---
## 5. Gotchas
1. **Empty Event Handlers:** Both `GridViewColumnHeader_OnClick` and `GridViewColumnHeaderSearchable_OnSearch` have empty bodies. This suggests either:
- The functionality is not yet implemented (work in progress).
- The logic has been moved elsewhere (e.g., MVVM bindings in the XAML or a code-behind that was refactored).
2. **Missing XAML File:** The actual UI layout, column definitions, and event bindings are defined in `PSDReportResultsView.xaml`, which is not included here. The behavior of the view cannot be fully understood without it.
3. **Interface Contract Unknown:** The members required by `IPSDReportResultsView` are not visible in this source file. It is unclear whether this view fully satisfies the interface or if additional members exist in another partial class file.

View File

@@ -0,0 +1,99 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/ViewModel/PSDReportResultsViewModel.cs
generated_at: "2026-04-16T13:39:37.629543+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "7cb2cb6c499c73c1"
---
# Documentation: PSDReportResultsViewModel.cs
## 1. Purpose
`PSDReportResultsViewModel` is a Prism-based ViewModel responsible for displaying PSD (Power Spectral Density) report results, specifically GRMS (G-RMS) summary data for channels. It serves as a child view model that receives data via event aggregation from a parent view model, maintains an observable collection of results for UI binding, and provides user-initiated export functionality to PDF and CSV formats.
---
## 2. Public Interface
### Class: `PSDReportResultsViewModel`
**Inheritance:** `BaseViewModel<IPSDReportResultsViewModel>`
**Implements:** `IPSDReportResultsViewModel`
### Constructor
```csharp
public PSDReportResultsViewModel(
IPSDReportSettingsView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
```
Initializes the view model, sets the View's DataContext to itself, and creates `NotificationRequest` and `ConfirmationRequest` instances.
### Properties
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `View` | `IBaseView` | get/set | The associated view instance. |
| `Parent` | `IBaseViewModel` | get/set | Reference to the parent view model, used to filter event payloads. |
| `Results` | `ObservableCollection<IChannelGRMSSummary>` | get/set | Collection of GRMS summary results bound to the UI. |
| `NotificationRequest` | `InteractionRequest<Notification>` | get/private set | Interaction request for displaying notifications. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | get/private set | Interaction request for displaying confirmations. |
| `ExportToPDFCommand` | `DelegateCommand` | get | Lazily-initialized command that publishes `SaveReportToPDFRequestedEvent`. |
| `ExportToCSVCommand` | `DelegateCommand` | get | Lazily-initialized command that publishes `SaveReportToCSVRequestedEvent`. |
### Methods
```csharp
public override void Initialize(object parameter)
```
Sets `Parent` from the parameter, initializes `Results` as an empty collection, and subscribes to events.
---
## 3. Invariants
- **Parent Filtering:** Event handlers `OnGRMSValuesUpdated` and `OnGraphSelectedChannelsChanged` will early-return if `Parent` does not match `arg.ParentVM` (or `arg?.ParentVM`). This ensures the view model only processes events intended for its specific parent context.
- **Results Initialization:** `Results` is always initialized as a new empty `ObservableCollection<IChannelGRMSSummary>` in `Initialize()` before any events are processed.
- **Lazy Command Initialization:** Both `ExportToPDFCommand` and `ExportToCSVCommand` are lazily instantiated using the null-coalescing pattern.
- **UIThread Subscription:** `OnGRMSValuesUpdated` is explicitly subscribed with `ThreadOption.UIThread`, ensuring the handler executes on the UI thread.
---
## 4. Dependencies
### External Dependencies (Imports)
| Namespace | Usage |
|-----------|-------|
| `DTS.Common.Base` | `BaseViewModel<T>`, `IBaseView`, `IBaseViewModel` |
| `DTS.Common.Events` | `PSDReportGRMSValuesUpdatedEvent`, `PSDReportGRMSValuesUpdatedEventArg`, `GraphSelectedChannelsNotification`, `GraphSelectedChannelsNotificationArg`, `SaveReportToPDFRequestedEvent`, `SaveReportToPDFRequestedEventArgs`, `SaveReportToCSVRequestedEvent`, `SaveReportToCSVRequestedEventArgs` |
| `DTS.Common.Interactivity` | `InteractionRequest<T>`, `Notification`, `Confirmation` |
| `DTS.Common.Interface` | `IPSDReportResultsViewModel`, `IChannelGRMSSummary`, `ITestChannel`, `IPSDReportSettingsView` |
| `DTS.Common.Utils` | `ReplaceLast` extension method (inferred from usage on `string`) |
| `Prism.Commands` | `DelegateCommand` |
| `Prism.Events` | `IEventAggregator`, `ThreadOption` |
| `Prism.Regions` | `IRegionManager` |
| `Unity` | `IUnityContainer` |
### Event Dependencies
- **Subscribes to:**
- `PSDReportGRMSValuesUpdatedEvent` — populates `Results` collection
- `GraphSelectedChannelsNotification` — sets `Directory` for export operations
- **Publishes:**
- `SaveReportToPDFRequestedEvent` — triggered by `ExportToPDFCommand`
- `SaveReportToCSVRequestedEvent` — triggered by `ExportToCSVCommand`
---
## 5. Gotchas
1. **Constructor Parameter Type Mismatch:** The constructor accepts `IPSDReportSettingsView` but assigns it to `View` which is typed as `IBaseView`. This implies `IPSDReportSettingsView` must inherit from `IBaseView`, but the relationship is not visible in this file.
2. **Member Hiding with `new` Keyword:** Both `ConfirmationRequest` and `_regionManager` use the `new` keyword, hiding base class members with the same names. This could cause unexpected behavior if the base class members are accessed through a base-class reference.
3. **Property Name Shadows System Type:** The private property `Directory` shadows `System.IO.Directory`. While scoped locally, this could cause confusion during debugging or if `using System.IO;` is added.
4. **`ReplaceLast` Extension Method Undefined Here:** The call to `channels[0].BinaryFilePath.ReplaceLast("Binary", "Reports")` depends on an extension method from `DTS.Common.Utils`. Its behavior (e.g., what happens if "Binary" is not found) is not defined in this source.
5. **No Unsubscribe Logic:** The `Subscribe()` method subscribes to events, but there is no corresponding `Unsubscribe()` or cleanup in this file. If the view model lifecycle is not managed correctly, this could lead to memory leaks or stale event handlers.