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,55 @@
---
source_files:
- DataPRO/Modules/TestSetups/CachedItemsList/CachedItemsListModule.cs
generated_at: "2026-04-17T16:16:03.436010+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a74bedf4b2a5cfaf"
---
# CachedItemsList
### Purpose
This module serves as the Prism module initializer for the CachedItemsList feature, responsible for registering the CachedItemsList view and view model with the Unity dependency injection container. It provides assembly metadata used by the application shell to display and categorize the module within the "Prepare" assembly group.
### Public Interface
**CachedItemsListModule**
- `CachedItemsListModule(IUnityContainer unityContainer)` - Constructor accepting the injected Unity container.
- `void Initialize()` - Registers `ICachedItemsListView``CachedItemsListView` and `ICachedItemsListViewModel``CachedItemsListViewModel` with Unity.
- `void OnInitialized(IContainerProvider containerProvider)` - Empty implementation.
- `void RegisterTypes(IContainerRegistry containerRegistry)` - Delegates to `Initialize()`.
**CachedItemsListModuleNameAttribute** (extends `TextAttribute`)
- `string AssemblyName { get; }` - Returns `AssemblyNames.CachedItemsList.ToString()`.
- `Type GetAttributeType()` - Returns `typeof(TextAttribute)`.
- `string GetAssemblyName()` - Returns the assembly name.
**CachedItemsListModuleImageAttribute** (extends `ImageAttribute`)
- `BitmapImage AssemblyImage { get; }` - Loads image via `AssemblyInfo.GetImage(AssemblyNames.CachedItemsList.ToString())`.
- `string AssemblyName { get; }` - Returns `AssemblyNames.CachedItemsList.ToString()`.
- `string AssemblyGroup { get; }` - Returns `eAssemblyGroups.Prepare.ToString()`.
- `eAssemblyRegion AssemblyRegion { get; }` - Returns `eAssemblyRegion.CachedItemsListRegion`.
- `BitmapImage GetAssemblyImage()`, `string GetAssemblyName()`, `string GetAssemblyGroup()`, `eAssemblyRegion GetAssemblyRegion()` - Accessor methods.
### Invariants
- The module must be constructed with a non-null `IUnityContainer` instance.
- Assembly-level attributes are applied exactly once per assembly.
- The module is exported as `IModule` and registered with Prism under the name `"CachedItemsListModule"`.
### Dependencies
**Depends on:**
- `DTS.Common` (provides `AssemblyNames`, `AssemblyInfo`, `eAssemblyGroups`, `eAssemblyRegion`, `TextAttribute`, `ImageAttribute`)
- `DTS.Common.Interface`
- `DTS.Common.Interface.TestSetups.CachedItemsList` (provides `ICachedItemsListView`, `ICachedItemsListViewModel`)
- `Prism.Ioc`, `Prism.Modularity`
- `Unity`
- `System.ComponentModel.Composition`
**Depended on by:** Not determinable from source alone.
### Gotchas
- Same discrepancy as TestSetupsListModule: the comment claims "singleton" registration but `RegisterType` is used without singleton lifetime configuration.
- The `_img` field in `CachedItemsListModuleImageAttribute` is set both in the property getter and the constructor, potentially causing redundant image loading.
---

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

View File

@@ -0,0 +1,25 @@
---
source_files:
- DataPRO/Modules/TestSetups/Diagnostics/DiagnosticsModule.cs
generated_at: "2026-04-17T16:47:09.117257+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "67401adcd0b7b1ac"
---
# DiagnosticsModule Documentation
## 1. Purpose
This module serves as the Prism-based entry point for the Diagnostics subsystem within the DTS application framework. It is responsible for registering the Diagnostics view and view-model with the Unity dependency injection container and providing assembly metadata (name, image, group, region) that enables the main application shell to discover and display the Diagnostics module as an available component. The module belongs to the "Prepare" assembly group and targets the "DiagnosticsRegion" for UI composition.
---
## 2. Public Interface
### `DiagnosticsModule` Class
Implements `Prism.Modularity.IModule`. The primary module definition for the Diagnostics feature.
| Member | Signature | Description |
|

View File

@@ -0,0 +1,45 @@
---
source_files:
- DataPRO/Modules/TestSetups/Diagnostics/Properties/Settings.Designer.cs
- DataPRO/Modules/TestSetups/Diagnostics/Properties/AssemblyInfo.cs
generated_at: "2026-04-17T16:28:27.912791+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "8c0e747416c026d6"
---
# Properties
### Purpose
This module provides assembly metadata and application settings infrastructure for the Diagnostics assembly. It defines version information and COM visibility settings for a diagnostics-related component within the TestSetups subsystem.
### Public Interface
**`Diagnostics.Properties.Settings`** (internal sealed class)
- Inherits from `global::System.Configuration.ApplicationSettingsBase`
- `static Settings Default { get; }` - Returns the synchronized singleton instance of the settings class.
- No custom settings properties are defined beyond the base infrastructure.
**Assembly-level attributes:**
- `AssemblyTitle("Diagnostics")`
- `AssemblyCompany("DTS")`
- `AssemblyProduct("Diagnostics")`
- `AssemblyCopyright("Copyright © 2018")`
- `ComVisible(false)`
- `Guid("c91752c2-0792-475c-be1e-bc1aff79e56e")`
- `AssemblyVersion("1.0.0.0")`
- `AssemblyFileVersion("1.0.0.0")`
### Invariants
- The `Settings` class is a singleton accessed via `Settings.Default`.
- The settings instance is thread-safe via `Synchronized()`.
### Dependencies
- **Depends on:** `System.Configuration.ApplicationSettingsBase`, `System.Reflection`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices`.
- **Depended on by:** Unclear from source alone; presumably consumed by the main Diagnostics module.
### Gotchas
- `Settings.Designer.cs` is auto-generated. Manual changes will be lost on regeneration.
- The settings class exists but has no custom properties defined, suggesting either the module doesn't require persisted settings or they are managed elsewhere.
---

View File

@@ -0,0 +1,31 @@
---
source_files:
- DataPRO/Modules/TestSetups/Diagnostics/Resources/TranslateExtension.cs
- DataPRO/Modules/TestSetups/Diagnostics/Resources/StringResources.Designer.cs
generated_at: "2026-04-17T16:12:45.077519+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "30c046db2cd41539"
---
# Resources
### 1. Purpose
This module provides localization resources specifically for the `Diagnostics` assembly. It enables XAML-based UI components to bind to localized strings via the `TranslateExtension` markup extension, and exposes strongly-typed access to culture-specific resources (such as "Channels", "Details", "Groups", "Hardware") through the auto-generated `StringResources` class.
### 2. Public Interface
**Class: `Diagnostics.TranslateExtension`**
* `public TranslateExtension(string key)` — Constructor that accepts the resource key to be localized.
* `public override object ProvideValue(IServiceProvider serviceProvider)` — Returns the localized string corresponding to `_key`. Returns `#stringnotfound#` if the key is null or empty. Returns `#stringnotfound# {key}` if the lookup fails.
**Class: `Diagnostics.Resources.StringResources` (internal)**
* `internal static global::System.Resources.ResourceManager ResourceManager` — Returns the cached ResourceManager instance for the `Diagnostics.Resources.StringResources` resource set.
* `internal static global::System.Globalization.CultureInfo Culture` — Gets or sets the current UI culture for resource lookups.
* `internal static string Channels` — Looks up the localized string for "Channels".
* `internal static string Details` — Looks up the localized string for "Details".
* `internal static string Groups` — Looks up the localized string for "Group(s)".
* `internal static string Hardware` — Looks up the localized string for "Hardware".
### 3. Invariants
* `TranslateExtension` never returns `null`; it returns a fallback string constant `#stringnotfound#` in error cases.
* `StringResources

View File

@@ -0,0 +1,38 @@
---
source_files:
- DataPRO/Modules/TestSetups/Diagnostics/View/DiagnosticsTreeView.xaml.cs
generated_at: "2026-04-17T16:15:37.018884+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "68d90272e6ceb1e2"
---
# View
### Purpose
This module provides a WPF view component for displaying diagnostic information in a tree structure. It serves as the visual representation layer for diagnostic data within the TestSetups module, implementing the `IDiagnosticsTreeView` interface to ensure contract compliance with the rest of the system.
### Public Interface
**`DiagnosticsTreeView` (class)**
- Signature: `public partial class DiagnosticsTreeView : IDiagnosticsTreeView`
- Description: A WPF UserControl representing a diagnostic tree view. The class is minimal, serving primarily as a code-behind for the associated XAML file. The constructor calls `InitializeComponent()` to load the XAML-defined UI.
### Invariants
- The view must always implement `IDiagnosticsTreeView` as defined in `DTS.Common.Interface.TestSetups.Diagnostics`.
- The associated XAML file (DiagnosticsTreeView.xaml) must exist and be properly formatted, as `InitializeComponent()` relies on it.
### Dependencies
- **Depends on**:
- `System.Windows` (WPF framework)
- `System.Windows.Controls`
- `System.Windows.Data`
- `System.Windows.Media`
- `DTS.Common.Interface.TestSetups.Diagnostics.IDiagnosticsTreeView`
- **Depended on by**: Unknown from source alone (likely a parent Diagnostics module or ViewModel).
### Gotchas
- The file uses `// ReSharper disable CheckNamespace` which suppresses namespace warnings. The namespace `Diagnostics` may not match the folder structure convention, which could cause confusion when locating the file.
- The class has no additional logic beyond initialization; all behavior is presumably defined in the XAML or bound ViewModel.
---

