Files
DP44/docs/ai/DataPRO/DataPRO/Controls/TestSetups/Import/Views.md
2026-04-17 14:55:32 -04:00

6.4 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/DataPRO/Controls/TestSetups/Import/Views/StatusAndProgressBarControl.xaml.cs
DataPRO/DataPRO/Controls/TestSetups/Import/Views/SummaryControl.xaml.cs
DataPRO/DataPRO/Controls/TestSetups/Import/Views/ReadFileControl.xaml.cs
DataPRO/DataPRO/Controls/TestSetups/Import/Views/SquibChannelsControl.xaml.cs
DataPRO/DataPRO/Controls/TestSetups/Import/Views/AnalogChannelsControl.xaml.cs
DataPRO/DataPRO/Controls/TestSetups/Import/Views/DigitalInputChannelsControl.xaml.cs
DataPRO/DataPRO/Controls/TestSetups/Import/Views/DigitalOutputChannelsControl.xaml.cs
DataPRO/DataPRO/Controls/TestSetups/Import/Views/HardwareScanControl.xaml.cs
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 inherited UserControl.

SummaryControl

Displays a summary of the import configuration. Implements IPageContent.

public SummaryControl(SummaryViewModel summaryViewModel)
  • Sets DataContext to the provided summaryViewModel before 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 DataContext to the provided readFileViewModel before initialization.

IPageContent Implementation: Identical to SummaryControl (same stub implementations).


SquibChannelsControl

Configures squib channel imports. Implements IPageContent.

public SquibChannelsControl(SquibChannelsViewModel squibChannelsViewModel)
  • Sets DataContext to the provided squibChannelsViewModel before initialization.

IPageContent Implementation: Identical to SummaryControl.


AnalogChannelsControl

Configures analog channel imports. Implements IPageContent.

public AnalogChannelsControl(AnalogChannelsViewModel analogChannelsViewModel)
  • Sets DataContext to the provided analogChannelsViewModel before initialization.

IPageContent Implementation: Identical to SummaryControl.


DigitalInputChannelsControl

Configures digital input channel imports. Implements IPageContent.

public DigitalInputChannelsControl(DigitalInputChannelsViewModel digitalInputChannelsViewModel)
  • Sets DataContext to the provided digitalInputChannelsViewModel before initialization.

IPageContent Implementation: Identical to SummaryControl.


DigitalOutputChannelsControl

Configures digital output channel imports. Implements IPageContent.

public DigitalOutputChannelsControl(DigitalOutputChannelsViewModel digitalOutputChannelsViewModel)
  • Sets DataContext to the provided digitalOutputChannelsViewModel before 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 DataContext to model, stores references to _page and _hardwareViewModel, and wires up OnDone and OnClear callbacks 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>