15 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:04:46.817731+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 84120b73a95d6917 |
Documentation: Channel Interfaces Module (DTS.Common.Interface.Channels)
1. Purpose
This module defines a set of interfaces that model channels in a data acquisition system (DAS), including their database representation (IChannelDbRecord), configuration settings (IChannelSetting, IChannelSettingRecord, IGroupChannelSettingRecord), and logical grouping within test setups (IGroupChannel). It serves as the foundational abstraction layer for channel management across UI, business logic, and data persistence layers—enabling consistent handling of physical measurement channels (analog, digital, CAN, UART, etc.), sensor assignments, hardware mapping, and channel-specific settings like range, polarity, filters, and protocol-specific parameters (e.g., CAN bitrates, UART config). The interfaces support both data transfer (e.g., records) and runtime behavior (e.g., IGroupChannel with UI state and validation).
2. Public Interface
IChannelSettingRecord
int Id { get; set; }– Unique identifier for the setting type.string SettingName { get; set; }– Human-readable name of the setting (e.g., "Range", "Polarity").string DefaultValue { get; set; }– Default value for the setting as a string.
Represents a static, reusable channel setting definition (e.g., a setting template).
IGroupChannelSettingRecord
long ChannelId { get; set; }– Foreign key to the channel (IChannelDbRecord.Id).int SettingId { get; set; }– Foreign key toIChannelSettingRecord.Id.string SettingValue { get; set; }– Actual value assigned to the setting for this channel.
Represents a specific assignment of a setting to a channel instance.
IChannelCode
int Id { get; }– Unique identifier for the channel code.string Code { get; }– Short code string (e.g., "A1", "CH1").string Name { get; }– Descriptive name (e.g., "Accelerometer Front Left").ChannelEnumsAndConstants.ChannelCodeType CodeType { get; }– Enumerated type of the code (e.g., ISO, User, DAS).
Encapsulates metadata about a channel’s identifying codes (used for labeling/organization).
IChannelSetting
long ChannelId { get; set; }– ID of the channel this setting belongs to.int SettingTypeId { get; }– ID of the setting type (links toIChannelSettingRecord.Id).string SettingName { get; }– Name of the setting (mirrorsIChannelSettingRecord.SettingName).string DefaultValue { get; }– Default value (mirrorsIChannelSettingRecord.DefaultValue).string Value { get; set; }– Current value as string (generic fallback).int IntValue { get; set; }– Current value as integer (for numeric settings).double DoubleValue { get; set; }– Current value as double (for numeric settings).bool BoolValue { get; set; }– Current value as boolean (for toggle settings).IChannelSetting Clone()– Deep copy of the setting instance.
Represents a runtime setting instance attached to a channel, supporting type-specific accessors.
IChannelDbRecord
long Id { get; set; }– Primary key (DB record ID).int GroupId { get; set; }– Foreign key to group.string IsoCode { get; set; }– ISO-standard channel code.string IsoChannelName { get; set; }– ISO-standard channel name.string UserCode { get; set; }– User-defined channel code.string UserChannelName { get; set; }– User-defined channel name.int DASId { get; set; }– ID of the DAS device.int DASChannelIndex { get; set; }– Physical channel index on the DAS.int GroupChannelOrder { get; set; }– Order within the group.int TestSetupOrder { get; set; }– Order in the test setup.int SensorId { get; set; }– Foreign key to sensor.bool Disabled { get; set; }– Whether the channel is disabled.DateTime LastModified { get; set; }– Timestamp of last DB modification.string LastModifiedBy { get; set; }– User who last modified the record.
Database mapping interface for channel records (EF Core style).
IGroupChannel
- Extends
IChannelDbRecord(inherits all DB record properties). SensorConstants.AvailableRangesLowG RangeLowG { get; set; }– Low-G sensor range enum.bool VoltageInsertionSensor { get; }– Whether channel has a voltage-insertion sensor.bool RangeModifiableSensorLowG { get; }– Whether channel has a low-G sensor with modifiable range.bool RangeModifiableSensorARS { get; }– Whether channel has an ARS sensor with modifiable range.InitialOffset[] AvailableInitialOffsets { get; set; }– Available initial offset options.string IEPESupport { get; }– IEPE support status (e.g., "Supported", "N/A").IGroup Group { get; set; }– Parent group.string GroupName { get; set; }– Display name of parent group.bool GroupNameValid { get; set; }– WhetherGroupNameis set.bool IsoCodeValid { get; set; }– WhetherIsoCodeis set (not validated for correctness).bool IsoChannelNameValid { get; set; }– WhetherIsoChannelNameis set.bool UserCodeValid { get; set; }– WhetherUserCodeis set.bool UserChannelNameValid { get; set; }– WhetherUserChannelNameis set.bool HardwareValid { get; }– Whether hardware is assigned.string HardwareId { get; set; }– Legacy hardware identifier ([das serial]:[channel index]).double TestSampleRate { get; set; }– Sample rate of associated DAS.bool SensorValid { get; }– Whether a sensor is assigned.bool IsDisabled { get; set; }– Whether channel is disabled for data collection.long ChannelId { get; set; }– Channel instance ID (distinct fromIChannelDbRecord.Id? See Gotchas).void SetHardwareChannel(IHardwareChannel hardwareChannel)– Assigns hardware channel.void SetSensor(IDragAndDropItem sensor, IChannelSetting[] channelDefaults, bool applySensorDataToBlankChannels)– Assigns sensor and optionally applies defaults.bool CompareValue(string property)– Compares current value ofpropertyto a reference (e.g., for diff detection).bool SetDifferent(string property)/void SetNotDifferent()– Marks/unmarks property as "different" (UI state).void SetRange(CACOption option)– Sets range based on CAC option enum.bool CanMoveUp { get; set; }/bool CanMoveDown { get; set; }– UI state for reordering.bool DeleteShouldBeEnabled { get; set; }– UI state for delete button.System.Windows.Visibility RemoveSensorVisibility { get; set; }– UI visibility for sensor removal control.bool IsBlank()– Whether channel is unconfigured (no hardware/sensor).void Clear()– Clears hardware and sensor assignments.bool Filter(string term)– Whether channel matches search term.ICommand PasteCommand { get; set; }– Command for paste operations.IChannelSetting[] ChannelSettings { get; set; }– Collection of channel settings.void AdjustCANSettings(bool canIsFD)/void AdjustCANSources(bool canIsFD, int canArbBaseBitrate, int canDataBitrate)– Adjusts CAN settings for FD vs classic.string GetChannelName(IsoViewMode isoViewMode)/string GetChannelCode(IsoViewMode isoViewMode)– Returns name/code based on view mode.void Copy(IGroupChannel groupChannel)– Copies state from another channel.string Hardware { get; set; }– UI display string for hardware.string Sensor { get; }– UI display string for sensor.ISensorData SensorData { get; }– Sensor metadata.IHardwareChannel HardwareChannel { get; }– Hardware channel object.IDragAndDropItem DragAndDropItem { get; }– Drag-and-drop source item.ISensorCalibration SensorCalibration { get; }– Sensor calibration data.void SetSensorCalibration(ISensorCalibration calibration)/void SetSensorData(...)– Assigns sensor data/calibration.bool HasEID { get; }– Whether channel has EID (Event ID) support.bool IsAnalog { get; }/bool IsSquib { get; }/bool IsDigitalIn { get; }/bool IsDigitalOut { get; }/bool IsClock { get; }/bool IsUart { get; }/bool IsStreamIn { get; }/bool IsStreamOut { get; }/bool IsCan { get; }– Sensor type flags.double Range { get; set; }– Current range setting.double Capacity { get; }– Sensor capacity.IFilterClass FilterClass { get; set; }– Filter class (e.g., FB 13120).string Polarity { get; set; }– Polarity setting.string Units { get; }– Sensor units.ZeroMethodType ZeroMethod { get; set; }– Zeroing method.double ZeroMethodStart { get; set; }/double ZeroMethodEnd { get; set; }– Zeroing window.string Sensitivity { get; }– Sensor sensitivity.InitialOffset InitialOffset { get; set; }– Initial offset value.bool SquibLimitDuration { get; set; }/double SquibDuration { get; set; }/double? SquibDelay { get; set; }/double SquibCurrent { get; set; }– Squib-specific settings.bool DigitalOutLimitDuration { get; set; }/double DigitalOutDuration { get; set; }/double DigitalOutDurationMax { get; set; }/double DigitalOutDelay { get; set; }– Digital output settings.DigitalOutputModes DigitalOutputMode { get; set; }/SquibFireMode SquibFireMode { get; set; }/DigitalInputModes DigitalInputMode { get; set; }– Mode enums.string ActiveValue { get; set; }/string DefaultValue { get; set; }– Digital output values.uint UartBaudRate { get; set; }/uint UartDataBits { get; set; }/StopBits UartStopBits { get; set; }/Parity UartParity { get; set; }/Handshake UartFlowControl { get; }/UartDataFormat UartDataFormat { get; set; }– UART settings.string StreamInUDPAddress { get; set; }/UDPStreamProfile StreamOutUDPProfile { get; set; }/string StreamOutUDPAddress { get; set; }/ushort StreamOutUDPTimeChannelId { get; set; }/ushort StreamOutUDPDataChannelId { get; set; }/string StreamOutUDPTmNSConfig { get; set; }/ushort StreamOutIRIGTimeDataPacketIntervalMs { get; set; }/ushort StreamOutTMATSIntervalMs { get; set; }– Stream settings.bool CanIsFD { get; set; }/int CanArbBaseBitrate { get; set; }/int CanArbBaseSJW { get; set; }/int CanDataBitrate { get; set; }/int CanDataSJW { get; set; }/string CanFileType { get; set; }– CAN settings.IFilterClass GetFilterClassFromISOCode(ISoftwareFilter[] filters, string isoCode)– Retrieves filter class from ISO code.CoerceISOCodeDelegate CoerceISOCodeFunc { get; }– Function to coerce/normalize ISO codes.UIItemStatus ChannelStatus { get; }– Combined status (e.g., "Complete", "Missing Sensor").void SetSettingsFromSensor(ISensorData sd)– Applies sensor defaults to channel settings.string GetChangeList(ISensorData sensor)– Returns list of differences between sensor and channel settings.bool IsRangeDifferent { get; set; }/bool IsFilterClassDifferent { get; set; }/ ... (manyIs...Differentproperties) – UI state flags for setting changes.
Core runtime interface for a channel in a group. Combines DB record data, hardware/sensor state, settings, and UI metadata.
3. Invariants
IChannelDbRecord:Id,GroupId,DASId,DASChannelIndex,GroupChannelOrder,TestSetupOrder, andSensorIdmust be non-null and valid (e.g.,SensorId > 0if a sensor is assigned).Disabledimplies the channel should not be used for data collection.LastModifiedandLastModifiedBymust be set on every update.
IGroupChannel:IsBlank()returnstrueonly if both hardware and sensor are unassigned.SensorValid,HardwareValid,IsAnalog,IsSquib, etc., are mutually exclusive and consistent with assigned sensor/hardware types.ChannelStatusreflectsIsCompleteand sensor calibration validity.Is...Differentproperties are UI state flags and do not affect data integrity.ChannelId(fromIGroupChannel) is distinct fromId(fromIChannelDbRecord)—see Gotchas.
IChannelSetting:- Only one of
Value,IntValue,DoubleValue, orBoolValueshould be actively used per setting instance (type-specific). Clone()must produce a deep copy (no shared mutable references).
- Only one of
4. Dependencies
-
Depends on:
DTS.Common.Enums.Channels(ChannelCodeType)System.ComponentModel.DataAnnotations(Key,Column)System(DateTime)DTS.Common.Interface.DataRecorders(IHardwareChannel)DTS.Common.Interface.Sensors.SensorsList(IDragAndDropItem)DTS.Common.Interface.Sensors(ISensorData,ISensorCalibration)DTS.Common.Interface.Groups.GroupList(IGroup)DTS.Common.Enums(e.g.,InitialOffset,ZeroMethodType,DigitalOutputModes,SquibFireMode,DigitalInputModes)DTS.Common.Classes.ChannelCodes(CoerceISOCodeDelegate)DTS.Common.Interface.Sensors.SoftwareFilters(IFilterClass,ISoftwareFilter)System.IO.Ports(StopBits,Parity,Handshake)System.Windows.Input(ICommand)System.Windows(Visibility)
-
Depended on by:
- UI layers (WPF) for channel configuration, validation, and binding.
- Data persistence layers (e.g., EF Core) for
IChannelDbRecordmapping. - Sensor/hardware assignment logic (e.g.,
SetSensor,SetHardwareChannel). - Test setup and data collection orchestration (e.g.,
IsDisabled,ChannelStatus).
5. Gotchas
ChannelIdvsId:IGroupChannelinheritsIChannelDbRecord.Id(DB primary key) but also declares its ownlong ChannelId { get; set; }. The purpose ofChannelIdis unclear from the source—comments suggest it may be a legacy identifier or used for UI grouping. Do not assumeChannelId == Id.HardwareIdis deprecated: The comment explicitly states this is an old identifier ([das serial]:[channel index]) and questions why it coexists withHardwareChannel. Prefer `Hardware