View File

@@ -0,0 +1,38 @@
---
source_files:
- DataPRO/Modules/TestSetups/Diagnostics/ViewModel/DiagnosticsViewModel.cs
generated_at: "2026-04-17T16:47:10.374442+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e1ab887d53b828fa"
---
# DiagnosticsViewModel Documentation
## 1. Purpose
`DiagnosticsViewModel` is a Prism-based ViewModel for the Diagnostics module within the TestSetups subsystem. It serves as the presentation logic layer for diagnostic UI, managing view binding, user notifications, and event-driven communication with other application components. The class is designed as a shared singleton (MEF `CreationPolicy.Shared`) and acts as a bridge between the `IDiagnosticsTreeView` and the application's event infrastructure.
---
## 2. Public Interface
### Constructor
```csharp
public DiagnosticsViewModel(
IDiagnosticsTreeView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
```
Initializes the ViewModel, sets the `TreeView`'s `DataContext` to itself, creates interaction requests, and subscribes to `RaiseNotification` and `BusyIndicatorChangeNotification` events.
---
### Properties
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `View` | `IDiagnosticsTreeView` | get/set | DiagnosticsTreeView reference (appears separate from `TreeView`). |
| `TreeView` | `IDiagnosticsTreeView` | get/set | The diagnostics tree view; `DataContext`

View File

