72 lines
3.2 KiB
Markdown
72 lines
3.2 KiB
Markdown
---
|
|
source_files:
|
|
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestModification/View/TestModificationView.xaml.cs
|
|
generated_at: "2026-04-16T13:47:19.361025+00:00"
|
|
model: "zai-org/GLM-5-FP8"
|
|
schema_version: 1
|
|
sha256: "3165a969f0d942bf"
|
|
---
|
|
|
|
# Documentation: TestModificationView.xaml.cs
|
|
|
|
## 1. Purpose
|
|
|
|
This module provides the code-behind for a WPF view component (`TestModificationView`) within the DTS Viewer application's TestModification module. It implements the `ITestModificationView` interface and exposes available filter class options to the view layer, serving as a bridge between the sensor database configuration and the UI for test modification functionality.
|
|
|
|
---
|
|
|
|
## 2. Public Interface
|
|
|
|
### `TestModificationView` (Class)
|
|
|
|
**Implements:** `ITestModificationView`
|
|
|
|
#### Constructor
|
|
|
|
```csharp
|
|
public TestModificationView()
|
|
```
|
|
Initializes the view component by calling `InitializeComponent()`, which loads the associated XAML.
|
|
|
|
#### Property: `AvailableCFC`
|
|
|
|
```csharp
|
|
public List<IFilterClass> AvailableCFC { get; }
|
|
```
|
|
Returns a list of available filter classes (CFC = Channel Filter Classes, per comment "FB 13120"). Each access instantiates a new `AnalogSettingDefaults` object and returns its `FilterOptions` property.
|
|
|
|
---
|
|
|
|
## 3. Invariants
|
|
|
|
- The `AvailableCFC` property always returns a non-null `List<IFilterClass>` (the actual nullability depends on `AnalogSettingDefaults.FilterOptions` implementation, which is external to this file).
|
|
- The view is a partial class; the XAML counterpart (`TestModificationView.xaml`) must exist for `InitializeComponent()` to succeed.
|
|
- The class implements `ITestModificationView`, implying contractual obligations defined in that interface (not visible in this source).
|
|
|
|
---
|
|
|
|
## 4. Dependencies
|
|
|
|
### This module depends on:
|
|
- `DTS.Common.Interface` — provides `ITestModificationView` interface
|
|
- `DTS.Common.Interface.Sensors.SoftwareFilters` — provides `IFilterClass` interface
|
|
- `DTS.SensorDB` — provides `AnalogSettingDefaults` class
|
|
- `System.Windows.Controls` — WPF infrastructure (UserControl base, implied by `InitializeComponent()` pattern)
|
|
|
|
### Unused import:
|
|
- `System.Text.RegularExpressions` — imported but not referenced in this file
|
|
|
|
### What depends on this module:
|
|
- Cannot be determined from this source file alone (likely referenced by a module registration/bootstrapper or a parent view).
|
|
|
|
---
|
|
|
|
## 5. Gotchas
|
|
|
|
1. **Object allocation on every property access**: The `AvailableCFC` getter creates a new `AnalogSettingDefaults` instance on every call. If this property is data-bound and accessed frequently by WPF, it could cause unnecessary allocations. Consider whether caching is appropriate.
|
|
|
|
2. **Unused import**: `System.Text.RegularExpressions` is imported but not used in this file. This may indicate dead code, a missing implementation, or usage in the XAML portion.
|
|
|
|
3. **Namespace suppression**: The file includes `// ReSharper disable CheckNamespace`, suggesting the namespace may not match the folder structure. This could cause confusion when navigating the codebase.
|
|
|
|
4. **FB 13120 reference**: The comment references a tracking item (likely a bug or feature request). The context and resolution status of this item are unknown from the source alone. |