Files

294 lines
16 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Interface/DASFactory/IAutoArmed.cs
- Common/DTS.CommonCore/Interface/DASFactory/ITiltSensorCalAware.cs
- Common/DTS.CommonCore/Interface/DASFactory/IRangeBandwidthLimited.cs
- Common/DTS.CommonCore/Interface/DASFactory/IAutoArmStatus.cs
- Common/DTS.CommonCore/Interface/DASFactory/ITimeSynchronization.cs
- Common/DTS.CommonCore/Interface/DASFactory/IConnectedEthernetDevice.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDASConfigurationArg.cs
- Common/DTS.CommonCore/Interface/DASFactory/IRealtime.cs
- Common/DTS.CommonCore/Interface/DASFactory/IUDPQATSEntry.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDASFactory.cs
- Common/DTS.CommonCore/Interface/DASFactory/ICommunication.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDiscoveredDevice.cs
- Common/DTS.CommonCore/Interface/DASFactory/IAnalogInputDASChannel.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDASCommunication.cs
generated_at: "2026-04-16T02:25:03.434505+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "5d1420792c49604c"
---
# DASFactory Interface Documentation
## 1. Purpose
This module defines a set of C# interfaces that collectively represent the contract for interacting with Data Acquisition Systems (DAS) in the DASFactory subsystem. These interfaces abstract hardware-specific behaviors—such as configuration, diagnostics, real-time data streaming, arming, time synchronization, and communication transport—into a unified API layer. They enable decoupling of core business logic from hardware implementation details, supporting multiple DAS device types (e.g., SLICE, TDAS, g5, S6) and facilitating operations like device discovery, configuration, diagnostics, and data acquisition. The interfaces are designed to be consumed by higher-level services (e.g., `ConfigurationService`, `DiagnosticsService`, `DownloadService`) and are central to the factory pattern used for device management.
## 2. Public Interface
### Interfaces (No implementation classes provided; only interface definitions)
#### `IAutoArmed`
- **Property**: `bool AutoArmed { get; set; }`
Indicates whether the DAS unit is currently in an auto-armed state.
#### `ITiltSensorCalAware`
- **Property**: `double[] TiltSensorCals { get; }`
Provides calibration coefficients for tilt sensors (e.g., for converting raw ADC values to degrees).
#### `IRangeBandwidthLimited`
- **Property**: `bool RangeBandwidthLimited { get; }`
Indicates whether the DAS units analog input range is constrained by bandwidth limitations.
#### `IAutoArmStatus`
- **Property**: `DFConstantsAndEnums.CommandStatus AutoArmStatus { get; set; }`
Represents the current status of the auto-arm command (e.g., pending, success, failure).
#### `ITimeSynchronization`
- **Property**: `bool SupportsTimeSynchronization { get; }`
Indicates whether the device supports time synchronization.
- **Property**: `DateTime SystemBaseTime { get; }`
Returns the base system time used for time-synchronized acquisition.
#### `IConnectedEthernetDevice`
- **Property**: `string MACAddress { get; }`
MAC address of the connected Ethernet device.
- **Property**: `int Port { get; }`
Port number on the parent device (e.g., SLICE6DB) to which this device is connected.
- **Property**: `string SerialNumber { get; set; }`
Serial number of the connected Ethernet device.
#### `IDASConfigurationArg`
- **Property**: `IDASCommunication DAS { get; }`
Reference to the DAS unit being configured.
- **Property**: `bool BlankConfigurationRead { get; }`
Indicates whether the configuration was read from a blank (uninitialized) configuration storage.
- **Property**: `bool ConfigurationFailedValidation { get; }`
Indicates whether the configuration failed validation during a configuration event.
#### `IRealTime`
- **Property**: `List<int> RealtimeDASChannels { get; set; }`
List of channel indices from which real-time data is streamed.
- **Property**: `List<double> TiltAxisData { get; set; }`
Tilt sensor axis data (X, Y, Z) in degrees for Slice6.
- **Property**: `string UDPStreamAddress { get; }`
UDP stream address for Slice6/Slice6A real-time data.
#### `IUDPQATSEntry`
- **Properties**:
- `string ResponseHostMac`, `ResponseClientMacAddress`, `SerialNumber`
- `byte ArmState`, `ArmMode`, `Started`, `Triggered`, `FaultFlags`, `LegacyFaultFlags`
- `uint SampleRate`, `ulong TotalSamples`, `CurrentSample`, `EventNumber`, `FaultSampleNumber`
- `ulong EventTriggerSample`, `EstimateMaxSamples`
- `short TiltSensorCh1`, `TiltSensorCh2`, `TiltSensorCh3`
- `float InputVoltage`, `BackupVoltage`, `BatterySOC`, `SysTempC`
- `byte SyncClockEnable`, `ADCExtClockSyncEnable`, `SyncClockStatus`, `ADCExtClockSyncStatus`
- `float[] ChannelOffsetMV`, `ShuntDeviationPercent`
- `DateTime Timestamp`
Encapsulates a single UDP packets worth of QATS (Quick Arm/Trigger Status) telemetry data from a DAS unit.
#### `IDASFactory`
- **Properties**:
- `bool AllowSDBCommandPort { get; set; }`
- `double S6ConnectNewTimeout { get; set; }`
- `string[] SliceDBHostNames { get; set; }`
- `string[] TDASHostNames { get; set; }`
- `string[] TDASSerialPortNames { get; set; }`
- `string TDASSerialRackSerialNumber { get; set; }`
- `int MultiCastAutoDiscoveryDefaultTimeoutMS { get; set; }`
- `string Language { get; set; }`
- **Methods**:
- `bool PingAll()`
- `void TakeOwnership()`
- `string[] GetConnectedDevices()`
- `List<IDASCommunication> GetDASList()`
- `List<IDASCommunication> GetSortedDASList()`
- `List<ICommunication> GetDevList()`
- `void DetachAllDevices(bool detachUSB = false)`
- `void Refresh(ActionCompleteDelegate action)`
- `SortableBindingList<IDiscoveredDevice> AutoDiscoverMulticast(bool discoverParents = true)`
#### `ICommunication`
- **Properties**:
- `IConnection Transport { get; set; }`
- `int ReceiveBufferSize { get; set; }`
- `string SerialNumber { get; set; }`
- `string FirmwareVersion { get; set; }`
- `byte ProtocolVersion { get; set; }`
- `ICommunication_DASInfo DASInfo { get; set; }`
- `Dictionary<DFConstantsAndEnums.ProtocolLimitedCommands, byte> MinimumProtocols { get; set; }`
- `bool ExecuteIsBusy { get; set; }`
- `string ConnectString { get; }`
- `bool Connected { get; }`
- **Methods**:
- `void SetupReader()`
- `void InitMinProto()`
- `bool IsCommandSupported(ProtocolLimitedCommands command)`
- `byte GetMinProto(ProtocolLimitedCommands command)`
- `void Connect(string ConnectString, CommunicationCallback Callback, object CallbackObject, int CallbackTimeout, string ipAddress)`
- `void Disconnect(bool reuseSocket, CommunicationCallback Callback, object CallbackObject, int CallbackTimeout)`
- `void Close(int Timeout)`
- `void Flush(int Timeout)`
- `void Execute(byte[] byteData, CommunicationCallback Callback, object CallbackObject, int CallbackTimeout)`
- `void PseudoExecute(byte[] byteData, CommunicationCallback Callback, object CallbackObject, int CallbackTimeout)`
- `byte[] SyncExecute(byte[] byteData, int Timeout)`
- `void Cancel()`, `ForceCancel()`, `IsCanceled()`, `ClearCancel()`
- `ManualResetEvent CancelEvent { get; }`
- **Events**:
- `event EventHandler OnDisconnected`
#### `IDiscoveredDevice`
- **Properties**:
- `string Serial { get; set; }`
- `MultiCastDeviceClasses DevClass { get; set; }`
- `string Mac { get; set; }`
- `IDiscoveredDevice Parent { get; set; }`
- `bool IsModule { get; set; }`
- `int Port { get; set; }`
- `int PositionOnDistributor { get; set; }`
- `int PositionOnChain { get; set; }`
- `bool Dhcp { get; set; }`
- `string Ip`, `Subnet`, `Gateway`, `Dns`
- `bool Connected { get; set; }`
- `string ConnectedIp`, `ConnectedHost`
- `ushort SystemId`, `string Location`
- `string FirmwareVersion`, `BuildId`
- `IConnectedEthernetDevice[] Connections { get; set; }`
- **Methods**:
- `bool IsParent(IDiscoveredDevice possibleChild)`
- `int GetPort(IDiscoveredDevice device)`
- `int GetSlot(IDiscoveredDevice child, Dictionary<string, IDiscoveredDevice> lookup)`
- `int GetSlotOnPort(IDiscoveredDevice child, Dictionary<string, IDiscoveredDevice> lookup)`
#### `IAnalogInputDASChannel`
- **Properties**:
- `SensorConstants.BridgeType TypeOfBridge { get; set; }`
- `SensorConstants.BridgeType[] SupportedBridges { get; set; }`
- `DigitalInputModes[] SupportedDigitalInputModes { get; set; }`
- `SensorConstants.CouplingModes CouplingMode { get; set; }`
- `double BridgeResistanceOhms { get; set; }`
- `double ZeroPoint { get; set; }`
- `double SensorCapacityEU`, `SensorCapacity { get; set; }`
- `string SensorPolarity { get; set; }`
- `double DesiredRangeWithHeadroomEU { get; set; }`
- `double SensitivityMilliVoltsPerEU { get; set; }`
- `double SensitivityMilliVoltsPerEUNormalized { get; }`
- `bool IsProportionalToExcitation { get; set; }`
- `bool IsSupported(ExcitationVoltageOptions.ExcitationVoltageOption o)`
- `bool IsInverted { get; set; }`
- `string OriginalChannelName`, `ChannelName2 { get; set; }`
- `string ChannelId`, `ChannelGroupName { get; set; }`
- `string HardwareChannelName { get; set; }`
- `string DIUnits { get; set; }`
- `DigitalInputModes DigitalMode { get; set; }`
- `LinearizationFormula LinearizationFormula { get; set; }`
- `ExcitationVoltageOptions.ExcitationVoltageOption Excitation { get; set; }`
- `ExcitationVoltageOptions.ExcitationVoltageOption[] SupportedExcitation { get; set; }`
- `string EngineeringUnits { get; set; }`
- `string SerialNumber`, `Manufacturer`, `Model`, `Description { get; set; }`
- `ZeroMethodType ZeroMethod { get; set; }`
- `double ZeroAverageStartSeconds`, `ZeroAverageStopSeconds { get; set; }`
- `double InitialEU { get; set; }`
- `string InitialOffset { get; set; }`
- `bool Unipolar { get; set; }`
- `bool ShuntIsEnabled { get; set; }`
- `short ZeromVInADC { get; set; }`
- `bool VoltageInsertionCheckEnabled { get; set; }`
- `bool IEPEChannel`, `DigitalInputChannel`, `CalSignalIsEnabled { get; set; }`
- `bool RemoveOffset`, `VerifyOffset { get; set; }`
- `double OffsetToleranceLowMilliVolts`, `OffsetToleranceHighMilliVolts { get; set; }`
- `DateTime LastCalibrationDate`, `CalDueDate { get; set; }`
- `string ISOCode { get; set; }`
- `bool BypassAAFilter { get; set; }`
- `string SensorID { get; set; }`
- `IDiagnosticResult Diagnostics { get; }`
- `bool UpdateChannelFromDatabase { get; set; }`
- `double? TriggerBelowThresholdEu`, `TriggerAboveThresholdEu { get; set; }`
- `bool AlreadyLevelTriggered { get; set; }`
- `double MeasuredEULevelTriggerCheck { get; set; }`
- `double SoftwareFilterFrequency { get; set; }`
- `IFilterClass SoftwareFilterClass { get; set; }`
- `IDiagnosticResult DiagnosticInformation { get; }`
- `double? MeasuredExcitationVolts`, `FactoryExcitationVolts { get; }`
- `double ScalefactorMilliVoltsPerADC`, `ScalefactorEngineeringUnitsPerADC { get; set; }`
- `double NoiseAsPercentOfFullScale { get; set; }`
- `double UnsupersampledSampleRate { get; set; }`
- `bool IsConfigured()`
- **Methods**:
- `void WriteElementEnd(XmlWriter writer)`
- `void WriteXml(XmlWriter writer)`
- `string GetSupportedExcitationSerialized()`
- `string GetSupportedDigitalInputModesSerialized()`
- `string GetSupportedBridgesSerialized()`
- `void WriteXmlCRC32(XmlWriter writer)`
#### `IDASCommunication`
- **Inherits from**: `IConfiguration`, `IDiagnos`, `ITriggerCheck`, `IRealTime`, `IArmStatus`, `IDownload`, `IInformation`, `IAutoArmStatus`, `IAutoArmed`, `IRangeBandwidthLimited`, `ITimeSynchronization`
- **Properties**:
- `ExcitationStatus ExcitationStatus { get; set; }`
- `DateTime? FirstUseDate { get; set; }`
- `bool IsFirstUseDateSupported { get; set; }`
- `bool IsStreamingSupported { get; set; }`
- `bool DiagnosticsHasBeenRun { get; set; }`
- `bool ConfigureHasBeenRun { get; set; }`
- `int RecordId { get; set; }`
- `float InputLowVoltage`, `InputMediumVoltage`, `InputHighVoltage`
- `float BatteryLowVoltage`, `BatteryMediumVoltage`, `BatteryHighVoltage`
- `double MinimumValidInputVoltage`, `MaximumValidInputVoltage`
- `double MinimumValidBatteryVoltage`, `MaximumValidBatteryVoltage`
- `string SerialNumber { get; set; }`
- `string FirmwareVersion { get; }`
- `int MaxModules { get; set; }`
- `bool InvertTrigger { set; }`
- `bool InvertStart { get; set; }`
- `bool IgnoreShortedStart`, `IgnoreShortedTrigger { get; set; }`
- `string MACAddress { get; set; }`
- `string[] DownstreamMACAddresses { get; set; }`
- `bool SupportsIndividualChannelRealtimeStreaming { get; }`
- **Methods**:
- `void ReadFirstUseDate()`
- `void SetIsStreamingSupported(bool supported = false)`
- `bool ConnectionCheck()`
- `HardwareTypes GetHardwareType()`
- `double[] GetNominalRanges(SensorConstants.BridgeType bridge)`
- `int NumberOfConfiguredChannels()`
- `int NumberOfChannels()`
- `long MaxMemory()`
- `uint MinSampleRate()`
- `uint MaxSampleRate(int numberOfConfiguredChannels)`
- `uint MaxAAFilterRate()`
- `bool SupportsAutoArm()`
- `bool SupportsLevelTrigger()`
- `bool SupportsRealtime()`
- `bool SupportsMultipleEvents()`
- `bool SupportsTriggerInversion()`
- `bool SupportsStartInversion()`
- `bool SupportsHardwareInputCheck()`
- `bool SupportsMultipleSampleRealtime()`
- `bool ControlsDAQ()`
- `bool CheckAAF(float rate)`
- `bool RequireDiagnosticRateMatchSampleRate()`
- `ulong GetPhaseShiftSamples(uint ModuleIndex, double ActualSampleRate, uint HardwareAAF, ulong originalT0)`
- `bool IsEthernetDistributor()`
- `bool GetCanCheckArmStatus()`
- `bool IsSlice6Distributor()`
- `bool IsBattery()`
- `bool IsTSRAIR()`
- `bool IsSlice6Air()`
## 3. Invariants
- **`IDASCommunication`** must implement all inherited interfaces (`IConfiguration`, `IDiagnos`, `ITriggerCheck`, `IRealTime`, `IArmStatus`, `IDownload`, `IInformation`, `IAutoArmStatus`, `IAutoArmed`, `IRangeBandwidthLimited`, `ITimeSynchronization`).
- **`ICommunication`** must support `ConnectString`-based connection establishment and `Execute`/`SyncExecute` for command dispatch.
- **`ICommunication.CancelEvent`** is a `ManualResetEvent` that signals cancellation state; `Cancel()` and `ForceCancel()` must set this event.
- **`IDiscoveredDevice`** must accurately reflect physical topology (e.g., `Port`, `PositionOnChain`, `PositionOnDistributor`) for hierarchical devices like SLICE6DB.
- **`IAnalogInputDASChannel`** must ensure `IsConfigured()` returns `true` only if `SerialNumber` is non-null/non-empty.
- **`IDASCommunication`** must expose `FirmwareVersion` as read-only, while `SerialNumber` is read-write.
- **`ITimeSynchronization.SystemBaseTime`** must be valid only if `SupportsTimeSynchronization` is `true`.
- **`IUDPQATSEntry.Timestamp`** must represent the time the UDP packet was received or generated (implementation-dependent but must be non-null).
- **`IDASFactory.Refresh(...)`** must update `GetDASList()` to reflect current hardware state before invoking the `action` callback.
## 4. Dependencies
- **External Dependencies**:
- `DTS.Common.Enums.*` (e.g., `DFConstantsAndEnums`, `CommunicationConstantsAndEnums`, `HardwareTypes`, `SensorConstants`, `DigitalInputModes`, `ZeroMethodType`, `ExcitationVoltageOptions`)
- `DTS.Common.Interface.*` (e.g., `IConnection`, `ICommunication_DASInfo`, `IDiagnosticResult`, `IFilter