Files
DP44/enriched-qwen3-coder-next/DataPRO/DataPRO/CollectDataSubControls/ResolveChannels.md
2026-04-17 14:55:32 -04:00

11 KiB
Raw Blame History

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/DataPRO/CollectDataSubControls/ResolveChannels/SensorOutOfPosition.cs
DataPRO/DataPRO/CollectDataSubControls/ResolveChannels/ExtraEIDsTable.cs
DataPRO/DataPRO/CollectDataSubControls/ResolveChannels/SensorsOutofPositionTable.cs
DataPRO/DataPRO/CollectDataSubControls/ResolveChannels/ResolvedChannelsTable.cs
DataPRO/DataPRO/CollectDataSubControls/ResolveChannels/ChannelsToResolveTable.cs
DataPRO/DataPRO/CollectDataSubControls/ResolveChannels/HardwareChannelsTable.cs
2026-04-16T04:15:08.688374+00:00 Qwen/Qwen3-Coder-Next-FP8 1 a9dba4b05459423e

ResolveChannels

Documentation: ResolveChannels Module Channel Resolution UI Tables


1. Purpose

This module provides a set of WPF-based data grid tables used in the Resolve Channels step of the DataPRO test setup workflow. Its purpose is to visualize and enable manual resolution of channel mismatches between logical channels (as defined in the test setup) and physical channels (as present on hardware modules). Specifically, it displays unresolved channels, channels with mismatched EIDs (Sensor ID out of position), channels with extra/unexpected EIDs, and resolved channel assignments. The module supports drag-and-drop interactions to assign or unassign logical-to-physical channel mappings.


2. Public Interface

SensorOutOfPosition (DataPROWin7.CollectDataSubControls.ResolveChannels)

  • SensorOutOfPosition(string currentChannel, string originalChannel, string sensorId, string sensor)
    Constructor. Initializes immutable properties representing a sensor whose EID was found on a different physical channel than originally assigned.

  • CurrentChannel (string, read-only)
    The physical channel currently reporting the sensors EID.

  • OriginalChannel (string, read-only)
    The physical channel expected to report the sensors EID.

  • SensorId (string, read-only)
    The EID (sensor ID) of the sensor.

  • Sensor (string, read-only)
    Human-readable sensor description (e.g., serial number or type).


ExtraEIDsTable (DataPROWin7.SubControls)

  • UnSet()
    Clears the table by setting ItemsSource to null.

  • UpdateTable(TableHelper[] items)
    Populates the table with TableHelper instances representing channels with EIDs not present in the test setup.

  • TableHelper (nested class)

    • TableHelper(string channelName, string eid, string sensorName)
      Constructor. Stores channel, EID, and sensor name for display.
    • ChannelName (string, read-only)
    • EID (string, read-only)
    • SensorName (string, read-only)
  • ColumnIds enum
    Defines column order: ChannelName, EID, SensorName.


SensorsOutOfPositionTable (DataPROWin7.CollectDataSubControls.ResolveChannels)

  • UnSet()
    Clears the table by setting ItemsSource to null.

  • UpdateTable(SensorOutOfPosition[] items)
    Populates the table with SensorOutOfPosition instances.

  • ColumnIds enum
    Defines column order: CurrentChannel, OriginalChannel, SensorId, Sensor.

  • Constructor
    SensorsOutOfPositionTable(ContentControl parentControl, DataPROPage page, ResolveChannels resolveChannels)
    Initializes grid columns, sets SelectionMode = None, and configures binding to SensorOutOfPosition properties.


ResolvedChannelsTable (DataPROWin7.SubControls)

  • UnSet()
    Clears the underlying DataTable rows and reassigns DataTable.

  • Update(ResolveChannels.ManuallyResolvedChannel[] channels)
    Populates the table with manually resolved channel mappings. Each row includes:

    • DAS serial/module info
    • Logical channel name
    • Sensor info
    • Resolved logical channel object
  • ColumnIds enum (private)
    DAS, ChannelName, Sensor, ResolvedChannel.

  • Constructor
    ResolvedChannelsTable(ContentControl parentControl, DataPROPage page)
    Initializes a System.Data.DataTable with typed columns and WPF DataGrid columns bound to the table.


