9.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:22:23.083455+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 7ad50e5b491c81bf |
GroupTemplate
Documentation: Group Template Interface Module
1. Purpose
This module defines the core interfaces for the Group Template subsystem, which manages reusable template definitions for grouping test channels and associated metadata in the DTS (Device Test System) platform. It provides a layered architecture separating data models (IGroupTemplate, ITestObjectTemplate, IGroupTemplateChannel), view models (IGroupTemplateViewModel, IGroupTemplateListViewModel, ITemplateChannelListViewModel, IGroupTemplateInfoControlViewModel), and view contracts (IGroupTemplateListView, IGroupTemplateExportView, IGroupTemplateImportView, ITemplateChannelListView, IGroupTemplateInfoControlView). These interfaces enable separation of concerns for UI presentation, data binding, and business logic related to template creation, listing, import/export, and channel configuration.
2. Public Interface
Data Model Interfaces
-
IGroupTemplate
Represents a group template with basic properties:Disabled,Name,Description,Channels,AssociatedGroups,LastModifiedBy,LastModified,SerialNumber. IncludesFilter(string term)for client-side filtering. -
IGroupTemplateChannel
Represents a channel within a group template. Properties:Custom(read-only),DisplayOrder,NameOfTheChannel,Name(read-only),Required,ISOCode. IncludesFilter(string term).GroupTemplateChannelComparer
ImplementsIComparer<IGroupTemplateChannel>for sorting. UsesSortField(of typeGroupTemplateChannelFields) andAscendingflag. Supports sorting byRequired,Name,ISOCode,Custom, andDisplayOrder. ThrowsArgumentOutOfRangeExceptionfor unsupported sort fields.
-
ITestObjectTemplate
Represents a test object template (possibly embedded). Properties includeTemplateName,TemplateNameOrOriginalTemplateName,Icon,Description,LocalOnly,Version,LastModifiedBy,LastModified,CRC32,TestObject,TestObjectType,TemplateParent,SysBuilt,OriginalTemplateName,Embedded. IncludesIsISOMode()method.
View Model Interfaces
-
IGroupTemplateViewModel
Main view model for group template operations. Properties:ImportView(IGroupTemplateImportView),ExportView(IGroupTemplateExportView). IncludesUnset()method (likely for cleanup/disposal). -
IGroupTemplateListViewModel
Manages the list view of group templates. Properties:View(IGroupTemplateListView),Templates(array ofIGroupTemplate). Methods:GetAllTemplates(bool bIncludeEmbedded, bool bISOMode),Unset(),Sort(object o, bool columnClick),Filter(string term),MouseDoubleClick(int index). ImplementsIFilterableListView(inherited fromIBaseViewModel+IFilterableListView). -
ITemplateChannelListViewModel
Manages the channel list for a group template. Properties:View(ITemplateChannelListView). Methods:Unset(),Sort(object o, bool columnClick),Filter(string term),SetAllChannels(IGroupTemplateChannel[] channels),GetAllChannels(),MoveDown(IGroupTemplateChannel channel),MoveUp(IGroupTemplateChannel channel),SetParent(object o). -
IGroupTemplateInfoControlViewModel
Manages the info/control view for a selected group template. Properties:View(IGroupTemplateInfoView),SelectedGroupTemplate(IGroupTemplate). Note:IGroupTemplateInfoViewis referenced but not defined in this module; its definition is assumed to be in theDataPro.Common.Interfacenamespace.
View Interface Contracts
-
IGroupTemplateListView
Marker interface for the group template list view (extendsIBaseView). -
IGroupTemplateExportView
Marker interface for the group template export view (extendsIBaseView). -
IGroupTemplateImportView
Marker interface for the group template import view (extendsIBaseView). -
ITemplateChannelListView
Marker interface for the template channel list view (extendsIBaseView). -
IGroupTemplateInfoControlView
Marker interface for the group template info/control view (extendsIBaseView). Note: This interface is defined in theDataPro.Common.Interfacenamespace, notDTS.Common.Interface.GroupTemplate.
3. Invariants
- All view interfaces (
IGroupTemplateListView,IGroupTemplateExportView, etc.) are marker interfaces extendingIBaseView; they convey no additional contract beyond type identity. - View models (
IGroupTemplateViewModel,IGroupTemplateListViewModel, etc.) must maintain a valid reference to their corresponding view (via theViewproperty) during active use. IGroupTemplateListViewModel.Templatesis expected to be an array ofIGroupTemplateinstances populated byGetAllTemplates(...).ITemplateChannelListViewModelexpectsSetAllChannels(...)to be called beforeGetAllChannels(),MoveUp/Down, orSortoperations to ensure channel data is initialized.IGroupTemplateChannel.Nameis read-only and likely derived fromNameOfTheChannelor other internal state.ITestObjectTemplate.EmbeddedandITestObjectTemplate.TemplateNameare related: embedded templates use a GUID asTemplateName, whileOriginalTemplateNamestores the human-readable name.IGroupTemplate.Filter(string term)andIGroupTemplateChannel.Filter(string term)must implement case-insensitive or substring matching (exact behavior not specified in source).IGroupTemplateInfoControlViewModelrequiresIGroupTemplateInfoViewto be defined elsewhere (inDataPro.Common.Interface).
4. Dependencies
-
Internal Dependencies
- All interfaces depend on
DTS.Common.Base.IBaseViewandDTS.Common.Base.IBaseViewModel. IGroupTemplateListViewModeldepends onDTS.Common.Interface.Pagination.IFilterableListView.IGroupTemplateChanneldepends onDTS.Common.Enums.GroupTemplates.GroupTemplateChannelFields(enum for sort fields).IGroupTemplateInfoControlViewModeldepends onDataPro.Common.Interface.IGroupTemplateInfoView(not provided in this module).
- All interfaces depend on
-
External Dependencies
DataPro.Common.Basenamespace (used inIGroupTemplateInfoControlViewandIGroupTemplateInfoControlViewModel).System,System.Collections.Generic,System.Linq(implied viaIComparer,String.Compare, etc.).
-
Dependents
- UI layers (e.g., WPF/WinForms views) likely implement the view interfaces.
- View model implementations (e.g.,
GroupTemplateListViewModelImpl) depend on these interfaces for DI and testability. - Import/export logic likely consumes
IGroupTemplateImportView/IGroupTemplateExportView. - Channel ordering UI likely consumes
ITemplateChannelListViewModel.
5. Gotchas
- Namespace Inconsistency:
IGroupTemplateInfoControlViewandIGroupTemplateInfoControlViewModelreside inDataPro.Common.Interface, notDTS.Common.Interface.GroupTemplate, despite being grouped here. This may cause confusion during navigation or refactoring. - Missing
IGroupTemplateInfoView: Referenced inIGroupTemplateInfoControlViewModel, but not defined in this module. Its contract is unknown. IGroupTemplateChannel.NamevsNameOfTheChannel:Nameis read-only, whileNameOfTheChannelis read-write. The relationship between them is not documented (e.g., isNamea normalized version?).CRC32andVersionfields: Comments indicate these are “not currently used” or “unsure if this is still used”, suggesting potential dead code or legacy artifacts.TemplateParentandSysBuilt: Comments indicate uncertainty about usage; behavior may be undefined or deprecated.IFilterableListView: Inherited byIGroupTemplateListViewModel, but its contract (e.g.,FilterTermproperty,OnFilterChangedevent) is not visible here.Unset()method: Used across multiple view models; likely for cleanup, but semantics (e.g., nullingView, releasing resources) are not specified.MouseDoubleClick(int index): Signature implies index-based selection, but no context (e.g., which item, event args) is provided—potential source of off-by-one or stale-index bugs.- No generic constraints: View models accept
objectforSort(object o, bool columnClick)andSetParent(object o), risking runtime type errors if callers pass unexpected types.