6.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T04:49:40.145713+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 1b549e2b16a3c023 |
TTS
Purpose
The TTSImportModule is a Prism module responsible for registering view and view-model types related to TTS (Test Timing Specification) import functionality within the DTS (Device Test System) framework. It enables modular UI composition by integrating TTS-specific import views (e.g., hardware scan, file editing, summary, channel configuration) into the application’s dependency injection container via Unity, making them available for navigation and reuse across the UI. This module acts as a bridge between the core test setup infrastructure and the TTS import feature set, ensuring proper instantiation and lifecycle management of its UI components.
Public Interface
Class: TTSImportModule
-
TTSImportModule(IUnityContainer unityContainer)
Constructor. Accepts a Unity container via dependency injection and stores it for later use in type registration duringInitialize(). -
void Initialize()
Registers all TTS import-related view and view-model types as singleton mappings in the Unity container. Specifically registers:IHardwareScanView→HardwareScanViewIHardwareScanViewModel→HardwareScanViewModelIEditFileView→EditFileViewIEditFileViewModel→EditFileViewModelISummaryView→SummaryViewISummaryViewModel→SummaryViewModelIReadFileView→ReadFileViewIReadFileViewModel→ReadFileViewModelILevelTriggerView→LevelTriggerViewILevelTriggerViewModel→LevelTriggerViewModelIAnalogChannelsView→AnalogChannelsViewIAnalogChannelsViewModel→AnalogChannelsViewModelITOMChannelsView→TOMChannelsViewITOMChannelsViewModel→TOMChannelsViewModelIDigitalInputChannelsView→DigitalInputChannelsViewIDigitalInputChannelsViewModel→DigitalInputChannelsViewModelIDigitalOutputChannelsView→DigitalOutputChannelsViewIDigitalOutputChannelsViewModel→DigitalOutputChannelsViewModel
-
void OnInitialized(IContainerProvider containerProvider)
Currently throwsNotImplementedException. Intended for post-initialization logic per Prism module lifecycle, but unused. -
void RegisterTypes(IContainerRegistry containerRegistry)
Currently throwsNotImplementedException. Presumably intended for Prism’sIContainerRegistry-based type registration, but not implemented.
Attribute Classes
-
TTSImportModuleNameAttribute
Assembly-level attribute. Inherits fromTextAttribute. Returns"TTSImport"as theAssemblyName(viaAssemblyNames.TTSImport.ToString()). Used to identify the module by name. -
TTSImportModuleImageAttribute
Assembly-level attribute. Inherits fromImageAttribute. Provides metadata for UI presentation:AssemblyImage: Loads image viaAssemblyInfo.GetImage("TTSImport").AssemblyName:"TTSImport".AssemblyGroup:"Prepare"(viaeAssemblyGroups.Prepare.ToString()).AssemblyRegion:eAssemblyRegion.TTSImportRegion.
Invariants
- The
TTSImportModulemust be loaded before any UI components that depend on its registered views/view-models are instantiated. - All view and view-model types registered in
Initialize()must be concrete types implementing their respective interfaces (e.g.,HardwareScanView : IHardwareScanView). - The
AssemblyNames.TTSImportandeAssemblyGroups.Prepare/eAssemblyRegion.TTSImportRegionenums must be defined and accessible (fromDTS.Common), or runtime failures will occur during attribute initialization. - The
AssemblyInfo.GetImage(...)method must return a validBitmapImagefor"TTSImport"; otherwise,TTSImportModuleImageAttributemay throw or return null.
Dependencies
Dependencies of this module:
DTS.Common(specificallyAssemblyNames,eAssemblyGroups,eAssemblyRegion,AssemblyInfo)Prism.Modularity(IModule,IContainerProvider,IContainerRegistry)Unity(IUnityContainer)System.Windows.Media.Imaging(BitmapImage)- Internal interfaces under
DTS.Common.Interface.TestSetups.Imports.TTS.*(e.g.,IHardwareScanView,IAnalogChannelsViewModel)
Dependencies on this module:
- Any module or UI component that consumes TTS import views (e.g., via
IUnityContainer.Resolve<T>()or Prism region navigation) depends on this module being loaded first. - The
TTSImportModuleNameAttributeandTTSImportModuleImageAttributeare used by the host application (likely in module discovery/UI assembly rendering), so the host depends on these attributes being present.
Gotchas
OnInitializedandRegisterTypesare unimplemented — throwingNotImplementedException. This is inconsistent with Prism’sIModulecontract and may cause runtime errors if the host framework calls them.- Hardcoded assembly name
"TTSImport"— relies onAssemblyNames.TTSImportandAssemblyInfo.GetImage(...). If these are misconfigured or renamed, attribute initialization will fail silently or throw. - No validation in
Initialize()— assumes all view/view-model types exist and are resolvable. Missing implementations will cause Unity registration to fail at runtime (not compile time). - No cleanup logic — the module does not unregister types or dispose resources (e.g., images), potentially contributing to memory leaks in long-running scenarios.
TTSImportModuleImageAttributeconstructor assigns_imgtwice — redundant assignment in the parameterized constructor (_img = ...in both default and: this(null)paths). Likely harmless but indicates possible refactoring debt.- No documentation on view/view-model responsibilities — while interfaces like
IHardwareScanVieware registered, their semantics (e.g., data flow, user interactions) are not described here and must be inferred from their implementations.