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,104 @@
---
source_files:
- Common/DTS.CommonCore/Interface/RegionOfInterest/RegionOfInterestChannels/IRegionOfInterestChannelsView.cs
- Common/DTS.CommonCore/Interface/RegionOfInterest/RegionOfInterestChannels/IRegionOfInterestChannelsViewModel.cs
generated_at: "2026-04-16T12:22:46.294400+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "3255d2bc1a28f8fd"
---
# Documentation: RegionOfInterestChannels Module
## 1. Purpose
This module defines the View and ViewModel interfaces for managing Regions of Interest (ROI) channels within the DTS system. It follows a Model-View-ViewModel (MVVM) pattern, where `IRegionOfInterestChannelsView` represents the view contract and `IRegionOfInterestChannelsViewModel` defines the presentation logic for filtering, sorting, selecting, and validating ROI channel data. This module appears to be part of a larger test setup or data acquisition system where hardware channels are organized into regions of interest for monitoring or analysis.
---
## 2. Public Interface
### IRegionOfInterestChannelsView
**Declaration:**
```csharp
public interface IRegionOfInterestChannelsView : IBaseView { }
```
A marker interface extending `IBaseView`. No members are defined beyond the inherited contract.
---
### IRegionOfInterestChannelsViewModel
**Declaration:**
```csharp
public interface IRegionOfInterestChannelsViewModel : IBaseViewModel
```
**Properties:**
| Name | Type | Description |
|------|------|-------------|
| `View` | `IRegionOfInterestChannelsView` | Gets or sets the associated view instance. |
| `RegionsOfInterest` | `BindingList<IRegionOfInterest>` | Gets or sets the collection of regions of interest being managed. |
| `AllChannelSSNs` | `string[]` | Gets an array of all channel SSNs (presumably Serial Numbers). |
| `ISOViewMode` | `IsoViewMode` | Gets or sets the current ISO view mode. |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void SetParent(object o)` | Sets a parent object reference (purpose unclear from source alone). |
| `void SetGroups(ITestSetup testSetup, Dictionary<string, IDASHardware> serialNumberToHardware, IsoViewMode viewMode)` | Configures groups using a test setup, hardware lookup dictionary, and view mode. |
| `void SetTest(string path, IsoViewMode viewMode)` | Sets a test context using a file path and view mode. |
| `void Filter(object tag, string term)` | Filters channels based on a tag and search term. |
| `void Filter(string term)` | Filters in (searches for) a term among all channels. |
| `void Sort(object o, bool columnClick)` | Sorts the data; parameters suggest sorting by column interaction. |
| `void SelectAll(int roiIndex, bool selection)` | Selects or deselects all items within a specific region of interest identified by `roiIndex`. |
| `bool Validate(ref List<string> errors)` | Validates the current state; populates the `errors` list with validation messages and returns a boolean success indicator. |
---
## 3. Invariants
1. **MVVM Contract**: `IRegionOfInterestChannelsViewModel` must always have an associated `IRegionOfInterestChannelsView` via the `View` property.
2. **BindingList Usage**: `RegionsOfInterest` uses `BindingList<IRegionOfInterest>`, implying the collection must support change notification for UI binding.
3. **Validation Contract**: The `Validate` method must populate the `errors` list (passed by reference) when returning `false`.
4. **ROI Index Bounds**: The `roiIndex` parameter in `SelectAll` must correspond to a valid index within `RegionsOfInterest` (not enforced at interface level, but implied).
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
- `System.Collections.Generic` — For `List<T>` and `Dictionary<TKey, TValue>`.
- `System.Collections.ObjectModel` — For collection types.
- `System.ComponentModel` — For `BindingList<T>`.
- `DTS.Common.Interface.DataRecorders` — Provides `IDASHardware`.
- `DTS.Common.Interface.TestSetups.TestSetupsList` — Provides `ITestSetup`.
- `DTS.Common.Enums` — Provides `IsoViewMode` enum.
**Referenced but not actively used (commented code):**
- `DTS.Common.Interface.Groups``ITestObject` (in commented `SetGroups` overload).
- `DTS.Common.Interface.GroupTemplate``ITestObjectTemplate` (in commented `SetGroups` overload).
**Dependents:**
- Cannot be determined from these source files alone.
---
## 5. Gotchas
1. **Commented Method Signature**: There is a commented-out overload of `SetGroups`:
```csharp
//void SetGroups(ITestObject[] groups, Dictionary<string, IDASHardware> hardwareLookup, ITestObjectTemplate[] groupTemplates);
```
This suggests a refactoring occurred where the method signature changed to accept `ITestSetup` instead of individual arrays. The active `SetGroups` method has different semantics—callers should not assume the old signature is still supported.
2. **Ambiguous `SetParent` Purpose**: The `SetParent(object o)` method accepts a generic `object` type without documentation. The intended parent type and usage context are unclear from the source alone.
3. **Ambiguous `Sort` Parameters**: The `Sort(object o, bool columnClick)` method uses non-descriptive parameter names. The meaning of `o` and the `columnClick` flag's effect on sorting behavior are unclear from the source alone.
4. **SSN Terminology**: `AllChannelSSNs` uses the abbreviation "SSN" without definition. This likely means "Serial Number" but should be confirmed against system documentation.