DataPRO/DataPRO/Pages/TestSetups And RunTest/RunTestPageCheckHardware.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/RunTestPageDiagnostics.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/RunTestPageRealtime.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/RunTestPage.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/RunTestPageExport.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/DiagnosticsPage.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/RunTestPageStatusCheck.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/CollectDataPage.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/TestSetupsChangePage.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/QuickSensorCheckPage.cs
DataPRO/DataPRO/Pages/TestSetups And RunTest/TestSetupEditAddHardwarePage.cs
2026-04-17T15:47:07.283406+00:00
zai-org/GLM-5-FP8
1
07eaa0ac5878fa50
Documentation: Test Setups and RunTest Pages
1. Purpose
This module contains the page classes for the test execution workflow in DataPRO, a WPF-based data acquisition and testing application. These pages handle the complete test lifecycle: test setup selection, hardware configuration and verification, diagnostics execution, real-time data collection, and data export. The module follows a wizard-style navigation pattern where each page represents a distinct step in the test process, inheriting from either RunTestBase or DataPROPage base classes to provide consistent navigation, state management, and UI framework integration.
RunTestPageStatusCheck(DataModel.TabPageItem item, int possibleSteps)
Initializes with tab page item and step count; stores _item field.
OnSetActive
public override void OnSetActive()
Complex logic: resets navigation if not on Hardware step, subscribes to AutomaticModeStatusEvent, modifies AllowedSteps based on settings, calls base, starts test.
UniqueId
public override string UniqueId
Returns MY_ID.
MY_ID
public const string MY_ID = "Diagnostics_StatusLineCheck"
Constant identifier for this page.
CollectDataPage
publicclassCollectDataPage:DataPROPage
Member
Signature
Description
Constructor
CollectDataPage()
Parameterless constructor calling Initialize().
Constructor
CollectDataPage(DataModel.TabPageItem item)
Constructor with tab page item.
OnSetActive
public override void OnSetActive()
Calls base, then SetRunButtonEnabled().
UniqueId
public override string UniqueId
Returns "CollectData".
OnButtonPress
public override bool OnButtonPress(Controls.PageButton button)
Handles Record_CollectDataRunButton by calling SetNewTest().
public override void ReportErrors(List<string> errors)
Shows message box with errors.
DoneButtonPress
public override void DoneButtonPress()
Handles modification state propagation to referring page.
3. Invariants
Unique ID Consistency: Each page class defines a MY_ID constant and returns it via the UniqueId property override. This ID must be unique across all pages.
Event Subscription Guard: Pages that subscribe to AutomaticModeStatusEvent (RunTestPageRealtime, RunTestPage, RunTestPageStatusCheck) use a _subscribed boolean flag to prevent duplicate subscriptions.
Base Call Ordering:
OnSetActive() implementations must call base.OnSetActive() at appropriate points (typically after page-specific setup).
UnSet() implementations must call base.UnSet() after cleanup.
Test Lifecycle: Pages that start tests via ((App)Application.Current).StartTest() should ensure proper test termination. QuickSensorCheckPage.UnSet() explicitly calls EndTest().
Hardware Page State: TestSetupEditAddHardwarePage tracks _entryState and _bModificationsWereMade to properly propagate modification state to the referring page.
Navigation Step Management: RunTestPageStatusCheck.OnSetActive() enforces that if the current step is not PossibleSteps.Hardware, navigation resets to the first step in navStepList.
AllowedSteps Bitwise Operations: RunTestPageStatusCheck uses bitwise operations to modify AllowedSteps, requiring that AllowedSteps be treated as a flags enum bitmask.
4. Dependencies
External Dependencies (from imports)
Prism.Ioc - ContainerLocator, IEventAggregator for dependency resolution and event aggregation
DTS.Slice.Users - User.UserPermissionLevels for permission checks
Unity - IUnityContainer for DI in TestSetupEditAddHardwarePage
Internal Dependencies
DataModel.TabPageItem - Constructor parameter for all pages
DataModel.TestTemplate - Used by TestSetupEditAddHardwarePage
Controls.TestSetupsControl - Used by DiagnosticsPage, CollectDataPage, TestSetupsChangePage
Controls.QuickSensorCheck - Used by QuickSensorCheckPage
BrushesAndColors - Color constants for UI theming
Common.SerializedSettings - Configuration settings for behavior toggles
CommonFunctions - Helper methods for channel creation
Downstream Dependencies (Inferred)
RunTestBase - Base class for RunTestPage* classes
DataPROPage - Base class for standalone pages
App - Application singleton accessed via Application.Current
MainWindow - Main window accessed for navigation and test setup changes
5. Gotchas
Duplicate Constructor Pattern: Multiple classes define two constructors where the simpler constructor does NOT initialize the _item field, but the constructor with possibleSteps does. This means