init
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Interface/DASFactory/ARM/IArmStatus.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/ARM/IArmStatusData.cs
|
||||
generated_at: "2026-04-16T03:11:25.846617+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "5782109e320aeb67"
|
||||
---
|
||||
|
||||
# ARM
|
||||
|
||||
## Documentation: `IArmStatus` and `IArmStatusData` Interfaces
|
||||
|
||||
### 1. Purpose
|
||||
This module defines the contract for tracking and managing the operational state of a DAS (Data Acquisition System) unit within the DASFactory ARM (Armed) subsystem. It provides a standardized interface (`IArmStatus`) to query and update high-level DAS states (e.g., *Arm*, *Realtime*, *Streaming*) and exposes detailed status metadata via the `IArmStatusData` interface. The interfaces decouple state management from hardware-specific implementations, enabling consistent state tracking without direct hardware polling—critical for coordinating test sequencing, diagnostics, and database persistence in the DAS factory workflow.
|
||||
|
||||
---
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
#### `IArmStatus` Interface
|
||||
- **`void SetInArm(bool WriteToDb)`**
|
||||
Marks the unit as being in *Arm* state. If `WriteToDb` is `true`, persists the state to the database.
|
||||
|
||||
- **`void SetInRealtime(bool WriteToDb, bool ExitRealtimeIfPossible)`**
|
||||
Marks the unit as being in *Realtime* mode. If `WriteToDb` is `true`, persists the state. If `ExitRealtimeIfPossible` is `true`, allows exiting *Realtime* if conditions permit (e.g., if already in a conflicting state).
|
||||
|
||||
- **`bool GetIsInArm()`**
|
||||
Returns `true` if the unit is *known* to be in *Arm* state (based on internal flags only—no hardware query).
|
||||
|
||||
- **`bool GetIsInRealtime()`**
|
||||
Returns `true` if the unit is *known* to be in *Realtime* state (based on internal flags only—no hardware query).
|
||||
|
||||
- **`bool GetIsStreaming()`**
|
||||
Returns `true` if the unit is *known* to be *streaming* (based on internal flags only—no hardware query).
|
||||
|
||||
- **`IArmStatusData DASArmStatus { get; set; }`**
|
||||
Gets or sets the detailed status object (`IArmStatusData`) for the DAS unit.
|
||||
|
||||
- **`void SetDASArmStatus(IArmStatusData status, bool bSetInDb)`**
|
||||
Sets the `DASArmStatus` property to `status`. If `bSetInDb` is `true`, persists the new status to the database.
|
||||
|
||||
- **`void SetDASArmStatus()`**
|
||||
Persists the *current* `DASArmStatus` value to the database (if connected). Does *not* modify the in-memory status object.
|
||||
|
||||
#### `IArmStatusData` Interface
|
||||
- **`bool ReceivedInvalidModeDuringSetup { get; set; }`**
|
||||
Indicates if the unit received an `InvalidMode` error during initial setup (used as a proxy for *streaming* detection in some contexts).
|
||||
|
||||
- **`void ClearTriggerCheckStatus()`**
|
||||
Clears flags related to trigger-check diagnostics (e.g., `IsTriggerShorted`, `IsStartShorted`).
|
||||
|
||||
- **`bool IsArmed { get; set; }`**
|
||||
Indicates if the DAS is currently armed.
|
||||
|
||||
- **`bool IsTriggered { get; set; }`**
|
||||
Indicates if the DAS has sensed a trigger event.
|
||||
|
||||
- **`bool IsTriggerShorted { get; set; }`**
|
||||
Indicates if the trigger was shorted *during a trigger-check procedure* (distinct from `IsTriggered`).
|
||||
|
||||
- **`bool IsStartShorted { get; set; }`**
|
||||
Indicates if the start signal was shorted *during a trigger-check procedure*.
|
||||
|
||||
- **`bool IsRecording { get; set; }`**
|
||||
Indicates if the DAS is currently recording sample data.
|
||||
|
||||
- **`bool IsFaulted { get; set; }`**
|
||||
Indicates if the DAS has faulted.
|
||||
|
||||
- **`bool IsInRealtime { get; set; }`**
|
||||
Indicates if the DAS is in real-time mode.
|
||||
|
||||
- **`bool IsInFlashWrite { get; set; }`**
|
||||
Indicates if the DAS is in flash-write mode (G5-specific).
|
||||
|
||||
- **`bool IsUndefined { get; set; }`**
|
||||
Used when `TDAS ARM STAT READ` returns no data (fallback state).
|
||||
|
||||
- **`bool IsInPostTestDiagnostics { get; set; }`**
|
||||
Indicates if the DAS is running post-test diagnostics.
|
||||
|
||||
- **`double TimeRemainingSeconds { get; set; }`**
|
||||
Estimated seconds remaining in the current recording.
|
||||
|
||||
- **`double PercentComplete { get; set; }`**
|
||||
Completion percentage for flash-write operations.
|
||||
|
||||
- **`ulong TotalSamples { get; set; }`**
|
||||
Total number of samples to be recorded in the current test.
|
||||
|
||||
- **`ulong CurrentSample { get; set; }`**
|
||||
Current sample index being recorded.
|
||||
|
||||
- **`uint SampleRate { get; set; }`**
|
||||
Current sample rate (samples per second).
|
||||
|
||||
- **`double? InputMilliVolts { get; set; }`**
|
||||
Current input voltage (in millivolts), or `null` if unavailable.
|
||||
|
||||
- **`double? BatteryMilliVolts { get; set; }`**
|
||||
Current battery voltage (in millivolts), or `null` if no battery is present.
|
||||
|
||||
- **`int? EventNumber { get; set; }`**
|
||||
Current event number being recorded, or `null` if not applicable.
|
||||
|
||||
- **`ushort? MaxEventsPossible { get; set; }`**
|
||||
Maximum number of events supported by the device (per issue FB 26817).
|
||||
|
||||
- **`int RecordingMode { get; set; }`**
|
||||
Numeric recording mode identifier (e.g., 0 = normal, 1 = burst).
|
||||
|
||||
- **`string FaultMessage { get; set; }`**
|
||||
Human-readable fault description (e.g., "Overvoltage on input channel 3").
|
||||
|
||||
- **`bool IsRearming { get; set; }`**
|
||||
Indicates if the DAS is in the rearming phase after a test.
|
||||
|
||||
- **`bool HasBeenRecording { get; set; }`**
|
||||
Indicates if the DAS has ever recorded in the current session.
|
||||
|
||||
- **`double? TimeLeftInArm { get; set; }`**
|
||||
Estimated time remaining in the *Arm* state (in seconds), or `null` if unknown.
|
||||
|
||||
---
|
||||
|
||||
### 3. Invariants
|
||||
- **State Flags Are Software-Only**: `GetIsInArm()`, `GetIsInRealtime()`, and `GetIsStreaming()` return *only* software-tracked flags—no hardware queries are performed.
|
||||
- **`DASArmStatus` Is Mutable**: The `DASArmStatus` property is read-write; consumers may replace the entire `IArmStatusData` instance.
|
||||
- **Database Persistence Is Optional**: Methods like `SetInArm`, `SetInRealtime`, and `SetDASArmStatus` accept a `bool` parameter to control database writes.
|
||||
- **`IsTriggerShorted`/`IsStartShorted` Are Trigger-Check-Specific**: These flags are *only* set during trigger-check diagnostics and are cleared by `ClearTriggerCheckStatus()`.
|
||||
- **`ReceivedInvalidModeDuringSetup` Is a Heuristic**: Used as a fallback to infer *streaming* status when direct state queries fail, but is not a primary state indicator.
|
||||
|
||||
---
|
||||
|
||||
### 4. Dependencies
|
||||
- **Depends On**:
|
||||
- None explicitly (pure interface definitions; no implementation or external library references in source).
|
||||
- **Depended On By**:
|
||||
- Likely consumed by DAS factory control logic (e.g., test sequencers, diagnostics tools) that need to monitor DAS state without hardware coupling.
|
||||
- `IArmStatusData` is used as a data carrier for database persistence (via `SetDASArmStatus()`).
|
||||
- Concrete implementations (not shown) would depend on hardware communication layers (e.g., ARM-specific drivers) to populate `IArmStatusData`.
|
||||
|
||||
---
|
||||
|
||||
### 5. Gotchas
|
||||
- **`GetIsInRealtime()` vs. `IsInRealtime`**:
|
||||
`GetIsInRealtime()` is a *state flag* (set by `SetInRealtime()`), while `IsInRealtime` in `IArmStatusData` is a *data field* that may be updated independently (e.g., by hardware polling). They are not guaranteed to be synchronized.
|
||||
- **`IsTriggerShorted` ≠ `IsTriggered`**:
|
||||
Confusingly, `IsTriggerShorted` is *only* set during trigger-checks, whereas `IsTriggered` is set in many contexts (e.g., actual trigger events). Do not assume equivalence.
|
||||
- **`ReceivedInvalidModeDuringSetup` Is Legacy Heuristic**:
|
||||
Its use as a streaming indicator is explicitly noted as a workaround for incomplete state reporting (see XML comment). Avoid relying on it for new logic unless legacy compatibility is required.
|
||||
- **`SetDASArmStatus()` Persists Current State**:
|
||||
The parameterless overload persists the *current* `DASArmStatus` value but does *not* update it—consumers may mistakenly assume it refreshes or validates the data.
|
||||
- **Nullable Value Semantics**:
|
||||
Properties like `InputMilliVolts`, `EventNumber`, and `TimeLeftInArm` use `double?`/`int?`/`ushort?`—`null` indicates *unknown/unavailable*, not a default value (e.g., `0`).
|
||||
@@ -0,0 +1,294 @@
|
||||
---
|
||||
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 channel’s 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
|
||||
@@ -0,0 +1,281 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/ITriggerCheck.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IOptimizationValues.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/ITCDiagnosticResults.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/ICanDiagnosticResults.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IDiagnosticMessagesDevice.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/ICanDiagnosticResult.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IArmCheckActions.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IModuleDiagnosticsResult.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/ITriggerCheckResult.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/ITCDiagnosticResult.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IArmCheckResults.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IDiagnos.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IDiagnosticActions.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IBaseInputValues.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Diagnostics/IDiagnosticResult.cs
|
||||
generated_at: "2026-04-16T03:11:30.898849+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "fef2c76ac2e14d1b"
|
||||
---
|
||||
|
||||
# Diagnostic Interfaces Module Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module defines a set of interfaces that collectively support diagnostics for the DAS (Data Acquisition System) factory environment. It provides structured contracts for capturing, storing, and managing diagnostic results across multiple subsystems—including analog channels, CAN bus, trigger logic, arm checks, and module-level diagnostics—while also supporting configuration of diagnostic actions and optimization parameters. The interfaces serve as a contract layer between diagnostic execution logic (likely in `DTS.DASLib.Service.DiagnosticsService`) and higher-level UI or orchestration components, enabling consistent data exchange for health monitoring, validation, and reporting.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **`ITriggerCheck`**
|
||||
- `ITriggerCheckResult TriggerResult { get; set; }`
|
||||
Gets or sets the result of the trigger check, encapsulating trigger and start-record line status.
|
||||
|
||||
- **`IOptimizationValues`**
|
||||
- `float TransferSpeed { get; set; }`
|
||||
Stores the current data transfer speed used for real-time optimization.
|
||||
|
||||
- **`ITCDiagnosticResults`**
|
||||
- `ITCDiagnosticResult[] TCDiagnosticResults { get; }`
|
||||
Gets the array of thermocouple diagnostic results.
|
||||
- `void ClearTCDiagnosticResults()`
|
||||
Clears the stored thermocouple diagnostic results.
|
||||
- `void SetTCDiagnosticResults(ITCDiagnosticResult[] results)`
|
||||
Sets the thermocouple diagnostic results.
|
||||
|
||||
- **`ICanDiagnosticResults`**
|
||||
- `ICanDiagnosticResult[] CanDiagnosticResults { get; }`
|
||||
Gets the array of CAN bus diagnostic results.
|
||||
- `void ClearCanDiagnosticResults()`
|
||||
Clears the stored CAN diagnostic results.
|
||||
- `void SetDiagnosticResults(ICanDiagnosticResult[] results)`
|
||||
Sets the CAN diagnostic results (note: method name mismatch with property name—uses `SetDiagnosticResults` instead of `SetCanDiagnosticResults`).
|
||||
|
||||
- **`IDiagnosticMessagesDevice`**
|
||||
- `string[] GetFatalErrorFields()`
|
||||
Returns an array of field names associated with fatal errors.
|
||||
- `DiagnosticMessageRow[] GetCurrentDiagnosticMessages(string[] fields, bool failingOnly)`
|
||||
Retrieves current diagnostic messages for specified fields; `failingOnly` filters to only failing messages.
|
||||
|
||||
- **`ICanDiagnosticResult`**
|
||||
- `string ChannelName { get; set; }`, `int ChannelIndex { get; set; }`, `int Data { get; set; }`, `int ErrorFrame { get; set; }`, `double Load { get; set; }`, `int Overruns { get; set; }`, `DateTime LastUpdate { get; set; }`, `bool Active { get; set; }`
|
||||
Properties describing CAN channel diagnostic state.
|
||||
- `void Copy(ICanDiagnosticResult source)`
|
||||
Copies diagnostic data from another `ICanDiagnosticResult`.
|
||||
|
||||
- **`IArmCheckActions`**
|
||||
- Boolean properties indicating which arm checks should be performed:
|
||||
`PerformBatteryVoltageCheck`, `PerformInputVoltageCheck`, `PerformSensorIdCheck`, `PerformEventLineCheck`, `PerformSquibResistanceCheck`, `PerformTiltSensorCheck`, `PerformTemperatureCheck`, `PerformClockSyncCheck`.
|
||||
|
||||
- **`IModuleDiagnosticsResult`**
|
||||
- Properties for pre- and post-temperature readings at four locations (`TemperatureLocation{1–4}{Pre,Post}`), all `float`.
|
||||
|
||||
- **`ITriggerCheckResult`**
|
||||
- `bool IsStatusGood { get; set; }`
|
||||
Overall DAS status.
|
||||
- `bool IsStartRecordActive { get; set; }`
|
||||
Whether the start record line is currently active.
|
||||
- `bool HasStartRecordBeenActive { get; set; }`
|
||||
Whether the start record line was active *after arming*.
|
||||
- `bool IsTriggered { get; set; }`
|
||||
Whether the trigger line is currently active.
|
||||
- `bool HasTriggered { get; set; }`
|
||||
Whether the trigger line was active *after arming*.
|
||||
|
||||
- **`ITCDiagnosticResult`**
|
||||
- `string ChannelName { get; set; }`, `int ChannelIndex { get; set; }`, `double? CurrentReading { get; set; }`
|
||||
Thermocouple channel identification and current reading.
|
||||
- `DiagnosticStatus Status { get; set; }`
|
||||
Diagnostic status (type not defined in this file; assumed external).
|
||||
- `ConnectionStatuses ConnectionStatus { get; set; }`
|
||||
Connection status (enum defined in this file).
|
||||
- `void Copy(ITCDiagnosticResult source)`
|
||||
Copies data from another `ITCDiagnosticResult`.
|
||||
|
||||
- **`IArmCheckResults`**
|
||||
- `Dictionary<int, string[]> SensorIds { get; set; }`
|
||||
Maps module/channel IDs to sensor ID strings.
|
||||
- `Dictionary<int, double> SquibResistances { get; set; }`
|
||||
Squib resistance values per module/channel.
|
||||
- `double?[] BatteryVoltage { get; set; }`
|
||||
Battery voltage per module (nullable, supports multi-battery systems like TDAS Pro rack).
|
||||
- `double? InputVoltage { get; set; }`, `bool? StartLineShorted { get; set; }`, `bool? EventLineShorted { get; set; }`
|
||||
Input voltage and line short status.
|
||||
- `short[] TiltSensorDataPre { get; set; }`, `double[] TiltDegrees { get; set; }`
|
||||
Pre-processed tilt sensor data and converted degrees.
|
||||
- `Dictionary<byte, short[]> IndexedTiltSensorDataPre { get; set; }`, `Dictionary<byte, double[]> IndexedTiltDegrees { get; set; }`
|
||||
Indexed tilt data (by module ID?).
|
||||
- `float[] TemperaturesPre { get; set; }`
|
||||
Pre-processed temperature readings.
|
||||
- `double[] Gains { get; set; }`, `double[] ZeroData { get; set; }`
|
||||
Gain and zero calibration data.
|
||||
- `IDictionary<InputClockSource, bool> InputClockLocks { get; set; }`
|
||||
Clock lock status per input clock source.
|
||||
|
||||
- **`IDiagnos`**
|
||||
- `IDiagnosticActions[] ChannelDiagnostics { get; set; }`
|
||||
Diagnostic action configurations per channel.
|
||||
- `void SetChannelDiagnosticActions(IDiagnosticActions[] actions, bool setInDb = true)`
|
||||
Sets diagnostic actions, optionally persisting to DB.
|
||||
- `IDiagnosticResult[] ChannelDiagnosticsResults { get; set; }`
|
||||
Diagnostic results per channel.
|
||||
- `void ClearChannelDiagnosticsResults(bool bClearDb = true)`
|
||||
Clears diagnostic results, optionally from DB.
|
||||
- `void SetChannelDiagnosticsResults(IDiagnosticResult[] results, bool setInDb)`
|
||||
Sets diagnostic results, optionally persisting to DB.
|
||||
- `IModuleDiagnosticsResult[] ModuleDiagnosticsResults { get; set; }`
|
||||
Per-module diagnostic results.
|
||||
- `IBaseInputValues BaseInput { get; set; }`
|
||||
Base input power and voltage diagnostics.
|
||||
- `IDictionary<InputClockSource, bool> DASClockSyncStatus { get; set; }`
|
||||
Clock sync status per source.
|
||||
- `bool ClockSyncInUTC { get; set; }`, `byte PTPDomainID { get; set; }`
|
||||
Clock sync mode and PTP domain ID.
|
||||
- `IArmCheckActions ArmCheckActions { get; set; }`, `IArmCheckResults ArmCheckResults { get; set; }`
|
||||
Arm check configuration and results.
|
||||
- `IOptimizationValues OptimizationValues { get; set; }`
|
||||
Optimization settings (e.g., transfer speed).
|
||||
|
||||
- **`IDiagnosticActions`**
|
||||
- `int DASChannelNumber { get; set; }`
|
||||
Target DAS channel number.
|
||||
- Boolean flags indicating which diagnostic actions to perform:
|
||||
`MeasureExcitation`, `MeasureOffset`, `CheckDigitalState`, `MeasureInternalOffset`, `RemoveOffset`, `MeasureNoise`, `PerformShuntCheck`, `SquibFireCheck`, `PerformVoltageInsertCheck`, `PerformCalSignalCheck`, `MeasureBridgeResistance`.
|
||||
- `bool AllActionsDisabled()`
|
||||
Returns `true` if all diagnostic actions are disabled.
|
||||
|
||||
- **`IBaseInputValues`**
|
||||
- `double InputMilliVolts { get; set; }`, `bool InputMilliVoltsValid { get; }`
|
||||
Current input voltage in mV and validity flag.
|
||||
- `double InputVoltage { get; set; }`, `double MinimumValidInputVoltage { get; set; }`, `double MaximumValidInputVoltage { get; set; }`
|
||||
Input voltage and valid range.
|
||||
- `double BatteryMilliVolts { get; set; }`, `bool BatteryMilliVoltsValid { get; }`, `double BatteryVoltage { get; set; }`
|
||||
Battery voltage metrics.
|
||||
- `double? BatterySoC { get; set; }`
|
||||
Battery state of charge (percentage; `null` if not queried, `0` if unavailable).
|
||||
- `double MinimumValidBatteryVoltage { get; set; }`, `double MaximumValidBatteryVoltage { get; set; }`
|
||||
Valid battery voltage range.
|
||||
- `bool BatteryIsCharging { get; set; }`
|
||||
Charging status.
|
||||
- `double TemperatureC { get; set; }`
|
||||
Hardware-logged temperature in °C.
|
||||
- Status strings: `BatteryVoltageStatus`, `InputVoltageStatus`, `StatusDisplayBattery`, `StatusDisplayInput`.
|
||||
- Status colors: `BatteryVoltageStatusColor`, `InputVoltageStatusColor` (enum from `DFConstantsAndEnums`).
|
||||
- `double ChargeCapacity { get; set; }`, `bool ChargeCapacityValid { get; }`
|
||||
Battery charge capacity and validity.
|
||||
|
||||
- **`IDiagnosticResult`**
|
||||
- `int DASChannelNumber { get; set; }`, `int EventNumber { get; set; }`
|
||||
Channel and event context.
|
||||
- Scaling factors: `double ScalefactorMilliVoltsPerADC { get; set; }`, `double ScalefactorEngineeringUnitsPerADC { get; set; }`.
|
||||
- `double ExpectedExcitationMilliVolts { get; set; }`
|
||||
Factory excitation value.
|
||||
- `short GetExpectedDataZeroLevelADC(ZeroMethodType zeroMethod)`
|
||||
Returns expected zero-level ADC for a given zeroing method.
|
||||
- Measured values (nullable):
|
||||
`MeasuredExcitationMilliVolts`, `NegativeExcitation`, `MeasuredOffsetMilliVolts`, `MeasuredInternalOffsetMilliVolts`, `MeasuredOffsetEngineeringUnits`, `AutoZeroPercentDeviation`, `FinalOffsetADC`, `RemovedOffsetADC`, `RemovedInternalOffsetADC`, `NoisePercentFullScale`, `MeasuredShuntDeflectionMv`, `MeasuredCalSignalMv`, `TargetCalSignalMv`, `MeasuredDurationMS`, `MeasuredDelayMS`, `TargetGain`, `MeasuredGain`, `QueriedGain`, `TargetShuntDeflectionMv`, `BridgeResistance`.
|
||||
- `bool ShuntDeflectionFailed { get; set; }`, `bool CalSignalCheckFailed { get; set; }`
|
||||
Boolean flags for test outcomes.
|
||||
- `bool? SquibFirePassed`, `bool? SquibDurationPassed`, `bool? SquibDelayPassed`
|
||||
Squib fire test results.
|
||||
- `double[] SquibFireCurrentData`, `double[] SquibFireVoltageData`, `double[] SquibFireTimeAxis`
|
||||
Raw squib fire test waveforms.
|
||||
- `double SquibThreshold { get; set; }`, `double SquibVoltageScaler { get; set; }`, `double SquibCurrentScaler { get; set; }`
|
||||
Squib test configuration and scaling.
|
||||
- `short ZeroMVInADC { get; set; }`, `short WindowAverageADC { get; set; }`
|
||||
Zero-level and window-averaged ADC values.
|
||||
- `bool DigitalInputActiveState { get; set; }`
|
||||
Digital input active state.
|
||||
|
||||
### Enumerations
|
||||
|
||||
- **`ConnectionStatuses`** (in `ITCDiagnosticResult.cs`)
|
||||
- `NotTested`, `Connected`, `NotConnected`, `ModuleNotConnected`
|
||||
Status values for sensor/module connection state.
|
||||
- Annoted with `[Description(...)]` attributes for localization.
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **`ITriggerCheckResult`**:
|
||||
- `HasStartRecordBeenActive` and `HasTriggered` are *cumulative* since arming (not just current state).
|
||||
- `IsStatusGood` reflects overall DAS health; its relationship to other flags is not defined but likely implies all checks passed.
|
||||
|
||||
- **`IDiagnosticResult`**:
|
||||
- `ScalefactorMilliVoltsPerADC` and `ScalefactorEngineeringUnitsPerADC` are *mandatory* for scaling downloaded samples; must not be ignored.
|
||||
- `WindowAverageADC == short.MinValue` indicates uninitialized/invalid data.
|
||||
- Measured values (`Measured*`) may be `null` (or `0.0` interpreted as `null`) if not measured—consumers must check nullability.
|
||||
|
||||
- **`IBaseInputValues`**:
|
||||
- `BatterySoC == 0` is valid (unavailable), but `null` means not queried.
|
||||
- Voltage status strings and colors are derived from voltage values and ranges.
|
||||
|
||||
- **`IArmCheckResults`**:
|
||||
- `BatteryVoltage` is an array to support multi-battery modules (e.g., TDAS Pro rack).
|
||||
- Tilt sensor data is provided both as flat arrays and indexed dictionaries (likely per module).
|
||||
|
||||
- **`IDiagnos`**:
|
||||
- `ChannelDiagnostics` and `ChannelDiagnosticsResults` must be aligned by index (i.e., `ChannelDiagnostics[i]` corresponds to `ChannelDiagnosticsResults[i]`).
|
||||
- `OptimizationValues.TransferSpeed` is used for real-time optimization (per comment in `IDiagnos`).
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### In this module:
|
||||
- **`DTS.Common.Classes.DASFactory`** (via `IDiagnosticMessagesDevice.cs`)
|
||||
Provides `DiagnosticMessageRow` type.
|
||||
|
||||
- **`DTS.Common.Converters`** (via `ITCDiagnosticResult.cs`)
|
||||
Provides `EnumDescriptionTypeConverter` for `ConnectionStatuses`.
|
||||
|
||||
- **`DTS.Common.Enums.Sensors`** (via `IDiagnosticResult.cs`)
|
||||
Provides `ZeroMethodType` (used in `GetExpectedDataZeroLevelADC`).
|
||||
|
||||
- **`DTS.Common.Enums.DASFactory`** (via `IBaseInputValues.cs`)
|
||||
Provides `InputClockSource` and `DFConstantsAndEnums.VoltageStatusColor`.
|
||||
|
||||
### Inferred external dependencies:
|
||||
- **`DTS.DASLib.Service.DiagnosticsService`**
|
||||
Referenced in `IDiagnosticResult` XML comments for `Calibrate` method and `DiagnosticsActions` class.
|
||||
|
||||
- **`AnalogInputDasChannel`**
|
||||
Referenced in `IDiagnosticResult` XML comments for offset limits.
|
||||
|
||||
- **`DiagnosticsActions`**
|
||||
Referenced in `IDiagnosticResult` XML comments for `PerformShuntCheck`.
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- **Method name mismatch in `ICanDiagnosticResults`**:
|
||||
The interface defines `SetDiagnosticResults(ICanDiagnosticResult[] results)` instead of `SetCanDiagnosticResults`, which is inconsistent with the naming pattern of `ClearCanDiagnosticResults()` and the property `CanDiagnosticResults`.
|
||||
|
||||
- **Ambiguous null semantics**:
|
||||
Multiple `double?` and `short?` properties in `IDiagnosticResult` and `IBaseInputValues` use `0.0` or `0` as a sentinel for "not measured" (e.g., `MeasuredExcitationMilliVolts`, `MeasuredOffsetMilliVolts`). Consumers must distinguish between actual zero values and null via explicit null checks or validity flags (e.g., `InputMilliVoltsValid`, `BatteryMilliVoltsValid`).
|
||||
|
||||
- **`NegativeExcitation` flag**:
|
||||
Added to preserve legacy behavior for negative excitation reporting (see comment referencing issue #14233). This is a workaround for hardware quirks and should be preserved for backward compatibility.
|
||||
|
||||
- **`WindowAverageADC` sentinel value**:
|
||||
`short.MinValue` indicates uninitialized/invalid data—consumers must check for this explicitly.
|
||||
|
||||
- **`IArmCheckResults.BatteryVoltage` is nullable array**:
|
||||
`double?[]` implies per-module voltages, but null entries may occur if a module is absent or unmeasured.
|
||||
|
||||
- **`IDiagnos.SetChannelDiagnosticActions` and `SetChannelDiagnosticsResults`**:
|
||||
Default `setInDb`/`bClearDb` parameters suggest optional persistence, but behavior when `false` is not specified (e.g., in-memory only?).
|
||||
|
||||
- **`ITCDiagnosticResult.ConnectionStatus` enum uses `[Description]` attributes**:
|
||||
Consumers expecting localized strings must use the `EnumDescriptionTypeConverter` or equivalent to resolve descriptions.
|
||||
|
||||
- **No validation rules defined**:
|
||||
Interfaces do not enforce constraints (e.g., `DASChannelNumber` range, `TransferSpeed` bounds). Validation is likely handled elsewhere.
|
||||
|
||||
- **Missing type definitions**:
|
||||
Types like `DiagnosticStatus`, `DiagnosticMessageRow`, `ZeroMethodType`, `InputClockSource`, and `DFConstantsAndEnums.VoltageStatusColor` are referenced but not defined in this module—consumers must locate them in referenced assemblies.
|
||||
|
||||
- **`IDiagnosticResult` has many squib-related fields**:
|
||||
Includes waveform arrays (`SquibFireCurrentData`, etc.) and flags—suggests a complex squib test implementation. Ensure consumers handle potentially large arrays appropriately.
|
||||
|
||||
None identified beyond the above.
|
||||
@@ -0,0 +1,239 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IDownloadReport.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IEventInfoAggregate.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IUARTDownload.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IUARTDownloadRequest.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IUARTEventInfo.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IDownloadRequest.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IEventInfo.cs
|
||||
- Common/DTS.Common/Interface/DASFactory/Download/IDownload.cs
|
||||
generated_at: "2026-04-16T03:10:59.435560+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "eb0f522ba1432603"
|
||||
---
|
||||
|
||||
# Documentation: DASFactory Download Interfaces
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module defines a set of interfaces that collectively model the data structures and contracts required for downloading event data (both analog/digital channel data and UART stream data) from a DAS (Data Acquisition System). It serves as the contract layer between the DAS hardware/firmware and the DASFactory application, enabling structured querying, reporting, and state tracking of event downloads. The interfaces standardize how event metadata (e.g., timestamps, fault flags, GUIDs), download requests (e.g., sample ranges, sub-sampling), and UART-specific data descriptors are represented and exchanged.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Interfaces
|
||||
|
||||
#### `IDownloadReport`
|
||||
- **`IEventInfo[] Events { get; set; }`**
|
||||
Gets or sets an array of all standard (non-UART) event metadata stored on the DAS. Index corresponds to event number (0-based or 1-based depending on system convention).
|
||||
- **`IUARTEventInfo[] UARTEvents { get; set; }`**
|
||||
Gets or sets an array of UART-specific event metadata. Each entry corresponds to a UART event, indexed by event number.
|
||||
|
||||
#### `IEventInfoAggregate`
|
||||
- **`string EventId { get; set; }`**
|
||||
Unique identifier for the event (e.g., user-assigned or auto-generated).
|
||||
- **`string EventDescription { get; set; }`**
|
||||
Human-readable description of the event.
|
||||
- **`double DurationSeconds { get; set; }`**
|
||||
Total duration of the event in seconds.
|
||||
- **`string GUID { get; set; }`**
|
||||
Globally unique identifier for the event.
|
||||
- **`bool HasBeenDownloaded { get; set; }`**
|
||||
Indicates whether this event has been successfully downloaded.
|
||||
- **`bool WasTriggered { get; set; }`**
|
||||
Indicates whether the event was triggered (as opposed to being a pre-trigger buffer).
|
||||
- **`int NumberOfChannels { get; set; }`**
|
||||
Number of channels included in the event.
|
||||
- **`ulong NumberOfSamples { get; set; }`**
|
||||
Total number of samples across all channels.
|
||||
- **`ulong NumberOfBytes { get; set; }`**
|
||||
Total size of raw data (in bytes) for the event.
|
||||
- **`bool Faulted { get; set; }`**
|
||||
Indicates whether the event completed with faults.
|
||||
- **`int EventNumber { get; set; }`**
|
||||
Sequential event number assigned by the DAS.
|
||||
- **`void Add(IEventInfo newEvent)`**
|
||||
Aggregates additional `IEventInfo` data into this aggregate (e.g., for multi-part events).
|
||||
|
||||
#### `IUARTDownload`
|
||||
- **`uint BaudRate { get; }`**
|
||||
Current UART baud rate (read-only, populated by DASFactory).
|
||||
- **`uint DataBits { get; }`**
|
||||
UART data bits configuration.
|
||||
- **`StopBits StopBits { get; }`**
|
||||
UART stop bits configuration (from `System.IO.Ports`).
|
||||
- **`Parity Parity { get; }`**
|
||||
UART parity configuration.
|
||||
- **`Handshake FlowControl { get; }`**
|
||||
UART flow control setting.
|
||||
- **`UartDataFormat DataFormat { get; }`**
|
||||
UART data format (e.g., ASCII, binary).
|
||||
- **`IUARTDownloadRequest WhatUARTToDownload { get; set; }`**
|
||||
Request specifying which UART event and data range to download.
|
||||
- **`void SetWhatUARTToDownload(IUARTDownloadRequest request, bool bSetInDb = true)`**
|
||||
Sets the UART download request; optionally persists to database.
|
||||
|
||||
#### `IUARTDownloadRequest`
|
||||
- **`ushort EventNumber { get; set; }`**
|
||||
Event number of the UART event to download.
|
||||
- **`ulong TotalByteCount { get; set; }`**
|
||||
Total number of bytes in the UART stream for the event.
|
||||
- **`ulong TriggerByteCount { get; set; }`**
|
||||
Byte offset where the trigger occurred in the UART stream.
|
||||
- **`ulong FaultByteCount { get; set; }`**
|
||||
Byte offset where the first fault occurred (if any).
|
||||
- **`ulong StartTimestamp { get; set; }`**
|
||||
Start time of the UART stream (in ticks or system time units).
|
||||
- **`ulong EndTimestamp { get; set; }`**
|
||||
End time of the UART stream.
|
||||
- **`int BaudRate { get; set; }`**
|
||||
Baud rate used during UART recording.
|
||||
|
||||
#### `IUARTEventInfo`
|
||||
- **`ushort EventNumber { get; set; }`**
|
||||
Event number of the UART event.
|
||||
- **`bool DataPresent { get; set; }`**
|
||||
Indicates whether UART data exists for this event.
|
||||
- **`bool DataDownloaded { get; set; }`**
|
||||
Indicates whether UART data has been successfully downloaded.
|
||||
- **`ulong TotalByteCount { get; set; }`**
|
||||
Total bytes of UART data.
|
||||
- **`ulong TriggerByteCount { get; set; }`**
|
||||
Byte offset of the trigger in the UART stream.
|
||||
- **`ulong FaultByteCount { get; set; }`**
|
||||
Byte offset of the first fault in the UART stream.
|
||||
- **`ulong StartTimestamp { get; set; }`**
|
||||
Start timestamp of the UART stream.
|
||||
- **`ulong EndTimestamp { get; set; }`**
|
||||
End timestamp of the UART stream.
|
||||
- **`uint BaudRate { get; set; }`**
|
||||
Baud rate during UART recording.
|
||||
|
||||
#### `IDownloadRequest`
|
||||
- **`ushort EventNumber { get; set; }`**
|
||||
Event number to download.
|
||||
- **`byte DASChannelNumber { get; set; }`**
|
||||
Channel number to download; `ALL_CHANNELS` (value not shown, assumed constant) for all.
|
||||
- **`ulong StartSample { get; set; }`**
|
||||
First sample index to include.
|
||||
- **`ulong EndSample { get; set; }`**
|
||||
Last sample index to include.
|
||||
- **`ulong SamplesToSkip { get; set; }`**
|
||||
Sub-sampling factor: `0` or `1` = no sub-sampling; `n > 1` = keep every *n*-th sample.
|
||||
*Constraint:* `(EndSample - StartSample + 1)` must be divisible by `SamplesToSkip`.
|
||||
- **`double StartRecordTimestampSec { get; set; }`**
|
||||
Start time of recording in seconds (integer part).
|
||||
- **`double TriggerTimestampSec { get; set; }`**
|
||||
Trigger time in seconds (integer part).
|
||||
- **`double StartRecordTimestampNanoSec { get; set; }`**
|
||||
Fractional (nanosecond) part of start time.
|
||||
- **`double TriggerTimestampNanoSec { get; set; }`**
|
||||
Fractional (nanosecond) part of trigger time.
|
||||
- **`bool PTPMasterSync { get; set; }`**
|
||||
Indicates whether PTP (Precision Time Protocol) master synchronization was used.
|
||||
|
||||
#### `IDownload`
|
||||
- **`IDownloadRequest WhatToDownload { get; set; }`**
|
||||
Request specifying which event/channel/sample range to download.
|
||||
- **`void SetWhatToDownload(IDownloadRequest request, bool bSetInDb = true)`**
|
||||
Sets the download request; optionally persists to database.
|
||||
- **`IDownloadReport EventInfo { get; set; }`**
|
||||
Report containing all event metadata retrieved from the DAS.
|
||||
- **`void SetEventInfo(IDownloadReport eventInfo, bool bSetInDb = true)`**
|
||||
Sets the event metadata report; optionally persists to database.
|
||||
- **`bool[] EventDownloadedStatus { get; set; }`**
|
||||
Array (indexed by event number) indicating whether each event has been downloaded.
|
||||
- **`void SetEventDownloadStatus(bool[] status, bool storeInDb = true)`**
|
||||
Sets the downloaded status array.
|
||||
- **`Guid[] EventGuids { get; set; }`**
|
||||
Array (indexed by event number) of GUIDs for events.
|
||||
- **`void SetEventGuids(Guid[] guids, bool storeInDb = true)`**
|
||||
Sets the event GUIDs array.
|
||||
- **`ushort[] FaultFlags { get; set; }`**
|
||||
Array (indexed by event number) of fault flags.
|
||||
- **`void SetEventFaultFlags(ushort[] flags, bool storeInDb = true)`**
|
||||
Sets the fault flags array.
|
||||
- **`uint[] ExtendedFaultFlags1 { get; set; }`**
|
||||
Array of extended fault flags (1 of 4).
|
||||
- **`uint[] ExtendedFaultFlags2 { get; set; }`**
|
||||
Array of extended fault flags (2 of 4).
|
||||
- **`uint[] ExtendedFaultFlags3 { get; set; }`**
|
||||
Array of extended fault flags (3 of 4).
|
||||
- **`uint[] ExtendedFaultFlags4 { get; set; }`**
|
||||
Array of extended fault flags (4 of 4).
|
||||
- **`void SetExtendedFaultFlags(uint[][] flags)`**
|
||||
Populates all four `ExtendedFaultFlags*` arrays from a jagged array (first dimension = events, second = up to 4 flags per event).
|
||||
- **`byte[] ArmAttempts { get; set; }`**
|
||||
Array (indexed by event number) of arm attempt counts.
|
||||
- **`void SetEventArmAttemps(byte[] armAttempts, bool storeInDb = true)`**
|
||||
Sets the arm attempts array.
|
||||
|
||||
#### `IDownloadPathAware`
|
||||
- **`string EventPath { get; set; }`**
|
||||
Filesystem or logical path where event data is stored.
|
||||
|
||||
#### `DownloadExtendedFaultFunctions` (static helper class)
|
||||
- **`static void SetExtendedFaultFlags(uint[][] flags, IDownload download)`**
|
||||
Helper to populate `ExtendedFaultFlags1–4` arrays from a jagged array. If `flags` is null or empty, calls `ClearExtendedFaultFlags`.
|
||||
- **`static void ClearExtendedFaultFlags(IDownload download)`**
|
||||
Sets all `ExtendedFaultFlags*` arrays to `null`.
|
||||
|
||||
#### `IEventInfo`
|
||||
- **`IDASModule[] Modules { get; set; }`**
|
||||
Array of module info objects, indexed by `ModuleArrayIndex`.
|
||||
- **`int EventNumber { get; set; }`**
|
||||
Event number.
|
||||
- **`Guid TestGUID { get; set; }`**
|
||||
GUID of the event.
|
||||
- **`ushort FaultFlags { get; set; }`**
|
||||
Primary fault flags.
|
||||
- **`ushort FaultFlagsEx { get; set; }`**
|
||||
Extended fault flags (legacy, separate from `ExtendedFaultFlags*` arrays).
|
||||
- **`byte ArmAttempts { get; set; }`**
|
||||
Number of arm attempts.
|
||||
- **`DateTime TestTime { get; set; }`**
|
||||
Timestamp of the event.
|
||||
- **`string TestID { get; set; }`**
|
||||
Event ID string.
|
||||
- **`string Description { get; set; }`**
|
||||
Event description.
|
||||
- **`bool HasBeenDownloaded { get; set; }`**
|
||||
Download status.
|
||||
- **`bool WasTriggered { get; set; }`**
|
||||
Trigger status.
|
||||
- **`void ClearFaults()`**
|
||||
Clears fault flags (implementation-specific).
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **Event indexing**: Arrays like `Events`, `UARTEvents`, `EventDownloadedStatus`, `EventGuids`, `FaultFlags`, `ExtendedFaultFlags*`, and `ArmAttempts` are indexed by event number. The exact mapping (0-based vs. 1-based) is not specified and must be inferred from usage.
|
||||
- **Sample range constraint**: For `IDownloadRequest.SamplesToSkip`, `(EndSample - StartSample + 1)` must be divisible by `SamplesToSkip`. This is enforced by the caller.
|
||||
- **UART event data consistency**: In `IUARTEventInfo` and `IUARTDownloadRequest`, `TriggerByteCount` and `FaultByteCount` are byte offsets within the UART stream (`TotalByteCount`), and `StartTimestamp` ≤ `EndTimestamp`.
|
||||
- **Extended fault flags**: Exactly 4 extended fault flag arrays exist (`ExtendedFaultFlags1`–`4`), and `SetExtendedFaultFlags` expects each inner array to have at most 4 elements.
|
||||
- **Download atomicity**: Downloads are performed one event at a time (per comments on `ExtendedFaultFlags*`), though metadata may be batched.
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### Dependencies *of* this module:
|
||||
- **`DTS.Common.Interface.DownloadEvent`** (via `IDownloadReport`): Defines `IEventInfo` and `IUARTEventInfo` interfaces (not included here, but referenced).
|
||||
- **`DTS.Common.Enums`** (via `IUARTDownload`): Defines `UartDataFormat`, `StopBits`, `Parity`, `Handshake` enums.
|
||||
- **`System.IO.Ports`** (via `IUARTDownload`): For `StopBits`, `Parity`, `Handshake`.
|
||||
- **`DTS.Common.Interface.DASFactory.Config`** (via `IEventInfo`): Defines `IDASModule` interface (not included here).
|
||||
|
||||
### Dependencies *on* this module:
|
||||
- DASFactory application logic (e.g., download workflows, UI, persistence).
|
||||
- Any module implementing `IDownload`, `IDownloadRequest`, `IDownloadReport`, etc., to interact with DAS hardware or storage.
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- **`SamplesToSkip` validation is caller responsibility**: The interface does not enforce divisibility of `(EndSample - StartSample + 1)` by `SamplesToSkip`; violation may cause runtime errors.
|
||||
- **`EventNumber` indexing ambiguity**: Arrays are indexed by event number, but whether event numbers start at `0` or `1` is not specified. This is a common source of off-by-one bugs.
|
||||
- **`FaultFlagsEx` vs. `ExtendedFaultFlags*`**: `IEventInfo.FaultFlagsEx` is a single `ushort`, while `IDownload` exposes four `uint[]` arrays (`ExtendedFaultFlags1–4`). These are likely related but not directly synchronized—caution is needed when updating one without the other.
|
||||
- **`DownloadExtendedFaultFunctions` is static**: Its methods operate on an `IDownload` instance but do not modify the `IDownload` interface itself; callers must ensure the instance is valid before calling.
|
||||
- **`bSetInDb` parameter semantics**: Many `Set*` methods include `bSetInDb`/`storeInDb` parameters. Their behavior (e.g., whether they overwrite or merge) is not documented.
|
||||
- **UART and analog event separation**: `IDownloadReport` separates `Events` (analog/digital) and `UARTEvents` (serial), but there is no explicit link between them (e.g., same `EventNumber` may appear in both). This could lead to inconsistencies if not managed carefully.
|
||||
- **Timestamp units**: `StartTimestamp`/`EndTimestamp` in UART interfaces are `ulong`, but their unit (e.g., ticks, nanoseconds, microseconds) is not specified. Similarly, `StartRecordTimestampSec` and `StartRecordTimestampNanoSec` are split—ensure correct reconstruction of full timestamps.
|
||||
- **Missing `ALL_CHANNELS` constant**: The `DASChannelNumber` comment references `ALL_CHANNELS`, but its value is not defined in the provided source.
|
||||
|
||||
None identified beyond those above.
|
||||
Reference in New Issue
Block a user