--- source_files: - Common/DTS.CommonCore/Interface/Channels/IChannelSettingRecord.cs - Common/DTS.CommonCore/Interface/Channels/IGroupChannelSettingRecord.cs - Common/DTS.CommonCore/Interface/Channels/IChannelCode.cs - Common/DTS.CommonCore/Interface/Channels/IChannelSetting.cs - Common/DTS.CommonCore/Interface/Channels/IChannelDbRecord.cs - Common/DTS.CommonCore/Interface/Channels/IGroupChannel.cs generated_at: "2026-04-16T02:30:03.492567+00:00" model: "Qwen/Qwen3-Coder-Next-FP8" schema_version: 1 sha256: "cbc4fb29d29bc466" --- # Channels ### **Purpose** This module defines a set of interfaces that model channel-related data and behavior within the DTS (Data Acquisition and Test System) platform. It establishes contracts for representing physical and logical channels—both as database records (`IChannelDbRecord`) and as runtime objects (`IGroupChannel`)—alongside associated settings (`IChannelSetting`, `IChannelSettingRecord`, `IGroupChannelSettingRecord`) and channel identification codes (`IChannelCode`). These interfaces collectively support configuration, data acquisition, UI binding, and persistence of measurement channels, including support for analog, digital, squib, clock, UART, and stream modules, as well as sensor/hardware assignment, calibration, and filtering. --- ### **Public Interface** #### **`IChannelSettingRecord`** - **`int Id { get; set; }`** Unique identifier for the setting definition. - **`string SettingName { get; set; }`** Human-readable name of the setting (e.g., `"Range"`, `"Polarity"`). - **`string DefaultValue { get; set; }`** Default value (as a string) for this setting type. #### **`IGroupChannelSettingRecord`** - **`long ChannelId { get; set; }`** Foreign key referencing the channel (`IChannelDbRecord.Id`). - **`int SettingId { get; set; }`** Reference to the setting definition (`IChannelSettingRecord.Id`). - **`string SettingValue { get; set; }`** Actual value assigned to this setting on the channel. #### **`IChannelCode`** - **`int Id { get; }`** Unique identifier for the channel code. - **`string Code { get; }`** Machine-readable code (e.g., ISO code fragment). - **`string Name { get; }`** Human-readable description of the code. - **`ChannelEnumsAndConstants.ChannelCodeType CodeType { get; }`** Enumerated type of the code (e.g., `Range`, `Filter`, `Polarity`). #### **`IChannelSetting`** - **`long ChannelId { get; set; }`** ID of the channel this setting belongs to. - **`int SettingTypeId { get; }`** ID of the setting type (corresponds to `IChannelSettingRecord.Id`). - **`string SettingName { get; }`** Name of the setting (e.g., `"Range"`). - **`string DefaultValue { get; }`** Default value for this setting type. - **`string Value { get; set; }`** Current value stored as a string. - **`int IntValue { get; set; }`** Typed value (int) for numeric settings. - **`double DoubleValue { get; set; }`** Typed value (double) for floating-point settings. - **`bool BoolValue { get; set; }`** Typed value (bool) for boolean settings. - **`IChannelSetting Clone()`** Creates a deep copy of the setting. #### **`IChannelDbRecord`** - **`long Id { get; set; }`** Primary key in the database. - **`int GroupId { get; set; }`** Foreign key to the group (`IGroup.Id`). - **`string IsoCode { get; set; }`** ISO-standard code for the channel (e.g., `"A1.1"`). - **`string IsoChannelName { get; set; }`** ISO-standard name of the channel. - **`string UserCode { get; set; }`** User-defined code. - **`string UserChannelName { get; set; }`** User-defined name of the channel. - **`int DASId { get; set; }`** ID of the data acquisition system (DAS) device. - **`int DASChannelIndex { get; set; }`** Physical channel index on the DAS device. - **`int GroupChannelOrder { get; set; }`** Order of the channel within its group. - **`int TestSetupOrder { get; set; }`** Order of the channel in the test setup. - **`int SensorId { get; set; }`** ID of the assigned sensor. - **`bool Disabled { get; set; }`** Whether the channel is disabled. - **`DateTime LastModified { get; set; }`** Timestamp of last modification. - **`string LastModifiedBy { get; set; }`** User who last modified the record. #### **`IGroupChannel`** *(Extends `IChannelDbRecord`)* All members of `IChannelDbRecord` are inherited. Additional members: - **`SensorConstants.AvailableRangesLowG RangeLowG { get; set; }`** Low-G sensor range setting. - **`bool VoltageInsertionSensor { get; }`** Indicates presence of a calibration-less voltage measurement channel. - **`bool RangeModifiableSensorLowG { get; }`** Indicates embedded low-G sensor with modifiable range. - **`bool RangeModifiableSensorARS { get; }`** Indicates embedded ARS sensor with modifiable range. - **`InitialOffset[] AvailableInitialOffsets { get; set; }`** Available initial offset options (depends on assigned sensor calibration). - **`string IEPESupport { get; }`** IEPE support status (e.g., `"Supported"`, `"N/A"`). - **`IGroup Group { get; set; }`** Parent group object. - **`string GroupName { get; set; }`** Display name of the parent group. - **`bool GroupNameValid { get; set; }`** Whether `GroupName` is set (not validated for correctness). - **`bool IsoCodeValid { get; set; }`** Whether `IsoCode` is set (not validated for correctness). - **`bool IsoChannelNameValid { get; set; }`** Whether `IsoChannelName` is set. - **`bool UserCodeValid { get; set; }`** Whether `UserCode` is set. - **`bool UserChannelNameValid { get; set; }`** Whether `UserChannelName` is set. - **`bool HardwareValid { get; }`** Whether hardware has been assigned. - **`string HardwareId { get; set; }`** Legacy hardware identifier (format: `"[das serial]:[channel index]"`). - **`double TestSampleRate { get; set; }`** Sample rate of the associated DAS. - **`bool SensorValid { get; }`** Whether a sensor has been assigned. - **`bool IsDisabled { get; set; }`** Whether the channel is disabled for data collection. - **`void SetHardwareChannel(IHardwareChannel hardwareChannel)`** Assigns a hardware channel object. - **`void SetSensor(IDragAndDropItem sensor, IChannelSetting[] channelDefaults, bool applySensorDataToBlankChannels)`** Assigns a sensor and optionally applies its default settings. - **`bool CompareValue(string property)`** Compares current value of a property to its original (e.g., for change tracking). - **`bool SetDifferent(string property)`** Marks a property as having been changed from its original value. - **`void SetNotDifferent()`** Clears all "different" flags. - **`void SetRange(CACOption option)`** Sets range based on a CAC option. - **`bool CanMoveUp { get; set; }`** Whether the channel can be moved up in the list. - **`bool CanMoveDown { get; set; }`** Whether the channel can be moved down in the list. - **`bool DeleteShouldBeEnabled { get; set; }`** Whether delete action should be enabled in UI. - **`System.Windows.Visibility RemoveSensorVisibility { get; set; }`** UI visibility for sensor removal control. - **`bool IsBlank()`** Returns `true` if the channel is new and unedited. - **`void Clear()`** Clears hardware and sensor assignments. - **`bool Filter(string term)`** Returns `true` if the channel matches the given search term. - **`ICommand PasteCommand { get; set; }`** Command executed on paste operation. - **`IChannelSetting[] ChannelSettings { get; set; }`** Array of channel-specific settings. - **`string GetChannelName(IsoViewMode isoViewMode)`** Returns channel name based on ISO view mode. - **`string GetChannelCode(IsoViewMode isoViewMode)`** Returns channel code based on ISO 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 and configuration. - **`IHardwareChannel HardwareChannel { get; }`** Hardware channel object. - **`IDragAndDropItem DragAndDropItem { get; }`** Drag-and-drop representation of the channel. - **`ISensorCalibration SensorCalibration { get; }`** Sensor calibration data. - **`void SetSensorCalibration(ISensorCalibration calibration)`** Assigns sensor calibration. - **`void SetSensorData(ISensorData sensorData, IDragAndDropItem dragAndDropItem, bool decideSettings = false)`** Assigns sensor data and optionally updates settings. - **`bool HasEID { get; }`** Whether the channel has an EID (Embedded ID). - **`bool IsAnalog { get; }`** Whether channel has an analog sensor assigned (or is non-blank). - **`bool IsSquib { get; }`** Whether channel has a squib sensor assigned (or is non-blank). - **`bool IsDigitalIn { get; }`** Whether channel has a digital input sensor assigned (or is non-blank). - **`bool IsDigitalOut { get; }`** Whether channel has a digital output sensor assigned (or is non-blank). - **`bool IsClock { get; }`** Whether channel is from an RTC module. - **`bool IsUart { get; }`** Whether channel is from a UART module. - **`bool IsStreamIn { get; }`** Whether channel is from a stream-in module. - **`bool IsStreamOut { get; }`** Whether channel is from a stream-out module. - **`double Range { get; set; }`** Current range setting. - **`double Capacity { get; }`** Sensor capacity. - **`IFilterClass FilterClass { get; set; }`** Filter class setting. - **`string Polarity { get; set; }`** Polarity setting. - **`string Units { get; }`** Units of measurement. - **`ZeroMethodType ZeroMethod { get; set; }`** Zeroing method. - **`double ZeroMethodStart { get; set; }`** Start time for zeroing. - **`double ZeroMethodEnd { get; set; }`** End time for zeroing. - **`string Sensitivity { get; }`** Sensor sensitivity. - **`InitialOffset InitialOffset { get; set; }`** Initial offset value. - **`bool SquibLimitDuration { get; set; }`** Whether squib duration is limited. - **`double SquibDuration { get; set; }`** Squib duration. - **`double? SquibDelay { get; set; }`** Nullable squib delay (nullable for UI purposes). - **`double SquibCurrent { get; set; }`** Squib current. - **`bool DigitalOutLimitDuration { get; set; }`** Whether digital output duration is limited. - **`double DigitalOutDuration { get; set; }`** Digital output duration. - **`double DigitalOutDurationMax { get; set; }`** Maximum allowed digital output duration (FB 28107). - **`double DigitalOutDelay { get; set; }`** Digital output delay. - **`DigitalOutputModes DigitalOutputMode { get; set; }`** Digital output mode. - **`SquibFireMode SquibFireMode { get; set; }`** Squib fire mode. - **`DigitalInputModes DigitalInputMode { get; set; }`** Digital input mode. - **`string ActiveValue { get; set; }`** Active value for digital inputs/outputs. - **`string DefaultValue { get; set; }`** Default value for digital inputs/outputs. - **`uint UartBaudRate { get; set; }`** UART baud rate. - **`uint UartDataBits { get; set; }`** UART data bits. - **`StopBits UartStopBits { get; set; }`** UART stop bits. - **`Parity UartParity { get; set; }`** UART parity. - **`Handshake UartFlowControl { get; }`** UART flow control (always `NONE`; FB 30486). - **`UartDataFormat UartDataFormat { get; set; }`** UART data format. - **`string StreamInUDPAddress { get; set; }`** UDP address for stream-in. - **`UDPStreamProfile StreamOutUDPProfile { get; set; }`** UDP profile for stream-out. - **`string StreamOutUDPAddress { get; set; }`** UDP address for stream-out. - **`ushort StreamOutUDPTimeChannelId { get; set; }`** Time channel ID for stream-out UDP. - **`ushort StreamOutUDPDataChannelId { get; set; }`** Data channel ID for stream-out UDP. - **`string StreamOutUDPTmNSConfig { get; set; }`** TMATS configuration for stream-out. - **`ushort StreamOutIRIGTimeDataPacketIntervalMs { get; set; }`** IRIG packet interval (ms). - **`ushort StreamOutTMATSIntervalMs { get; set; }`** TMATS interval (ms; per FB 29987). - **`IFilterClass GetFilterClassFromISOCode(ISoftwareFilter[] filters, string isoCode)`** Retrieves filter class based on ISO code. - **`CoerceISOCodeDelegate CoerceISOCodeFunc { get; }`** Function to coerce/normalize ISO codes. - **`UIItemStatus ChannelStatus { get; }`** Combined status of channel (e.g., incomplete, error). - **`void SetSettingsFromSensor(ISensorData sd)`** Applies sensor settings to channel. - **`string GetChangeList(ISensorData sensor)`** Returns list of differences between sensor and channel settings. - **`bool IsRangeDifferent { get; set; }`** Whether range differs from original. - **`bool IsFilterClassDifferent { get; set; }`** Whether filter class differs from original. - **`bool IsPolarityDifferent { get; set; }`** Whether polarity differs from original. - **`bool IsZeroMethodDifferent { get; set; }`** Whether zero method differs from original. - **`bool IsZeroMethodStartDifferent { get; set; }`** Whether zero start time differs. - **`bool IsZeroMethodEndDifferent { get; set; }`** Whether zero end time differs. - **`bool IsInitialOffsetDifferent { get; set; }`** Whether initial offset differs. - **`bool IsSquibFireModeDifferent { get; set; }`** Whether squib fire mode differs. - **`bool IsSquibDelayDifferent { get; set; }`** Whether squib delay differs. - **`bool IsSquibLimitDurationDifferent { get; set; }`** Whether squib duration limit differs. - **`bool IsSquibDurationDifferent { get; set; }`** Whether squib duration differs. - **`bool IsSquibCurrentDifferent { get; set; }`** Whether squib current differs. - **`bool IsDigitalOutputModeDifferent { get; set; }`** Whether digital output mode differs. - **`bool IsDigitalOutDelayDifferent { get; set; }`** Whether digital output delay differs. - **`bool IsDigitalOutLimitDurationDifferent { get; set; }`** Whether digital output duration limit differs. - **`bool IsDigitalOutDurationDifferent { get; set; }`** Whether digital output duration differs. - **`bool IsDigitalInputModeDifferent { get; set; }`** Whether digital input mode differs. - **`bool IsDefaultValueDifferent { get; set; }`** Whether default value differs. - **`bool IsActiveValueDifferent { get; set; }`** Whether active value differs. - **`bool BorderShouldShowOutOfDate { get; set; }`** Whether UI border should indicate stale data. --- ### **Invariants** - `IChannelDbRecord.Id` must be unique per record and non-negative. - `IChannelDbRecord.GroupId` must reference a valid group. - `IChannelDbRecord.DASChannelIndex` must be ≥ 0 and consistent with the DAS device’s channel count. - `IChannelDbRecord.SensorId` must be ≥ 0 if a sensor is assigned; otherwise, may be 0 or -1 depending on implementation. - `IGroupChannel.IsBlank()` returns `true` only if the channel has never been edited (i.e., no hardware/sensor assigned and all fields at defaults). - `IGroupChannel.SensorValid` and