@@ -0,0 +1,42 @@
---
source_files:
- DataPRO/Modules/TestSetups/Imports/TTS/TTSImportModule.cs
generated_at: "2026-04-17T16:16:03.437787+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "53eb3457fc360d37"
---
# TTS
### Purpose
This module serves as the Prism module initializer for the TTS (Test Setup) Import feature, responsible for registering multiple views and view models related to hardware scanning, file editing, summary display, channel configuration (analog, digital input, digital output), and level triggers. It provides assembly metadata for the "Prepare" assembly group.
### Public Interface
**TTSImportModule**
- `TTSImportModule(IUnityContainer unityContainer)` - Constructor accepting the injected Unity container.
- `void Initialize()` - Registers the following view/view model pairs with Unity:
- `IHardwareScanView``HardwareScanView`, `IHardwareScanViewModel``HardwareScanViewModel`
- `IEditFileView``EditFileView`, `IEditFileViewModel``EditFileViewModel`
- `ISummaryView``SummaryView`, `ISummaryViewModel``SummaryViewModel`
- `IReadFileView``ReadFileView`, `IReadFileViewModel``ReadFileViewModel`
- `ILevelTriggerView``LevelTriggerView`, `ILevelTriggerViewModel``LevelTriggerViewModel`
- `IAnalogChannelsView``AnalogChannelsView`, `IAnalogChannelsViewModel``AnalogChannelsViewModel`
- `ITOMChannelsView``TOMChannelsView`, `ITOMChannelsViewModel``TOMChannelsViewModel`
- `IDigitalInputChannelsView``DigitalInputChannelsView`, `IDigitalInputChannelsViewModel``DigitalInputChannelsViewModel`
- `IDigitalOutputChannelsView``DigitalOutputChannelsView`, `IDigitalOutputChannelsViewModel``DigitalOutputChannelsViewModel`
- `void OnInitialized(IContainerProvider containerProvider)` - **Throws `NotImplementedException`**.
- `void RegisterTypes(IContainerRegistry containerRegistry)` - **Throws `NotImplementedException`**.
**TTSImportModuleNameAttribute** (extends `TextAttribute`)
- `string AssemblyName { get; }` - Returns `AssemblyNames.TTSImport.ToString()`.
- `Type GetAttributeType()` - Returns `typeof(TextAttribute)`.
- `string GetAssemblyName()` - Returns the assembly name.
**TTSImportModuleImageAttribute** (extends `ImageAttribute`)
- `BitmapImage AssemblyImage { get; }` - Loads image via `AssemblyInfo.GetImage(AssemblyNames.TTSImport.ToString())`.
- `string AssemblyName { get; }` - Returns `AssemblyNames.TTSImport.ToString()`.
- `string AssemblyGroup { get; }` - Returns `eAssemblyGroups.Prepare.ToString()`.
- `eAssemblyRegion AssemblyRegion { get; }` - Returns `eAssemblyRegion.TTSImportRegion`.
- Accessor methods: `GetAssemblyImage()

View File

@@ -0,0 +1,257 @@
---
source_files:
- DataPRO/Modules/TestSetups/Imports/TTS/Model/WorkFunctionThreadData.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/SummaryChannel.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/ChannelSummary.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/DasSummary.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/HardwareSummaryRecord.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/TTSTestSetup.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/TTSLevelTriggerRecord.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/DASChannel.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Model/TTSChannelRecord.cs
generated_at: "2026-04-17T15:50:30.197430+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "aa6e85661fc3946d"
---
# TTS Import Model Documentation
## 1. Purpose
This module provides the data model layer for TTS (Toyota Test Setup) import functionality within the DataPRO test setup system. It contains model classes representing test configurations, channel records, hardware channel assignments, level triggers, and various summary records. These models implement `INotifyPropertyChanged` for WPF data binding, support serialization via `GetBytes()` methods for hash generation, and serve as the bridge between hardware abstraction layers and the UI for test setup import workflows.
---
## 2. Public Interface
### WorkFunctionThreadData
**Namespace:** `TTSImport.Model`
Simple container for thread synchronization events.
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `WorkFunctionThreadData()` | Initializes `CancelEvent` and `DoneEvent` as non-signaled (`false`). |
| CancelEvent | `ManualResetEvent { get; }` | Read-only event for signaling thread cancellation. |
| DoneEvent | `ManualResetEvent { get; }` | Read-only event for signaling thread completion. |
---
### SummaryChannel
**Namespace:** `TTSImport.Model`
**Implements:** `ISummaryChannel`
| Member | Signature | Description |
|--------|-----------|-------------|
| ChannelType | `string { get; set; }` | Channel type identifier. Raises `PropertyChanged` on set. |
| Assigned | `int { get; set; }` | Count of assigned channels. Raises `PropertyChanged` on set. |
| Unassigned | `string { get; set; }` | Unassigned channel information. Raises `PropertyChanged` on set. |
| PropertyChanged | `event PropertyChangedEventHandler` | Standard property changed event. |
| OnPropertyChanged | `void OnPropertyChanged(string propertyName)` | Invokes `PropertyChanged` event if handlers are attached. |
---
### ChannelSummary
**Namespace:** `TTSImport.Model`
**Implements:** `IChannelSummary`
| Member | Signature | Description |
|--------|-----------|-------------|
| ChannelType | `string { get; set; }` | Channel type identifier. |
| Requested | `int { get; set; }` | Number of requested channels. |
| Assigned | `int { get; set; }` | Number of assigned channels. |
| Unassigned | `int { get; set; }` | Number of unassigned channels. |
| PropertyChanged | `event PropertyChangedEventHandler` | Property changed event. |
| OnPropertyChanged | `void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event. |
---
### DasSummary
**Namespace:** `TTSImport.Model`
**Implements:** `IDasSummary`
| Member | Signature | Description |
|--------|-----------|-------------|
| DASSerial | `string { get; set; }` | DAS device serial number. |
| EIDFound | `string { get; set; }` | Electronic ID found status. |
| BatteryVoltageStatus | `string { get; set; }` | Battery voltage status string. |
| BatteryVoltageColor | `System.Windows.Media.SolidColorBrush { get; set; }` | Color indicator for battery voltage status. |
| InputVoltageStatus | `string { get; set; }` | Input voltage status string. |
| InputVoltageColor | `System.Windows.Media.SolidColorBrush { get; set; }` | Color indicator for input voltage status. |
| PropertyChanged | `event PropertyChangedEventHandler` | Property changed event. |
| OnPropertyChanged | `void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event. |
---
### HardwareSummaryRecord
**Namespace:** `TTSImport.Model`
**Implements:** `IHardwareSummaryRecord`
**Base:** `DTS.Common.Base.BasePropertyChanged`
| Member | Signature | Description |
|--------|-----------|-------------|
| DOut | `uint { get; set; }` | Digital output count. |
| DIn | `uint { get; set; }` | Digital input count. |
| Squib | `uint { get; set; }` | Squib channel count. |
| Analog | `uint { get; set; }` | Analog channel count. |
| SPS | `uint { get; set; }` | SPS device count. |
| SPD | `uint { get; set; }` | SPD device count. |
| SPT | `uint { get; set; }` | SPT device count. |
| ECM | `uint { get; set; }` | ECM device count. |
| Rack | `uint { get; set; }` | Rack count. |
| G5 | `uint { get; set; }` | G5 device count. |
| Total | `uint { get; }` | Sum of `Analog + Squib + DIn + DOut`. Private setter. |
| UpdateTotal | `void UpdateTotal()` | Recalculates `Total` from component counts. |
| Update | `void Update(uint analog, uint squib, uint din, uint dout, uint ecm, uint sps, uint spt, uint spd, uint g5, uint rack)` | Sets all counts and calls `UpdateTotal()`. |
---
### TTSTestSetup
**Namespace:** `TTSImport.Model`
**Implements:** `ITTSSetup`
| Member | Signature | Description |
|--------|-----------|-------------|
| SampleRate | `double { get; set; }` | Sample rate for recording. |
| Mode | `RecordingModes { get; set; }` | Recording mode enum value. |
| TestLength | `double { get; }` | Computed as `PreTrigger + PostTrigger`. |
| PreTrigger | `double { get; set; }` | Pre-trigger duration. |
| PostTrigger | `double { set; }` | Post-trigger duration. |
| ROIStart | `double { get; set; }` | Region of interest start time. |
| ROIEnd | `double { get; set; }` | Region of interest end time. |
| Filename | `string { get; set; }` | Output filename. |
| TestId | `string { get; set; }` | Test identifier. |
| Line1Line4 | `string { get; set; }` | First 4 lines of CSV file for recreation. |
| DummyList | `string[] { get; set; }` | Array of 8 dummy strings. |
| Channels | `ITTSChannelRecord[] { get; set; }` | Array of channel records. |
| LevelTriggers | `ILevelTrigger[] { get; set; }` | Array of 6 level triggers. |
| OriginalImportFile | `string { get; set; }` | Path to original import file. |
| AllowAdvancedRecordingModes | `bool { get; set; }` | Enables HybridRecorder options. |
| AllowActiveRecordingModes | `bool { get; set; }` | Enables Active RAM modes. |
| AllowTSRAIRRecordingModes | `bool { get; set; }` | Enables TSRAIR recording modes. |
| RequireEIDFound | `bool { get; set; }` | Whether EIDs must be found for sensor use. |
| DefaultDigitalInputMode | `string { get; set; }` | Default digital input mode from config. |
| SquibDefaults | `ISquibSettingDefaults { get; set; }` | Default squib settings. |
| DefaultSquibFireDurationMs | `double { get; set; }` | Default squib fire duration from config. |
| PreAssignedSensorIdAndHwId | `Tuple<string, string>[] { get; set; }` | Pre-existing sensor-to-hardware assignments from XML import. |
| Constructor | `TTSTestSetup()` | Initializes `DummyList[8]`, empty `Channels`, and 6 `LevelTriggers`. |
| GetHashCode | `new string GetHashCode()` | Returns SHA256 hash string of test setup state. **Note:** Uses `new` keyword to hide base method. |
---
### TTSLevelTriggerRecord
**Namespace:** `TTSImport.Model`
**Implements:** `ILevelTrigger`
**Base:** `DTS.Common.Base.BasePropertyChanged`
| Member | Signature | Description |
|--------|-----------|-------------|
| Code | `string { get; }` | Channel code from associated channel, or empty string. |
| JCode | `string { get; }` | JCODE from associated channel, or empty string. |
| ValuePercent | `double { get; set; }` | Threshold as percentage of full scale. Triggers `RecalculateEUValue()`. |
| ValueEU | `double { get; set; }` | Threshold in engineering units. Triggers `RecalculatePercent()`. |
| EULabel | `string { get; }` | Engineering units label from associated channel. |
| HWSerialNumber | `string { get; }` | Hardware channel display string. |
| ChannelNumber | `int { get; }` | TTS channel number, or 0 if no channel. |
| Channel | `ITTSChannelRecord { get; set; }` | Associated channel record. Setting triggers refresh of all other level triggers. |
| TestSetup | `ITTSSetup { get; }` | Parent test setup (set via constructor). |
| AvailableChannels | `ITTSChannelRecord[] { get; }` | Channels eligible for level trigger assignment. Enforces max 2 per G5, no duplicate codes/SIMs. |
| IsActive | `bool { get; }` | True if `Channel` is set and not an empty record. |
| IsModified | `bool { get; set; }` | Dirty flag for tracking changes. |
| Constructor | `TTSLevelTriggerRecord(ITTSSetup setup)` | Sets `TestSetup` reference. |
| GetBytes | `byte[] GetBytes()` | Serializes trigger state for hashing. Returns empty array if inactive. |
| Refresh | `void Refresh()` | Updates `AvailableChannels` and validates current `Channel` assignment. Re-entrancy guarded. |
| Add | `void Add(ITTSChannelRecord channel)` | Raises `AvailableChannels` property changed. |
| Remove | `void Remove(ITTSChannelRecord channel)` | Unassigns `Channel` if matches parameter; raises `AvailableChannels` changed. |
| ToString | `override string ToString()` | Returns `Code`. |
---
### DASChannel
**Namespace:** `TTSImport.Model`
**Base:** `System.Windows.DependencyObject`
**Implements:** `INotifyPropertyChanged`
| Member | Signature | Description |
|--------|-----------|-------------|
| Disabled | `bool` (DependencyProperty) | Whether channel is disabled for test execution. |
| HardwareChannel | `IHardwareChannel { get; }` | Wrapped hardware channel interface. |
| TestSetup | `ITTSSetup { get; }` | Associated test setup (optional). |
| Channel | `ITTSChannelRecord { get; private set; }` | Associated TTS channel record. |
| DASChannelString | `string { get; }` | String representation of hardware channel. |
| ToyotaCode | `string { get; set; }` | Channel code from `Channel.ChannelCode`. |
| EID | `string { get; set; }` | Electronic ID on physical channel. |
| Name | `string { get; set; }` | JCode or description from channel. |
| SerialNumber | `string { get; }` | Sensor serial number. |
| Sensitivity | `double { get; }` | Sensor sensitivity. |
| SensitivityString | `string { get; }` | Sensitivity formatted to 12 decimal places. |
| IsActive | `bool { get; }` | True if `Channel` is set (and for digital out, mode is not `NONE`). |
| Capacity | `double { get; }` | Sensor capacity. |
| Range | `double { get; set; }` | Channel range. |
| CableMultiplier | `double { get; set; }` | Cable multiplier factor. |
| Polarity | `string { get; set; }` | `"+"` or `"-"` based on `SensorPolarity`. |
| DigitalOutputMode | `DigitalOutputModes { get; set; }` | Digital output mode; setting to/from `NONE` adds/removes from test setup. |
| DigitalOutputDelayMs | `double { get; set; }` | Delay between trigger and output. |
| DigitalOutputDurationMs | `double { get; set; }` | Output duration (default 100ms). |
| SquibFireMode | `SquibFireMode { get; set; }` | Squib firing mode. |
| SquibFireDelayMs | `double { get; set; }` | Delay before squib fire. |
| SquibFireCurrent | `double { get; set; }` | Current limit in amps. |
| SquibFireDurationMs | `double { get; set; }` | Squib fire duration. |
| SquibFireResistanceLowOhm | `double { get; set; }` | Low resistance tolerance (default 1Ω). |
| SquibFireResistanceHighOhm | `double { get; set; }` | High resistance tolerance (default 8Ω). |
| LimitDuration | `bool { get; set; }` | Whether to limit squib fire duration. |
| Constructor | `DASChannel(IHardwareChannel channel)` | Wraps hardware channel. |
| Constructor | `DASChannel(IHardwareChannel channel, ITTSSetup setup)` | Wraps hardware channel with test setup reference. |
| SetITTSChannelRecord | `void SetITTSChannelRecord(ITTSChannelRecord channel)` | Assigns/unassigns channel record to hardware. Updates all UI properties. |
| Polarities | `IEnumerable<string>` | Returns `["+", "-"]`. |
| SquibFireModes | `IEnumerable<SquibFireMode>` | Returns `[CAP, CONSTANT]`. |
| OutputModes | `IEnumerable<DigitalOutputModes>` | Returns available digital output modes. |
---
### TTSChannelRecord
**Namespace:** `TTSImport.Model`
**Implements:** `ITTSChannelRecord`
**Base:** `DTS.Common.Base.BasePropertyChanged`
| Member | Signature | Description |
|--------|-----------|-------------|
| ChannelNumber | `int { get; set; }` | TTS channel number. |
| ChannelCode | `string { get; set; }` | Channel code identifier. |
| JCodeOrDescription | `string { get; set; }` | J-code or description. Updates `IsJCodeValid` on set. |
| ChannelRange | `double { get; set; }` | Channel range in EU. Updates `IsRangeValid` on set. |
| ChannelRangeString | `string { get; set; }` | String representation of range. |
| ChannelFilterHz | `int { get; set; }` | Filter frequency in Hz. Updates `IsFilterValid` on set. |
| FilterString | `string { get; set; }` | String representation of filter. |
| SensorSerialNumber | `string { get; set; }` | Sensor serial number. |
| SensorEID | `string { get; set; }` | Sensor electronic ID. |
| SensorSensitivity | `double { get; set; }` | Sensor sensitivity. |
| SensorExcitationVolts | `double { get; set; }` | Excitation voltage. |
| SensorCapacity | `double { get; set; }` | Sensor capacity. |
| SensorEU | `string { get; set; }` | Engineering units. |
| SensorPolarity | `bool { get; set; }` | Polarity flag. |
| ChannelType | `ToyotaBridgeType { get; set; }` | Bridge type enum. |
| Description | `string { get; set; }` | Channel description. |
| ProportionalToExcitation | `bool { get; set; }` | Whether proportional to excitation. |
| BridgeResistance | `double { get; set; }` | Bridge resistance. |
| InitialOffsetVoltage | `double { get; set; }` | Initial offset voltage. |
| InitialOffsetVoltageTolerance | `double { get; set; }` | Offset voltage tolerance. |
| RemoveOffset | `bool { get; set; }` | Whether to remove offset. |
| ZeroMethod | `ToyotaZeroMethods { get; set; }` | Zero method enum. |
| CableMultiplier | `double { get; set; }` | Cable multiplier. |
| InitialEUInMV | `double { get; set; }` | Initial EU in mV. |
| InitialEUInEU | `double { get; set; }` | Initial EU value. |
| IRTraccExponent | `double { get; set; }` | IRTracc exponent. |
| PolynomialConstant | `double { get; set; }` | Polynomial constant term. |
| PolynomialCoefficientAC, Alpha | `double { get; set; }` | Polynomial coefficients. |
| ISOCode | `string { get; set; }` | ISO code. |
| ISODescription | `string { get; set; }` | ISO description. |
| ISOPolarity | `string { get; set; }` | ISO polarity. |
| IsSquib | `bool { get; set; }` | Whether this is a squib channel. |
| IsDigitalInput | `bool { get; set; }` | Whether this is a digital input. |
| IsDigitalOutput | `bool { get; set; }` | Whether this is a digital output. |
| HardwareChannel | `IHardwareChannel { get; set; }` | Associated hardware channel. |
| IsEmptyRecord | `bool { get; }` | True if `ChannelCode == "NONE"` and no serial number. |
| IsChannelCodeValid | `bool { get; set; }` | Channel code validation state. |
| IsJCodeValid | `bool { get; set; }`

View File

@@ -0,0 +1,46 @@
---
source_files:
- DataPRO/Modules/TestSetups/Imports/TTS/Properties/AssemblyInfo.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Properties/Settings.Designer.cs
generated_at: "2026-04-17T16:28:27.909772+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "1ed045fc2814c998"
---
# Properties
### Purpose
This module provides assembly metadata and application settings for the TTSImport assembly, which appears to be a component responsible for importing test setup data. It defines version information, COM visibility settings, and a user-scoped setting for controlling the default test import method.
### Public Interface
**`TTSImport.Properties.Settings`** (internal sealed class)
- Inherits from `global::System.Configuration.ApplicationSettingsBase`
- `static Settings Default { get; }` - Returns the synchronized singleton instance of the settings class.
- `int DefaultTestImportMethod { get; set; }` - A user-scoped setting with a default value of `0`. Controls which import method is used by default for test imports.
**Assembly-level attributes:**
- `AssemblyTitle("TTSImport")`
- `AssemblyCompany("DTS")`
- `AssemblyProduct("TTSImport")`
- `AssemblyCopyright("Copyright © 2017")`
- `ComVisible(false)`
- `Guid("a8ff540f-f22a-45ae-a63b-4984ed74c654")`
- `AssemblyVersion("1.0.0.0")`
- `AssemblyFileVersion("1.0.0.0")`
### Invariants
- The `Settings` class is a singleton accessed via `Settings.Default`.
- `DefaultTestImportMethod` is guaranteed to return `0` if no user setting has been persisted.
- The settings instance is thread-safe via `Synchronized()`.
### Dependencies
- **Depends on:** `System.Configuration.ApplicationSettingsBase`, `System.Reflection`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices`.
- **Depended on by:** Unclear from source alone; presumably the main TTSImport module accesses `Settings.Default.DefaultTestImportMethod`.
### Gotchas
- `Settings.Designer.cs` is auto-generated by Visual Studio's `SettingsSingleFileGenerator`. Manual changes will be overwritten if the settings are regenerated.
- The meaning of `DefaultTestImportMethod` values (what `0` represents vs other values) is not documented in the source.
---

