7.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T02:29:26.774100+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 3255d2bc1a28f8fd |
RegionOfInterestChannels
Documentation: IRegionOfInterestChannelsViewModel and IRegionOfInterestChannelsView
1. Purpose
This module defines the contract for the view and view model layers responsible for managing and presenting a collection of regions of interest (ROIs) in the context of test setups, channel groupings, and hardware configurations. It serves as the data and interaction layer for UI components that display, filter, sort, and validate ROI channel data—typically used in test setup or configuration interfaces where users define or inspect specific channel subsets (ROIs) across hardware devices. The module sits between domain-level ROI definitions (IRegionOfInterest) and higher-level test setup logic (ITestSetup, IDASHardware), enabling dynamic UI-driven manipulation of ROI collections.
2. Public Interface
IRegionOfInterestChannelsView
- Interface:
IRegionOfInterestChannelsView : IBaseView
A marker interface for the view layer (e.g., UI control or page) implementing the view contract for ROI channel presentation. Inherits fromIBaseView, implying standard view lifecycle or binding support.
IRegionOfInterestChannelsViewModel
-
Interface:
IRegionOfInterestChannelsViewModel : IBaseViewModel
Core business logic interface for ROI channel management.-
void SetParent(object o)
Assigns a parent object (e.g., a parent view model or controller) for hierarchical navigation or context propagation. -
IRegionOfInterestChannelsView View { get; set; }
Gets or sets the associated view instance. Enables two-way binding or view-model-to-view coordination. -
BindingList<IRegionOfInterest> RegionsOfInterest { get; set; }
Gets or sets the mutable list of ROI objects currently managed.BindingList<T>implies change notifications (e.g., for UI data binding). -
string[] AllChannelSSNs { get; }
Read-only array of serial numbers (SSNs) for all channels known to the view model (e.g., from hardware or test setup). Used for validation or lookup. -
void SetGroups(ITestSetup testSetup, Dictionary<string, IDASHardware> serialNumberToHardware, IsoViewMode viewMode)
Initializes or updates the ROI list based on a given test setup, hardware lookup (by serial number), and view mode. Replaces or populatesRegionsOfInterest. -
void SetTest(string path, IsoViewMode viewMode)
Loads ROI data from a test definition atpath, applying the specifiedIsoViewMode. Likely used for loading saved or template-based configurations. -
void Filter(object tag, string term)
Filters ROIs (and possibly their channels) using a searchterm, with optionaltagfor context-specific filtering (e.g., by group or hardware type). -
void Filter(string term)
Overload ofFilterthat filters all channels/ROIs bytermwithout additional context. -
void Sort(object o, bool columnClick)
Sorts theRegionsOfInterestlist.olikely identifies the sort key (e.g., column header or property name);columnClickmay indicate user-initiated sorting. -
void SelectAll(int roiIndex, bool selection)
Sets the selection state (true= selected,false= deselected) for all channels within the ROI atroiIndex. -
bool Validate(ref List<string> errors)
Validates the current ROI configuration (e.g., channel assignments, hardware compatibility). Returnsfalseif errors exist; populateserrorswith human-readable messages. -
IsoViewMode ISOViewMode { get; set; }
Gets or sets the current view mode (e.g.,IsoViewMode.Standard,IsoViewMode.Comparison), influencing how ROIs/channels are displayed or interpreted.
-
3. Invariants
RegionsOfInterestmust be aBindingList<IRegionOfInterest>—not a plainList<T>—to support UI change notifications.AllChannelSSNsmust contain all channel serial numbers relevant to the current context (e.g., those intestSetupor loaded hardware), and must not include duplicates.Validate(ref List<string> errors)must returnfalseif any ROI or channel assignment is invalid (e.g., missing hardware, duplicate SSNs, out-of-range indices), and must populateerrorswith actionable details.FilterandSortoperations must not mutate the underlying ROI data—only the view or displayed list (implied byBindingListusage and typical MVVM patterns).SetGroupsandSetTestmust fully reinitializeRegionsOfInterestand related state (e.g.,AllChannelSSNs,ISOViewMode) to reflect the new context.
4. Dependencies
Imports/Usings (Explicit Dependencies)
DTS.Common.Base→ Base interfaces (IBaseViewModel,IBaseView).System.Collections.Generic,System.Collections.ObjectModel,System.ComponentModel→ Core .NET collections and data binding (BindingList<T>,ObservableCollection<T>implied viaIBaseViewModel).DTS.Common.Interface.DataRecorders→IDASHardware.DTS.Common.Interface.Groups,DTS.Common.Interface.GroupTemplate→ITestObject,ITestObjectTemplate(commented-out signature suggests legacy use).DTS.Common.Interface.TestSetups.TestSetupsList→ITestSetup.DTS.Common.Enums→IsoViewMode.
Inferred Dependencies
- Consumers: Any UI layer or parent view model requiring ROI channel management (e.g., test configuration dialog, ROI editor).
- Dependencies:
IRegionOfInterest(type of items inRegionsOfInterest)ITestSetup(forSetGroups/SetTest)IDASHardware(viaserialNumberToHardwaredictionary)IsoViewModeenum (controls behavior of filtering/sorting/validation)
Notable Omission
- The commented-out
SetGroupssignature suggests a prior design usingITestObject[]andITestObjectTemplate[]; current implementation usesITestSetupinstead. This may indicate legacy compatibility concerns.
5. Gotchas
SetGroupsvs.SetTestambiguity: The distinction betweenSetGroups(hardware/test setup-driven) andSetTest(path-driven) is not clarified in the source. It is unclear whetherSetTestinternally callsSetGroupsor loads data from disk (e.g., JSON/XML).Filter(object tag, string term): The purpose oftagis undocumented. It may be used for multi-filter scenarios (e.g., filtering by group and term), but without implementation or usage context, its contract is ambiguous.SelectAll(int roiIndex, bool selection): No bounds checking is declared. Passing an out-of-rangeroiIndexmay cause runtime exceptions.AllChannelSSNsscope: It is unclear whether this includes only channels in the current test setup or all channels in the system. This affects validation logic (e.g., rejecting SSNs not inAllChannelSSNs).- No thread-safety guarantees:
BindingList<T>is not thread-safe; concurrent modifications (e.g., from background workers) may corrupt state. IsoViewModeusage: The enumIsoViewModeis used in multiple methods, but its possible values and their behavioral impact are not defined here (must be checked inDTS.Common.Enums).
None identified from source alone.