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,27 @@
---
source_files:
- DataPRO/Modules/TestSetups/CachedItemsList/Model/CachedItem.cs
generated_at: "2026-04-17T16:15:37.020486+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "535fd714b2c15b81"
---
# Model
### Purpose
This module provides comparison logic for sorting `ITestSetup` objects in a list. It exists to enable flexible, multi-field sorting of test setup records with support for both ascending and descending order, abstracting the comparison rules from the view and ViewModel layers.
### Public Interface
**`TestSetupComparer` (class)**
- Signature: `public class TestSetupComparer : IComparer<ITestSetup>`
- Description: A comparer class that defines sorting behavior for `ITestSetup` instances based on configurable field and direction.
**Properties:**
- `SortField` (`TestSetupFields`): The field to sort by. Defaults to `TestSetupFields.Name`.
- `SortAscending` (`bool`): The sort direction. Defaults to `true`. When `false`, the comparison operands are swapped.
**`Compare(ITestSetup left, ITestSetup right)`**
- Signature: `public int Compare(ITestSetup left, ITestSetup right)`
- Description

View File

@@ -0,0 +1,21 @@
---
source_files:
- DataPRO/Modules/TestSetups/CachedItemsList/Properties/Settings.Designer.cs
- DataPRO/Modules/TestSetups/CachedItemsList/Properties/AssemblyInfo.cs
generated_at: "2026-04-17T16:12:50.918245+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9684e92ee2731c2a"
---
# Properties
### 1. Purpose
This module contains the assembly-level configuration and metadata for the `CachedItemsList` assembly. It defines standard .NET assembly attributes (version, title, copyright) and provides a singleton entry point for application settings.
### 2. Public Interface
* **`Settings` (Class)**
* *Signature*: `internal sealed partial class Settings : ApplicationSettingsBase`
* *Property*: `public static Settings Default` — Returns a thread-safe singleton instance of the application settings for this assembly.
* **Assembly Attributes**
*

View File

@@ -0,0 +1,49 @@
---
source_files:
- DataPRO/Modules/TestSetups/CachedItemsList/Resources/TranslateExtension.cs
- DataPRO/Modules/TestSetups/CachedItemsList/Resources/StringResources.Designer.cs
generated_at: "2026-04-17T16:12:50.916382+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b004bb021a814472"
---
# Resources
### 1. Purpose
This module provides localization resources specifically for the `CachedItemsList` functionality within the TestSetups system. It enables XAML-based UI components to bind to localized strings via a markup extension and exposes strongly-typed string properties for keys such as "CacheTime", "Hardware", and "Sensor" for use in code-behind or other logic.
### 2. Public Interface
* **`TranslateExtension` (Class)**
* *Signature*: `public class TranslateExtension : MarkupExtension`
* *Constructor*: `TranslateExtension(string key)` — Initializes the extension with the resource key to look up.
* *Method*: `public override object ProvideValue(IServiceProvider serviceProvider)` — Returns the localized string corresponding to `_key`. Returns `#stringnotfound#` if the key is null/empty, or `#stringnotfound# <key>` if the lookup fails.
* **`StringResources` (Class)**
* *Signature*: `internal class StringResources`
* *Properties*: Provides access to specific localized strings.
* `string CacheTime`: Looks up "Cache Time".
* `string DBTime`: Looks up "Db Time".
* `string Deleted`: Looks up "[Deleted]".
* `string Hardware`: Looks up "Hardware".
* `string Name`: Looks up "Name".
* `string ObjectType`: Looks up "(Type)".
* `string Prepare_TestSetups_EditTestSetup_Page_Update`: Looks up "Refresh".
* `string Sensor`: Looks up "Sensor".
* `string SensorCal`: Looks up "Sensor calibration".
* *Property*: `static ResourceManager ResourceManager` — Returns the cached resource manager for this assembly.
* *Property*: `static CultureInfo Culture` — Gets or sets the current UI culture for resource lookups.
### 3. Invariants
* `TranslateExtension` always returns a non-null string. It never returns `null` or throws exceptions for missing keys; it returns a fallback error string instead.
* `StringResources.ResourceManager` is lazily initialized and cached; it is thread-safe upon initialization via the standard .NET pattern shown.
* The `StringResources` class is `internal` and cannot be accessed outside the `CachedItemsList` assembly.
### 4. Dependencies
* **Depends on**: `System`, `System.Windows.Markup`, `System.Globalization`, `System.Resources`.
* **Resource File**: Implicitly depends on a `.resx` file (likely `StringResources.resx`) that generates the `StringResources` class.
### 5. Gotchas
* The `TranslateExtension` swallows missing key errors silently in the UI by returning `#stringnotfound#`. This is useful for debugging but requires UI inspection to catch missing translations.
* The constant `NotFound` is defined locally within `TranslateExtension`. If other modules use a similar pattern, the error string format is duplicated rather than shared.
---

View File

