6.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:50:08.947322+00:00 | zai-org/GLM-5-FP8 | 1 | 3145b9d8c3358fd9 |
Documentation: DataPRO Import Views
1. Purpose
This module contains WPF UserControl views for a Test Setup Import wizard within the DataPRO application. Each control represents a step or component in the import workflow, including file reading, hardware scanning, channel configuration (Analog, Squib, Digital Input, Digital Output), summary display, and progress indication. These views follow a Model-View-ViewModel (MVVM) pattern, binding to corresponding ViewModels and implementing the IPageContent interface to integrate with a page-based navigation system.
2. Public Interface
StatusAndProgressBarControl
A minimal UserControl for displaying status and progress during import operations.
public StatusAndProgressBarControl()
- Default constructor that calls
InitializeComponent(). No additional logic or public members beyond the inheritedUserControl.
SummaryControl
Displays a summary of the import configuration. Implements IPageContent.
public SummaryControl(SummaryViewModel summaryViewModel)
- Sets
DataContextto the providedsummaryViewModelbefore initialization.
IPageContent Implementation:
| Method | Behavior |
|---|---|
void IPageContent.SetPermissions(User.UserPermissionLevels actualPermission, User.UserPermissionLevels requiredPermission) |
Sets IsEnabled to true if (int)actualPermission >= (int)requiredPermission |
bool IPageContent.KeyDown(object sender, KeyEventArgs arg) |
Returns false (no handling) |
void IPageContent.StartSearch(string term) |
No-op |
bool IPageContent.OnButtonPress(PageButton button) |
Returns false (no handling) |
bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow) |
Returns true unconditionally |
void OnSetActive() |
Calls Validate() with empty lists and displayWindow=false |
void IPageContent.UnSet(Action OnComplete = null) |
No-op |
object GetPageContent() |
Returns this |
ReadFileControl
Handles the file reading step of the import workflow. Implements IPageContent.
public ReadFileControl(ReadFileViewModel readFileViewModel)
- Sets
DataContextto the providedreadFileViewModelbefore initialization.
IPageContent Implementation: Identical to SummaryControl (same stub implementations).
SquibChannelsControl
Configures squib channel imports. Implements IPageContent.
public SquibChannelsControl(SquibChannelsViewModel squibChannelsViewModel)
- Sets
DataContextto the providedsquibChannelsViewModelbefore initialization.
IPageContent Implementation: Identical to SummaryControl.
AnalogChannelsControl
Configures analog channel imports. Implements IPageContent.
public AnalogChannelsControl(AnalogChannelsViewModel analogChannelsViewModel)
- Sets
DataContextto the providedanalogChannelsViewModelbefore initialization.
IPageContent Implementation: Identical to SummaryControl.
DigitalInputChannelsControl
Configures digital input channel imports. Implements IPageContent.
public DigitalInputChannelsControl(DigitalInputChannelsViewModel digitalInputChannelsViewModel)
- Sets
DataContextto the provideddigitalInputChannelsViewModelbefore initialization.
IPageContent Implementation: Identical to SummaryControl.
DigitalOutputChannelsControl
Configures digital output channel imports. Implements IPageContent.
public DigitalOutputChannelsControl(DigitalOutputChannelsViewModel digitalOutputChannelsViewModel)
- Sets
DataContextto the provideddigitalOutputChannelsViewModelbefore initialization.
IPageContent Implementation: Identical to SummaryControl.
HardwareScanControl
The most complex control; handles hardware scanning and displays DAS (Data Acquisition System) device summaries and channel mappings. Implements IPageContent.
protected HardwareScanControl()
- Protected parameterless constructor for designer/inheritance use.
public HardwareScanControl(HardwareViewModel model, DataPROPage page)
- Primary constructor. Sets
DataContexttomodel, stores references to_pageand_hardwareViewModel, and wires upOnDoneandOnClearcallbacks on the ViewModel.
public void Scan()
- Initiates a hardware scan by calling
_hardwareViewModel.Scan(true).
Private Methods:
| Method | Purpose |
|---|---|
void ViewModelClear() |
Clears ItemsSource on lvChannelSummary, lvDASSummary, and dgDASCount. Uses Dispatcher.BeginInvoke if not on UI thread. |
void ViewModelDone() |
Called when ViewModel completes; populates data tables and list views with scan results. |
void CreateDataTable() |
Builds a DataTable for dgDASCount with columns for hardware types and channel counts. |
void PopulateListView() |
Populates lvDASSummary with active DAS devices from ((App)Application.Current).DASFactory.GetActiveDevices(). |
void CreateChannelsSummary() |
Populates lvChannelSummary with _hardwareViewModel.GetChannelSummary(). |
void AddNewColumn(string header, ref int colIdx) |
Adds a column to _dt and dgDASCount. |
void PopulateRow(ref DataRow row, Models.DASSummaryRow summary, HardwareTypes[] dasTypes, string title) |
Populates a DataRow with DAS counts for each hardware type and channel category. |
Fields:
| Field | Type | Purpose |
|---|---|---|
_page |
DataPROPage |
Reference to parent page |
_hardwareViewModel |
HardwareViewModel |
Bound ViewModel |
_dt |
DataTable |
Backing data for dgDASCount |
_hardwareTypeToDisplayString |
Dictionary<HardwareTypes, string> |