Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common/Interface/DASFactory/Config.md
2026-04-17 14:55:32 -04:00

294 lines
16 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
source_files:
- Common/DTS.Common/Interface/DASFactory/Config/IAlignUDPToPPSAware.cs
- Common/DTS.Common/Interface/DASFactory/Config/IEID.cs
- Common/DTS.Common/Interface/DASFactory/Config/IVoltageInsertionEnabled.cs
- Common/DTS.Common/Interface/DASFactory/Config/IInformation.cs
- Common/DTS.Common/Interface/DASFactory/Config/IConfigurationData.cs
- Common/DTS.Common/Interface/DASFactory/Config/IConfiguration.cs
- Common/DTS.Common/Interface/DASFactory/Config/IInfoResultModule.cs
- Common/DTS.Common/Interface/DASFactory/Config/IDASChannel.cs
- Common/DTS.Common/Interface/DASFactory/Config/IInfoResult.cs
- Common/DTS.Common/Interface/DASFactory/Config/IDASModule.cs
generated_at: "2026-04-16T03:10:42.932137+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "f73b754208bf94f9"
---
# Documentation: `DTS.Common.Interface.DASFactory.Config` Interfaces
## 1. Purpose
This module defines a set of interfaces that collectively represent the configuration, metadata, and operational state of a Data Acquisition System (DAS) unit. These interfaces serve as the contract layer between the DAS hardware abstraction and higher-level services (e.g., `ConfigurationService`), enabling structured configuration management, serialization, channel/module metadata retrieval, and system-wide state introspection. They are used primarily during setup, pre-test configuration, and post-test data analysis to expose hardware capabilities, channel configurations, calibration data, and synchronization settings in a type-safe and testable manner.
## 2. Public Interface
### `IAlignUDPToPPSAware`
- **`bool AlignUDPToPPS { get; set; }`**
Gets or sets a flag indicating whether UDP packet timestamps should be aligned to the PPS (Pulse Per Second) signal.
### `IEID`
- **`string ID { get; set; }`**
Gets or sets the EID (Event Identifier) string (e.g., sensor serial or identifier).
- **`byte[] Blob { get; set; }`**
Gets or sets a binary blob associated with the EID (e.g., sensor calibration data).
- **`bool IsValid()`**
Returns `true` if the EID data is considered valid (e.g., non-null/non-empty ID and Blob).
### `IVoltageInsertionEnabled`
- **`bool VoltageInsertionEnabled { get; }`**
Gets a read-only flag indicating whether voltage insertion (a hardware feature) is currently enabled on the DAS unit.
### `IInformation`
- **`IInfoResult DASInfo { get; set; }`**
Gets or sets the `IInfoResult` object containing hardware metadata (e.g., module list, calibration, channel mapping).
- **`void SetDASInfo(IInfoResult dasInfo, bool bSetInDb = true)`**
Sets the `DASInfo` property and optionally persists it to a database.
- **`void SetDASInfo()`**
Overload of `SetDASInfo` that calls the above with `bSetInDb = true`.
### `IConfigurationData`
- **`IDASModule[] Modules { get; set; }`**
Gets or sets the array of modules in the DAS.
- **`IEID[] IDs { get; set; }`**
Gets or sets the array of EIDs for the entire DAS.
- **`string TestID { get; set; }`**
Gets or sets the ID of the current test/event.
- **`string TestSetupUniqueId { get; set; }`**
Gets or sets a unique identifier for the test setup instance.
- **`string InstanceID { get; set; }`**
Gets or sets the ID of a test run instance (used to locate downloaded data).
- **`string Description { get; set; }`**
Gets or sets a human-readable description of the current test/event.
- **`bool ClearSetup { get; set; }`**
Gets or sets a flag indicating whether to clear the current setup before applying new configuration.
- **`int NumberOfConfiguredChannels()`**
Returns the count of channels where `IsConfigured()` returns `true`.
- **`int NumberOfChannels()`**
Returns the total number of channels (configured or not).
- **`int NumberOfDownloadChannels()`**
Returns the number of channels that are downloadable (i.e., not UART or StreamOut).
- **`int[] DisplayOrder { get; set; }`**
Gets or sets the per-channel display order array.
- **`int DasDisplayOrder { get; set; }`**
Gets or sets the DAS-wide display order.
- **`int GetDisplayOrder(uint channelIdx)`**
Returns the display order for the channel at index `channelIdx`.
- **`string UDPReceiveAddress { get; set; }`**
Gets or sets the UDP receive address used to control the OBR-DDR.
- **Serialization methods**
- `void WriteXml(XmlWriter writer)`
- `void ReadXml(XmlReader reader)`
- `XmlSchema GetSchema()`
Standard XML serialization interface methods.
### `IConfiguration`
- **`string TestDirectory { get; set; }`**
Gets or sets the local path where the DAS stores test information.
- **`bool SupportsAutoDetect { get; }`**
Gets a read-only flag indicating whether the unit supports auto-detection of channel types (e.g., bridge/IEPE).
- **`void QueryConnectedDevices()`**
Directly queries the hardware to detect connected devices (if supported).
- **`IConfigurationData ConfigData { get; set; }`**
Gets or sets the `IConfigurationData` object containing the pre-test configuration.
- **`ClockSyncProfile DASClockSyncProfile { get; set; }`**
Gets or sets the clock synchronization profile (applied only to units that support it).
- **`int GetDASDisplayOrder()`**
Returns the DAS display order (default `-1`).
- **`int[] GetChannelDisplayOrder()`**
Returns the per-channel display order array.
- **`void SetDASDisplayOrder(int order)`**
Sets the DAS display order (intended for use by FWTU only).
- **`void SetChannelDisplayOrder(int[] order)`**
Sets the per-channel display order array (intended for use by FWTU only).
### `IInfoResultModule`
- **`string SerialNumber { get; set; }`**
Serial number of the module.
- **`string FirmwareVersion { get; set; }`**
Firmware version string.
- **`int ModuleArrayIndex { get; set; }`**
Index of this module in the module array (0-based).
- **`uint NumberOfChannels { get; set; }`**
Number of channels attached to this module.
- **`uint[] SupportedSampleRates { get; set; }`**
Array of supported sample rates (in Hz).
- **`Dictionary<uint, float> SampleRate2AAFrequency { get; set; }`**
Mapping from sample rate to corresponding anti-aliasing filter frequency.
- **`ulong? MaxEventStorageSpaceInBytes { get; set; }`**
Maximum event storage space (bytes) for this module (`null` if DAS-level).
- **`uint? NumberOfBytesPerSampleClock { get; set; }`**
Bytes stored per sample clock for all channels (`null` if DAS-level).
- **`double MaxRecordingSamples { get; set; }`**
Maximum number of samples this module can record.
- **`DateTime? CalibrationDate { get; set; }`**
Last calibration date/time (`null` if unknown/invalid).
- **`bool RackIsUnreadable { get; set; }`**
`true` if a TDAS rack is armed and unresponsive to queries.
- **`DFConstantsAndEnums.ModuleType TypeOfModule { get; set; }`**
Module type (e.g., analog input, clock, etc.).
- **`DFConstantsAndEnums.RecordingMode[] SupportedModes { get; set; }`**
Supported recording modes.
- **`bool IsProgrammable { get; set; }`**
Indicates whether the module is programmable.
### `IDASChannel`
- **`DFConstantsAndEnums.ConfigMode ConfigurationMode { get; set; }`**
Configuration mode of the channel.
- **`bool DiagnosticsMode { get; set; }`**
Whether the channel is in diagnostics mode.
- **`int ModuleChannelNumber { get; set; }`**
Channel number relative to its owning module.
- **`int AbsoluteDisplayOrder { get; set; }`**
Absolute display order index across all channels.
- **`double UnitConverision { get; set; }`**
Conversion factor for unit scaling (note: typo in source; likely intended `UnitConversion`).
- **`bool AtCapacity { get; set; }`**
Whether the channel is at full-scale capacity.
- **`double CapacityOutputIsBasedOn { get; set; }`**
Reference value for capacity calculation.
- **`SensorConstants.SensUnits SensitivityUnits { get; set; }`**
Units of the sensor sensitivity (e.g., mV/V, pC).
- **`byte Number { get; }`**
Absolute channel number within the DAS (0-based).
- **`IEID[] IDs { get; set; }`**
Array of EIDs associated with this channel.
- **`DateTime EventStartTime { get; set; }`**
Timestamp of the event start for this channel.
- **`bool LevelTriggerSeen { get; set; }`**
Whether a level trigger was detected on this channel.
- **`string IsoChannelName { get; set; }`**
ISO-standard channel name.
- **`string ChannelGroupName { get; set; }`**
Name of the group this channel belongs to.
- **`string UserCode { get; set; }`**
User-defined code.
- **`string UserChannelName { get; set; }`**
User-defined channel name.
- **`string LinearSensorCalibration { get; set; }`**
Linear calibration coefficients (e.g., slope/offset).
- **`int QualificationSamples { get; set; }`**
Number of samples used for trigger qualification.
- **`int? LevelTriggerT0AdjustmentSamples { get; set; }`**
Sample shift applied to align T0 with this channels trigger (if not directly triggered, `null`).
- **`bool IsConfigured()`**
Returns `true` if the channel is considered configured (sensor connected, config present).
- **Serialization methods**
- `void WriteElementStart(XmlWriter writer)`
- `void WriteElementEnd(XmlWriter writer)`
- `void WriteXmlCRC32(XmlWriter writer)`
- `void WriteXml(XmlWriter writer)`
- `void ReadXml(XmlReader reader)`
- `XmlSchema GetSchema()`
- **`int IdType { get; set; }`**
Type identifier for the EID (e.g., sensor type).
- **`string UserValue1 { get; set; }`**, **`UserValue2`**, **`UserValue3`**
User-defined string fields.
### `IInfoResult`
- **`string MACAddress { get; set; }`**
MAC address of the DAS unit.
- **`IInfoResultModule[] Modules { get; set; }`**
Array of modules in the DAS.
- **`List<Common.Classes.Hardware.ExternalTilt> ActiveExternalTilts { get; set; }`**
List of active external tilt sensors.
- **`uint MaxNumberOfModules { get; set; }`**
Maximum number of modules supported by the DAS.
- **`ulong? MaxEventStorageSpaceInBytes { get; set; }`**
Total event storage space (bytes) for the DAS (`null` if per-module).
- **`uint? NumberOfBytesPerSampleClock { get; set; }`**
Total bytes per sample clock for all channels (`null` if per-module).
- **`bool? DeviceStreamingOnly { get; set; }`**
`true` if the device is hardware-configured for streaming-only (`null` if unsupported).
- **`int NumberOfBridgeChannels { get; set; }`**
Hardcoded count of bridge channels (temporary constant).
- **`IEID BatteryID { get; set; }`**
EID for the battery module.
- **`bool HasBattery { get; }`**
`true` if a battery is physically present.
- **Channel mapping methods**
- `byte MapDASChannelNumber2RealtimeChannelNumber(int channelNumber)`
- `byte MapDASChannelNumber2ModuleArrayIndex(int channelNumber)`
- `byte MapDASChannelNumber2ModuleDeviceID(int channelNumber)`
- `byte MapDASChannelNumber2ModuleChannelNumber(int channelNumber)`
- `byte MapModuleArrayIndexAndChannelNum2DASChannel(int moduleArrayIdx, int channelNumber)`
Bidirectional mappings between DAS-wide channel numbers, module indices, and device IDs.
- **`DateTime? CalibrationDate { get; set; }`**
DAS calibration date (`1970-01-01` if invalid/NA).
### `IDASModule`
- **`IDASChannel[] Channels { get; set; }`**
Array of channels attached to this module (indexed by `ModuleChannelNumber`).
- **`IEID[] IDs { get; set; }`**
EIDs for sensors on each channel.
- **`int ModuleArrayIndex { get; set; }`**
Index of this module in the module array.
- **`double RequestedPreTriggerSeconds { get; set; }`**, **`double RequestedPostTriggerSeconds { get; set; }`**
Requested pre/post trigger durations (seconds).
- **`double PreTriggerSeconds { get; set; }`**, **`double PostTriggerSeconds { get; set; }`**
Actual pre/post trigger durations (seconds) after configuration.
- **`int NumberOfEvents { get; set; }`**
Number of events to collect before disarming.
- **`int WakeUpMotionTimeout { get; set; }`**
Seconds of inactivity before entering sleep mode.
- **`string FirmwareVersion { get; set; }`**
Firmware version string.
- **`string Description { get; set; }`**
Module description (e.g., for Slice6 Distributor).
- **`ulong? MaxEventStorageSpaceInBytes { get; set; }`**
Storage space for this module.
- **`ulong NumberOfSamples { get; set; }`**
Total samples captured in last recording session.
- **`ulong[] TriggerSampleNumbers { get; set; }`**
Array of sample numbers where triggers occurred.
- **`int GetLevelTriggerT0AdjustmentSamplesAutoApplied()`**
Returns the auto-applied T0 adjustment (in samples).
- **`ulong StartRecordSampleNumber { get; set; }`**
Sample number where recording started.
- **`uint StartRecordTimestampSec`, `uint TriggerTimestampSec`, `uint StartRecordTimestampNanoSec`, `uint TriggerTimestampNanoSec`**
Timestamps (seconds + nanoseconds) for start and trigger events.
- **`bool PTPMasterSync { get; set; }`**
Whether PTP master synchronization is enabled.
- **Tilt sensor properties (pre/post)**
- `double TiltSensorAxisX/Y/ZDegreesPre/Post { get; set; }`
- `float TemperatureLocation1/2/3/4Pre/Post { get; set; }`
- **`uint SampleRateHz { get; set; }`**, **`uint ActualSampleRateHz { get; set; }`**
Requested and actual sample rates (Hz).
- **`float AAFilterRateHz { get; set; }`**
Hardware anti-aliasing filter rate.
- **`DFConstantsAndEnums.RecordingMode RecordingMode { get; set; }`**
Current recording mode.
- **`DateTime ScheduledStartTime { get; set; }`**, **`int RecordingInterval { get; set; }`**
Scheduled start time and recording interval.
- **`UDPStreamProfile StreamProfile { get; set; }`**
UDP streaming profile.
- **Slice 6 Tilt feature properties**
- `TiltAxes`, `TargetAxisOne/Two`, `TargetAngleAxisX/Y/Z`, `MountOffsetAxisOne/Two`, `SystemLocation`, `SystemID`, `AxisIgnored`, `LevelTolerance`, `UseForTiltCalculation`, `InputVoltage`, `BatteryVoltage`, `TiltID`, `TiltSerialNumber`.
- **`int NumberOfConfiguredChannels()`**, **`int NumberOfConfiguredTOMChannels()`**
Returns count of configured channels or TOM channels.
- **`bool IsDummyArmed()`**
Returns `true` if the module is in dummy-armed state.
- **`int NumberOfChannels()`**
Total number of channels on this module.
- **`string SerialNumber()`**, **`DFConstantsAndEnums.ModuleType ModuleType()`**
Retrieves module serial number and type.
- **`bool IsStreamIn()`**, **`IsStreamOut()`**, **`IsUart()`**, **`IsClock()`**, **`IsEmbedded()`**, **`IsThermocoupler()`**
Type-check helpers based on `ModuleType()`.
- **Serialization methods**
- `void WriteXmlCRC32(XmlWriter writer)`
- `void WriteXml(XmlWriter writer)`
- `void ReadXml(XmlReader reader)`
- `XmlSchema GetSchema()`
- `ushort GetCRC32()`
## 3. Invariants
- **Channel numbering**: `IDASChannel.Number` is a 0-based absolute channel index within the DAS (0..29 implied by `MapDASChannelNumber2*` methods).
- **Module indexing**: `IDASModule.ModuleArrayIndex` is 0-based and corresponds to position in `IConfigurationData.Modules` and `IInfoResult.Modules`.
- **Channel mapping consistency**: The mapping functions in `IInfoResult` must be consistent and invertible (e.g., `MapModuleArrayIndexAndChannelNum2DASChannel` is the inverse of `MapDASChannelNumber2ModuleArrayIndex` and `MapDASChannelNumber2ModuleChannelNumber`).
- **`IsConfigured()` semantics**: A channel is considered "configured" only if a sensor is connected and/or configuration data exists (set via `ConfigurationService.Configure(...)`).
- **`DASInfo` initialization**: `IInformation.DASInfo` must be set before calling `SetDASInfo(...)`; otherwise, behavior is undefined.
- **`NumberOfDownloadChannels()` excludes UART/StreamOut**: Only channels capable of data download (e.g., analog inputs) are counted.
- **`CalibrationDate` invalidity**: A value of `1970-01-01` indicates invalid/NA calibration date (per `IInfoResult.CalibrationDate` documentation).
- **`DisplayOrder` arrays**: `DisplayOrder` (per-channel) and `DasDisplayOrder