6.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T04:50:32.534964+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | e6043d62e08504ef |
TTSImport View Layer Documentation
1. Purpose
This module provides WPF user interface views for the TTS (Test Tool Suite) import workflow within the DataPRO test setup system. Each view implements a corresponding interface from the DTS.Common.Interface hierarchy and serves as the presentation layer for specific configuration steps—such as hardware scanning, channel selection (analog, digital input/output, TOM), level triggering, file editing/reading, and summary display. These views are lightweight containers that delegate logic to associated view models via data binding and explicit method calls, following a standard MVVM pattern adapted for the existing codebase.
2. Public Interface
All classes are public partial and inherit from WPF UserControl (implied by InitializeComponent() usage), implementing interfaces defined in DTS.Common.Interface and sub-namespaces.
| Class | Interface | Signature | Behavior |
|---|---|---|---|
LevelTriggerView |
ILevelTriggerView |
public LevelTriggerView() |
Constructor initializes XAML UI via InitializeComponent(). No additional logic. |
HardwareScanView |
IHardwareScanView |
public HardwareScanView() |
Constructor initializes XAML UI via InitializeComponent(). No additional logic. |
TOMChannelsView |
ITOMChannelsView |
public TOMChannelsView() |
Constructor initializes XAML UI via InitializeComponent(). No additional logic. |
AnalogChannelsView |
IAnalogChannelsView |
public AnalogChannelsView() |
Constructor initializes XAML UI via InitializeComponent(). No additional logic. |
ReadFileView |
IReadFileView |
public ReadFileView()public void Connect(int connectionId, object target) |
Constructor initializes XAML UI. Connect() is a no-op stub (empty body). |
DigitalInputChannelsView |
IDigitalInputChannelsView |
public DigitalInputChannelsView() |
Constructor initializes XAML UI via InitializeComponent(). No additional logic. |
DigitalOutputChannelsView |
IDigitalOutputChannelsView |
public DigitalOutputChannelsView() |
Constructor initializes XAML UI via InitializeComponent(). No additional logic. |
SummaryView |
ISummaryView |
public SummaryView()public void UpdateTestIds(string[] serializedValues)public void SetTestName(string testName)public string GetTestId() |
Constructor initializes XAML UI. UpdateTestIds() delegates to ctrlTestId.PopulateAllTestIdPrefixSuffixValues(). SetTestName() sets TestName and TestSetupLabel on ctrlTestId. GetTestId() returns result of ctrlTestId.GetTestId(). |
EditFileView |
IEditFileView |
public EditFileView()private void TextBox_TextChanged(object sender, TextChangedEventArgs e) |
Constructor initializes XAML UI. TextBox_TextChanged event handler extracts text from the changed TextBox, casts DataContext to IEditFileViewModel, and invokes Search(text) on it. |
Note
: All views reference a control named
ctrlTestId(inSummaryView.xaml.cs) andTextBoxcontrols (inEditFileView.xaml.cs). Their exact types and interfaces (PopulateAllTestIdPrefixSuffixValues,GetTestId, etc.) are not defined in this module and must be inferred fromDTS.Common.Interfaceor related XAML definitions.
3. Invariants
- All views are instantiated with parameterless constructors only (no dependency injection via constructor).
- Each view’s
InitializeComponent()must be called first in the constructor (standard WPF practice). EditFileView.TextBox_TextChangedassumes itsDataContextis assignable toIEditFileViewModel; failure to satisfy this will cause a runtimeInvalidCastException.ReadFileView.Connect()is present but has no effect—its parameters (connectionId,target) are unused.- All views belong to the
TTSImportnamespace, and their interfaces reside underDTS.Common.Interface(with sub-namespaces for digital channels and TTS-specific interfaces).
4. Dependencies
Dependencies of this module:
DTS.Common.Interface(core interfaces:ILevelTriggerView,IHardwareScanView,IReadFileView,ISummaryView)DTS.Common.Interface.TestSetups.Imports.TTS(interfaces:ITOMChannelsView,IEditFileView,IAnalogChannelsView)DTS.Common.Interface.TestSetups.Imports.TTS.DIChannels(IDigitalInputChannelsView)DTS.Common.Interface.TestSetups.Imports.TTS.DOChannels(IDigitalOutputChannelsView)- WPF framework types:
System.Windows.Controls.TextBox,System.Windows.Controls.UserControl,System.Windows.RoutedEventArgs(viaTextChangedEventArgs)
Dependencies on this module:
- Unknown from source alone. These views are likely consumed by a view model layer or a navigation/controller module (e.g.,
TTSImportmodule’s view models or a parent test setup wizard).
5. Gotchas
- Namespace mismatch: All view classes are in the
TTSImportnamespace, but their XML documentation comments incorrectly referenceHardwareScanView.xamlfor all views (includingReadFileView,SummaryView, etc.). This may indicate copy-paste errors in comments or incorrect XAML file names. - Unused
Connectmethod:ReadFileView.Connect()is declared but empty—likely a placeholder for future connection logic or legacy code. - Assumed control names:
SummaryViewrelies on a control namedctrlTestId, andEditFileViewon aTextBoxnamedsender. If XAML names differ, runtime errors will occur. - No validation in
EditFileView: TheTextBox_TextChangedhandler blindly castsDataContexttoIEditFileViewModel. If the view is reused or bound to a non-conforming view model, it will crash. - Missing interface definitions: The interfaces (e.g.,
ISummaryView,IEditFileView) are referenced but not defined here; their exact contracts (e.g., whetherUpdateTestIdsorSearchare required) must be verified inDTS.Common.Interface. - No error handling: None of the views include try/catch blocks or logging—failures in
InitializeComponent()or casting will propagate unhandled exceptions.