ChannelsToResolveTable (DataPROWin7.SubControls)

  • UnSet()
    Clears the underlying DataTable rows.

  • Update(ResolveChannels.UnresolvedChannel[] channels)
    Populates the table with unresolved channels. For each channel:

    • Channel name (ISO view mode)
    • Sensor serial number (via SensorsCollection.GetSensorById)
    • Sensor type (Squib/Digital Input/Digital Output/IEPE/Analog)
    • Status message (e.g., Issue field)
    • UnresolvedChannel object (for drag/drop)
  • ColumnIds enum (private)
    ChannelName, SensorName, Type, StatusMessage, UnresolvedChannel.

  • DRAG_FORMAT (const string)
    "UnresolvedChannel []" — custom format used when dragging unresolved channels.

  • Drag-and-drop overrides

    • StartDragging()
      Serializes selected UnresolvedChannel objects using DRAG_FORMAT.
    • DoDrop(IDataObject, DataGridCell, string)
      On drop (from hardware table), calls _resolveChannels.ManuallyResolveChannels(dasChannels, logicalChannels).
  • Constructor
    ChannelsToResolveTable(ContentControl parentControl, DataPROPage page, ResolveChannels resolveChannels)
    Sets SelectionMode = MultiRow, configures columns, and registers drag/drop formats.


HardwareChannelsTable (DataPROWin7.SubControls)

  • Update(TestTemplate test, Dictionary<string, UnresolvedChannel> resolvedChannels, List<ManuallyResolvedChannel> manuallyResolvedChannels, Dictionary<string, HardwareChannel> channelLookup)
    Populates the table with hardware channels. Filters out unsupported/irrelevant channels (e.g., squib pairs, RTC, high-G below cutoff). Populates rows with:

    • DAS/module serial
    • Physical channel name
    • IEPE support status
    • Logical channel name (if resolved)
    • Sensor info (--- if none)
    • Flags: ManuallyAssigned, SensorIDMissing, SensorIdOutOfPlace
    • Remove command (button) with associated HardwareChannel parameter
  • Update(DASHardware[] hardware, ...)
    Overload accepting raw hardware array.

  • UnSet()
    Clears the underlying DataTable.

  • ViewMode (property, ChannelViews enum)
    Controls filtering: ALL, Assigned, Open, Manual.

  • ScrollIntoFocus(HardwareChannel channel)
    Scrolls the grid to show the row for the given hardware channel.

  • btnRemoveCellTemplate_Click(object parameter)
    Event handler for remove button: calls _resolveChannels.ManuallyUnresolveChannel(channel).

  • ColumnIds enum
    Includes: DAS, Module, PhysicalChannelName, IEPESupport, LogicalChannelName, Sensor, DASChannel, RemoveCommand, CMDParam, CMD_ENABLED, ManuallyAssigned, UsingSensorId, SensorIDMissing, SensorIdOutOfPlace.

  • Drag-and-drop overrides

    • StartDragging()
      Serializes selected HardwareChannel objects (excludes locked/assigned channels, high-G below cutoff). Uses DTS.Common.Classes.Hardware.DragAndDropPayload.FORMAT.
    • DoDrop(IDataObject, DataGridCell, string)
      On drop (from ChannelsToResolveTable), calls _resolveChannels.ManuallyResolveChannels(dasChannels, logicalChannels).
  • Constructor
    HardwareChannelsTable(ContentControl parentControl, DataPROPage page, object owningControl)
    Initializes DataTable, WPF columns, remove button column, drag/drop formats, and registers cell background coloring logic (HardwareChannelsTable_LoadedCellPresenter).


