init
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/Properties/AssemblyInfo.cs
|
||||
generated_at: "2026-04-16T11:02:08.508418+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "a578e8bbaedafe8e"
|
||||
---
|
||||
|
||||
# Documentation: DTS.Viewer.PSDReportResults Assembly Configuration
|
||||
|
||||
## 1. Purpose
|
||||
This source file provides assembly-level metadata and configuration attributes for the `DTS.Viewer.PSDReportResults` library. It defines the assembly's identity, version information, and COM visibility settings within the larger "DTS Viewer" application ecosystem. It exists to embed standard .NET assembly information into the compiled DLL.
|
||||
|
||||
## 2. Public Interface
|
||||
This file does not contain public classes, methods, or functions. It strictly defines assembly-level attributes using C# attribute syntax.
|
||||
|
||||
**Defined Attributes:**
|
||||
|
||||
* **`AssemblyTitle`**: Set to `"DTS.Viewer.PSDReportResults"`.
|
||||
* **`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.
|
||||
* **`ComVisible`**: Set to `false`. Prevents types in this assembly from being visible to COM components.
|
||||
* **`Guid`**: Set to `"486af003-0dec-4b05-a7a5-39e6ca9ec629"`. Acts as the ID for the type library if the project is exposed to COM.
|
||||
* **`AssemblyVersion`**: Set to `"1.0.0.0"`.
|
||||
* **`AssemblyFileVersion`**: Set to `"1.0.0.0"`.
|
||||
|
||||
## 3. Invariants
|
||||
* **COM Visibility:** The `ComVisible(false)` attribute ensures that all types within this assembly are not exposed to COM by default. To expose a specific type, that type must be explicitly marked with `ComVisible(true)`.
|
||||
* **Versioning:** Both the assembly version and file version are currently fixed at `1.0.0.0`.
|
||||
* **Identity:** The `Guid` attribute provides a unique identifier for this specific assembly, which remains constant regardless of version changes.
|
||||
|
||||
## 4. Dependencies
|
||||
**Internal Dependencies (Imports):**
|
||||
* `System.Reflection`: Required for the assembly attribute classes (e.g., `AssemblyTitleAttribute`, `AssemblyVersionAttribute`).
|
||||
* `System.Runtime.CompilerServices`: Imported by default in standard AssemblyInfo templates, though no specific attributes from this namespace are used in this file.
|
||||
* `System.Runtime.InteropServices`: Required for the `ComVisible` and `Guid` attributes.
|
||||
|
||||
**External Dependencies:**
|
||||
* None identified from this source file alone. The specific runtime or logic dependencies of the `DTS.Viewer.PSDReportResults` assembly are not defined here.
|
||||
|
||||
## 5. Gotchas
|
||||
* **Missing Metadata:** The `AssemblyDescription`, `AssemblyConfiguration`, and `AssemblyCompany` attributes are explicitly set to empty strings. This may result in missing metadata in the compiled DLL properties, which can be problematic for internal tooling or inventory management.
|
||||
* **Hardcoded Versions:** The `AssemblyVersion` and `AssemblyFileVersion` are hardcoded to `"1.0.0.0"`. If the project uses Continuous Integration (CI) for automatic versioning, this file may need to be ignored or modified during the build process; otherwise, every build will report as version 1.0.0.0.
|
||||
* **Legacy Structure:** The presence of an explicit `AssemblyInfo.cs` suggests this project may be using the older .NET Framework SDK style project format. Newer SDK-style projects typically auto-generate this information in the `.csproj` file, though this file can still be used if the project is configured to not auto-generate assembly info.
|
||||
@@ -0,0 +1,92 @@
|
||||
---
|
||||
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-16T11:02:06.405832+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 component. It consists of a strongly-typed resource accessor class (`StringResources`) generated from a `.resx` file, and a XAML markup extension (`TranslateExtension`) that allows UI elements to bind directly to localized strings declaratively within XAML markup.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `TranslateExtension`
|
||||
**Location:** `DTS.Viewer.PSDReportResults.Resources.TranslateExtension`
|
||||
**Inheritance:** `System.Windows.Markup.MarkupExtension`
|
||||
|
||||
A XAML markup extension used to resolve localized strings at runtime.
|
||||
|
||||
* **Constructor**
|
||||
```csharp
|
||||
public TranslateExtension(string key)
|
||||
```
|
||||
Initializes the extension with the resource key to be looked up. The key is stored in a private readonly field `_key`.
|
||||
|
||||
* **Method: ProvideValue**
|
||||
```csharp
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
```
|
||||
Resolves the localized string for the key provided in the constructor.
|
||||
* Returns `NotFound` ("#stringnotfound#") if the `_key` is null or empty.
|
||||
* Retrieves the string using `StringResources.ResourceManager.GetString(_key)`.
|
||||
* Returns `NotFound + " " + _key` if the resource lookup returns null (key not found in resources).
|
||||
|
||||
### `StringResources`
|
||||
**Location:** `DTS.Viewer.PSDReportResults.Resources.StringResources`
|
||||
**Visibility:** `internal`
|
||||
|
||||
A strongly-typed resource class auto-generated by Visual Studio/ResGen. It provides access to localized strings defined in the associated `.resx` file.
|
||||
|
||||
* **Property: ResourceManager**
|
||||
```csharp
|
||||
internal static global::System.Resources.ResourceManager ResourceManager { get; }
|
||||
```
|
||||
Returns the cached `ResourceManager` instance for this assembly. It looks up resources named `"DTS.Viewer.PSDReportResults.Resources.StringResources"`.
|
||||
|
||||
* **Property: Culture**
|
||||
```csharp
|
||||
internal static global::System.Globalization.CultureInfo Culture { get; set; }
|
||||
```
|
||||
Gets or sets the current `CultureInfo` for resource lookups. Overrides the current thread's `CurrentUICulture` for this specific resource class.
|
||||
|
||||
* **Resource Properties (Static Strings)**
|
||||
The following static properties return localized strings:
|
||||
* `ChannelName` (Lookup key: "ChannelName")
|
||||
* `ExportPSDHeader` (Lookup key: "ExportPSDHeader")
|
||||
* `ExportPSDtoCSV` (Lookup key: "ExportPSDtoCSV")
|
||||
* `ExportPSDtoPDF` (Lookup key: "ExportPSDtoPDF")
|
||||
* `GRMS` (Lookup key: "GRMS")
|
||||
* `PSDResultsHeader` (Lookup key: "PSDResultsHeader")
|
||||
* `SampleRate` (Lookup key: "SampleRate")
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
* **Auto-generation:** The `StringResources` class is auto-generated. Manual modifications to `StringResources.Designer.cs` will be lost upon regeneration. Changes must be made to the underlying `.resx` file.
|
||||
* **Return Types:** `TranslateExtension` is decorated with `[MarkupExtensionReturnType(typeof(string))]`, guaranteeing that `ProvideValue` returns a string (or the fallback error string).
|
||||
* **Fallback Behavior:** `TranslateExtension` will never return `null`. It guarantees a string return, either the localized value or a specific error constant.
|
||||
* **Visibility:** `StringResources` is `internal`, restricting access to the `DTS.Viewer.PSDReportResults` assembly.
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
* **Internal Dependencies:**
|
||||
* `TranslateExtension` depends entirely on `StringResources.ResourceManager` to perform lookups.
|
||||
* **External Dependencies (Framework):**
|
||||
* `System`
|
||||
* `System.Windows.Markup` (for `MarkupExtension` and `IServiceProvider`)
|
||||
* `System.Resources` (for `ResourceManager`)
|
||||
* `System.Globalization` (for `CultureInfo`)
|
||||
* `System.CodeDom.Compiler` (Attributes on `StringResources`)
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
* **Error String Variations:** The `TranslateExtension` returns different error strings depending on the failure mode.
|
||||
* If the input `_key` is null/empty, it returns exactly `"#stringnotfound#"`.
|
||||
* If the lookup fails (key is valid but missing in resources), it returns `"#stringnotfound# " + _key` (note the space and the appended key).
|
||||
* Developers parsing or validating these strings must account for this difference.
|
||||
* **Designer File Edits:** As noted in the auto-generated header, editing `StringResources.Designer.cs` directly is unsafe. The specific resource strings listed (e.g., `ChannelName`, `GRMS`) are the only ones currently defined; adding new ones requires regenerating this file.
|
||||
* **Culture Management:** `StringResources.Culture` is a static property. Setting it changes the culture for all subsequent lookups within this resource manager, potentially affecting threading behavior if not managed carefully.
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/View/PSDReportResultsView.xaml.cs
|
||||
generated_at: "2026-04-16T11:02:24.723243+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "7dcd71bef7b7c279"
|
||||
---
|
||||
|
||||
# Documentation: PSDReportResultsView
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`PSDReportResultsView` is a WPF view component responsible for displaying PSD (likely Power Spectral Density) report results in the DTS Viewer application. It serves as the code-behind for a XAML view and implements the `IPSDReportResultsView` interface, indicating it follows an interface-based architecture pattern—likely for MVP (Model-View-Presenter) or MVVM (Model-View-ViewModel) separation. This module exists to render report data and handle user interactions with the grid view, such as column header clicks and search functionality.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Class: `PSDReportResultsView`
|
||||
|
||||
**Inheritance/Implementation:**
|
||||
- Implements: `IPSDReportResultsView` (from `DTS.Common.Interface`)
|
||||
|
||||
**Constructor:**
|
||||
|
||||
```csharp
|
||||
public PSDReportResultsView()
|
||||
```
|
||||
Initializes a new instance of the view and calls `InitializeComponent()` to load the associated XAML layout.
|
||||
|
||||
---
|
||||
|
||||
### Methods
|
||||
|
||||
#### `GridViewColumnHeader_OnClick`
|
||||
|
||||
```csharp
|
||||
private void GridViewColumnHeader_OnClick(object sender, System.Windows.RoutedEventArgs e)
|
||||
```
|
||||
Event handler for column header click events in a GridView. Currently contains no implementation (empty body).
|
||||
|
||||
**Parameters:**
|
||||
- `sender` - The object that raised the event
|
||||
- `e` - `System.Windows.RoutedEventArgs` containing event data
|
||||
|
||||
---
|
||||
|
||||
#### `GridViewColumnHeaderSearchable_OnSearch`
|
||||
|
||||
```csharp
|
||||
private void GridViewColumnHeaderSearchable_OnSearch(object sender, System.Windows.RoutedEventArgs e)
|
||||
```
|
||||
Event handler for search operations on searchable column headers. Currently contains no implementation (empty body).
|
||||
|
||||
**Parameters:**
|
||||
- `sender` - The object that raised the event
|
||||
- `e` - `System.Windows.RoutedEventArgs` containing event data
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- The class must implement `IPSDReportResultsView` interface contract (specific members not visible in this source).
|
||||
- `InitializeComponent()` must be called in the constructor for the XAML-defined UI to be instantiated.
|
||||
- Both event handlers are `private`, indicating they are wired to XAML events and not intended for external invocation.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This module depends on:
|
||||
- `DTS.Common.Interface` — specifically `IPSDReportResultsView` interface
|
||||
- `System.Windows` (implied by `RoutedEventArgs` usage)
|
||||
|
||||
### What depends on this module:
|
||||
- **Cannot be determined from source alone.** The `IPSDReportResultsView` interface suggests a presenter or controller component likely holds a reference to this view, but no consumers are visible in this file.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- **Empty event handlers:** Both `GridViewColumnHeader_OnClick` and `GridViewColumnHeaderSearchable_OnSearch` have empty implementations. This may indicate:
|
||||
- Incomplete functionality (tech debt)
|
||||
- Placeholder methods for future implementation
|
||||
- Dead code that should be removed if unused in XAML
|
||||
|
||||
- **Interface contract unknown:** The specific members required by `IPSDReportResultsView` are not visible in this source. It is unclear whether the class fully satisfies the interface or if required members are defined elsewhere (e.g., in the XAML partial or another partial class file).
|
||||
|
||||
- **XAML file not provided:** The associated `PSDReportResultsView.xaml` file is not included, so the actual UI structure, data bindings, and event wirings cannot be verified.
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReportResults/ViewModel/PSDReportResultsViewModel.cs
|
||||
generated_at: "2026-04-16T11:01:33.528546+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "7cb2cb6c499c73c1"
|
||||
---
|
||||
|
||||
# Documentation: PSDReportResultsViewModel
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`PSDReportResultsViewModel` is a Prism-based view model responsible for displaying PSD (Power Spectral Density) report results, specifically GRMS (Root Mean Square) summary data for channels. It serves as a subscriber to report update events and provides user-initiated export functionality to PDF and CSV formats. The view model participates in a parent-child relationship with another view model (passed during initialization) and filters incoming events to ensure it only processes data intended for its specific context.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Description |
|
||||
|------|------|-------------|
|
||||
| `View` | `IBaseView` | Gets or sets the associated view instance. Assigned in constructor. |
|
||||
| `Parent` | `IBaseViewModel` | Gets or sets the parent view model. Used to filter event subscriptions. Set during `Initialize`. |
|
||||
| `Results` | `ObservableCollection<IChannelGRMSSummary>` | Collection of GRMS summary results displayed to the user. Cleared and repopulated on `PSDReportGRMSValuesUpdatedEvent`. |
|
||||
| `NotificationRequest` | `InteractionRequest<Notification>` | Interaction request for showing notifications to the user. |
|
||||
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Interaction request for showing confirmation dialogs. Declared with `new` keyword (hides base member). |
|
||||
| `ExportToPDFCommand` | `DelegateCommand` | Command that triggers PDF export by publishing `SaveReportToPDFRequestedEvent`. Lazily instantiated. |
|
||||
| `ExportToCSVCommand` | `DelegateCommand` | Command that triggers CSV export by publishing `SaveReportToCSVRequestedEvent`. Lazily instantiated. |
|
||||
|
||||
### Methods
|
||||
|
||||
| Signature | Description |
|
||||
|-----------|-------------|
|
||||
| `PSDReportResultsViewModel(IPSDReportSettingsView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Constructor. Accepts an `IPSDReportSettingsView` (note: not `IPSDReportResultsView`), assigns it to `View`, sets `DataContext` to itself, and initializes interaction requests and service references. |
|
||||
| `override void Initialize(object parameter)` | Initializes the view model. Expects `parameter` to be castable to `IBaseViewModel` (assigned to `Parent`). Creates empty `Results` collection and subscribes to events. |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
1. **Parent-based event filtering**: Both `OnGRMSValuesUpdated` and `OnGraphSelectedChannelsChanged` check `if (Parent != arg.ParentVM) return;` — events are ignored if the sender's parent view model does not match this instance's parent.
|
||||
|
||||
2. **Results collection lifecycle**: `Results` is instantiated as an empty `ObservableCollection<IChannelGRMSSummary>` in `Initialize`, not in the constructor. It is cleared before repopulation in `OnGRMSValuesUpdated`.
|
||||
|
||||
3. **Directory derivation**: The private `Directory` property is derived from the first selected channel's `BinaryFilePath` with `"Binary"` replaced by `"Reports"` via `ReplaceLast`. If no channels are selected, `Directory` is set to `string.Empty`.
|
||||
|
||||
4. **Lazy command instantiation**: Both `ExportToPDFCommand` and `ExportToCSVCommand` use lazy initialization via null-coalescing pattern.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This module depends on:
|
||||
- **DTS.Common.Base** — `BaseViewModel<T>`
|
||||
- **DTS.Common.Events** — `PSDReportGRMSValuesUpdatedEvent`, `PSDReportGRMSValuesUpdatedEventArg`, `GraphSelectedChannelsNotification`, `GraphSelectedChannelsNotificationArg`, `SaveReportToPDFRequestedEvent`, `SaveReportToPDFRequestedEventArgs`, `SaveReportToCSVRequestedEvent`, `SaveReportToCSVRequestedEventArgs`
|
||||
- **DTS.Common.Interactivity** — `InteractionRequest<T>`, `Notification`, `Confirmation`
|
||||
- **DTS.Common.Interface** — `IBaseView`, `IBaseViewModel`, `IPSDReportResultsViewModel`, `IChannelGRMSSummary`, `ITestChannel`, `IPSDReportSettingsView`
|
||||
- **DTS.Common.Utils** — `ReplaceLast` extension method (inferred from usage on string)
|
||||
- **Prism.Delegates** — `DelegateCommand`
|
||||
- **Prism.Events** — `IEventAggregator`, `ThreadOption`
|
||||
- **Prism.Regions** — `IRegionManager`
|
||||
- **Unity** — `IUnityContainer`
|
||||
- **System.Collections.ObjectModel** — `ObservableCollection<T>`
|
||||
|
||||
### What depends on this module:
|
||||
- Not determinable from this source file alone. Consumers would implement `IPSDReportResultsView` and resolve `IPSDReportResultsViewModel` via the container.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Constructor parameter type mismatch**: The constructor accepts `IPSDReportSettingsView` but the class implements `IPSDReportResultsViewModel`. This appears inconsistent — the view type name suggests "settings" while the view model is for "results". This may be intentional coupling or a copy-paste error.
|
||||
|
||||
2. **Member hiding with `new` keyword**:
|
||||
- `_regionManager` is declared with `new`, hiding the base class's `_regionManager`.
|
||||
- `ConfirmationRequest` is declared with `new`, hiding a base class member.
|
||||
- This suggests the base class `BaseViewModel<T>` already defines these members, and the derived class is overriding them shadow-style rather than using proper override/virtual patterns.
|
||||
|
||||
3. **Unused service references**: `_eventAggregator`, `_unityContainer`, and `_regionManager` are stored as private fields despite the base class constructor already receiving them. The `new` keyword on `_regionManager` indicates potential confusion about inheritance.
|
||||
|
||||
4. **Null-conditional handling inconsistency**: `OnGraphSelectedChannelsChanged` uses null-conditional operators (`arg?.ParentVM`, `arg?.SelectedChannels`) while `OnGRMSValuesUpdated` does not. This suggests different assumptions about event argument nullability.
|
||||
|
||||
5. **Unused imports**: `System.Threading.Tasks` is imported but no async/await or Task usage is present in the file.
|
||||
Reference in New Issue
Block a user