10 KiB
10 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:59:53.800390+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 51c3cf5ed1e74c4d |
Arm
Documentation: ARM Status and Pre-Arm Checks Module
1. Purpose
This module provides data structures and utilities for managing the ARM state of a Data Acquisition System (DAS) unit and for configuring/collecting pre-arm diagnostic checks. It enables the system to track real-time operational status (e.g., armed, triggered, faulted, recording) via ArmStatus, and to define and store results of diagnostic checks (e.g., battery voltage, sensor IDs, squib resistance) via ArmCheckActions and ArmCheckResults. It serves as the core data layer for the ArmingService, supporting safe arming workflows and post-test diagnostics.
2. Public Interface
ArmCheckActions
bool PerformBatteryVoltageCheck { get; set; }
Flag indicating whether to perform a battery voltage diagnostic check.bool PerformInputVoltageCheck { get; set; }
Flag indicating whether to perform an input voltage diagnostic check.bool PerformSensorIdCheck { get; set; }
Flag indicating whether to verify sensor EIDs.bool PerformEventLineCheck { get; set; }
Flag indicating whether to check for shorts on the event line.bool PerformSquibResistanceCheck { get; set; }
Flag indicating whether to measure squib resistance.bool PerformTiltSensorCheck { get; set; }
Flag indicating whether to perform tilt sensor diagnostics.bool PerformTemperatureCheck { get; set; }
Flag indicating whether to perform temperature diagnostics.bool PerformClockSyncCheck { get; set; }
Flag indicating whether to verify clock synchronization status.ArmCheckActions()
Constructor initializes all check flags tofalse.
ArmCheckResults
Dictionary<int, string[]> SensorIds { get; set; }
Maps channel index (int) to an array of sensor EIDs (strings) read from that channel.Dictionary<int, double> SquibResistances { get; set; }
Maps channel index (int) to measured squib resistance (Ω).double?[] BatteryVoltage { get; set; }
Array of optional battery voltage readings (mV), supporting multiple batteries per module (e.g., TDAS Pro rack).double? InputVoltage { get; set; }
Optional input voltage reading (mV).bool? StartLineShorted { get; set; }
Optional result indicating if the start line is shorted.bool? EventLineShorted { get; set; }
Optional result indicating if the event line is shorted.short[] TiltSensorDataPre { get; set; }
Raw pre-check tilt sensor ADC values.double[] TiltDegrees { get; set; }
Tilt angles (degrees) computed fromTiltSensorDataPre.Dictionary<byte, short[]> IndexedTiltSensorDataPre { get; set; } = new Dictionary<byte, short[]>();
Indexed raw tilt data (key = device/module index).Dictionary<byte, double[]> IndexedTiltDegrees { get; set; } = new Dictionary<byte, double[]>();
Indexed tilt angles (key = device/module index).float[] TemperaturesPre { get; set; }
Raw temperature sensor readings (likely ADC counts or mV).double[] Gains { get; set; }
Channel gains used during diagnostics.double[] ZeroData { get; set; }
Zero-offset calibration data.IDictionary<InputClockSource, bool> InputClockLocks { get; set; }
Maps clock source type (InputClockSource) to lock status (true= locked).
ArmStatus
bool ReceivedInvalidModeDuringSetup { get; set; } = false;
Indicates ifInvalidModeerror was received during setup; used as a heuristic to detect streaming mode.void ClearTriggerCheckStatus()
Resets trigger-related flags:IsTriggered,IsArmed,IsRecording,IsTriggerShorted,IsStartShorted.ArmStatus()
Default constructor.ArmStatus(IArmStatusData status)
Copy constructor fromIArmStatusDatainterface; copies all properties.bool IsArmed { get; set; }
True if DAS is currently armed.bool IsTriggered { get; set; }
True if DAS has sensed a trigger event.bool IsTriggerShorted { get; set; }
True if trigger line is shorted during trigger check only.bool IsStartShorted { get; set; }
True if start line is shorted during trigger check only.bool IsRecording { get; set; }
True if DAS is currently recording samples.bool IsFaulted { get; set; }
True if DAS has faulted.bool IsInRealtime { get; set; }
True if DAS is in real-time mode.bool IsInFlashWrite { get; set; }
True if DAS is in flash write mode (G5).bool IsUndefined { get; set; }
True ifARM STAT READreturned no data.bool IsInPostTestDiagnostics { get; set; }
True if DAS is running post-test diagnostics.double TimeRemainingSeconds { get; set; }
Estimated seconds remaining in recording.double PercentComplete { get; set; }
Flash write progress percentage.ulong TotalSamples { get; set; }
Total samples to be recorded in the test.ulong CurrentSample { get; set; }
Current sample index being recorded.uint SampleRate { get; set; }
Current sample rate (Hz).double? InputMilliVolts { get; set; }
Input voltage (mV); auto-converts values > 100,000 from µV to mV.double? BatteryMilliVolts { get; set; }
Battery voltage (mV); auto-converts values > 100,000 from µV to mV.int? EventNumber { get; set; }
Current event number being recorded.ushort? MaxEventsPossible { get; set; }
Maximum number of events supported by the device (per issue #26817).int RecordingMode { get; set; }
Numeric recording mode identifier.string FaultMessage { get; set; }
Human-readable fault description (if any).bool IsRearming { get; set; }
True if DAS is in rearming state.bool HasBeenRecording { get; set; }
True if DAS has ever recorded during the current session.double? TimeLeftInArm { get; set; }
Time remaining in armed state (seconds).static void SetArmStatus(IDASCommunication unit, IArmStatusData status, bool bSetInDb)
Assignsstatustounit.DASArmStatus. IfbSetInDbis true and DB is connected, persists status toARM.SetArmStatusstored procedure; logs exceptions viaAPILogger.
3. Invariants
InputMilliVoltsandBatteryMilliVolts:
Values > 100,000 are always divided by 1,000 to convert from µV to mV. Null values remain null.TimeLeftInArm:
No conversion is applied—values are stored directly asdouble.ClearTriggerCheckStatus():
Only resets trigger-related flags (IsTriggered,IsArmed,IsRecording,IsTriggerShorted,IsStartShorted). Does not affectIsFaulted,IsRecording, or other non-trigger flags.ArmCheckActions:
All check flags default tofalse; no validation ensures at least one check is enabled.ArmCheckResults.SensorIds:
Key is channel index (0-based), value is array of EIDs (strings) per channel.ArmStatus.SetArmStatus(...):
Does not throw exceptions; failures in DB persistence are silently logged viaAPILogger.
4. Dependencies
Imports/Usings
DTS.Common.Interface.DASFactory.Diagnostics→ ProvidesIArmCheckActions,IArmCheckResults,IArmStatusData.DTS.Common.Interface.DASFactoryandDTS.Common.Interface.DASFactory.ARM→ ProvidesIDASCommunication,IArmStatusData,InputClockSource.DTS.Common→ Provides logging utilities (e.g.,APILogger).DASFactoryDb.ARM→ ProvidesARM.SetArmStatus(...)stored procedure.System.Collections.Generic,System→ Standard .NET types.
Dependencies on this module
ArmingService.GetArmStatus(...)(referenced inArmStatussummary) — not shown in source, but implied to be the primary consumer ofArmStatus.- Any code performing pre-arm diagnostics — uses
ArmCheckActionsto configure checks andArmCheckResultsto store results. - Database layer — calls
ARM.SetArmStatus(...)viaArmStatus.SetArmStatus(...).
Dependencies of this module
DASFactoryDb.DbWrapper.Connected— checked before DB writes.APILogger— used for exception logging inSetArmStatus.
5. Gotchas
InputMilliVolts/BatteryMilliVoltsunit conversion:
Values > 100,000 are assumed to be in µV and converted to mV. If a value is legitimately > 100,000 mV (e.g., 120,000 mV = 120 V), it will be incorrectly divided to 120 mV. This is likely a legacy assumption for µV inputs.IsTriggerShortedvsIsTriggered:
IsTriggerShortedis only set duringTriggerCheck, whileIsTriggeredis set in many contexts. Confusing the two may lead to incorrect logic (e.g., mistaking a trigger event for a line short).ReceivedInvalidModeDuringSetupheuristic:
Used to detect streaming mode, but this is not a guaranteed or documented protocol behavior—may break if firmware changes.ArmCheckResults.SensorIdskey type:
Key isint(channel index), but no validation ensures keys are non-negative or contiguous.IndexedTiltSensorDataPre/IndexedTiltDegrees:
Key isbyte(device/module index), but no documentation clarifies how indices are assigned or whether duplicates are possible.SetArmStatus(...)silently swallows DB errors:
Exceptions during DB persistence are logged but do not propagate—callers may assume persistence succeeded.ArmStatuscopy constructor does not guard against nullstatus:
While it returns early on null, it does not clear the current instance’s properties—only copies non-null values fromstatus.- No validation in
ArmCheckActions:
It is possible to configure no checks (all flagsfalse), which may lead to unsafe arming if not handled upstream.
None identified beyond the above.