@@ -0,0 +1,29 @@
---
source_files:
- DataPRO/Modules/TestSetups/CachedItemsList/View/CachedItemsListView.xaml.cs
generated_at: "2026-04-17T16:16:01.850923+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e33536c2992a264a"
---
# View
### 1. Purpose
This module provides the WPF view implementation for the Cached Items List user interface. It serves as the presentation layer for displaying cached test setup items, implementing the `ICachedItemsListView` interface to ensure compatibility with the system's view-model binding infrastructure. It appears to be a passive view, as significant interaction logic (sorting, mouse handling) is currently commented out.
### 2. Public Interface
* **`CachedItemsListView` (Class)**
* **Signature:** `public partial class CachedItemsListView : ICachedItemsListView`
* **Constructor:** `public CachedItemsListView()` — Initializes the component by calling `InitializeComponent()`.
* **Behavior:** Acts as a code-behind file for a XAML control. It currently exposes no public methods or properties other than the constructor. It contains commented-out private event handlers for `ListViewHeader_Click` and `MouseDoubleClick`.
### 3. Invariants
* The class must always call `InitializeComponent()` upon construction to load the associated XAML.
* The view must remain assignable to `ICachedItemsListView` for dependency injection resolution.
### 4. Dependencies
* **Internal/Project:**
* `DTS.Common.Interface.TestSetups.CachedItemsList` (specifically `ICachedItemsListView`).
* **Framework:**
* `System.Windows` (WPF core).

View File

@@ -0,0 +1,76 @@
---
source_files:
- DataPRO/Modules/TestSetups/CachedItemsList/ViewModel/CachedItemsListViewModel.cs
generated_at: "2026-04-17T16:00:55.338770+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "fbd3e29061155d1a"
---
# CachedItemsListViewModel Documentation
## 1. Purpose
`CachedItemsListViewModel` is a Prism/MEF view model for the Cached Items List module within the DTS (Data Test System) test setup framework. It serves as the presentation logic layer for displaying and managing cached items—specifically sensors, hardware components, and sensor calibrations—comparing in-memory cached data against database records to identify discrepancies. The class implements the `INotifyPropertyChanged` pattern and integrates with the application's event aggregation and region management infrastructure.
## 2. Public Interface
### Constructor
```csharp
public CachedItemsListViewModel(ICachedItemsListView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
Initializes the view model, sets the view's DataContext, creates interaction requests, and subscribes to `RaiseNotification` and `BusyIndicatorChangeNotification` events.
### Properties
| Property | Type | Description |
|----------|------|-------------|
| `View` | `ICachedItemsListView` | The associated view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | Used to raise notification dialogs. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Used to raise confirmation dialogs. |
| `CachedItems` | `ICachedItem[]` | Array of cached items. Initialized to empty array. |
| `IsDirty` | `bool` | Always returns `false`. |
| `IsBusy` | `bool` | Busy indicator state, triggers `PropertyChanged`. |
| `IsMenuIncluded` | `bool` | Menu inclusion flag, triggers `PropertyChanged`. |
| `IsNavigationIncluded` | `bool` | Navigation inclusion flag, triggers `PropertyChanged`. |
| `HasOutofDateCachedItems` | `bool` | Returns `true` if `CachedItems` contains any elements. |
| `HasMissingSensors` | `bool` | Returns `true` if any cached item has `DBTime == DateTime.MinValue` and `ObjectType == Resources.StringResources.Sensor`. |
### Events
```csharp
public event PropertyChangedEventHandler PropertyChanged
```
Standard `INotifyPropertyChanged` event.
### Methods
```csharp
public void OnPropertyChanged(string propertyName)
```
Invokes the `PropertyChanged` event if handlers are attached.
```csharp
public void Unset()
public void Cleanup()
public Task CleanupAsync()
public void Initialize()
public void Initialize(object parameter)
public void Initialize(object parameter, object model)
public Task InitializeAsync()
public Task InitializeAsync(object parameter)
public void Activated()
```
Lifecycle methods—currently all empty implementations. `CleanupAsync`, `InitializeAsync`, and `InitializeAsync(object parameter)` return `Task.CompletedTask`.
```csharp
public bool SetCachedItems(ISensorData[] sensors, ISensorCalibration[] sensorCalibrations, IDASHardware[] hardware, IDASHardware[] allDAS)
```
Intended to populate `CachedItems` by comparing provided sensors, calibrations, and hardware against database records. **Currently returns `false` immediately; all logic is commented out.**
## 3. Invariants
- **Singleton lifetime**: The class is decorated with `[PartCreationPolicy(CreationPolicy.Shared)]`, ensuring a single shared instance via MEF.
- **`IsDirty` is always `false`**: The property has no backing logic to track actual dirty state.
- **`CachedItems` is never null**: Property is initialized to an empty array `new ICachedItem[0]`.
- **Event subscriptions are keep-subscribed**: `BusyIndicatorChangeNotification` is subscribed with `keepSubscriberReferenceAlive: true`, preventing weak reference cleanup.
- **`HasOutofDateCachedItems` naming**: Despite the name, it simply checks if any items