View File

@@ -0,0 +1,98 @@
---
source_files:
- DataPRO/Modules/TestSetups/Imports/TTS/Resources/StringResources.ja.Designer.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Resources/TranslateExtension.cs
- DataPRO/Modules/TestSetups/Imports/TTS/Resources/StringResources.Designer.cs
generated_at: "2026-04-17T15:55:43.662597+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "d7d95270db602454"
---
# Documentation: TTS Import Resources Module
## 1. Purpose
This module provides localization and internationalization support for the TTS (Test Setup) Import functionality within the DataPRO system. It enables XAML-based UI string resolution through a WPF markup extension pattern, and maintains a strongly-typed catalog of localized strings for test setup operations including sensor assignments, channel configurations, DAS (Data Acquisition System) management, and import validation messaging. The module serves as the presentation layer's interface to localized text resources.
---
## 2. Public Interface
### `TranslateExtension` (Class)
**Namespace:** `TTSImport`
**Attribute:** `[MarkupExtensionReturnTypeAttribute(typeof(string))]`
A WPF markup extension for resolving localized strings in XAML bindings.
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `TranslateExtension(string key)` | Initializes the extension with the resource key to look up. Stores key in readonly field `_key`. |
| `NotFound` | `public const string NotFound = "#stringnotfound#"` | Constant returned when a resource key cannot be resolved. |
| `ProvideValue` | `public override object ProvideValue(IServiceProvider serviceProvider)` | Returns the localized string for `_key` via `Resources.StringResources.ResourceManager.GetString(_key)`. Returns `NotFound` if `_key` is null or empty. Returns `NotFound + " " + _key` if the lookup returns null. |
### `StringResources` (Class)
**Namespace:** `TTSImport.Resources`
**Accessibility:** `internal`
**Attributes:** `[GeneratedCode]`, `[DebuggerNonUserCode]`, `[CompilerGenerated]`
An auto-generated strongly-typed resource class providing access to localized strings.
| Member | Signature | Description |
|--------|-----------|-------------|
| `ResourceManager` | `internal static global::System.Resources.ResourceManager ResourceManager { get; }` | Lazy-initialized cached ResourceManager instance for the resource bundle `"TTSImport.Resources.StringResources"`. |
| `Culture` | `internal static global::System.Globalization.CultureInfo Culture { get; set; }` | Gets or sets the current UI culture for resource lookups. Defaults to null (uses current thread culture). |
**Selected Resource String Properties (non-exhaustive):**
| Property | Sample Value (from comments) |
|----------|------------------------------|
| `AAF_SLICE` | `"Requested SLICE AAF: {0}"` |
| `AAF_TDAS` | `"Requested TDAS AAF: {0}"` |
| `Added` | `"Added"` |
| `Analog` | `"Analog"` |
| `AssignSensorPrompt` | `"Assign sensor? ID on the channel will be applied to the sensor and removed from any other sensors."` |
| `ImportTestSetup_MustBeCSVOrXML` | `"TTS import requires either .csv or .xml input file"` |
| `ImportTestSetup_DuplicateChannelCode` | `"{0} is a duplicate Channel Code."` |
| `ImportTestSetup_DuplicateJCode` | `"JCode {0} is a duplicate"` |
| `EmptyChannelCodeWarning` | `"Non empty channel codes are required, please complete channel codes to continue"` |
| `ExcitationNotSupportedByChannel` | `"Sensor excitation {0} not supported by channel"` |
| `SensorNotFound` | `"Sensor \"{0}\" not found in database"` |
---
## 3. Invariants
- **Key Immutability:** The `_key` field in `TranslateExtension` is `readonly` and set only at construction time.
- **Fallback Behavior:** `ProvideValue` will never return null; it always returns either the resolved string, the `NotFound` constant, or `NotFound + " " + _key`.
- **Empty Key Handling:** Passing `null` or empty string to `TranslateExtension` returns exactly `NotFound` (without the key suffix).
- **Resource Manager Singleton:** `StringResources.ResourceManager` uses lazy initialization with a null-check pattern; once initialized, the same instance is returned on subsequent calls.
- **Auto-Generated Code:** `StringResources.Designer.cs` is tool-generated; manual edits will be lost on regeneration.
---
## 4. Dependencies
### This Module Depends On:
- `System` (core BCL)
- `System.Windows.Markup` (for `MarkupExtension` and `MarkupExtensionReturnTypeAttribute`)
- `System.Resources` (for `ResourceManager`)
- `System.Globalization` (for `CultureInfo`)
- `System.CodeDom.Compiler` (for `GeneratedCodeAttribute`)
- Embedded `.resx` resource files backing `StringResources`
### What Depends On This Module:
- **Inferred:** XAML views within the `TTSImport` module that use `{tts:Translate KeyName}` markup extension syntax for localized UI strings.
- **Inferred:** Code within `TTSImport` namespace that accesses `StringResources` properties directly for error messages, labels, and validation text.
---
## 5. Gotchas
1. **Empty Japanese Resource File:** The file `StringResources.ja.Designer.cs` is present but completely empty (0 bytes). It is unclear whether this is intentional (no Japanese localization needed) or a missing/failed code generation. Developers should verify if Japanese localization is required.
2. **Namespace Discrepancy:** `TranslateExtension` resides in namespace `TTSImport` but references `Resources.StringResources` which is in `TTSImport.Resources`. The fully qualified resource path `"TTSImport.Resources.StringResources"` is hardcoded in the generated class.
3. **Debugging Difficulty:** The `NotFound` fallback pattern (`#stringnotfound# keyname`) could appear in production UI if resource keys are misspelled or resources are missing, potentially exposing internal key names to end users.
4. **No Null Propagation on ResourceManager:** The `ProvideValue` method calls `ResourceManager.GetString(_key)` without null-checking the `ResourceManager` property itself (though the property getter handles this internally).

