16 KiB
16 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T04:21:17.003966+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | c6d2c56784c09efc |
Documentation: Test Setup Import Models
1. Purpose
This module provides data models for representing and manipulating test setup channel configurations during import operations in the DataPRO application. It serves as the data layer for UI components that display, validate, and allow editing of channel assignments between physical DAS hardware channels and logical sensor records. The models bridge the gap between low-level hardware interfaces (IHardwareChannel, IDASCommunication) and high-level UI requirements (e.g., summary tables, validation indicators), supporting operations such as sensor assignment, configuration synchronization, and status reporting (e.g., EID counts, voltage status, channel type summaries).
2. Public Interface
TestSetupModel
List<ChannelModel> Channels { get; set; }
Collection of logicalChannelModelinstances representing sensor/channel assignments.ObservableCollection<DASChannelModel> DASChannels { get; set; }
Collection ofDASChannelModelinstances representing physical DAS hardware channels.
SummaryChannelModel
string ChannelType { get; set; }
Type of channel (e.g., "Analog", "Squib").int Assigned { get; set; }
Number of channels of this type that are assigned to sensors.string Unassigned { get; set; }
String representation of unassigned channel count (likely for display formatting).
ChannelSummaryRow
ChannelSummaryRow(string channelType, int requested, int assigned, int unassigned)
Constructor initializing summary statistics for a channel type.string ChannelType { get; }
Channel type identifier.int Requested { get; }
Total requested channels of this type.int Assigned { get; }
Number of assigned channels.int Unassigned { get; }
Number of unassigned channels.void AddCount(bool assigned)
IncrementsRequestedand eitherAssignedorUnassignedbased onassigned.SolidColorBrush UnassignedColor { get; }
ReturnsBrush_ApplicationStatus_Failedif any unassigned channels exist, otherwiseBrush_ApplicationStatus_Complete.
SummaryRow
SummaryRow(int number, string description, string serialNumber, string sensorTag, string eid, string location)
Constructor for rows in "Extra/Found/Missing" tables in sensor import summary.int Number { get; set; }
Channel number (not index), if available.string Description { get; set; }
Channel description.string SerialNumber { get; set; }
Sensor serial number.string SensorTag { get; set; }
Sensor tag (e.g., "CF", "P4").string EID { get; set; }
Electronic ID on the sensor.string Location { get; set; }
Physical location of the sensor.
DASRow
DASRow(IDASCommunication das)
Constructor that initializes DAS hardware metadata and counts valid EIDs from configuration.string SerialNumberFamily { get; }
Serial number of the DAS hardware.int EIDFound { get; }
Count of valid EIDs found in DAS configuration (only for non-Ethernet distributors).string InputVoltageStatus { get; }
Voltage status string for input voltage.SolidColorBrush InputVoltageColor { get; }
Color brush corresponding to input voltage status.string BatteryVoltageStatus { get; }
Voltage status string for battery voltage.SolidColorBrush BatteryVoltageColor { get; }
Color brush corresponding to battery voltage status.
DASSummaryRow
void AddDAS(DataModel.DASHardware das)
Adds a DAS hardware instance to the summary and updates channel type counts.HardwareTypes[] GetRelevantDAS()
Returns array of hardware types present (non-empty).int GetHardwareTypeOrder(HardwareTypes a)
Returns display order integer for a givenHardwareTypesenum value (custom ordering defined in_hardwareDisplayOrder).int GetDASCount(HardwareTypes dasType)
Returns count of DAS units of specified type.void Clear()
Resets all internal state (DAS list and channel counts).- Properties (all
int):
Analog,Squib,DigitalIn,DigitalOut,StreamOut,UART,StreamIn,CAN
Represent counts of each channel type across all added DAS units.
ChannelModel
ChannelModel()
Default constructor initializing default values.ChannelModel(SensorData sd)
Constructor initializing fromSensorData.void InitializeFromGroupChannel(IGroupChannel groupChannel)
Updates properties from a group channel (e.g., user overrides).SensorData Sensor { get; set; }
Underlying sensor data record.IHardwareChannel HardwareChannel { get; set; }
Associated hardware channel.bool IsModified { get; set; }
Flag indicating whether the record has been modified.bool IsEmptyRecord { get; }
ReturnstrueifChannelCode == "None"andSensorSerialNumberis null/empty.bool IsChannelCodeValid { get; set; }
Indicates whetherChannelCodeis non-empty and not "None".bool RemoveOffset { get; set; }
Whether offset removal is enabled.bool ProportionalToExcitation { get; set; }
Whether sensor output is proportional to excitation.double InitialOffsetVoltage { get; set; }
Initial offset voltage.double InitialOffsetVoltageTolerance { get; set; }
Tolerance for initial offset voltage.string SensorEU { get; set; }
Engineering units of the sensor.double BridgeResistance { get; set; }
Bridge resistance.string ChannelRangeString { get; set; }
String representation ofChannelRange(formatted withSYSTEMSETTINGformat).string ISOCode { get; set; }
ISO standard code.string ISODescription { get; set; }
ISO channel description.string ISOPolarity { get; set; }
ISO polarity ("+" or "-").bool IsSquib { get; set; }
Whether channel is a squib.bool IsDigitalInput { get; set; }
Whether channel is digital input.bool IsDigitalOutput { get; set; }
Whether channel is digital output.double InitialEUInMV { get; set; }
Initial EU in millivolts.double InitialEUInEU { get; set; }
Initial EU in engineering units.double IRTraccExponent { get; set; }
IR Tracc linearization exponent.string DASChannelString { get; }
String representation ofHardwareChannel.string ChannelCode { get; set; }
User-defined channel code.string CustomCodeDescription { get; set; }
Custom code description.string SensorSerialNumber { get; set; }
Sensor serial number.string ChannelEID { get; set; }
EID on the channel.string SensorEID { get; }
EID fromSensor.EIDor backing field.double SensorSensitivity { get; set; }
Sensor sensitivity.double SensorCapacity { get; set; }
Sensor capacity.bool SensorPolarity { get; set; }
Sensor polarity (true= positive).double ChannelRange { get; set; }
Channel range.IFilterClass FilterClass { get; set; }
Software filter class.bool IsRangeValid { get; set; }
WhetherChannelRangeis valid (>0 and not NaN).double CableMultiplier { get; set; }
Cable multiplier factor.bool Disabled { get; set; }
Whether channel is disabled.double SensorExcitationVolts { get; }
Excitation voltage magnitude fromSensor.SupportedExcitation.SquibFireMode SquibFireMode { get; set; }
Squib fire mode (CAPorCONSTANT).double SquibFireDelayMs { get; set; }
Delay between trigger and squib fire.double SquibFireCurrent { get; set; }
Squib fire current limit (amps).bool LimitDuration { get; set; }
Whether squib fire duration is limited.double SquibFireDurationMs { get; set; }
Squib fire duration (clamped toDEFAULT_MIN_FIRE_DURATION_MS/DEFAULT_MAX_FIRE_DURATION_MS).double SquibFireResistanceLowOhm { get; set; }
Squib resistance tolerance low (ohms).double SquibFireResistanceHighOhm { get; set; }
Squib resistance tolerance high (ohms).DigitalInputModes DigitalInputMode { get; set; }
Digital input mode.DigitalOutputModes DigitalOutputMode { get; set; }
Digital output mode.double DigitalOutputDelay { get; set; }
Digital output delay (ms).double DigitalOutputDuration { get; set; }
Digital output duration (ms).
DASChannelModel
DASChannelModel(IHardwareChannel channel)
Constructor wrapping a hardware channel.void SetChannelModel(ChannelModel channel)
Assigns/removes aChannelModelto/from this hardware channel, updating bidirectional references and raising property change notifications.DigitalOutputModes DigitalOutputMode { get; set; }
Gets/sets digital output mode; raisesDigitalOutputChannelChangedevent on mode transitions.double DigitalOutputDelayMs { get; set; }
Digital output delay (ms).double DigitalOutputDurationMs { get; set; }
Digital output duration (ms).string Polarity { get; set; }
Sensor polarity ("+" or "-").SquibFireMode SquibFireMode { get; set; }
Squib fire mode.bool Disabled { get; set; }
Whether channel is disabled (viaDependencyProperty).ChannelModel Channel { get; private set; }
AssociatedChannelModel(sensor record).string DASChannelString { get; }
String representation ofHardwareChannel.string CustomCode { get; set; }
Custom code description.string EID { get; set; }
Electronic ID on the channel.string UserChannelName { get; set; }
Channel code (user name).string ISOCode { get; set; }
ISO code.string ISOChannelName { get; set; }
ISO channel name.string SerialNumber { get; }
Sensor serial number (with special handling for test-specific serials).double Sensitivity { get; }
Sensor sensitivity.string SensitivityString { get; }
Sensitivityformatted to 12 decimal places.bool IsActive { get; }
trueif channel has a record and is not a disabled digital output.double Capacity { get; }
Sensor capacity.double Range { get; set; }
Channel range.IFilterClass FilterClass { get; set; }
Filter class.double CableMultiplier { get; set; }
Cable multiplier.double SquibFireDelayMs { get; set; }
Squib fire delay.double SquibFireCurrent { get; set; }
Squib fire current limit.bool LimitDuration { get; set; }
Whether squib duration is limited.double SquibFireDurationMs { get; set; }
Squib fire duration.double SquibFireResistanceLowOhm { get; set; }
Squib resistance low tolerance.double SquibFireResistanceHighOhm { get; set; }
Squib resistance high tolerance.IHardwareChannel HardwareChannel { get; }
Wrapped hardware channel.
3. Invariants
ChannelModel.ChannelCodemust not be"None"for a record to be considered non-empty (IsEmptyRecord == false).ChannelModel.SquibFireDurationMsis always clamped to[DEFAULT_MIN_FIRE_DURATION_MS, DEFAULT_MAX_FIRE_FIRE_DURATION_MS](enforced in setter).ChannelSummaryRow.UnassignedColoris determined solely byUnassigned > 0.DASSummaryRow._hardwareDisplayOrderdefines explicit ordering for known hardware types; unknown types fall back to_hardwareDisplayOrder.Count + (int)HardwareTypes.DASRow.EIDFoundcounts only valid EIDs from non-Ethernet-distributor DAS units (excludesIsEthernetDistributor()units).DASChannelModel.ChannelandChannelModel.HardwareChannelare kept in sync: assigning aChannelModelto aDASChannelModelsetsChannel.HardwareChannel = HardwareChannel, and vice versa.DASChannelModel.IsActivefor digital outputs isfalseonly ifDigitalOutputMode == DigitalOutputModes.NONE.DASChannelModel.SerialNumberreturns a localized string forTEST_SPECIFIC_ANALOG_SERIAL; otherwise returnsChannel.SensorSerialNumber.
4. Dependencies
Dependencies of this module:
DTS.Common.*
Core infrastructure:BasePropertyChanged,HardwareTypes,DigitalInputModes,DigitalOutputModes,SquibFireMode,IFilterClass,IHardwareChannel,IGroupChannel,ExcitationVoltageOptions,SensorConstants,Logging.APILogger,SharedResource.Strings.StringResources,DAS.Concepts.Test.Module.Channel.Sensor,DASLib.Service.OutputSquibChannel,Enums.Hardware.HardwareConstants.DTS.SensorDB
SensorDatatype.DTS.Common.Interface.Channels
ChannelModelusesDASChannelModelandIGroupChannel.DTS.Common.Interface.DASFactory
IDASCommunication.DTS.DASLib.Service
OutputSquibChannel,HardwareConstants.System.Windows.Media
SolidColorBrush,BrushesAndColors(viaChannelSummaryRow.UnassignedColor).System.Collections.ObjectModel
ObservableCollection<T>.
Dependencies on this module:
- UI Controls (inferred from namespace
DataPROWin7.Controls.TestSetups.Import.Models)
Likely consumed by XAML views and view models for test setup import workflows (e.g., channel assignment grids, summary tables). - Import Logic
Code inDataPROWin7.Controls.TestSetups.Import.*(e.g., view models, services) that populates and manipulates these models during import.
5. Gotchas
ChannelModel.SquibFireDurationMssetter silently clamps values to min/max constants (DEFAULT_MIN_FIRE_DURATION_MS,DEFAULT_MAX_FIRE_DURATION_MS). No exception or warning is raised for out-of-range assignments.DASRow.EIDFoundexcludes Ethernet distributors (das.IsEthernetDistributor()), but does not exclude SLICE Ethernet controllers (which are counted inDASSummaryRow.AddChannelCountForDASonly if notIsSLICEEthernetController).DASSummaryRow.AddChannelCountForDASskips SLICE Ethernet controllers entirely (if (das.IsSLICEEthernetController) { return; }), meaning no channel counts are accumulated for them.DASChannelModel.PolarityandChannelModel.SensorPolarityuse inverse semantics:SensorPolarity = truemeans positive polarity (no inversion), whilePolaritystring is"+"for positive.DASChannelModel.SerialNumberhas special handling forTEST_SPECIFIC_ANALOG_SERIAL, returning a localized string viaStringResources; other values are returned as-is.ChannelModel.ChannelRangeStringsetter parses and updatesChannelRange, but also setsIsRangeValid = trueon success — this may overwrite prior validation state.DASSummaryRow.GetHardwareTypeOrderfor unknown hardware types uses_hardwareDisplayOrder.Count + (int)HardwareTypes, which may cause ordering instability if new hardware types are added without updating_hardwareDisplayOrder.ChannelModel.InitializeFromGroupChannellogs exceptions viaAPILogger.Log(ex)but does not propagate them, potentially masking configuration errors.DASChannelModel.SetChannelModelraises manyOnPropertyChangednotifications (e.g., forIsActive,SerialNumber,SquibFireDelayMs) — callers should be aware of