3. Invariants

  • SensorOutOfPosition instances are immutable — all properties are read-only and set only in the constructor.
  • ExtraEIDsTable and SensorsOutOfPositionTable use ItemsSource — they are bound to arrays of view models (TableHelper[], SensorOutOfPosition[]) and cleared via UnSet().
  • ResolvedChannelsTable, ChannelsToResolveTable, and HardwareChannelsTable use System.Data.DataTable — they populate a typed DataTable and assign it to DataTable.
  • HardwareChannelsTable filters channels during Update() — skips squib pairs (by incrementing i), RTC channels, and high-G channels below 500 SPS.
  • HardwareChannelsTable disables remove button for locked EIDs — if a sensors EID is assigned to a different physical channel, CMD_ENABLED is false.
  • ChannelsToResolveTable allows multi-row selectionSelectionMode = MultiRow.
  • SensorsOutOfPositionTable and ExtraEIDsTable disable selectionSelectionMode = None.
  • HardwareChannelsTable supports drag/drop in both directions — from hardware to unresolved, and vice versa.

4. Dependencies

Imports/References

  • DTS.Common.* (Base, Enums, SharedResource.Strings, Classes, Utils)
  • DTS.SensorDB.SensorsCollection
  • C1.WPF.DataGrid (WPF DataGrid control)
  • System.Data (DataTable, DataColumn, DataRow)
  • System.Windows (WPF drag/drop, data binding, IDataObject)
  • DataPROWin7.DataModel (HardwareChannel, DASHardware)
  • DataPROWin7.SubControls (ResolveChannels, EditObjectSensorsControl)
  • DataPROWin7.CollectDataSubControls.ResolveChannels (internal namespace)

Usage

  • Consumed by: ResolveChannels control (inferred from constructor parameters and _resolveChannels field).
  • Depends on:
    • ResolveChannels.ManuallyResolveChannels() and ManuallyUnresolveChannel() methods.
    • ResolveChannels.GetHWIDForSensorId() (for EID locking).
    • DTS.SensorDB.SensorsCollection.SensorsList.GetSensorById() (to get sensor serial/type).
    • Common.SerializedSettings.ISOViewMode, WarnOnEIDPositionSwap.
    • DFConstantsAndEnums.TSR_AIR_HIGH_G_CUTOFF_RATE_SPS.
    • StringResources.* for localized headers/columns.

5. Gotchas

  • Squib channels skip next row — in HardwareChannelsTable.Update(), when a squib channel is encountered, i++ skips the next channel (squibs use two physical channels per sensor).
  • Module column is hidden but still definedColumnIds.Module exists but is not displayed; DAS column includes module info when needed.
  • TableHelper is only used by ExtraEIDsTable — not shared with SensorsOutOfPositionTable.
  • ResolvedChannelsTable uses ChannelRepresentation — to format DAS/module serial numbers.
  • ChannelsToResolveTable uses DRAG_FORMAT = "UnresolvedChannel []" — a custom format distinct from hardware drag format.
  • HardwareChannelsTable has complex row coloringHardwareChannelsTable_LoadedCellPresenter sets background based on:
    • SensorIdOutOfPlace (if WarnOnEIDPositionSwap)
    • SensorIDMissing
    • UsingSensorId (EID locked elsewhere)
    • Sensor presence + manual assignment
  • HardwareChannelsTable disables drag for high-G channels below cutoff — even if previously deleted (see comments referencing issue #30144).
  • HardwareChannelsTable allows drag of TSRAIR free channels — even if sensor != "---" but LogicalChannelName == NA.
  • UnSet() does not reset DataTable/ItemsSource to new instances — only clears rows/items. Reuse requires reassignment.
  • No validation in SensorOutOfPosition constructor — assumes caller provides consistent currentChannel/originalChannel/sensorId/sensor.