init
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/Properties/AssemblyInfo.cs
|
||||
generated_at: "2026-04-17T16:28:49.885454+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "580a1033f3df4c46"
|
||||
---
|
||||
|
||||
# Properties
|
||||
|
||||
### Purpose
|
||||
This module contains assembly-level metadata and configuration for the `DTS.Viewer.PSDReport` assembly. It is a standard .NET Framework properties file that defines version information, COM visibility settings, and assembly identity attributes used by the CLR and build system.
|
||||
|
||||
### Public Interface
|
||||
This module exposes no public types. It defines assembly-level attributes only:
|
||||
|
||||
**Assembly Attributes:**
|
||||
- `[assembly: AssemblyTitle("DTS.Viewer.PSDReport")]` - Defines the assembly title.
|
||||
- `[assembly: AssemblyDescription("")]` - Empty description.
|
||||
- `[assembly: AssemblyConfiguration("")]` - Empty configuration.
|
||||
- `[assembly: AssemblyCompany("")]` - Empty company name.
|
||||
- `[assembly: AssemblyProduct("DTS.Viewer.PSDReport")]` - Product name.
|
||||
- `[assembly: AssemblyCopyright("Copyright © 2021")]` - Copyright notice.
|
||||
- `[assembly: AssemblyTrademark("")]` - Empty trademark.
|
||||
- `[assembly: AssemblyCulture("")]` - Neutral culture.
|
||||
- `[assembly: ComVisible(false)]` - Types not visible to COM.
|
||||
- `[assembly: Guid("3d57ca12-a637-4cdb-b673-d9a5ff0cf062")]` - COM typelib GUID.
|
||||
- `[assembly: AssemblyVersion("1.0.0.0")]` - Assembly version.
|
||||
- `[assembly: AssemblyFileVersion("1.0.0.0")]` - File version.
|
||||
|
||||
### Invariants
|
||||
- AssemblyVersion and AssemblyFileVersion are both fixed at "1.0.0.0".
|
||||
- ComVisible is set to `false`, preventing COM interop by default.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on:** `System.Reflection`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices` (standard .NET Framework assemblies for assembly metadata).
|
||||
|
||||
### Gotchas
|
||||
- Company name, description, and trademark fields are empty, suggesting incomplete assembly metadata configuration.
|
||||
- The copyright year is 2021, which may need updating for maintenance.
|
||||
|
||||
---
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/Resources/TranslateExtension.cs
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/Resources/StringResources.Designer.cs
|
||||
generated_at: "2026-04-17T16:12:01.659566+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "e841c5ffb3f98572"
|
||||
---
|
||||
|
||||
# Resources
|
||||
|
||||
### Purpose
|
||||
This module provides localization support for the PSD (Power Spectral Density) Report component within the DTS Viewer application. It exists to enable XAML-based string lookup for UI elements, allowing the report configuration interface to be localized. The module contains a WPF markup extension for direct XAML binding and a strongly-typed resource class with strings specific to PSD report settings, data selection, and modifications.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**`TranslateExtension` class** (public, inherits `MarkupExtension`)
|
||||
- `TranslateExtension(string key)` - Constructor accepting the resource key to look up.
|
||||
- `override object ProvideValue(IServiceProvider serviceProvider)` - Returns the localized string for the given `_key`. Returns `#stringnotfound#` if the key is null or empty, or `#stringnotfound# <key>` if the resource lookup fails.
|
||||
|
||||
**`StringResources` class** (internal sealed)
|
||||
- `static ResourceManager ResourceManager { get; }` - Returns the cached `ResourceManager` instance for the `DTS.Viewer.PSDReport.Resources.StringResources` resource bundle.
|
||||
- `static CultureInfo Culture { get; set; }` - Gets or sets the current thread's `CurrentUICulture` for resource lookups.
|
||||
- `static string DataHeader { get; }` - Localized string "Data".
|
||||
- `static string DataSelectionHeader { get; }` - Localized string "Data selection".
|
||||
- `static string GraphsDefaultTitle { get; }` - Localized string "Graphs".
|
||||
- `static string ModificationsHeader { get; }` - Localized string "Modify".
|
||||
- `static string PSDHeader { get; }` - Localized string "PSD".
|
||||
- `static string PSDResultsHeader { get; }` - Localized string "Results".
|
||||
- `static string PSDSettingsHeader { get; }` - Localized string "PSD Settings".
|
||||
- `static string SettingsTitle { get; }` - Localized string "Settings".
|
||||
- `static string TestsDefaultTitle { get; }` - Localized string "Tests".
|
||||
|
||||
### Invariants
|
||||
- The `TranslateExtension` class is decorated with `[MarkupExtensionReturnType(typeof(string))]`, guaranteeing it returns a string when used in XAML.
|
||||
- The `ProvideValue` method never returns `null`; it returns a fallback string beginning with `#stringnotfound#` on lookup failure.
|
||||
- The `StringResources.ResourceManager` property lazily initializes exactly once.
|
||||
- All resource string properties in `StringResources` are `internal` and return non-null values if the `.resx` file is properly configured.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on**: `System` (for `IServiceProvider`, `String`), `System.Windows.Markup` (for `MarkupExtension`, `MarkupExtensionReturnTypeAttribute`), `System.Resources` (for `ResourceManager`), `System.Globalization` (for `CultureInfo`).
|
||||
- **Depended on by**: XAML files within `DTS.Viewer.PSDReport` that use `{local:Translate KeyName}` syntax, and any code in that assembly requiring localized strings.
|
||||
|
||||
### Gotchas
|
||||
- The `TranslateExtension` class is defined in namespace `DTS.Viewer.PSDReport` but references `DTS.Viewer.PSDReport.Resources.StringResources`. This namespace structure must be accounted for in XAML namespace declarations.
|
||||
- The `NotFound` constant value `#stringnotfound#` is hardcoded and will appear in the UI if a resource key is missing, which may be visible to end users during development.
|
||||
- The `StringResources.Designer.cs` file is auto-generated; manual changes will be overwritten. Edit the corresponding `.resx` file instead.
|
||||
- The `PSDResultsHeader` resource exists in both `DTS.Viewer.PSDReport.Resources` and `DTS.Viewer.PSDReportResults.Resources` with the same default value "Results". This duplication may indicate shared terminology but could lead to inconsistency if localized differently.
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/View/PSDReportMainView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/View/PSDReportMainViewGrid.xaml.cs
|
||||
generated_at: "2026-04-17T16:11:57.315846+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "a6e4756ad90b5059"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
### Purpose
|
||||
This module provides WPF view components for the PSD (Power Spectral Density) Report feature. It contains two partial classes that serve as code-behind for XAML views, handling view initialization and UI event coordination. The module acts as the presentation layer for PSD report visualization, managing tab focus and responding to graph loading events.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**PSDReportMainView** (implements `IPSDReportMainView`)
|
||||
- `PSDReportMainView()` - Default constructor that calls `InitializeComponent()`. Contains commented-out code for AvalonDock layout serialization/deserialization via `XmlLayoutSerializer`.
|
||||
|
||||
**PSDReportMainViewGrid** (implements `IPSDReportMainViewGrid`)
|
||||
- `PSDReportMainViewGrid()` - Constructor that calls `InitializeComponent()` and registers a `Loaded` event handler.
|
||||
- `PSDReportMainViewGrid_Loaded(object sender, RoutedEventArgs e)` - Private event handler that resolves `IEventAggregator` from `ContainerLocator.Container` and subscribes to `GraphLoadedCountNotification` event.
|
||||
- `OnGraphLoadedCountNotification(GraphLoadedCountNotificationArg arg)` - Private callback that validates the `DataContext` matches `arg.ParentVM`, then spawns a background task that waits 3 seconds before setting focus to `chartResultsTab` via `Dispatcher.BeginInvoke`.
|
||||
- `SetFocus()` - Private method that selects, makes focusable, and focuses `chartResultsTab`.
|
||||
|
||||
### Invariants
|
||||
- `PSDReportMainViewGrid._eventAggregator` is null until the `Loaded` event fires.
|
||||
- `OnGraphLoadedCountNotification` will early-return if `DataContext` is null or does not match `arg.ParentVM` (cast to `IBaseViewModel`).
|
||||
- The 3-second delay in `OnGraphLoadedCountNotification` is hardcoded and unconditional when the callback proceeds.
|
||||
|
||||
### Dependencies
|
||||
**Depends on:**
|
||||
- `DTS.Common.Interface` (`IPSDReportMainView`, `IPSDReportMainViewGrid`, `IBaseViewModel`)
|
||||
- `DTS.Common.Base` (referenced but usage unclear from source)
|
||||
- `DTS.Common.Events` (`GraphLoadedCountNotification`, `GraphLoadedCountNotificationArg`)
|
||||
- `Prism.Ioc` (`ContainerLocator`)
|
||||
- `Prism.Events` (`IEventAggregator`)
|
||||
|
||||
**Depended on by:** Not determinable from source alone.
|
||||
|
||||
### Gotchas
|
||||
- **FB 14797 reference:** The code comments reference a bug/feature request number, indicating the event subscription pattern was added to fix a timing issue with `IEventAggregator` availability.
|
||||
- **Hardcoded 3-second delay:** The `Thread.Sleep(TimeSpan.FromSeconds(3))` is a magic number with no configuration. This may be insufficient on slower systems or unnecessarily long on faster ones.
|
||||
- **Commented-out AvalonDock code:** `PSDReportMainView` contains significant commented-out code for dock layout persistence. It's unclear if this functionality was removed intentionally or is work-in-progress.
|
||||
- **Namespace suppression:** Multiple ReSharper disable comments suggest the namespace may not match the folder structure convention.
|
||||
|
||||
---
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/ViewModel/PSDReportMainViewModel.cs
|
||||
generated_at: "2026-04-17T15:59:14.887503+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "a4bc49aeb12b2337"
|
||||
---
|
||||
|
||||
# PSDReportMainViewModel Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`PSDReportMainViewModel` serves as the primary view model coordinator for the PSD (Power Spectral Density) Report module within the DTS Viewer application. It manages navigation regions, orchestrates view loading, handles user interaction requests, and coordinates event-driven communication between child views (graphs, tests, charts, settings, and data selection components). This class acts as the central hub binding the PSD report UI regions to their respective views and view models.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Constructor
|
||||
```csharp
|
||||
public PSDReportMainViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
|
||||
```
|
||||
Initializes the view model with Prism/Unity infrastructure. Resolves `IPSDReportMainViewGrid` from the container and sets itself as the DataContext.
|
||||
|
||||
### Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `View` | `IBaseView` | Gets/sets the associated view instance. |
|
||||
| `NotificationRequest` | `InteractionRequest<Notification>` | Interaction request for displaying notifications. |
|
||||
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Interaction request for displaying confirmations. |
|
||||
| `ContextNavigationRegion` | `object` | Wraps `NavigationRegion.Content` from the view. |
|
||||
| `ContextGraphsRegion` | `object` | Wraps `GraphListRegion.Content` from the view. |
|
||||
| `ContextGraphListRegion` | `object` | Wraps `GraphListRegion.Content` from the view. |
|
||||
| `ContextTestsRegion` | `object` | Wraps `TestsRegion.Content` from the view. |
|
||||
| `ContextLegendRegion` | `object` | Wraps `LegendRegion.Content` from the view. |
|
||||
| `ContextPropertyRegion` | `object` | Standalone property (no backing view region referenced). |
|
||||
| `ContextChartOptionsRegion` | `object` | Wraps `ChartOptionsRegion.Content` from the view. |
|
||||
| `ContextViewerSettingsRegion` | `object` | Wraps `SettingsRegion.Content` from the view. |
|
||||
| `ContextReportDataSelectRegion` | `object` | Wraps `DataSelectRegion.Content` from the view. |
|
||||
| `ContextGraphRegion` | `object` | Wraps `GraphRegion.Content` from the view. |
|
||||
| `ContextReportChartOptionsRegion` | `object` | Wraps `ReportChartOptionsRegion.Content` from the view. |
|
||||
| `ContextReportResultsRegion` | `object` | Wraps `ReportResultsRegion.Content` from the view. |
|
||||
| `ConfigPath` | `string` | **Throws `NotImplementedException`** on get/set. |
|
||||
| `TitleTests` | `string` | Display title for tests section. |
|
||||
| `TotalSelectedTests` | `int` | Count of selected tests; updates `TitleTests` on set. |
|
||||
| `TotalLoadedTests` | `int` | Count of loaded tests; updates `TitleTests` on set. |
|
||||
| `TitleGraphs` | `string` | Display title for graphs section. |
|
||||
| `TotalSelectedGraphs` | `int` | Count of selected graphs; updates `TitleGraphs` on set. |
|
||||
| `TotalLoadedGraphs` | `int` | Count of loaded graphs; updates `TitleGraphs` on set. |
|
||||
| `SelectedDataFolder` | `string` | Publishes `DataFolderChangedEvent` when set (ignores null/empty). |
|
||||
| `SelectedDataFile` | `string` | Publishes `DataFolderChangedEvent` when set (ignores null/empty). |
|
||||
| `DoesUserHaveEditPermission` | `bool` | Permission flag (default: `false`). |
|
||||
| `ChannelCodeViewMode` | `IsoViewMode` | Publishes `ChannelCodesViewChangedEvent` on change. |
|
||||
| `CalibrationBehaviorSetting` | `CalibrationBehaviors` | Publishes `CalibrationBehaviorSettingChangedEvent` on change. |
|
||||
| `CalibrationBehaviorSettableInViewer` | `bool` | Controls tab selection and publishes `CalibrationBehaviorSettableInViewerChangedEvent`. |
|
||||
| `SettingsVisibility` | `Visibility` | Controls settings visibility (default: `Visible`). |
|
||||
| `IsBusy` | `bool` | Controls busy indicator display. |
|
||||
| `IsBusyMessage` | `string` | Message displayed during
|
||||
Reference in New Issue
Block a user