--- source_files: - Common/DTS.Common/Interface/DataRecorders/IDASDBRecord.cs - Common/DTS.Common/Interface/DataRecorders/IHardwareChannel.cs - Common/DTS.Common/Interface/DataRecorders/IDASHardware.cs - Common/DTS.Common/Interface/DataRecorders/IDASChannelDBRecord.cs generated_at: "2026-04-16T03:04:17.315073+00:00" model: "Qwen/Qwen3-Coder-Next-FP8" schema_version: 1 sha256: "e272a7c3fc6f00d6" --- # Documentation: Data Recorder Interfaces ## 1. Purpose This module defines core interfaces for representing hardware data acquisition systems (DAS) and their channels in the TTS (Test Tracking System) ecosystem. It provides a structured abstraction layer between the database layer and the application logic, enabling consistent handling of DAS hardware metadata, channel capabilities, and connectivity information. The interfaces `IDASDBRecord`, `IDASHardware`, `IHardwareChannel`, and `IDASChannelDBRecord` collectively model physical and logical hardware entities—including standalone DAS units, rack modules, and individual channels—with support for calibration tracking, first-use date management, diagnostic reporting, and bridge/excitation type capabilities. This abstraction facilitates hardware scanning, configuration, and data collection workflows across the test system. ## 2. Public Interface ### `IDASDBRecord` Encapsulates a DAS record as stored in the database. - **`int DASId { get; set; }`** Unique identifier for the DAS in the database. - **`string SerialNumber { get; set; }`** Hardware serial number. - **`int DASType { get; set; }`** Numeric type identifier for the DAS (e.g., TDAS, G5, TSRAIR). - **`int MaxModules { get; set; }`** Maximum number of modules supported by this DAS. - **`long MaxMemory { get; set; }`** Maximum memory capacity (in bytes) of the DAS. - **`double MaxSampleRate { get; set; }`** Maximum sample rate (Hz) supported by the DAS. - **`double MinSampleRate { get; set; }`** Minimum sample rate (Hz) supported by the DAS. - **`string FirmwareVersion { get; set; }`** Current firmware version string. - **`DateTime CalDate { get; set; }`** Last calibration date. - **`int ProtocolVersion { get; set; }`** Protocol version used by the DAS. - **`DateTime LastModified { get; set; }`** Timestamp of last database record modification. - **`string LastModifiedBy { get; set; }`** User or system that last modified the record. - **`int Version { get; set; }`** Record version for concurrency control. - **`bool LocalOnly { get; set; }`** Indicates if the record is local-only (deprecated per `IDASChannelDBRecord`). - **`DateTime LastUsed { get; set; }`** Timestamp of last known usage. - **`string LastUsedBy { get; set; }`** User or system that last used the hardware. - **`string Connection { get; set; }`** Connectivity information (e.g., IP, serial port) used for hardware scanning. - **`int Channels { get; set; }`** Total number of channels on the DAS. - **`string Position { get; set; }`** Physical or logical position of the DAS (e.g., rack location). - **`int[] ChannelTypes { get; set; }`** Array of channel type codes (interpretation is hardware-specific). - **`bool IsProgrammable { get; set; }`** Indicates if the DAS supports programmable configurations. - **`bool IsReconfigurable { get; set; }`** Indicates if the DAS can be reconfigured at runtime. - **`bool IsModule { get; set; }`** Indicates if this hardware is a module (e.g., rack-mounted) vs. standalone. - **`int PositionOnDistributor { get; set; }`** Position index on the distributor (e.g., bus segment). - **`int PositionOnChain { get; set; }`** Position index on the communication chain. - **`int Port { get; set; }`** Communication port number (e.g., TCP port, serial port). - **`string ParentDAS { get; set; }`** Serial number of the parent DAS (for modules). - **`DateTime? FirstUseDate { get; set; }`** First date of use after calibration; `null` if unused since calibration. Valid only if `IsFirstUseValid` is `true`. - **`int? TestId { get; set; }`** Test ID for stand-in hardware used only in a specific test. - **`int? GroupId { get; set; }`** Group ID for stand-in hardware used only in a specific group. - **`bool StandIn { get; set; }`** Indicates if this is dummy/stand-in hardware (no real data collection). - **`double MaxAAFRate { get; set; }`** Maximum anti-aliasing filter rate (Hz). - **`bool IsFirstUseValid { get; set; }`** Indicates if `FirstUseDate` is applicable and valid. --- ### `IHardwareChannel` Represents a single channel on a DAS, exposing its capabilities and diagnostics. - **`IDiagnosticResult Diagnostics { get; }`** Diagnostic results for this channel; `null` if unavailable. - **`bool IsSupportedBridgeType(SensorConstants.BridgeType bridgeType)`** Returns `true` if the channel supports the specified bridge type. - **`int ChannelNumber { get; }`** Logical channel number (1-based or 0-based depending on hardware). - **`string GetId()`** Returns a unique identifier string for the channel. - **`bool IsAnalog { get; }`** Indicates if the channel supports analog sensors. - **`bool IsSquib { get; }`** Indicates if the channel supports squib fire. - **`bool IsDigitalOut { get; }`** Indicates if the channel supports digital outputs. - **`bool IsDigitalIn { get; }`** Indicates if the channel supports digital inputs. - **`bool IsUart { get; }`** Indicates if the channel supports UART I/O. - **`bool IsStreamIn { get; }`** Indicates if the channel supports stream input. - **`bool IsStreamOut { get; }`** Indicates if the channel supports stream output. - **`bool IsThermocoupler { get; }`** Indicates if the channel supports thermocouple sensors. - **`bool IsCan { get; }`** Indicates if the channel supports CAN bus. - **`bool IsClock { get; }`** Indicates if the channel supports clock functionality. - **`bool IsTSRAIR { get; }`** Indicates if the channel belongs to a TSRAIR DAS. - **`bool IsSLICETC { get; }`** Indicates if the channel belongs to a SLICE thermocouple module. - **`bool IsTSRAIRModule { get; }`** Indicates if the channel belongs to a TSRAIR module. - **`IDASHardware GetParentDAS()`** Returns the parent DAS hardware object. - **`string ModuleSerialNumber { get; set; }`** Serial number of the module this channel belongs to (if applicable). - **`bool IsSupportedExcitation(ExcitationVoltageOptions.ExcitationVoltageOption excitation)`** Returns `true` if the specified excitation voltage is supported. - **`bool IsG5()`** Returns `true` if the channel’s parent DAS serial number starts with `"5M"`. - **`string ToString(IDASHardware[] hardwares)`** Returns a human-readable string representation, using the provided hardware array for context. --- ### `IDASHardware` Represents a DAS hardware unit (standalone or rack module) in the TTS import context. - **`int ProtocolVersion { get; }`** Protocol version supported by the hardware. - **`bool IsStandIn()`** Returns `true` if this is a stand-in (dummy) DAS. - **`bool IsFirstUseValid { get; }`** Indicates if `FirstUseDate` is valid and applicable. - **`DateTime? FirstUseDate { get; }`** First use date after calibration; `null` if unused. - **`bool IsPseudoRack()`** Returns `true` if this is a pseudo-rack (virtual or simulated rack). - **`int DASId { get; }`** Database ID of the DAS. - **`string SerialNumber { get; set; }`** Hardware serial number. - **`string SerialNumberFamily { get; set; }`** Family identifier derived from serial number (e.g., `"G5"`). - **`string EIDFound { get; set; }`** EID (Electronic ID) status or value. - **`string BatteryVoltageStatus { get; set; }`** Battery voltage status string (e.g., `"OK"`, `"LOW"`). - **`System.Windows.Media.SolidColorBrush BatteryVoltageColor { get; set; }`** UI color for battery voltage status. - **`string InputVoltageStatus { get; set; }`** Input voltage status string. - **`System.Windows.Media.SolidColorBrush InputVoltageColor { get; set; }`** UI color for input voltage status. - **`string ParentDAS { get; set; }`** Serial number of the parent DAS (for modules). - **`string Connection { get; set; }`** Connectivity information for hardware scanning. - **`IHardwareChannel[] GetIHardwareChannels()`** Returns all channels on this DAS. - **`bool IsSLICEEthernetController { get; }`** Returns `true` if this DAS is a SLICE Ethernet Controller. - **`bool IsTDASRack()`** Returns `true` if this DAS is a TDAS rack. - **`bool IsG5()`** Returns `true` if the DAS is a G5 model. - **`bool IsTSRAIR()`** Returns `true` if the DAS is a TSRAIR model. - **`bool IsTSRAIRModule()`** Returns `true` if the DAS is a TSRAIR module. - **`double GetMinSampleRateDouble()`** Returns the minimum sample rate supported by this DAS. - **`double GetMaxSampleRateDouble()`** Returns the maximum sample rate supported by this DAS. - **`bool IsModule()`** Returns `true` if this hardware is a module (not displayed in Hardware Scan for Slice bridges; displayed for TDAS racks). - **`string LastModifiedBy { get; set; }`** User/system that last modified the hardware record. - **`DateTime LastModified { get; set; }`** Timestamp of last modification. - **`HardwareTypes DASTypeEnum { get; set; }`** Enumerated type of the DAS (e.g., `HardwareTypes.TDAS`, `HardwareTypes.G5`). - **`int[] ChannelTypes { get; }`** Array of channel type codes for all channels on this DAS. --- ### `IDASChannelDBRecord` Represents a channel record in the database. - **`string HardwareId { get; set; }`** Hardware identifier string: `"_"`. - **`int DaschannelId { get; set; }`** Primary key of the channel record in the database. - **`int? Dasid { get; set; }`** Foreign key to the parent DAS record (`DASId`). - **`int ChannelIdx { get; set; }`** Physical channel index (0-based) on the DAS. - **`int SupportedBridges { get; set; }`** Bitmask of supported bridge types: - Bit 0: IEPE - Bit 1: Quarter bridge - Bit 2: Half bridge - Bit 3: Full bridge - Bit 4: Digital input - Bit 5: Squib fire - Bit 6: Digital output - Bit 7: Half bridge signal plus (G5) - Bit 8: Real-Time Clock - Bit 9: UART - **`int SupportedExcitations { get; set; }`** Bitmask of supported excitation voltages: - Bit 0: Invalid/undefined - Bit 1: 2V - Bit 2: 2.5V - Bit 3: 3V - Bit 4: 5V - Bit 5: 10V - Bit 6: 1V - **`int DASDisplayOrder { get; set; }`** Display order among channels on the DAS (may differ from physical order). - **`bool LocalOnly { get; set; }`** Deprecated. Previously indicated local-only storage. - **`int SupportedDigitalInputModes { get; set; }`** Bitmask of supported digital input modes (if digital input supported): - Bit 0: Invalid - Bit 1: Transition low-to-high (TLH) - Bit 2: Transition high-to-low (THL) - Bit 3: Contact closure normally open (CCNO) - Bit 4: Contact closure normally closed (CCNC) - **`int SupportedSquibFireModes { get; set; }`** Bitmask of supported squib fire modes (if squib fire supported): - Bit 0: Invalid - Bit 1: Capacitor discharge - Bit 2: Constant current - Bit 3: AC discharge - **`int SupportedDigitalOutputModes { get; set; }`** Bitmask of supported digital output modes (if digital output supported): - Bit 0: 5V low-to-high (FVLH) - Bit 1: 5V high-to-low (FVHL) - Bit 2: CCNO - Bit 3: CCNC - **`string ModuleSerialNumber { get; set; }`** Serial number of the module this channel belongs to (if applicable). - **`int SettingId { get; set; }`** ID of the channel configuration setting. - **`int ModuleArrayIndex { get; set; }`** Array index of the module among modules on the DAS. --- ## 3. Invariants - **`IDASDBRecord.StandIn` and `IDASHardware.IsStandIn()` must be consistent**: If `StandIn` is `true`, then `IsStandIn()` should return `true`. - **`IDASDBRecord.IsFirstUseValid` governs validity of `FirstUseDate`**: `FirstUseDate` is only meaningful when `IsFirstUseValid` is `true`; otherwise, it should be ignored. - **`IDASDBRecord.IsModule` and `IDASHardware.IsModule()` must align**: A module in the DB record should correspond to `IsModule()` returning `true` in the hardware interface. - **`IDASChannelDBRecord.HardwareId` format**: Must be `"_"` (e.g., `"ABC123_5"`). - **Bitmask semantics are fixed**: All bitmasks (`SupportedBridges`, `SupportedExcitations`, etc.) use the documented bit positions; no dynamic reassignment is allowed. - **`ChannelIdx` is zero-based**: Represents physical channel index on the DAS. - **`DASDisplayOrder` may differ from `ChannelIdx`**: Display order is a logical ordering, not necessarily physical. ## 4. Dependencies ### Imports/Usings: - `System` (core types, `DateTime`, `Nullable`) - `System.ComponentModel.DataAnnotations` and `System.ComponentModel.DataAnnotations.Schema` (`IDASChannelDBRecord` only) - `DTS.Common.Enums` (specifically `SensorConstants.BridgeType`, `ExcitationVoltageOptions.ExcitationVoltageOption`) - `DTS.Common.Interface.DASFactory.Diagnostics` (`IDiagnosticResult` interface) ### Inferred Dependencies: - **`IDiagnosticResult`** (from `DTS.Common.Interface.DASFactory.Diagnostics`) is used by `IHardwareChannel.Diagnostics`. - **`HardwareTypes`** enum (from `DTS.Common.Enums.Hardware`) is used in `IDASHardware.DASTypeEnum`. - **`SensorConstants.BridgeType`** and **`ExcitationVoltageOptions.ExcitationVoltageOption`** enums are used in `IHardwareChannel` methods. ### Likely Consumers: - Hardware scanning and discovery modules (uses `Connection`, `ParentDAS`, `IsModule`, `IsStandIn`) - Calibration and compliance tracking (uses `CalDate`, `FirstUseDate`, `IsFirstUseValid`) - Channel configuration and mapping (uses `ChannelIdx`, `DASDisplayOrder`, `SupportedBridges`, `SupportedExcitations`) - UI rendering (uses `BatteryVoltageColor`, `InputVoltageColor`, `Connection`, `Position`) ## 5. Gotchas - **`LocalOnly` is deprecated**: Both `IDASDBRecord.LocalOnly` and `IDASChannelDBRecord.LocalOnly` are marked as deprecated; do not rely on them for new logic. - **`FirstUseDate` is nullable and conditional**: Its value is only valid when `IsFirstUseValid` is `true`; otherwise, it should be ignored. - **`ChannelIdx` vs. `DASDisplayOrder`**: Physical channel index (`ChannelIdx`) and display order (`DASDisplayOrder`) may differ for some hardware; do not assume they are equal. - **`IsG5()` implementation is serial-number-based**: `IHardwareChannel.IsG5()` checks if the *serial number starts with `"5M"`*, not the DAS type enum. - **`IsModule()` semantics differ between interfaces**: - In `IDASDBRecord`, `IsModule` indicates if the record represents a module. - In `IDASHardware`, `IsModule()` controls visibility in Hardware Scan (e.g., `false` for TDAS rack modules, `true` for Slice bridges). - **Bitmask values are hardcoded**: The bit positions for `SupportedBridges`, `SupportedExcitations`, etc., are fixed and must not be changed without updating all consumers. - **`