16 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:46:20.834722+00:00 | zai-org/GLM-5-FP8 | 1 | b36d85328f88f945 |
Documentation: DataPRO CollectDataSubControls Module
1. Purpose
This module provides UI components and supporting infrastructure for the data collection workflow in the DataPRO application. It handles pre-test and post-test diagnostics, sensor-to-channel assignment, squib resistance verification, and dynamic list view templating. The module serves as the user-facing layer for hardware interaction during test execution, bridging the DataModel, DASLib services, and WPF presentation layer.
2. Public Interface
PreTestDiagnostics
Namespace: DataPROWin7.SubControls
A thin wrapper around DiagnosticsBase for pre-test diagnostic operations.
| Member | Signature | Description |
|---|---|---|
| Constructor | public PreTestDiagnostics() |
Default constructor, calls base constructor. |
| Constructor | public PreTestDiagnostics(DataPROPage page) |
Initializes with a DataPROPage and DiagnosticsType.PRE. |
PostTestDiagnostics
Namespace: DataPROWin7.SubControls
Extends DiagnosticsBase with post-test-specific behavior, including mixed-system warnings and low-power mode transitions.
| Member | Signature | Description |
|---|---|---|
| Constructor | public PostTestDiagnostics() |
Default constructor. |
| Constructor | public PostTestDiagnostics(DataPROPage page) |
Initializes with DiagnosticsType.POST. |
| RunCurStep | public override void RunCurStep() |
Intercepts execution to warn if mixed hardware (e.g., G5 units) cannot run post-test diagnostics. Calls base.RunCurStep() after warning or if no warning needed. |
| UnSet | public override void UnSet(Action OnComplete = null) |
Transitions hardware to low-power mode when leaving post-test diagnostics (FB14214). Disables navigation, then calls GoToLowPower. |
Private Methods:
RunsPostTestDiagnostics(IDASCommunication das)— Returnsfalseif the DAS is a G5 unit (cannot run post-test diagnostics).DoWarning()— DisplaysStringResources.PostTestDiagnosticsSomeWarnmessage box, then invokesbase.RunCurStep()on the dispatcher.GoToLowPower(Action OnComplete)— SetsApplicationStatusTypes.LowPowerMode, marks app busy with name"PostTestDiagLowPower", and callsSetLowPowerModeon the parentRunTestBase.
AssignSensorsSLICE
Namespace: DataPROWin7.SubControls
A minimal UserControl for sensor assignment (SLICE-specific).
| Member | Signature | Description |
|---|---|---|
| Constructor | public AssignSensorsSLICE() |
Calls InitializeComponent(). |
ListViewTemplateSelector
Namespace: DataPROWin7.SubControls
A DataTemplateSelector that switches between large and small item templates based on available client space and item count. Implements INotifyPropertyChanged.
| Member | Signature | Description |
|---|---|---|
| LargeItemListTemplate | public DataTemplate { get; set; } |
Template used when Mode is LargeList. |
| SmallItemListTemplate | public DataTemplate { get; set; } |
Template used when Mode is SmallList. |
| Mode | public Modes { get; set; } |
Current display mode (SmallList or LargeList). |
| NumberOfItems | public int { get; set; } |
Sets item count; triggers mode recalculation. |
| ClientSize | public Size { get; set; } |
Client area size; triggers mode recalculation. Default is Size(1000, 800). |
| SelectTemplate | public override DataTemplate SelectTemplate(object item, DependencyObject container) |
Returns LargeItemListTemplate or SmallItemListTemplate based on Mode. Defaults to SmallItemListTemplate. |
Nested Enum:
Modes { SmallList, LargeList }
Constants:
LargeItemHeight = 110LargeItemWidth = 600
Support Classes
Namespace: DataPROWin7.SubControls
Thread Data Classes
| Class | Properties | Purpose |
|---|---|---|
RunArmThreadData |
ManualResetEvent DoneEvent |
Thread synchronization for arm operations. |
BasicInfoThreadData |
ManualResetEvent DoneEvent |
Thread synchronization for basic info. |
HardwareThreadData |
ManualResetEvent DoneEvent |
Thread synchronization for hardware operations. |
AutoProgressionThreadData |
DoneEvent, CancelEvent, DelayMilliSeconds |
Thread data for automatic test progression. |
GenericThreadData |
DAS, ResetEvent, CancelEvent, MissingHardwareEvent, CurrentStatus, CtrlStatusRibbon, DASList, CheckTrigger, DoneAction, TTSImport, SuppressWarning |
General-purpose thread data for validation and hardware operations. |
TestIDFixedPrefixSuffixValues (Enum)
Values: NOT_FIXED = -1, None = 0, TimeStamp = 1, TestSetupName = 2
TestIDPreFixSuffix
| Member | Signature | Description |
|---|---|---|
| FixedValue | public TestIDFixedPrefixSuffixValues { get; } |
Returns the fixed value type. |
| Constructor | public TestIDPreFixSuffix(TestIDFixedPrefixSuffixValues fixedPrefixSuffix) |
Creates with enum value; stores string as "TESTID_PREFIX_SUFFIX_" + value. |
| Constructor | public TestIDPreFixSuffix(string dbPrefixSuffix) |
Creates with custom string. |
| ToString | public override string ToString() |
Returns the internal string. |
TestIDPreFixSuffixHelper (extends BasePropertyChanged)
| Member | Signature | Description |
|---|---|---|
| Constructor | public TestIDPreFixSuffixHelper(string testIDPreFixSuffix) |
Wraps a string-based prefix/suffix. |
| Constructor | public TestIDPreFixSuffixHelper(TestIDFixedPrefixSuffixValues testIdPreFixSuffix) |
Wraps an enum-based prefix/suffix. |
| ToString | public override string ToString() |
Returns localized string from StringResources.ResourceManager, or falls back to raw string. |
| Equals | public override bool Equals(object obj) |
Compares FixedValue; if NOT_FIXED, compares string values. |
| GetHashCode | public override int GetHashCode() |
Returns base implementation. |
SensorLayout
Namespace: DataPROWin7.SubControls
A UserControl for assigning sensors to hardware channels. Implements INotifyPropertyChanged.
| Member | Signature | Description |
|---|---|---|
| Channels | public DataModel.HardwareChannel[] { get; set; } |
Channels from the current Hardware. |
| DASType | public string { get; } |
Returns Hardware.HardwareType or "N/A". |
| DASSerial | public string { get; } |
Returns Hardware.SerialNumber or "N/A". |
| ModuleSerialNumber | public string { get; } |
Currently returns empty string (commented-out module logic). |
| ModuleNumberText | public string { get; } |
Currently returns empty string (commented-out module logic). |
| Hardware | public DataModel.DASHardware { get; set; } |
The hardware device being configured. |
| TestObject | public DataModel.TestObject { get; set; } |
The test object containing sensors and hardware. |
| Sensors | public Sensor[] { get; set; } |
Unassigned sensors from TestObject. |
| AssignButtonVisibility | public Visibility { get; set; } |
Controls visibility of assign buttons; propagates to all sensors. |
| RepopulateSensors | public void RepopulateSensors() |
Clears cached sensor list and raises OnPropertyChanged("Sensors"). |
Nested Class: Sensor (extends BasePropertyChanged)
| Member | Signature | Description |
|---|---|---|
| Selected | public bool { get; set; } |
Selection state; changes BackgroundColor. |
| BackgroundColor | public Color { get; } |
Colors.Yellow if selected, Colors.AliceBlue otherwise. |
| DataModelSensor | public DTS.SensorDB.SensorData { get; } |
The underlying sensor data. |
| SerialNumber | public string { get; } |
Sensor serial number. |
| Description | public string { get; } |
Sensor comment. |
| EngineeringUnits | public string { get; } |
Display unit. |
| SensorRanges | public string { get; } |
Formatted as "{RangeLow}/{RangeMedium}/{RangeHigh}/{Capacity}". |
| AssignButtonVisibility | public Visibility { get; set; } |
Visibility for the assign button. |
Event Handlers:
HardwareChannelList_SelectionChanged— Manages channel selection state and sensor list synchronization.btnSensorAssign_Click— Assigns selected sensor to selected channel.HardwareUnassign_Click— Unassigns sensor from a channel.
SquibResistanceCheck
Namespace: DataPROWin7.SubControls
Implements IPageContent for performing squib resistance checks. Handles configuration, execution, bypass, and reporting.
| Member | Signature | Description |
|---|---|---|
| Constructor | public SquibResistanceCheck(DataPROPage page) |
Initializes with page reference, creates SquibResistanceTable. |
| AggregateStatusColor | public override Color { get; set; } |
Sets both base and ctrlStatusRibbon.AggregateStatusColor. |
| AggregateStatusText | public override string { get; set; } |
Sets both base and ctrlStatusRibbon status text. |
| StartSearch | public void StartSearch(string term) |
Empty implementation. |
| OnSetActive | public void OnSetActive() |
Empty implementation. |
| SetPermissions | public void SetPermissions(User.UserPermissionLevels actualPermission, User.UserPermissionLevels requiredPermission) |
Empty implementation. |
| Validate | public bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow) |
Returns true always. |
| GetPageContent | public object GetPageContent() |
Resets state and returns this. |
| UnSet | public override void UnSet(Action OnComplete = null) |
Calls base, resets RunNow and _bFactoryChanged. |
| RunCurStep | public override void RunCurStep() |
Sets RunNow = true and calls Reset(). |
| Reset | public void Reset() |
Prepares UI, checks for running operations, queues WorkFunc on thread pool. |
| Bypass | public void Bypass(BypassCompleteDelegate bypassComplete) |
Cancels operation, sets status to Cancelled, turns excitation back on, invokes callback. |
| SetStatus | public override void SetStatus(ApplicationStatusTypes status) |
Updates UI based on status (IDLE, Cancelled, SettingConfiguration, Passed, FailedArmCheckListSetConfig, Failed, Validating). |
| DummyArm | protected override bool DummyArm |
Returns true if CurrentTest.CheckoutMode is set. |
Delegate:
public delegate void BypassCompleteDelegate()— Callback for bypass completion.
Key Private Fields:
_cancelEvent,_doneEvent,_cancelConfigEvent—ManualResetEventfor thread synchronization._squibTable— Instance ofSquibResistanceTable._armcheckDASErrors—List<string>holding per-DAS exceptions._bFactoryChanged— Flag indicating factory configuration changed during operation.
Private Methods:
PrepareForResistanceCheck()— Sets upArmCheckActions, populates squib table.WorkFunc(object o)— Main background worker; handles configuration, arm switch check, squib resistance measurement viaDiagnosticsService.PerformArmCheck, andArmingService.CheckAlreadyLevelTriggered.DoneHandler(bool exception)— Handles configuration completion.DoDoneCalculations()— Updates squib table, generates report, sets pass/fail status.TurnExcitationBackOnIfNeeded— Referenced but implementation not visible in source.
3. Invariants
-
PostTestDiagnostics Low-Power Transition:
UnSetalways attempts to transition to low-power mode viaGoToLowPower, using the busy name"PostTestDiagLowPower". -
ListViewTemplateSelector Mode Calculation:
Modeis set toSmallListwheneverNumberOfItems > maxUnits(wheremaxUnits = floor(Height/LargeItemHeight) * floor(Width/LargeItemWidth)). Otherwise,LargeListis used. -
SensorLayout Sensor Filtering: The
Sensorsproperty only returns sensors that are not already assigned to any channel in theTestObject.Hardwarecollection. -
SquibResistanceCheck Thread Safety:
_doneEventmust be set beforeWorkFuncexits (guaranteed infinallyblock)._cancelEventmust be checked periodically for cancellation requests. -
TestIDPreFixSuffixHelper Equality: Two helpers are equal if their
FixedValuematches and is notNOT_FIXED, or if both areNOT_FIXEDand their string representations match. -
SquibResistanceCheck Factory Change: If
_bFactoryChangedbecomestrueduring execution, the operation throwsStringResources.FactoryHasChangedand exits without reporting errors.
4. Dependencies
This Module Depends On:
DTS.Common.Base—BasePropertyChangedDTS.Common.Interface.DASFactory—IDASCommunicationDTS.DASLib.Service—ArmCheckActions,ConfigurationService,DiagnosticsService,ArmingService,ServiceBaseDTS.Common.SharedResource.Strings—StringResourcesDTS.Common.Enums—ApplicationStatusTypesDTS.Common.Utilities.Logging—APILoggerDTS.Slice.Users—User.UserPermissionLevelsDTS.Common—BrushesAndColors,ServiceCall,ServiceQueueDTS.SensorDB—SensorData,SensorModelCollection,SensorsCollectionDTS.Reports—ReportBaseDataPROWin7.DataModel—DASHardware,HardwareChannel,TestObjectDataPROWin7.Controls—StatusRibbon,HardwareDiscoveryControl
What Depends On This Module:
- Unclear from source alone — The module appears to be consumed by the main
DataPROapplication andRunTestBasepage orchestration, but exact consumers are not visible in these files.
5. Gotchas
-
PostTestDiagnostics G5 Exclusion: The
RunsPostTestDiagnosticsmethod explicitly excludes G5 hardware from post-test diagnostics. This is hardcoded and may need extension for future hardware types (noted in comments referencing issue #10304). -
SensorLayout Module Logic Disabled:
ModuleSerialNumberandModuleNumberTextproperties have their implementation commented out and always return empty strings. TheSensorsgetter also has commented-out module iteration logic that could causeNullReferenceExceptionif uncommented (variablemodulesis initialized tonullthen iterated). -
SquibResistanceCheck DAS Retry Logic:
WorkFunccontains multiple retry loops waiting for DAS devices (while (das.Count == 0 && count < maxTries)). These loops can block for up to 60 seconds in one case. -
ListViewTemplateSelector Default ClientSize: The default
ClientSizeof(1000, 800)may not reflect actual UI dimensions if not explicitly set, potentially causing incorrect mode selection. -
SquibResistanceCheck Bypass Does Not Wait: The
Bypassmethod callsTurnExcitationBackOnIfNeededbut does not wait for completion before invoking_onBypassComplete. -
GenericThreadData.DoneAction Limited Use: The
DoneActionproperty documentation states it is "only used currently by ResolveChannels.StartAutoResolution" — suggesting incomplete integration. -
TestIDPreFixSuffixHelper.GetHashCode: Returns
base.GetHashCode(), which does not incorporate the wrapped value. This violates the standardGetHashCode/Equalscontract whenEqualsis overridden.