init
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/ARM/IArmStatus.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/ARM/IArmStatusData.cs
|
||||
generated_at: "2026-04-16T02:36:19.293285+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "cab749a0c8a2b813"
|
||||
---
|
||||
|
||||
# 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 state abstraction layer—*not* a direct hardware interface—by exposing flags and metadata about the unit’s current mode (e.g., Arm, Realtime, Streaming), trigger status, fault conditions, and recording progress. The interfaces enable consistent state reporting and propagation (including optional persistence to a database) across higher-level components (e.g., test sequencers, UI, diagnostics), decoupling state logic from hardware-specific implementations.
|
||||
|
||||
---
|
||||
|
||||
### 2. **Public Interface**
|
||||
|
||||
#### `IArmStatus` Interface
|
||||
|
||||
| Member | Signature | Behavior |
|
||||
|--------|-----------|----------|
|
||||
| `SetInArm` | `void SetInArm(bool WriteToDb)` | Marks the unit as being in *Arm* mode. If `WriteToDb` is `true`, persists the state change to the database. |
|
||||
| `SetInRealtime` | `void SetInRealtime(bool WriteToDb, bool ExitRealtimeIfPossible)` | Marks the unit as being in *Realtime* mode. If `WriteToDb` is `true`, persists the state change. If `ExitRealtimeIfPossible` is `true`, may transition out of Realtime if conditions allow (e.g., post-test). |
|
||||
| `GetIsInArm` | `bool GetIsInArm()` | Returns `true` if the unit’s *Arm* flag is set (based on internal state, *not* hardware query). |
|
||||
| `GetIsInRealtime` | `bool GetIsInRealtime()` | Returns `true` if the unit’s *Realtime* flag is set (based on internal state, *not* hardware query). |
|
||||
| `GetIsStreaming` | `bool GetIsStreaming()` | Returns `true` if the unit is known to be *streaming* (based on internal state, *not* hardware query). |
|
||||
| `DASArmStatus` | `IArmStatusData DASArmStatus { get; set; }` | Gets or sets the current `IArmStatusData` instance holding detailed status fields. |
|
||||
| `SetDASArmStatus` (overload 1) | `void SetDASArmStatus(IArmStatusData status, bool bSetInDb)` | Replaces the current `DASArmStatus` with `status`. If `bSetInDb` is `true`, persists the new status to the database. |
|
||||
| `SetDASArmStatus` (overload 2) | `void SetDASArmStatus()` | Persists the *current* `DASArmStatus` to the database (if connected). Does *not* modify the in-memory status object. |
|
||||
|
||||
#### `IArmStatusData` Interface
|
||||
|
||||
| Member | Type | Description |
|
||||
|--------|------|-------------|
|
||||
| `ReceivedInvalidModeDuringSetup` | `bool` | `true` if the unit received an `InvalidMode` error during initial setup (used as a heuristic to infer streaming state in some code paths). |
|
||||
| `ClearTriggerCheckStatus()` | `void` | Clears flags related to trigger checks (e.g., `IsTriggerShorted`, `IsStartShorted`). |
|
||||
| `IsArmed` | `bool` | Whether the DAS is currently armed. |
|
||||
| `IsTriggered` | `bool` | Whether the DAS has sensed a trigger (set in many contexts, not limited to trigger checks). |
|
||||
| `IsTriggerShorted` | `bool` | Whether the trigger was shorted *during a trigger check*. Distinct from `IsTriggered`. |
|
||||
| `IsStartShorted` | `bool` | Whether the start signal was shorted *during a trigger check*. Only set during trigger checks. |
|
||||
| `IsRecording` | `bool` | Whether the DAS is currently recording sample data. |
|
||||
| `IsFaulted` | `bool` | Whether the DAS has faulted. |
|
||||
| `IsInRealtime` | `bool` | Whether the DAS is in real-time mode. |
|
||||
| `IsInFlashWrite` | `bool` | Whether the DAS is in flash write mode (G5). |
|
||||
| `IsUndefined` | `bool` | Used when `TDAS ARM STAT READ` returns no data (fallback state). |
|
||||
| `IsInPostTestDiagnostics` | `bool` | Whether the DAS is in post-test diagnostics. |
|
||||
| `TimeRemainingSeconds` | `double` | Estimated seconds remaining in recording. |
|
||||
| `PercentComplete` | `double` | Percentage complete for flash write operations. |
|
||||
| `TotalSamples` | `ulong` | Total number of samples to be recorded in the current test. |
|
||||
| `CurrentSample` | `ulong` | Current sample index being recorded. |
|
||||
| `SampleRate` | `uint` | Current sample rate (samples/sec). |
|
||||
| `InputMilliVolts` | `double?` | Current input voltage (mV), or `null` if unavailable. |
|
||||
| `BatteryMilliVolts` | `double?` | Current battery voltage (mV), or `null` if no battery present. |
|
||||
| `EventNumber` | `int?` | Current event number being recorded, or `null` if none. |
|
||||
| `MaxEventsPossible` | `ushort?` | Maximum number of events supported by the device (per issue FB 26817). |
|
||||
| `RecordingMode` | `int` | Numeric recording mode identifier (semantic meaning not documented in interface). |
|
||||
| `FaultMessage` | `string` | Optional human-readable fault description (e.g., for software-detected faults). |
|
||||
| `IsRearming` | `bool` | Whether the DAS is currently rearming. |
|
||||
| `HasBeenRecording` | `bool` | Whether the DAS has ever recorded in the current session. |
|
||||
| `TimeLeftInArm` | `double?` | Estimated time remaining in the *Arm* state (seconds), or `null`. |
|
||||
|
||||
---
|
||||
|
||||
### 3. **Invariants**
|
||||
|
||||
- **State Flags Are Software-Only**: Methods like `GetIsInArm()`, `GetIsInRealtime()`, and `GetIsStreaming()` return *software-tracked flags* only. They do *not* query hardware directly.
|
||||
- **`DASArmStatus` Is Mutable and Optional to Persist**: The `DASArmStatus` property can be replaced or updated, and persistence to the database is *explicitly opt-in* via `WriteToDb`/`bSetInDb` parameters.
|
||||
- **Trigger Check Flags Are Scoped**: `IsTriggerShorted` and `IsStartShorted` are *only* set during trigger checks and must be cleared via `ClearTriggerCheckStatus()` to avoid stale state.
|
||||
- **`ReceivedInvalidModeDuringSetup` Is a Heuristic**: This flag is used as a proxy for streaming state in some legacy code paths (see *Gotchas*), but is not a definitive indicator.
|
||||
- **Nullable Fields May Be Uninitialized**: All `double?`, `int?`, and `ushort?` properties may be `null` if the corresponding data is unavailable or not yet computed.
|
||||
|
||||
---
|
||||
|
||||
### 4. **Dependencies**
|
||||
|
||||
- **Depends On**:
|
||||
- `DTS.Common.Interface.DASFactory.ARM` namespace (inferred from `namespace` declaration).
|
||||
- Likely depends on database connectivity (via `WriteToDb`/`bSetInDb` parameters implying a persistence layer).
|
||||
- Likely depends on hardware communication layers (e.g., `TDAS ARM STAT READ` mentioned in `IsUndefined` comment), though not directly visible here.
|
||||
|
||||
- **Depended On By**:
|
||||
- Any component managing DAS state transitions (e.g., test sequencers, ARM state machines).
|
||||
- UI components displaying DAS status.
|
||||
- Diagnostics or logging modules that consume `IArmStatusData` for telemetry.
|
||||
- Hardware abstraction layers (implementations of `IArmStatus`).
|
||||
|
||||
---
|
||||
|
||||
### 5. **Gotchas**
|
||||
|
||||
- **`IsTriggered` vs. `IsTriggerShorted`**: `IsTriggered` is set broadly (e.g., after any trigger event), while `IsTriggerShorted` is *exclusively* set during trigger checks. Confusing these may lead to incorrect logic (e.g., assuming a physical trigger occurred when only a short was simulated).
|
||||
- **`ReceivedInvalidModeDuringSetup` as Streaming Proxy**: This flag is explicitly used *in some places* to infer streaming state when direct indicators (e.g., `IsRecording`) are unavailable. Relying on this heuristic outside its intended scope may cause incorrect behavior.
|
||||
- **`IsUndefined` Is a Fallback State**: When `TDAS ARM STAT READ` returns no data, `IsUndefined` should be set—but implementations may not consistently handle this case.
|
||||
- **`SetDASArmStatus()` Overload Ambiguity**: The parameterless `SetDASArmStatus()` persists the *current* in-memory status but does *not* update it. This may cause stale data to be persisted if the in-memory object was modified after the last explicit `SetDASArmStatus(status, ...)` call.
|
||||
- **`TimeLeftInArm` Semantics Unclear**: The meaning of `TimeLeftInArm` (e.g., time until disarm, time until test end) is not documented. Its relationship to `TimeRemainingSeconds` is ambiguous.
|
||||
- **`RecordingMode` Is Undocumented**: The integer value of `RecordingMode` has no documented mapping (e.g., enum or constants), making interpretation difficult without external context.
|
||||
|
||||
*None identified from source alone.*
|
||||
@@ -0,0 +1,190 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IEID.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IVoltageInsertionEnabled.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IInformation.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IConfigurationData.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IConfiguration.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IInfoResultModule.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IDASChannel.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IInfoResult.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Config/IDASModule.cs
|
||||
generated_at: "2026-04-16T02:35:36.435465+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "126041a8d3394f8b"
|
||||
---
|
||||
|
||||
# DAS Factory Configuration Interfaces Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module defines a set of core interfaces that establish the contract for configuration, metadata, and state management within the DAS (Data Acquisition System) factory framework. It provides abstractions for representing hardware configuration (`IConfiguration`, `IConfigurationData`), module/channel metadata (`IDASModule`, `IDASChannel`, `IInfoResult`, `IInfoResultModule`), identification (`IEID`), voltage insertion status (`IVoltageInsertionEnabled`), and serialization support. These interfaces decouple configuration logic from concrete implementations, enabling flexible hardware interaction, test setup management, and UI display ordering—particularly critical for multi-DAS, multi-channel systems where precise channel/module mapping and ordering are required.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `IEID`
|
||||
- `string ID { get; set; }` – Identifier string for the EID (e.g., serial, UUID).
|
||||
- `byte[] Blob { get; set; }` – Binary payload associated with the EID.
|
||||
- `bool IsValid()` – Returns `true` if the EID data is considered valid.
|
||||
|
||||
### `IVoltageInsertionEnabled`
|
||||
- `bool VoltageInsertionEnabled { get; }` – Indicates whether voltage insertion was detected as enabled on the hardware (see internal case 34284).
|
||||
|
||||
### `IInformation`
|
||||
- `IInfoResult DASInfo { get; set; }` – Gets or sets the hardware-derived information object.
|
||||
- `void SetDASInfo(IInfoResult dasInfo, bool bSetInDb = true)` – Sets `DASInfo`, optionally persisting to a database.
|
||||
- `void SetDASInfo()` – Overload that sets `DASInfo` with default persistence (`bSetInDb = true`).
|
||||
|
||||
### `IConfigurationData`
|
||||
- `IDASModule[] Modules { get; set; }` – Array of modules in the DAS.
|
||||
- `IEID[] IDs { get; set; }` – Array of EIDs for the entire DAS.
|
||||
- `string TestID { get; set; }` – Current test/event identifier.
|
||||
- `string TestSetupUniqueId { get; set; }` – Unique identifier for the test setup.
|
||||
- `string Description { get; set; }` – Human-readable description of the test/event.
|
||||
- `bool ClearSetup { get; set; }` – Flag indicating whether to clear existing setup.
|
||||
- `int NumberOfConfiguredChannels()` – Returns count of channels where `IsConfigured()` is `true`.
|
||||
- `int NumberOfChannels()` – Returns total number of channels (configured or not).
|
||||
- `int NumberOfDownloadChannels()` – Returns count of downloadable channels (excludes UART/StreamOut).
|
||||
- `int[] DisplayOrder { get; set; }` – Channel display order array.
|
||||
- `int DasDisplayOrder { get; set; }` – DAS-level display order.
|
||||
- `int GetDisplayOrder(uint channelIdx)` – Returns display order for a given channel index.
|
||||
- `string UDPReceiveAddress { get; set; }` – UDP address for OBR-DDR control.
|
||||
- `void WriteXml(XmlWriter writer)` – Serializes configuration to XML.
|
||||
- `void ReadXml(XmlReader reader)` – Deserializes configuration from XML.
|
||||
- `XmlSchema GetSchema()` – Returns XML schema for validation.
|
||||
|
||||
### `IConfiguration`
|
||||
- `string TestDirectory { get; set; }` – Path on PC where test data is stored.
|
||||
- `bool SupportsAutoDetect { get; }` – Indicates support for auto-detecting channel type (bridge/IEPE).
|
||||
- `void QueryConnectedDevices()` – Queries hardware for connected devices.
|
||||
- `IConfigurationData ConfigData { get; set; }` – Pre-test configuration data (updated by `ConfigurationService.Configure(...)`).
|
||||
- `ClockSyncProfile DASClockSyncProfile { get; set; }` – Clock synchronization profile (updated on configure, applied only to compatible units).
|
||||
- `int GetDASDisplayOrder()` – Returns DAS display order (default `-1`).
|
||||
- `int[] GetChannelDisplayOrder()` – Returns channel display order array.
|
||||
- `void SetDASDisplayOrder(int order)` – Sets DAS display order (intended for use by FWTU only).
|
||||
- `void SetChannelDisplayOrder(int[] order)` – Sets channel display order (intended for use by FWTU only).
|
||||
|
||||
### `IInfoResultModule`
|
||||
- `string SerialNumber { get; set; }` – Module serial number.
|
||||
- `string FirmwareVersion { get; set; }` – Firmware version string.
|
||||
- `int ModuleArrayIndex { get; set; }` – Index in the module array.
|
||||
- `uint NumberOfChannels { get; set; }` – Number of channels on this module.
|
||||
- `uint[] SupportedSampleRates { get; set; }` – Supported sample rates (Hz).
|
||||
- `Dictionary<uint, float> SampleRate2AAFrequency { get; set; }` – Mapping of sample rate to anti-aliasing filter frequency.
|
||||
- `ulong? MaxEventStorageSpaceInBytes { get; set; }` – Max storage per module (null if DAS-level).
|
||||
- `uint? NumberOfBytesPerSampleClock { get; set; }` – Bytes per sample per module (null if DAS-level).
|
||||
- `double MaxRecordingSamples { get; set; }` – Max samples this module can record.
|
||||
- `DateTime? CalibrationDate { get; set; }` – Last calibration date (null if invalid/NA).
|
||||
- `bool RackIsUnreadable { get; set; }` – `true` if TDAS rack is armed and unresponsive.
|
||||
- `DFConstantsAndEnums.ModuleType TypeOfModule { get; set; }` – Module type.
|
||||
- `DFConstantsAndEnums.RecordingMode[] SupportedModes { get; set; }` – Supported recording modes.
|
||||
- `bool IsProgrammable { get; set; }` – Indicates if module is programmable.
|
||||
|
||||
### `IDASChannel`
|
||||
- `DFConstantsAndEnums.ConfigMode ConfigurationMode { get; set; }` – Configuration mode.
|
||||
- `bool DiagnosticsMode { get; set; }` – Whether channel is in diagnostics mode.
|
||||
- `int ModuleChannelNumber { get; set; }` – Channel index within its module.
|
||||
- `int AbsoluteDisplayOrder { get; set; }` – Global display order.
|
||||
- `double UnitConverision { get; set; }` – Unit conversion factor (note: typo in property name).
|
||||
- `bool AtCapacity { get; set; }` – Whether channel is at capacity.
|
||||
- `double CapacityOutputIsBasedOn { get; set; }` – Output value capacity is based on.
|
||||
- `SensorConstants.SensUnits SensitivityUnits { get; set; }` – Sensitivity units.
|
||||
- `byte Number { get; }` – DAS-wide channel number (0-based).
|
||||
- `IEID[] IDs { get; set; }` – EIDs associated with this channel.
|
||||
- `DateTime EventStartTime { get; set; }` – Timestamp of event start.
|
||||
- `bool LevelTriggerSeen { get; set; }` – Whether level trigger was detected.
|
||||
- `string IsoChannelName { get; set; }`, `string ChannelGroupName { get; set; }`, `string UserCode { get; set; }`, `string UserChannelName { get; set; }`, `string LinearSensorCalibration { get; set; }` – User-configurable metadata fields.
|
||||
- `int QualificationSamples { get; set; }` – Number of samples for trigger qualification.
|
||||
- `int? LevelTriggerT0AdjustmentSamples { get; set; }` – Sample shift for time alignment (null if not directly triggered).
|
||||
- `bool IsConfigured()` – Returns `true` if channel is configured (sensor connected + config present).
|
||||
- `void WriteXml(XmlWriter writer)`, `void ReadXml(XmlReader reader)`, `XmlSchema GetSchema()` – XML serialization.
|
||||
- `int IdType { get; set; }`, `string UserValue1 { get; set; }`, `string UserValue2 { get; set; }`, `string UserValue3 { get; set; }` – Extensibility fields.
|
||||
|
||||
### `IInfoResult`
|
||||
- `string MACAddress { get; set; }` – MAC address of the DAS.
|
||||
- `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; }` – Max modules supported.
|
||||
- `ulong? MaxEventStorageSpaceInBytes { get; set; }` – DAS-level max storage (null if per-module).
|
||||
- `uint? NumberOfBytesPerSampleClock { get; set; }` – DAS-level bytes per sample (null if per-module).
|
||||
- `bool? DeviceStreamingOnly { get; set; }` – Hardware streaming-only flag (null if unsupported).
|
||||
- `int NumberOfBridgeChannels { get; set; }` – Count of bridge channels (temporary constant).
|
||||
- `IEID BatteryID { get; set; }` – Battery EID.
|
||||
- `bool HasBattery { get; }` – Whether hardware has a battery.
|
||||
- `byte MapDASChannelNumber2RealtimeChannelNumber(int channelNumber)` – Maps DAS channel to real-time channel number.
|
||||
- `byte MapDASChannelNumber2ModuleArrayIndex(int channelNumber)` – Maps DAS channel to module array index.
|
||||
- `byte MapDASChannelNumber2ModuleDeviceID(int channelNumber)` – Maps DAS channel to module device ID (1-based).
|
||||
- `byte MapDASChannelNumber2ModuleChannelNumber(int channelNumber)` – Maps DAS channel to module channel number (0-based).
|
||||
- `byte MapModuleArrayIndexAndChannelNum2DASChannel(int moduleArrayIdx, int channelNumber)` – Inverse mapping.
|
||||
- `DateTime? CalibrationDate { get; set; }` – DAS calibration date (returns `1970-01-01` if invalid/NA).
|
||||
|
||||
### `IDASModule`
|
||||
- `IDASChannel[] Channels { get; set; }` – Array of channels, indexed by `ModuleChannelNumber`.
|
||||
- `IEID[] IDs { get; set; }` – Module-level EIDs.
|
||||
- `int ModuleArrayIndex { get; set; }` – Index in module array.
|
||||
- `double RequestedPreTriggerSeconds { get; set; }`, `double RequestedPostTriggerSeconds { get; set; }` – Requested trigger timing.
|
||||
- `double PreTriggerSeconds { get; set; }`, `double PostTriggerSeconds { get; set; }` – Actual trigger timing.
|
||||
- `int NumberOfEvents { get; set; }` – Events to collect before disarming.
|
||||
- `int WakeUpMotionTimeout { get; set; }` – Inactivity timeout before sleep.
|
||||
- `string FirmwareVersion { get; set; }` – Module firmware version.
|
||||
- `string Description { get; set; }` – Module description.
|
||||
- `ulong? MaxEventStorageSpaceInBytes { get; set; }` – Module storage capacity.
|
||||
- `ulong NumberOfSamples { get; set; }` – Samples captured in last run.
|
||||
- `ulong[] TriggerSampleNumbers { get; set; }` – Array of trigger sample numbers.
|
||||
- `int GetLevelTriggerT0AdjustmentSamplesAutoApplied()` – Returns auto-applied T0 adjustment.
|
||||
- `ulong StartRecordSampleNumber { get; set; }` – Sample number where recording started.
|
||||
- `uint StartRecordTimestampSec`, `uint TriggerTimestampSec`, `uint StartRecordTimestampNanoSec`, `uint TriggerTimestampNanoSec` – Timestamps for start/trigger.
|
||||
- `bool PTPMasterSync { get; set; }` – Precision Time Protocol master sync status.
|
||||
- `double TiltSensorAxisX/Y/ZDegreesPre/Post { get; set; }` – Tilt angles before/after event.
|
||||
- `float TemperatureLocation1/2/3/4Pre/Post { get; set; }` – Temperatures before/after event.
|
||||
- `uint SampleRateHz { get; set; }`, `uint ActualSampleRateHz { get; set; }` – Nominal and actual sample rates.
|
||||
- `float AAFilterRateHz { get; set; }` – Anti-aliasing filter rate.
|
||||
- `DFConstantsAndEnums.RecordingMode RecordingMode { get; set; }` – Recording mode.
|
||||
- `DateTime ScheduledStartTime { get; set; }`, `int RecordingInterval { get; set; }` – Scheduling info.
|
||||
- `UDPStreamProfile StreamProfile { get; set; }` – UDP streaming profile.
|
||||
- `DFConstantsAndEnums.TiltAxes TiltAxes { get; set; }`, `double TargetAxisOne/Two { get; set; }`, `float TargetAngleAxisX/Y/Z { get; set; }`, `double MountOffsetAxisOne/Two { get; set; }`, `string SystemLocation { get; set; }`, `string SystemID { get; set; }`, `int AxisIgnored { get; set; }`, `double LevelTolerance { get; set; }`, `bool UseForTiltCalculation { get; set; }`, `double InputVoltage { get; set; }`, `double BatteryVoltage { get; set; }`, `byte TiltID { get; set; }`, `string TiltSerialNumber { get; set; }` – Slice 6 tilt feature fields.
|
||||
- `int NumberOfConfiguredChannels()`, `int NumberOfConfiguredTOMChannels()` – Channel counts.
|
||||
- `bool IsDummyArmed()` – Whether module is dummy-armed.
|
||||
- `int NumberOfChannels()` – Total channel count.
|
||||
- `string SerialNumber()`, `DFConstantsAndEnums.ModuleType ModuleType()` – Metadata getters.
|
||||
- `bool IsStreamIn()`, `bool IsStreamOut()`, `bool IsUart()`, `bool IsClock()`, `bool IsEmbedded()` – Module type checks.
|
||||
- `void WriteXml(XmlWriter writer)`, `void ReadXml(XmlReader reader)`, `XmlSchema GetSchema()`, `void WriteXmlCRC32(XmlWriter writer)`, `ushort GetCRC32()` – Serialization and checksum.
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **Channel numbering**: `IDASChannel.Number` is a DAS-wide 0-based index (0..29). `IDASModule.ModuleArrayIndex` is 0-based (0..9). `IDASChannel.ModuleChannelNumber` is 0-based within a module (0..2). Mapping functions (`Map*`) enforce consistent conversion between these spaces.
|
||||
- **Configuration state**: A channel is considered *configured* only if `IsConfigured()` returns `true`, which requires both a sensor connection and configuration data populated via `ConfigurationService.Configure(...)`.
|
||||
- **Display ordering**: `DisplayOrder` (array) and `DasDisplayOrder` (scalar) in `IConfigurationData` control UI rendering order. Default `DasDisplayOrder` is `-1`. Channel display order is managed via `GetChannelDisplayOrder()`/`SetChannelDisplayOrder()`.
|
||||
- **Storage hierarchy**: Storage capacity (`MaxEventStorageSpaceInBytes`, `NumberOfBytesPerSampleClock`) may be defined at either the DAS or module level (indicated by `null` values).
|
||||
- **Calibration date**: `IInfoResult.CalibrationDate` and `IInfoResultModule.CalibrationDate` return `DateTime?`. An invalid/NA date is represented as `1970-01-01` (Unix epoch).
|
||||
- **EID validity**: `IEID.IsValid()` must be called to validate EID data before use; no automatic validation is implied by property access.
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### Dependencies *of* this module (interfaces):
|
||||
- **`DTS.Common.Enums.DASFactory`**: Used via `DFConstantsAndEnums.ModuleType`, `RecordingMode`, `ConfigMode`, `TiltAxes`.
|
||||
- **`DTS.Common.Enums.Sensors`**: Used via `SensorConstants.SensUnits`.
|
||||
- **`System.Xml`**: Required for `XmlWriter`, `XmlReader`, `XmlSchema`.
|
||||
- **`System.Collections.Generic`**: Required for `Dictionary<uint, float>`, `List<ExternalTilt>`.
|
||||
- **`System`**: Required for `DateTime`, `byte`, `string`, `double`, `float`, `uint`, `ulong`, `int`, `bool`.
|
||||
|
||||
### Dependencies *on* this module:
|
||||
- **`ConfigurationService`**: Updates `IConfiguration.ConfigData` and `IConfiguration.DASClockSyncProfile` via `Configure(...)` (referenced in `IConfiguration` XML docs).
|
||||
- **`ClockSyncProfile`**: Used as a property type in `IConfiguration`; assumed to be defined elsewhere.
|
||||
- **`UDPStreamProfile`**: Used as a property type in `IDASModule`; assumed to be defined elsewhere.
|
||||
- **`Common.Classes.Hardware.ExternalTilt`**: Used in `IInfoResult.ActiveExternalTilts`; assumed to be defined elsewhere.
|
||||
- **`DTS.Common.Interface.DASFactory.Config` namespace**: All interfaces co-reside in this namespace and reference each other.
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- **Typo in property name**: `IDASChannel.UnitConverision` is misspelled (should be `UnitConversion`). This is preserved as-is per source.
|
||||
- **`SetDASInfo` overloads**: `IInformation.SetDASInfo()` has two overloads; the parameterless version defaults `bSetInDb = true`. Ensure callers understand persistence behavior.
|
||||
- **`NumberOfDownloadChannels` semantics**: Excludes UART and StreamOut modules; does *not* imply channels are active—only that they are of a downloadable type.
|
||||
- **`IsDummyArmed()`**: Specific to `IDASModule`; behavior and implications are not documented in source—assumed to relate to a test/diagnostic mode.
|
||||
- **`LevelTriggerT0AdjustmentSamples`**: A nullable `int?` in `IDASChannel`; `null` indicates no direct trigger. In `IInfoResult`, `MapDASChannelNumber2ModuleChannelNumber` assumes valid channel numbers (0..29); out-of-range inputs may cause undefined behavior (not validated in interface).
|
||||
- **`DeviceStreamingOnly`**: Nullable `bool?`; `null` means the device doesn’t support a streaming-only configuration, not that streaming is disabled.
|
||||
- **`ActualSampleRateHz`**: Comment notes it is currently used only for TSR AIR type hardware (FB 25558); behavior on other hardware is undefined.
|
||||
- **Display order mutability**: `SetDASDisplayOrder` and `SetChannelDisplayOrder` are documented as “should only be called really from FWTU”—suggesting external tools manage UI ordering, not core logic.
|
||||
- **`CalibrationDate` invalid representation**: `1970-01-01` is used as a sentinel for invalid dates in `IInfoResult.CalibrationDate`, but `IInfoResultModule.CalibrationDate` is `DateTime?` (nullable), so `null` is the canonical invalid value there. Inconsistent handling.
|
||||
- **`IDASChannel.Number` is read-only**: Unlike `Module
|
||||
@@ -0,0 +1,295 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/ITriggerCheck.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IOptimizationValues.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IArmCheckActions.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IModuleDiagnosticsResult.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/ITriggerCheckResult.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IDiagnos.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IArmCheckResults.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IDiagnosticActions.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IBaseInputValues.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Diagnostics/IDiagnosticResult.cs
|
||||
generated_at: "2026-04-16T02:36:25.319043+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "030f7186b5eb008c"
|
||||
---
|
||||
|
||||
# DAS Factory Diagnostics Interface Module Documentation
|
||||
|
||||
## 1. Purpose
|
||||
This module defines a set of interfaces that collectively represent the diagnostic subsystem for DAS (Data Acquisition System) devices within the DASFactory framework. It provides a standardized contract for capturing, configuring, and reporting diagnostic checks—including channel-level diagnostics (e.g., offset, noise, shunt checks), module-level diagnostics (e.g., temperature, battery voltage), arm-stage checks (e.g., sensor ID, squib resistance), and trigger/status monitoring (e.g., start record line, trigger line activity). The interfaces enable decoupling of diagnostic logic from implementation, supporting both real-time diagnostics and post-event analysis by standardizing how diagnostic actions are requested, results are collected, and metadata (e.g., calibration scale factors, clock sync status) is exposed.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `ITriggerCheck`
|
||||
- **`ITriggerCheckResult TriggerResult { get; set; }`**
|
||||
Gets or sets the result object containing trigger and start-record line status information.
|
||||
|
||||
### `IOptimizationValues`
|
||||
- **`float TransferSpeed { get; set; }`**
|
||||
Gets or sets the transfer speed used for real-time optimization (commented as “FB 6416 Keep the optimizations settings used for real-time optimization” in `IDiagnos`).
|
||||
|
||||
### `IArmCheckActions`
|
||||
- **`bool PerformBatteryVoltageCheck { get; set; }`**
|
||||
- **`bool PerformInputVoltageCheck { get; set; }`**
|
||||
- **`bool PerformSensorIdCheck { get; set; }`**
|
||||
- **`bool PerformEventLineCheck { get; set; }`**
|
||||
- **`bool PerformSquibResistanceCheck { get; set; }`**
|
||||
- **`bool PerformTiltSensorCheck { get; set; }`**
|
||||
- **`bool PerformTemperatureCheck { get; set; }`**
|
||||
- **`bool PerformClockSyncCheck { get; set; }`**
|
||||
Boolean flags indicating which arm-stage diagnostic checks should be performed.
|
||||
|
||||
### `IModuleDiagnosticsResult`
|
||||
- **`float TemperatureLocation1Pre/Post { get; set; }`**
|
||||
- **`float TemperatureLocation2Pre/Post { get; set; }`**
|
||||
- **`float TemperatureLocation3Pre/Post { get; set; }`**
|
||||
- **`float TemperatureLocation4Pre/Post { get; set; }`**
|
||||
Pre- and post-arm temperature readings at four physical locations on the module.
|
||||
|
||||
### `ITriggerCheckResult`
|
||||
- **`bool IsStatusGood { get; set; }`**
|
||||
Overall DAS status health (true = good).
|
||||
- **`bool IsStartRecordActive { get; set; }`**
|
||||
Whether the start record line is currently active.
|
||||
- **`bool HasStartRecordBeenActive { get; set; }`**
|
||||
Whether the start record line was active *at any time* after arming.
|
||||
- **`bool IsTriggered { get; set; }`**
|
||||
Whether the trigger line is currently active.
|
||||
- **`bool HasTriggered { get; set; }`**
|
||||
Whether the trigger line was active *at any time* after arming.
|
||||
|
||||
### `IDiagnos`
|
||||
- **`IDiagnosticActions[] ChannelDiagnostics { get; set; }`**
|
||||
Array of diagnostic action configurations, one per DAS channel.
|
||||
- **`void SetChannelDiagnosticActions(IDiagnosticActions[] actions, bool setInDb=true)`**
|
||||
Sets the diagnostic action configurations; optionally persists to database.
|
||||
- **`IDiagnosticResult[] ChannelDiagnosticsResults { get; set; }`**
|
||||
Array of diagnostic results, one per DAS channel.
|
||||
- **`void ClearChannelDiagnosticsResults(bool bClearDb = true)`**
|
||||
Clears channel diagnostic results; optionally clears from database.
|
||||
- **`void SetChannelDiagnosticsResults(IDiagnosticResult[] results, bool setInDb)`**
|
||||
Sets channel diagnostic results; optionally persists to database.
|
||||
- **`IModuleDiagnosticsResult[] ModuleDiagnosticsResults { get; set; }`**
|
||||
Array of module-level diagnostic results (e.g., temperature).
|
||||
- **`IBaseInputValues BaseInput { get; set; }`**
|
||||
Base input power and environmental diagnostics (voltage, battery, temperature).
|
||||
- **`IDictionary<InputClockSource, bool> DASClockSyncStatus { get; set; }`**
|
||||
Clock synchronization status per input clock source.
|
||||
- **`byte PTPDomainID { get; set; }`**
|
||||
Precision Time Protocol (PTP) domain ID.
|
||||
- **`IArmCheckActions ArmCheckActions { get; set; }`**
|
||||
Configuration for arm-stage diagnostic checks.
|
||||
- **`IArmCheckResults ArmCheckResults { get; set; }`**
|
||||
Results from arm-stage diagnostic checks.
|
||||
- **`IOptimizationValues OptimizationValues { get; set; }`**
|
||||
Real-time optimization settings (e.g., transfer speed).
|
||||
|
||||
### `IArmCheckResults`
|
||||
- **`Dictionary<int, string[]> SensorIds { get; set; }`**
|
||||
Mapped sensor IDs per module/channel.
|
||||
- **`Dictionary<int, double> SquibResistances { get; set; }`**
|
||||
Squib resistance values per module/channel.
|
||||
- **`double?[] BatteryVoltage { get; set; }`**
|
||||
Battery voltage readings (nullable, supports multiple batteries per module, e.g., TDAS Pro rack).
|
||||
- **`double? InputVoltage { get; set; }`**
|
||||
Input voltage (nullable).
|
||||
- **`bool? StartLineShorted { get; set; }`**
|
||||
Whether the start line is shorted (nullable).
|
||||
- **`bool? EventLineShorted { get; set; }`**
|
||||
Whether the event line is shorted (nullable).
|
||||
- **`short[] TiltSensorDataPre { get; set; }`**
|
||||
Raw tilt sensor data (pre-arm).
|
||||
- **`double[] TiltDegrees { get; set; }`**
|
||||
Tilt angle in degrees (derived from tilt sensor data).
|
||||
- **`Dictionary<byte, short[]> IndexedTiltSensorDataPre { get; set; }`**
|
||||
Indexed raw tilt sensor data (keyed by module ID).
|
||||
- **`Dictionary<byte, double[]> IndexedTiltDegrees { get; set; }`**
|
||||
Indexed tilt angles in degrees (keyed by module ID).
|
||||
- **`float[] TemperaturesPre { get; set; }`**
|
||||
Pre-arm temperature readings.
|
||||
- **`double[] Gains { get; set; }`**
|
||||
Gain values (e.g., from calibration).
|
||||
- **`double[] ZeroData { get; set; }`**
|
||||
Zero-level data (e.g., offset reference).
|
||||
- **`IDictionary<InputClockSource, bool> InputClockLocks { get; set; }`**
|
||||
Clock lock status per input clock source.
|
||||
|
||||
### `IDiagnosticActions`
|
||||
- **`int DASChannelNumber { get; set; }`**
|
||||
DAS channel number (0-indexed or 1-indexed relative to entire DAS unit).
|
||||
- **`bool MeasureExcitation { get; set; }`**
|
||||
Whether to measure excitation voltage applied to the sensor.
|
||||
- **`bool MeasureOffset { get; set; }`**
|
||||
Whether to measure sensor offset from 0.
|
||||
- **`bool CheckDigitalState { get; set; }`**
|
||||
Whether to check digital input state (open/closed/low/high).
|
||||
- **`bool MeasureInternalOffset { get; set; }`**
|
||||
Whether to measure internal offset.
|
||||
- **`bool RemoveOffset { get; set; }`**
|
||||
Whether firmware should compensate for offset (move base reading to 0).
|
||||
- **`bool MeasureNoise { get; set; }`**
|
||||
Whether to measure noise floor as % of full scale.
|
||||
- **`bool PerformShuntCheck { get; set; }`**
|
||||
Whether to perform emulated shunt check.
|
||||
- **`bool SquibFireCheck { get; set; }`**
|
||||
Whether to perform squib fire check.
|
||||
- **`bool PerformVoltageInsertCheck { get; set; }`**
|
||||
Whether to perform voltage insertion gain check (SLICE Pro).
|
||||
- **`bool PerformCalSignalCheck { get; set; }`**
|
||||
Whether to perform calibration signal check.
|
||||
- **`bool MeasureBridgeResistance { get; set; }`**
|
||||
Whether to measure bridge resistance.
|
||||
- **`bool AllActionsDisabled()`**
|
||||
Returns `true` if *all* diagnostic actions are disabled (i.e., no checks requested).
|
||||
|
||||
### `IBaseInputValues`
|
||||
- **`double InputMilliVolts { get; set; }`**
|
||||
Current input voltage in millivolts.
|
||||
- **`bool InputMilliVoltsValid { get; }`**
|
||||
Whether `InputMilliVolts` is valid.
|
||||
- **`double InputVoltage { get; set; }`**
|
||||
Current input voltage (same as `InputMilliVolts`, likely in volts).
|
||||
- **`double MinimumValidInputVoltage { get; set; }`**
|
||||
Minimum valid input voltage threshold.
|
||||
- **`double MaximumValidInputVoltage { get; set; }`**
|
||||
Maximum valid input voltage threshold.
|
||||
- **`bool BatteryMilliVoltsValid { get; }`**
|
||||
Whether `BatteryMilliVolts` is valid.
|
||||
- **`double BatteryMilliVolts { get; set; }`**
|
||||
Current battery voltage in millivolts.
|
||||
- **`double BatteryVoltage { get; set; }`**
|
||||
Current battery voltage (same as `BatteryMilliVolts`, likely in volts).
|
||||
- **`double MinimumValidBatteryVoltage { get; set; }`**
|
||||
Minimum valid battery voltage threshold.
|
||||
- **`double MaximumValidBatteryVoltage { get; set; }`**
|
||||
Maximum valid battery voltage threshold.
|
||||
- **`bool BatteryIsCharging { get; set; }`**
|
||||
Whether battery is currently charging.
|
||||
- **`double TemperatureC { get; set; }`**
|
||||
Hardware-logged temperature in °C.
|
||||
- **`string BatteryVoltageStatus { get; set; }`**
|
||||
Human-readable battery voltage status (e.g., “OK”, “LOW”).
|
||||
- **`string InputVoltageStatus { get; set; }`**
|
||||
Human-readable input voltage status.
|
||||
- **`string StatusDisplayBattery { get; set; }`**
|
||||
Display string for battery status.
|
||||
- **`string StatusDisplayInput { get; set; }`**
|
||||
Display string for input voltage status.
|
||||
- **`DFConstantsAndEnums.VoltageStatusColor BatteryVoltageStatusColor { get; set; }`**
|
||||
Color code for battery voltage status (e.g., green/yellow/red).
|
||||
- **`DFConstantsAndEnums.VoltageStatusColor InputVoltageStatusColor { get; set; }`**
|
||||
Color code for input voltage status.
|
||||
- **`double ChargeCapacity { get; set; }`**
|
||||
Battery charge capacity.
|
||||
- **`bool ChargeCapacityValid { get; }`**
|
||||
Whether `ChargeCapacity` is valid.
|
||||
|
||||
### `IDiagnosticResult`
|
||||
- **`int DASChannelNumber { get; set; }`**
|
||||
DAS channel number for this result.
|
||||
- **`int EventNumber { get; set; }`**
|
||||
Event number associated with this diagnostic.
|
||||
- **`double ScalefactorMilliVoltsPerADC { get; set; }`**
|
||||
Scale factor to convert ADC counts to millivolts (mandatory for data scaling).
|
||||
- **`double ScalefactorEngineeringUnitsPerADC { get; set; }`**
|
||||
Scale factor to convert ADC counts to engineering units.
|
||||
- **`double ExpectedExcitationMilliVolts { get; set; }`**
|
||||
Factory-calibrated excitation voltage (mandatory).
|
||||
- **`short GetExpectedDataZeroLevelADC(ZeroMethodType zeroMethod)`**
|
||||
Returns expected zero-level ADC for given zeroing method.
|
||||
- **`double? MeasuredExcitationMilliVolts { get; set; }`**
|
||||
Measured excitation voltage (nullable; 0.0 may mean null/unmeasured).
|
||||
- **`bool NegativeExcitation { get; set; }`**
|
||||
Whether `MeasuredExcitationMilliVolts` was negative at initial read (legacy handling).
|
||||
- **`double? MeasuredOffsetMilliVolts { get; set; }`**
|
||||
Measured offset in millivolts (nullable).
|
||||
- **`double? MeasuredInternalOffsetMilliVolts { get; set; }`**
|
||||
Measured internal offset in millivolts (nullable).
|
||||
- **`double? MeasuredOffsetEngineeringUnits { get; set; }`**
|
||||
Measured offset in engineering units (nullable).
|
||||
- **`double? AutoZeroPercentDeviation { get; set; }`**
|
||||
Deviation from 0 (in counts) after auto-zero (±5% check).
|
||||
- **`short? FinalOffsetADC { get; set; }`**
|
||||
Offset remaining after offset removal (nullable).
|
||||
- **`int? RemovedOffsetADC { get; set; }`**
|
||||
Amount of offset removed (nullable).
|
||||
- **`int? RemovedInternalOffsetADC { get; set; }`**
|
||||
Amount of internal offset removed (nullable).
|
||||
- **`double? NoisePercentFullScale { get; set; }`**
|
||||
Noise floor as % of full scale (nullable).
|
||||
- **`bool ShuntDeflectionFailed { get; set; }`**
|
||||
Whether shunt deflection check failed.
|
||||
- **`bool CalSignalCheckFailed { get; set; }`**
|
||||
Whether calibration signal check failed.
|
||||
- **`double? MeasuredShuntDeflectionMv { get; set; }`**
|
||||
Measured shunt deflection in mV (nullable).
|
||||
- **`double? MeasuredCalSignalMv { get; set; }`**
|
||||
Measured calibration signal in mV (nullable).
|
||||
- **`double? TargetCalSignalMv { get; set; }`**
|
||||
Target calibration signal in mV (nullable).
|
||||
- **`double? MeasuredDurationMS { get; set; }`**
|
||||
Measured duration in ms (e.g., for squib/fire checks).
|
||||
- **`double? MeasuredDelayMS { get; set; }`**
|
||||
Measured delay in ms.
|
||||
- **`bool? SquibFirePassed { get; set; }`**
|
||||
Whether squib fire check passed.
|
||||
- **`bool? SquibDurationPassed { get; set; }`**
|
||||
Whether squib duration check passed.
|
||||
- **`bool? SquibDelayPassed { get; set; }`**
|
||||
Whether squib delay check passed.
|
||||
- **`double[] SquibFireCurrentData { get; set; }`**
|
||||
Squib fire current trace.
|
||||
- **`double[] SquibFireVoltageData { get; set; }`**
|
||||
Squib fire voltage trace.
|
||||
- **`double[] SquibFireTimeAxis { get; set; }`**
|
||||
Time axis for squib fire traces.
|
||||
- **`double SquibThreshold { get; set; }`**
|
||||
Squib fire threshold.
|
||||
- **`double SquibVoltageScaler { get; set; }`**
|
||||
Scaler for squib voltage data.
|
||||
- **`double SquibCurrentScaler { get; set; }`**
|
||||
Scaler for squib current data.
|
||||
- **`double? TargetGain { get; set; }`**
|
||||
Target gain value (nullable).
|
||||
- **`double? MeasuredGain { get; set; }`**
|
||||
Measured gain value (nullable).
|
||||
- **`double? QueriedGain { get; set; }`**
|
||||
Gain value queried from hardware (nullable).
|
||||
- **`double? TargetShuntDeflectionMv { get; set; }`**
|
||||
Target shunt deflection in mV (nullable).
|
||||
- **`double? BridgeResistance { get; set; }`**
|
||||
Measured bridge resistance in ohms (nullable).
|
||||
- **`short ZeroMVInADC { get; set; }`**
|
||||
Zero voltage in ADC counts.
|
||||
- **`short WindowAverageADC { get; set; }`**
|
||||
Average ADC over window; `short.MinValue` indicates uninitialized/invalid.
|
||||
- **`bool DigitalInputActiveState { get; set; }`**
|
||||
Current state of digital input (active/inactive).
|
||||
|
||||
## 3. Invariants
|
||||
- **`IDiagnosticResult.ScalefactorMilliVoltsPerADC` and `ScalefactorEngineeringUnitsPerADC` are mandatory** for scaling raw ADC data to real-world values (per XML comment).
|
||||
- **`IDiagnosticResult.WindowAverageADC` uses `short.MinValue` to indicate uninitialized or invalid values**.
|
||||
- **`double?` properties in `IDiagnosticResult` and `IArmCheckResults` may use `0.0` to represent null/unmeasured values** (explicitly noted in comments).
|
||||
- **`IBaseInputValues.InputMilliVoltsValid`, `BatteryMilliVoltsValid`, and `ChargeCapacityValid` are read-only flags indicating validity of corresponding values**.
|
||||
- **`IArmCheckActions` and `IDiagnosticActions` use boolean flags to *enable* specific checks; `AllActionsDisabled()` returns `true` only if *all* flags are `false`**.
|
||||
- **`ITriggerCheckResult.HasStartRecordBeenActive` and `HasTriggered` track *cumulative* activity since arming, not just current state**.
|
||||
|
||||
## 4. Dependencies
|
||||
- **Depends on**:
|
||||
- `DTS.Common.Enums.DASFactory` (for `InputClockSource`, `DFConstantsAndEnums.VoltageStatusColor`)
|
||||
- `DTS.Common.Enums.Sensors` (for `ZeroMethodType`)
|
||||
- `System.Collections.Generic`, `System` (via `using` directives)
|
||||
- **Used by**:
|
||||
- `DTS.DASLib.Service.DiagnosticsService` (referenced in `IDiagnosticResult` comments for `Calibrate` method)
|
||||
- `DiagnosticsActions` (referenced in `IDiagnosticResult` comments for `PerformShuntCheck`, `MeasureBridgeResistance`)
|
||||
- `AnalogInputDasChannel` (referenced in `IDiagnosticResult` comments for offset limits)
|
||||
- **Implied consumers**:
|
||||
- Diagnostic UI components (via `IBaseInputValues.StatusDisplay*` and color enums)
|
||||
- Post-processing tools (via `IDiagnosticResult` scale factors and traces)
|
||||
- Arm/trigger logic (via `ITriggerCheck`, `IArmCheckActions/Results`)
|
||||
|
||||
## 5. Gotchas
|
||||
- **`double?` values may be `0.0` instead of `null` to indicate unmeasured data** (explicitly documented in `IDiagnosticResult`
|
||||
@@ -0,0 +1,228 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IDownloadReport.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IEventInfoAggregate.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IUARTDownload.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IUARTDownloadRequest.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IUARTEventInfo.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IDownloadRequest.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IDownload.cs
|
||||
- Common/DTS.CommonCore/Interface/DASFactory/Download/IEventInfo.cs
|
||||
generated_at: "2026-04-16T02:35:54.395482+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "efc5c7e5b438d0a3"
|
||||
---
|
||||
|
||||
# Download
|
||||
|
||||
## Documentation: DAS Factory Download Interfaces
|
||||
|
||||
### 1. Purpose
|
||||
This module defines a set of interfaces for interacting with DAS (Distributed Acoustic Sensing) devices to retrieve event data and UART stream data. It provides a standardized contract for querying stored events, specifying download requests (including sub-sampling and timestamp ranges), and managing metadata such as download status, GUIDs, fault flags, and arm attempts. The interfaces support both analog channel data (`IDownload`, `IEventInfo`) and serial UART data (`IUARTDownload`, `IUARTEventInfo`), enabling modular and consistent data retrieval workflows within the DASFactory system.
|
||||
|
||||
---
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
#### Interfaces (no concrete implementations provided in source)
|
||||
|
||||
##### `IDownloadReport`
|
||||
- **`IEventInfo[] Events { get; set; }`**
|
||||
Array of all standard (analog) events stored on the DAS. Index corresponds to event numbers (0-based or 1-based indexing not specified).
|
||||
- **`IUARTEventInfo[] UARTEvents { get; set; }`**
|
||||
Array of all UART events stored on the DAS. Index corresponds to event numbers.
|
||||
|
||||
##### `IEventInfoAggregate`
|
||||
- **`string EventId { get; set; }`**
|
||||
Identifier for the event.
|
||||
- **`string EventDescription { get; set; }`**
|
||||
Human-readable description of the event.
|
||||
- **`double DurationSeconds { get; set; }`**
|
||||
Duration of the event in seconds.
|
||||
- **`string GUID { get; set; }`**
|
||||
Globally unique identifier for the event.
|
||||
- **`bool HasBeenDownloaded { get; set; }`**
|
||||
Flag indicating whether the event has been downloaded.
|
||||
- **`bool WasTriggered { get; set; }`**
|
||||
Flag indicating whether the event was triggered.
|
||||
- **`int NumberOfChannels { get; set; }`**
|
||||
Number of channels recorded in the event.
|
||||
- **`ulong NumberOfSamples { get; set; }`**
|
||||
Total number of samples across all channels.
|
||||
- **`ulong NumberOfBytes { get; set; }`**
|
||||
Total size of the event data in bytes.
|
||||
- **`bool Faulted { get; set; }`**
|
||||
Flag indicating whether the event ended in a faulted state.
|
||||
- **`int EventNumber { get; set; }`**
|
||||
Event number.
|
||||
- **`void Add(IEventInfo newEvent)`**
|
||||
Adds an `IEventInfo` instance to this aggregate (likely for building a composite view).
|
||||
|
||||
##### `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 configuration.
|
||||
- **`UartDataFormat DataFormat { get; }`**
|
||||
UART data format (from `DTS.Common.Enums`).
|
||||
- **`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 from which to download UART data.
|
||||
- **`ulong TotalByteCount { get; set; }`**
|
||||
Total number of bytes in the UART stream for this event.
|
||||
- **`ulong TriggerByteCount { get; set; }`**
|
||||
Byte offset where the trigger occurred in the UART stream.
|
||||
- **`ulong FaultByteCount { get; set; }`**
|
||||
Byte offset where a fault occurred (if any).
|
||||
- **`ulong StartTimestamp { get; set; }`**
|
||||
Start timestamp of the UART stream (units not specified; likely microseconds or nanoseconds).
|
||||
- **`ulong EndTimestamp { get; set; }`**
|
||||
End timestamp of the UART stream.
|
||||
- **`int BaudRate { get; set; }`**
|
||||
Baud rate used during UART recording.
|
||||
|
||||
##### `IUARTEventInfo`
|
||||
- **`ushort EventNumber { get; set; }`**
|
||||
Event number.
|
||||
- **`bool DataPresent { get; set; }`**
|
||||
Flag indicating whether UART data exists for this event.
|
||||
- **`bool DataDownloaded { get; set; }`**
|
||||
Flag indicating whether UART data has been downloaded.
|
||||
- **`ulong TotalByteCount { get; set; }`**
|
||||
Total bytes in UART stream.
|
||||
- **`ulong TriggerByteCount { get; set; }`**
|
||||
Byte offset of trigger.
|
||||
- **`ulong FaultByteCount { get; set; }`**
|
||||
Byte offset of fault (if any).
|
||||
- **`ulong StartTimestamp { get; set; }`**
|
||||
Start timestamp.
|
||||
- **`ulong EndTimestamp { get; set; }`**
|
||||
End timestamp.
|
||||
- **`uint BaudRate { get; set; }`**
|
||||
Baud rate during recording.
|
||||
|
||||
##### `IDownloadRequest`
|
||||
- **`ushort EventNumber { get; set; }`**
|
||||
Event number to download.
|
||||
- **`byte DASChannelNumber { get; set; }`**
|
||||
Channel number; `ALL_CHANNELS` constant implied (value not provided).
|
||||
- **`ulong StartSample { get; set; }`**
|
||||
First sample index to download.
|
||||
- **`ulong EndSample { get; set; }`**
|
||||
Last sample index to download.
|
||||
- **`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 timestamp in seconds (integer part).
|
||||
- **`double TriggerTimestampSec { get; set; }`**
|
||||
Trigger timestamp in seconds (integer part).
|
||||
- **`double StartRecordTimestampNanoSec { get; set; }`**
|
||||
Fractional part of start timestamp in nanoseconds.
|
||||
- **`double TriggerTimestampNanoSec { get; set; }`**
|
||||
Fractional part of trigger timestamp in nanoseconds.
|
||||
- **`bool PTPMasterSync { get; set; }`**
|
||||
Flag indicating whether PTP (Precision Time Protocol) master sync was used.
|
||||
|
||||
##### `IDownload`
|
||||
- **`IDownloadRequest WhatToDownload { get; set; }`**
|
||||
Request specifying what data to download.
|
||||
- **`void SetWhatToDownload(IDownloadRequest request, bool bSetInDb = true)`**
|
||||
Sets the download request; optionally persists to database.
|
||||
- **`IDownloadReport EventInfo { get; set; }`**
|
||||
Metadata about stored events (populated by DASFactory).
|
||||
- **`void SetEventInfo(IDownloadReport eventInfo, bool bSetInDb = true)`**
|
||||
Sets event metadata; 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 download status array; optionally persists to database.
|
||||
- **`Guid[] EventGuids { get; set; }`**
|
||||
Array (indexed by event number) of event GUIDs.
|
||||
- **`void SetEventGuids(Guid[] guids, bool storeInDb = true)`**
|
||||
Sets GUID array; optionally persists to database.
|
||||
- **`ushort[] FaultFlags { get; set; }`**
|
||||
Array (indexed by event number) of fault flags.
|
||||
- **`void SetEventFaultFlags(ushort[] flags, bool storeInDb = true)`**
|
||||
Sets fault flags array; optionally persists to database.
|
||||
- **`byte[] ArmAttempts { get; set; }`**
|
||||
Array (indexed by event number) of arm attempt counts.
|
||||
- **`void SetEventArmAttemps(byte[] armAttempts, bool storeInDb = true)`**
|
||||
Sets arm attempts array; optionally persists to database.
|
||||
|
||||
##### `IEventInfo`
|
||||
- **`IDASModule[] Modules { get; set; }`**
|
||||
Array of modules involved in the event, indexed by `ModuleArrayIndex`.
|
||||
- **`int EventNumber { get; set; }`**
|
||||
Event number.
|
||||
- **`Guid TestGUID { get; set; }`**
|
||||
GUID of the event.
|
||||
- **`ushort FaultFlags { get; set; }`**
|
||||
Fault flags for the event.
|
||||
- **`ushort FaultFlagsEx { get; set; }`**
|
||||
Extended fault flags.
|
||||
- **`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; }`**
|
||||
Human-readable description.
|
||||
- **`bool HasBeenDownloaded { get; set; }`**
|
||||
Download status flag.
|
||||
- **`bool WasTriggered { get; set; }`**
|
||||
Trigger status flag.
|
||||
- **`void ClearFaults()`**
|
||||
Clears fault flags on the event.
|
||||
|
||||
---
|
||||
|
||||
### 3. Invariants
|
||||
- **`IDownloadRequest.SamplesToSkip` constraint**: `(EndSample - StartSample + 1) % SamplesToSkip == 0`.
|
||||
- **Indexing convention**: Arrays like `Events`, `UARTEvents`, `EventDownloadedStatus`, `EventGuids`, `FaultFlags`, and `ArmAttempts` are indexed by event number (type `int` or `ushort`), though exact offset (0-based vs. 1-based) is not specified.
|
||||
- **`IUARTEventInfo.BaudRate` vs `IUARTDownloadRequest.BaudRate`**:前者 is `uint`, latter is `int`. This may indicate a design inconsistency or domain-specific constraint (e.g., baud rates ≥ 0).
|
||||
- **`IDownloadRequest` timestamp decomposition**: `StartRecordTimestampSec` and `StartRecordTimestampNanoSec` together form a full timestamp; similarly for `TriggerTimestampSec`/`TriggerTimestampNanoSec`.
|
||||
- **`IEventInfo.Modules` indexing**: Must be accessed via `ModuleArrayIndex` of corresponding `IDASModule` instances.
|
||||
- **`IDownloadRequest.DASChannelNumber`**: Value `ALL_CHANNELS` (not defined here) implies download all channels.
|
||||
|
||||
---
|
||||
|
||||
### 4. Dependencies
|
||||
- **Imports/Usings**:
|
||||
- `DTS.Common.Interface.DownloadEvent` (for `IEventInfo`, `IUARTEventInfo` interfaces—*not defined in provided source*).
|
||||
- `DTS.Common.Enums` (for `UartDataFormat`, `StopBits`, `Parity`, `Handshake`—*not defined in provided source*).
|
||||
- `System.IO.Ports` (for `StopBits`, `Parity`, `Handshake` enums).
|
||||
- `System` (for `Guid`, `DateTime`, `Array`, etc.).
|
||||
- **Depended upon by**:
|
||||
- Likely consumed by `DASFactory` components (e.g., download logic, UI, database sync).
|
||||
- `IEventInfoAggregate` suggests aggregation logic (e.g., event grouping or summary generation).
|
||||
- **Assumed dependencies**:
|
||||
- `IDASModule` (referenced in `IEventInfo.Modules`) is defined elsewhere (not provided).
|
||||
- `ALL_CHANNELS` constant (referenced in `IDownloadRequest`) is defined elsewhere.
|
||||
|
||||
---
|
||||
|
||||
### 5. Gotchas
|
||||
- **`SetEventArmAttemps` typo**: Method name is `SetEventArmAttemps` (missing "t" in "Attempts") in `IDownload`. Likely a legacy typo.
|
||||
- **`IUARTDownloadRequest.BaudRate` vs `IUARTEventInfo.BaudRate`**: Type mismatch (`int` vs `uint`) may cause conversion issues or indicate inconsistent design.
|
||||
- **Timestamp units**: `StartTimestamp`, `EndTimestamp`, `TriggerByteCount`, etc., in `IUARTDownloadRequest` and `IUARTEventInfo` are `ulong` but units (e.g., µs, ns, ticks) are not documented.
|
||||
- **`SamplesToSkip` edge case**: `SamplesToSkip = 0` is explicitly disallowed by the constraint (division by zero risk), but documentation says "0 (or 1)"—likely a documentation error.
|
||||
- **Array indexing ambiguity**: No guarantee that event numbers map directly to array indices (e.g., sparse event numbering).
|
||||
- **`DataFormat` enum**: `UartDataFormat` is imported but not defined; its structure and valid values are unknown.
|
||||
- **`IDownloadRequest` timestamp precision**: Splitting timestamps into `Sec` and `NanoSec` fields may introduce rounding or overflow issues if not handled carefully.
|
||||
- **`ClearFaults()` behavior**: No documentation on whether clearing faults affects `FaultFlags`, `FaultFlagsEx`, or persistent state.
|
||||
|
||||
None identified beyond the above.
|
||||
Reference in New Issue
Block a user