View File

@@ -0,0 +1,28 @@
---
source_files:
- DataPRO/Modules/TestSetups/Imports/TTS/View/LevelTriggerView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/HardwareScanView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/TOMChannelsView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/AnalogChannelsView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/ReadFileView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/DigitalInputChannelsView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/DigitalOutputChannelsView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/SummaryView.xaml.cs
- DataPRO/Modules/TestSetups/Imports/TTS/View/EditFileView.xaml.cs
generated_at: "2026-04-17T16:11:25.805778+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9cfebf2414807d61"
---
# View
**Purpose:**
This module contains the code-behind for various WPF UserControls used in the TTS (Test Setup) import wizard. It acts as the View layer, defining partial classes that interface with XAML definitions. It bridges the UI elements with the application logic by implementing specific View interfaces and handling UI events like text changes.
**Public Interface:**
* `LevelTriggerView` (Partial Class): Implements `ILevelTriggerView`. Constructor calls `InitializeComponent`.
* `HardwareScanView` (Partial Class): Implements `IHardwareScanView`. Constructor calls `InitializeComponent`.
* `TOMChannelsView` (Partial Class): Implements `ITOMChannelsView`. Constructor calls `InitializeComponent`.
* `AnalogChannelsView` (Partial

View File

@@ -0,0 +1,177 @@
---
source_files:
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/DigitalOutputChannelsViewModel.cs
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/LevelTriggerViewModel.cs
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/DigitalInputChannelsViewModel.cs
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/TOMChannelsViewModel.cs
generated_at: "2026-04-17T15:49:35.967692+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "038dac49bea7aac0"
---
# TTS Import ViewModels Documentation
## 1. Purpose
This module provides four ViewModel classes for managing channel configuration within a TTS (Test Setup) Import workflow. Each ViewModel handles a specific channel type—Digital Output, Digital Input, Level Triggers, and TOM (Squib) channels—facilitating the mapping between physical hardware channels (`IDASHardware`/`IHardwareChannel`) and logical channel records (`ITTSChannelRecord`) in test setups. The ViewModels coordinate via `IEventAggregator` to respond to hardware scan results, file imports, and channel assignment changes, providing UI binding properties and commands for user interaction.
---
## 2. Public Interface
### DigitalOutputChannelsViewModel
**Implements:** `IDigitalOutputChannelsViewModel`
| Member | Signature | Description |
|--------|-----------|-------------|
| `View` | `public IDigitalOutputChannelsView View { get; set; }` | The associated view instance; DataContext is set to `this` in constructor. |
| `NotificationRequest` | `public InteractionRequest<Notification> NotificationRequest { get; }` | Used to raise notification dialogs. |
| `ConfirmationRequest` | `public InteractionRequest<Confirmation> ConfirmationRequest { get; }` | Used to raise confirmation dialogs. |
| `DASChannels` | `public ObservableCollection<DASChannel> DASChannels { get; set; }` | Collection of digital output channels from hardware. |
| `SelectedDASChannel` | `public DASChannel SelectedDASChannel { get; set; }` | Currently selected DAS channel in UI. |
| `EnableOrDisableText` | `public string EnableOrDisableText { get; }` | Returns localized "Enable" or "Disable" text based on `SelectedDASChannel.Channel.Disabled`. |
| `IsBusy` | `public bool IsBusy { get; set; }` | Bound to busy indicator state. |
| `IsMenuIncluded` | `public bool IsMenuIncluded { get; set; }` | Unclear purpose from source alone. |
| `IsNavigationIncluded` | `public bool IsNavigationIncluded { get; set; }` | Unclear purpose from source alone. |
| `IsDirty` | `public bool IsDirty { get; private set; }` | Indicates unsaved changes (never set to `true` in visible source). |
| `Cleanup()` | `public void Cleanup()` | Empty implementation. |
| `CleanupAsync()` | `public Task CleanupAsync()` | Returns `Task.CompletedTask`. |
| `Initialize()` | `public void Initialize()` | Empty implementation. |
| `Initialize(object)` | `public void Initialize(object parameter)` | Empty implementation. |
| `Initialize(object, object)` | `public void Initialize(object parameter, object model)` | Empty implementation. |
| `InitializeAsync()` | `public Task InitializeAsync()` | Returns `Task.CompletedTask`. |
| `InitializeAsync(object)` | `public Task InitializeAsync(object parameter)` | Returns `Task.CompletedTask`. |
| `Activated()` | `public void Activated()` | Empty implementation. |
| `OnPropertyChanged(string)` | `public void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event. |
| `PropertyChanged` | `public event PropertyChangedEventHandler PropertyChanged` | Standard INotifyPropertyChanged event. |
---
### LevelTriggerViewModel
**Implements:** `ILevelTriggerViewModel`
| Member | Signature | Description |
|--------|-----------|-------------|
| `View` | `public ILevelTriggerView View { get; set; }` | The associated view instance. |
| `LevelTriggers` | `public ILevelTrigger[] LevelTriggers { get; }` | Returns `_setup?.LevelTriggers`; provides access to level trigger configurations. |
| `IsBusy`, `IsMenuIncluded`, `IsNavigationIncluded`, `IsDirty` | Same as above | Standard state properties. |
| `NotificationRequest`, `ConfirmationRequest` | Same as above | Interaction requests. |
| Lifecycle methods (`Cleanup`, `Initialize`, etc.) | Same signatures as above | All return empty or `Task.CompletedTask`. |
| `OnPropertyChanged(string)` | Same as above | Raises `PropertyChanged` event. |
| `PropertyChanged` | Same as above | INotifyPropertyChanged event. |
---
### DigitalInputChannelsViewModel
**Implements:** `IDigitalInputChannelsViewModel`
| Member | Signature | Description |
|--------|-----------|-------------|
| `View` | `public IDigitalInputChannelsView View { get; set; }` | The associated view instance. |
| `DASChannels` | `public ObservableCollection<DASChannel> DASChannels { get; set; }` | Physical digital input channels from hardware. |
| `RemainingChannels` | `public ObservableCollection<ITTSChannelRecord> RemainingChannels { get; set; }` | Channel records not yet assigned to hardware. |
| `SelectedDASChannel` | `public DASChannel SelectedDASChannel { get; set; }` | Currently selected hardware channel. |
| `SelectedRemainingChannel` | `public ITTSChannelRecord SelectedRemainingChannel { get; set; }` | Currently selected unassigned channel record. |
| `AssignEnabled` | `public bool AssignEnabled { get; set; }` | Enables/disables Assign button in UI. |
| `RemoveEnabled` | `public bool RemoveEnabled { get; set; }` | Enables/disables Remove button in UI. |
| `EnableOrDisableEnabled` | `public bool EnableOrDisableEnabled { get; set; }` | Enables/disables Enable/Disable button. |
| `EnableOrDisableText` | `public string EnableOrDisableText { get; }` | Localized "Enable" or "Disable" text. |
| `AssignCommand` | `public DelegateCommand AssignCommand { get; }` | Assigns `SelectedRemainingChannel` to `SelectedDASChannel`. |
| `RemoveCommand` | `public DelegateCommand RemoveCommand { get; }` | Removes channel assignment from `SelectedDASChannel`. |
| `EnableOrDisableCommand` | `public DelegateCommand EnableOrDisableCommand { get; }` | Toggles `Disabled` state on selected channel. |
| Other members | Same as above | `IsBusy`, `IsDirty`, lifecycle methods, `PropertyChanged`. |
---
### TOMChannelsViewModel
**Implements:** `ITOMChannelsViewModel`
| Member | Signature | Description |
|--------|-----------|-------------|
| `View` | `public ITOMChannelsView View { get; set; }` | The associated view instance. |
| `DASChannels` | `public ObservableCollection<Model.DASChannel> DASChannels { get; set; }` | Physical squib channels from hardware (every other channel, `i += 2`). |
| `RemainingChannels` | `public ObservableCollection<ITTSChannelRecord> RemainingChannels { get; set; }` | Unassigned squib channel records. |
| `SelectedDASChannel` | `public Model.DASChannel SelectedDASChannel { get; set; }` | Currently selected squib hardware channel. |
| `SelectedRemainingChannel` | `public ITTSChannelRecord SelectedRemainingChannel { get; set; }` | Currently selected unassigned squib record. |
| `AssignCommand`, `RemoveCommand`, `EnableOrDisableCommand` | Same as `DigitalInputChannelsViewModel` | Same command implementations for squib channels. |
| Other members | Same as above | Standard state properties and lifecycle methods. |
---
## 3. Invariants
1. **Singleton Lifetime**: All four ViewModels are decorated with `[PartCreationPolicy(CreationPolicy.Shared)]`, ensuring a single shared instance per container.
2. **Event Subscription Thread Affinity**: All `IEventAggregator` subscriptions use `ThreadOption.PublisherThread` with `keepSubscriberReferenceAlive = true`, meaning handlers execute on the publisher's thread and subscribers are held strongly.
3. **UI Thread Requirement**: `OnAssignedChannelsChangedEvent` in `DigitalOutputChannelsViewModel`, `DigitalInputChannelsViewModel`, and `TOMChannelsViewModel` explicitly check `Application.Current.Dispatcher.CheckAccess()` and marshal to the UI thread via `BeginInvoke` if necessary.
4. **Hardware Channel Filtering**:
- `DigitalOutputChannelsViewModel`: Filters for `ch.IsDigitalOut == true`
- `DigitalInputChannelsViewModel`: Filters for `ch.IsDigitalIn == true`
- `TOMChannelsViewModel`: Filters for `ch.IsSquib == true` and iterates by `i += 2` (squib channels are paired)
5. **Channel Record Validation**: All ViewModels skip channel records where:
- `channelRecord.IsEmptyRecord == true`
- `channelRecord.IsChannelCodeValid == false`
- `channelRecord.ChannelCode == TTSChannelRecord.NONE`
6. **EID Mapping**: `DigitalOutputChannelsViewModel` and `LevelTriggerViewModel` maintain a mapping (`_hardwareChannelIdToSensorId` / `_sensorIdToChannelId`) from `EIDMappingEvent` for sensor-to-channel resolution.
---
## 4. Dependencies
### External Dependencies (from imports)
- **Prism Framework**: `Prism.Events`, `Prism.Regions`, `Prism.Commands` — Event aggregation, region management, delegate commands.
- **Unity**: `Unity` — Dependency injection container (`IUnityContainer`).
- **MEF**: `System.ComponentModel.Composition` — Part creation policy.
- **WPF**: `System.Windows`, `System.Windows.Data`, `System.Collections.ObjectModel` — UI collections and dispatcher.
### Internal Dependencies (DTS.* namespaces)
- `DTS.Common.Events` / `DTS.Common.Events.TTSImport` — Event types: `RaiseNotification`, `BusyIndicatorChangeNotification`, `AssignedChannelsChangedEvent`, `TTSImportHardwareScanFinishedEvent`, `EIDMappingEvent`, `TTSImportReadFileStatusEvent`, `TTSImportSavedChangesStatusEvent`, `TTSImportTestSetupChangedEvent`.
- `DTS.Common.Interface.DataRecorders``IDASHardware`, `IHardwareChannel`.
- `DTS.Common.Interface.TestSetups.Imports.TTS.*``ITTSSetup`, `ITTSChannelRecord`, `ILevelTrigger`, view interfaces.
- `DTS.Common.Interactivity``InteractionRequest<T>`, `Notification`, `Confirmation`, `NotificationContentEventArgs`.
- `DTS.Common.Enums``DigitalInputModes`, `ExcitationVoltageOptions`.
- `TTSImport.Model``DASChannel` model class.
- `TTSImport.Resources``StringResources` for localized strings.
### Consumers
- Unclear from source alone; these ViewModels are likely resolved by the DI container and bound to their respective Views (`IDigitalOutputChannelsView`, `ILevelTriggerView`, etc.).
---
## 5. Gotchas
1. **Logic Bug in `DetermineRemoveEnableStatus`** (present in `DigitalInputChannelsViewModel` and `TOMChannelsViewModel`):
```csharp
if (!string.IsNullOrWhiteSpace(_selectedDASChannel.EID) &&
_selectedDASChannel.EID == _selectedDASChannel.Channel.SensorEID)
{
RemoveEnabled = false;
}
RemoveEnabled = true; // This always overwrites the above!
```
The `RemoveEnabled = true` assignment always executes, making the preceding conditional check ineffective.
2. **Empty Async Lifecycle Methods**: All `InitializeAsync` and `CleanupAsync` methods return `Task.CompletedTask` with no actual async work. This may indicate incomplete implementation or a placeholder pattern.
3. **`IsDirty` Never Set to `true`**: The `IsDirty` property has a private setter but is never assigned `true` anywhere in the visible source. Its purpose is unclear.
4. **Historical Bug References in Comments** (`LevelTriggerViewModel.cs`):
- Comment references "11245" and "15643" (likely defect tracking IDs) describing edge cases around EID assignment and channel code validation.
- A comment notes: *"the below condition I think was missing a not"* indicating past confusion about boolean logic.
5. **Squib Channel Pairing** (`TOMChannelsViewModel`): Hardware channels are iterated with `i += 2`, implying squib channels are paired (voltage/initiation vs. current). This is not documented elsewhere and could cause confusion if the hardware configuration changes.
6. **Task.Run for MessageBox** (`DigitalInputChannelsViewModel.Assign` and `TOMChannelsViewModel.Assign`): The code uses `Task.Run(() => MessageBox.Show(...))` followed by `Application.Current.Dispatcher.BeginInvoke` for the actual assignment work. This pattern is unusual—MessageBox is typically shown on the UI thread directly.
7. **Pre-Assigned Channels Logic** (`LevelTriggerViewModel.UpdateLevelTriggers`): The method modifies `_setup.PreAssignedSensorIdAndHwId` in-place, reassigning it to a filtered list. This mutates shared state that may be observed elsewhere.
8. **Exception Swallowing** (`LevelTriggerViewModel.VoltageIsValid`): The method contains an empty `catch { }` block that silently ignores exceptions from `GetExcitationVoltageEnumFromMagnitude`, returning `false` for invalid voltages.

View File

@@ -0,0 +1,55 @@
---
source_files:
- DataPRO/Modules/TestSetups/TestSetupsList/TestSetupsListModule.cs
generated_at: "2026-04-17T16:16:03.433616+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "24fc77cec6a51f5c"
---
# TestSetupsList
### Purpose
This module serves as the Prism module initializer for the TestSetupsList feature, responsible for registering the TestSetupsList view and view model with the Unity dependency injection container. It provides assembly metadata (name, image, group, and region) used by the application shell to display and categorize the module within the "Prepare" assembly group.
### Public Interface
**TestSetupsListModule**
- `TestSetupsListModule(IUnityContainer unityContainer)` - Constructor accepting the injected Unity container.
- `void Initialize()` - Registers `ITestSetupsListView``TestSetupsListView` and `ITestSetupsListViewModel``TestSetupsListViewModel` with Unity (non-singleton registration via `RegisterType`).
- `void OnInitialized(IContainerProvider containerProvider)` - Empty implementation, no initialization logic.
- `void RegisterTypes(IContainerRegistry containerRegistry)` - Delegates to `Initialize()`.
**TestSetupsListModuleNameAttribute** (extends `TextAttribute`)
- `string AssemblyName { get; }` - Returns `AssemblyNames.TestSetupsList.ToString()`.
- `Type GetAttributeType()` - Returns `typeof(TextAttribute)`.
- `string GetAssemblyName()` - Returns the assembly name.
**TestSetupsListModuleImageAttribute** (extends `ImageAttribute`)
- `BitmapImage AssemblyImage { get; }` - Loads image via `AssemblyInfo.GetImage(AssemblyNames.TestSetupsList.ToString())`.
- `string AssemblyName { get; }` - Returns `AssemblyNames.TestSetupsList.ToString()`.
- `string AssemblyGroup { get; }` - Returns `eAssemblyGroups.Prepare.ToString()`.
- `eAssemblyRegion AssemblyRegion { get; }` - Returns `eAssemblyRegion.TestSetupsListRegion`.
- `BitmapImage GetAssemblyImage()`, `string GetAssemblyName()`, `string GetAssemblyGroup()`, `eAssemblyRegion GetAssemblyRegion()` - Accessor methods for respective properties.
### Invariants
- The module must be constructed with a non-null `IUnityContainer` instance.
- Assembly-level attributes `TestSetupsListModuleName` and `TestSetupsListModuleImageAttribute` are applied exactly once per assembly (`AllowMultiple = false`).
- The module is exported as `IModule` and registered with Prism's module catalog under the name `"TestSetupsListModule"`.
### Dependencies
**Depends on:**
- `DTS.Common` (provides `AssemblyNames`, `AssemblyInfo`, `eAssemblyGroups`, `eAssemblyRegion`, `TextAttribute`, `ImageAttribute`)
- `DTS.Common.Interface`
- `DTS.Common.Interface.TestSetups.TestSetupsList` (provides `ITestSetupsListView`, `ITestSetupsListViewModel`)
- `Prism.Ioc`, `Prism.Modularity` (provides `IModule`, `IContainerProvider`, `IContainerRegistry`)
- `Unity` (provides `IUnityContainer`)
- `System.ComponentModel.Composition` (provides `ExportAttribute`)
**Depended on by:** Not determinable from source alone (likely the main application shell/bootstrapper).
### Gotchas
- The view and view model are registered via `RegisterType`, meaning a new instance is created each time they are resolved—not a singleton. The comment in `Initialize()` says "as a singleton" but the code uses `RegisterType` without `ContainerControlledLifetimeManager`, which is inconsistent.
- `OnInitialized` is empty while `RegisterTypes` calls `Initialize()`; this dual-path initialization pattern may cause confusion about when registration actually occurs.
---

View File

@@ -0,0 +1,27 @@
---
source_files:
- DataPRO/Modules/TestSetups/TestSetupsList/Model/TestSetupComparer.cs
generated_at: "2026-04-17T16:15:37.019693+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "6eb89071d4a03a7e"
---
# 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,29 @@
---
source_files:
- DataPRO/Modules/TestSetups/TestSetupsList/Properties/Settings.Designer.cs
- DataPRO/Modules/TestSetups/TestSetupsList/Properties/AssemblyInfo.cs
generated_at: "2026-04-17T16:28:27.914333+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "cc6e546e99c9b2c8"
---
# Properties
### Purpose
This module provides assembly metadata and application settings infrastructure for the TestSetupsList assembly. It defines version information and COM visibility settings for a component that appears to manage lists of test setups.
### Public Interface
**`TestSetupsList.Properties.Settings`** (internal sealed class)
- Inherits from `global::System.Configuration.ApplicationSettingsBase`
- `static Settings Default { get; }` - Returns the synchronized singleton instance of the settings class.
- No custom settings properties are defined beyond the base infrastructure.
**Assembly-level attributes:**
- `AssemblyTitle("TestSetupsList")`
- `AssemblyCompany("DTS")`
- `AssemblyProduct("TestSetupsList")`
- `AssemblyCopyright("Copyright © 2017")`
- `ComVisible(false)`
- `Guid("9aa6d22f-5df9-4702-a16a-2c7f38b466f8

View File

@@ -0,0 +1,31 @@
---
source_files:
- DataPRO/Modules/TestSetups/TestSetupsList/Resources/TranslateExtension.cs
- DataPRO/Modules/TestSetups/TestSetupsList/Resources/StringResources.Designer.cs
generated_at: "2026-04-17T16:12:45.079196+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b088df474836561f"
---
# Resources
### 1. Purpose
This module provides localization resources specifically for the `Diagnostics` assembly. It enables XAML-based UI components to bind to localized strings via the `TranslateExtension` markup extension, and exposes strongly-typed access to culture-specific resources (such as "Channels", "Details", "Groups", "Hardware") through the auto-generated `StringResources` class.
### 2. Public Interface
**Class: `Diagnostics.TranslateExtension`**
* `public TranslateExtension(string key)` — Constructor that accepts the resource key to be localized.
* `public override object ProvideValue(IServiceProvider serviceProvider)` — Returns the localized string corresponding to `_key`. Returns `#stringnotfound#` if the key is null or empty. Returns `#stringnotfound# {key}` if the lookup fails.
**Class: `Diagnostics.Resources.StringResources` (internal)**
* `internal static global::System.Resources.ResourceManager ResourceManager` — Returns the cached ResourceManager instance for the `Diagnostics.Resources.StringResources` resource set.
* `internal static global::System.Globalization.CultureInfo Culture` — Gets or sets the current UI culture for resource lookups.
* `internal static string Channels` — Looks up the localized string for "Channels".
* `internal static string Details` — Looks up the localized string for "Details".
* `internal static string Groups` — Looks up the localized string for "Group(s)".
* `internal static string Hardware` — Looks up the localized string for "Hardware".
### 3. Invariants
* `TranslateExtension` never returns `null`; it returns a fallback string constant `#stringnotfound#` in error cases.
* `StringResources

View File

@@ -0,0 +1,38 @@
---
source_files:
- DataPRO/Modules/TestSetups/TestSetupsList/View/TestSetupsListView.xaml.cs
generated_at: "2026-04-17T16:15:37.020140+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5d810c4863232d2e"
---
# View
### Purpose
This module provides a WPF view component for displaying diagnostic information in a tree structure. It serves as the visual representation layer for diagnostic data within the TestSetups module, implementing the `IDiagnosticsTreeView` interface to ensure contract compliance with the rest of the system.
### Public Interface
**`DiagnosticsTreeView` (class)**
- Signature: `public partial class DiagnosticsTreeView : IDiagnosticsTreeView`
- Description: A WPF UserControl representing a diagnostic tree view. The class is minimal, serving primarily as a code-behind for the associated XAML file. The constructor calls `InitializeComponent()` to load the XAML-defined UI.
### Invariants
- The view must always implement `IDiagnosticsTreeView` as defined in `DTS.Common.Interface.TestSetups.Diagnostics`.
- The associated XAML file (DiagnosticsTreeView.xaml) must exist and be properly formatted, as `InitializeComponent()` relies on it.
### Dependencies
- **Depends on**:
- `System.Windows` (WPF framework)
- `System.Windows.Controls`
- `System.Windows.Data`
- `System.Windows.Media`
- `DTS.Common.Interface.TestSetups.Diagnostics.IDiagnosticsTreeView`
- **Depended on by**: Unknown from source alone (likely a parent Diagnostics module or ViewModel).
### Gotchas
- The file uses `// ReSharper disable CheckNamespace` which suppresses namespace warnings. The namespace `Diagnostics` may not match the folder structure convention, which could cause confusion when locating the file.
- The class has no additional logic beyond initialization; all behavior is presumably defined in the XAML or bound ViewModel.
---

View File

@@ -0,0 +1,58 @@
---
source_files:
- DataPRO/Modules/TestSetups/TestSetupsList/ViewModel/TestSetupsListViewModel.cs
generated_at: "2026-04-17T16:00:45.456136+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "790589951db7c0bc"
---
# TestSetupsListViewModel Documentation
## 1. Purpose
`TestSetupsListViewModel` is the presentation logic component for the Test Setups List module in a WPF/Prism-based application. It manages the display, filtering, sorting, and selection of `ITestSetup` objects, serving as the intermediary between the view (`ITestSetupsListView`) and the underlying data. The class implements the MVVM pattern with `INotifyPropertyChanged` support and integrates with Prism's event aggregation and region management systems for decoupled communication across the application.
---
## 2. Public Interface
### Constructor
```csharp
public TestSetupsListViewModel(ITestSetupsListView 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` | `ITestSetupsListView` | The associated view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | Used to raise notification dialogs. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Used to raise confirmation dialogs. |
| `SelectedTestSetupIndex` | `int` | Index of the currently selected test setup. Default: `-1`. |
| `SelectedTestSetupItems` | `BulkObservableCollection<ITestSetup>` | Collection of selected test setup items. Fires `TestSetupsListTestSetupSelectedEvent` on change. |
| `TestSetups` | `ITestSetup[]` | The filtered/sorted array of test setups displayed to the user. |
| `IsDirty` | `bool` | Indicates whether there are unsaved changes. Has private setter only. |
| `IsBusy` | `bool` | Controls busy indicator state. Raises `PropertyChanged` on change. |
| `IsMenuIncluded` | `bool` | Indicates whether menu is included. Raises `PropertyChanged` on change. |
| `IsNavigationIncluded` | `bool` | Indicates whether navigation is included. Raises `PropertyChanged` on change. |
| `ListViewId` | `string` | Returns constant string `"TestSetupsListView"`. |
### Events
```csharp
public event PropertyChangedEventHandler PropertyChanged
```
Standard `INotifyPropertyChanged` event for data binding.
### Methods
```csharp
public void OnPropertyChanged(string propertyName)
```
Invokes the `PropertyChanged` event for the specified property.
```csharp
public void ClearAllFilters()
```
Clears all field-specific search terms from `_