173 lines
9.4 KiB
Markdown
173 lines
9.4 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.Common/Classes/Hardware/ExternalTilt.cs
|
||
|
|
- Common/DTS.Common/Classes/Hardware/DragAndDropPayload.cs
|
||
|
|
- Common/DTS.Common/Classes/Hardware/SerializableAAF.cs
|
||
|
|
- Common/DTS.Common/Classes/Hardware/DASDBRecord.cs
|
||
|
|
- Common/DTS.Common/Classes/Hardware/DASChannelDBRecord.cs
|
||
|
|
- Common/DTS.Common/Classes/Hardware/DASMonitorInfo.cs
|
||
|
|
generated_at: "2026-04-17T15:35:23.326019+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "4e304d35fc9dc2de"
|
||
|
|
---
|
||
|
|
|
||
|
|
# DTS.Common.Classes.Hardware Documentation
|
||
|
|
|
||
|
|
## Purpose
|
||
|
|
|
||
|
|
This module provides data structures and persistence logic for hardware-related entities within the DTS (Data Acquisition System) domain. It contains database record mappings for DAS units and their channels, monitor configuration state for tilt sensors and channel metadata, and utility classes for hardware identification and drag-and-drop operations. The module serves as the data layer abstraction between the hardware abstraction layer and the database/serialization infrastructure.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Public Interface
|
||
|
|
|
||
|
|
### ExternalTilt
|
||
|
|
A simple POCO (Plain Old CLR Object) representing an external tilt sensor device.
|
||
|
|
|
||
|
|
**Properties:**
|
||
|
|
- `string SerialNumber { get; set; }` - Serial number of the tilt device
|
||
|
|
- `byte TiltID { get; set; }` - Numeric identifier for the tilt device
|
||
|
|
- `string SystemID { get; set; }` - System identifier where the tilt device is registered
|
||
|
|
- `string SystemLocation { get; set; }` - Physical location of the tilt device within the system
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### DragAndDropPayload
|
||
|
|
Static container class defining clipboard format identifiers for drag-and-drop operations involving hardware table rows.
|
||
|
|
|
||
|
|
**Constants:**
|
||
|
|
- `const string FORMAT = "RESOLVECHANNELS_HARDWARETABLE"` - Standard drag format
|
||
|
|
- `const string ALT_FORMAT = "ALT_RESOLVECHANNELS_HARDWARETABLE"` - Alternate drag format (Alt key modifier)
|
||
|
|
- `const string CTRL_FORMAT = "CTRL_RESOLVECHANNELS_HARDWARETABLE"` - Control drag format (Ctrl key modifier)
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### SerializableAAF
|
||
|
|
Container for Anti-Alias Filter serialization logic (currently non-functional).
|
||
|
|
|
||
|
|
**Nested Types:**
|
||
|
|
- `enum DAS_TYPE { TDAS = 0, SLICE = 1 }` - Enumeration identifying DAS hardware types
|
||
|
|
|
||
|
|
**Note:** All implementation methods (`GetSerializedKey()`, `GetSerializedValue()`, `FromSerializedStrings()`) are commented out. The class currently serves only as a container for the `DAS_TYPE` enum.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### DASDBRecord
|
||
|
|
Entity class representing a Data Acquisition System (DAS) database record. Implements `IDASDBRecord` and extends `BasePropertyChanged`.
|
||
|
|
|
||
|
|
**Constructors:**
|
||
|
|
- `DASDBRecord()` - Default constructor
|
||
|
|
- `DASDBRecord(IDASDBRecord copy)` - Copy constructor; performs shallow copy of most properties and deep copy of `ChannelTypes` array
|
||
|
|
- `DASDBRecord(IDataReader reader)` - Constructs instance from database reader using `Utility` helper methods
|
||
|
|
|
||
|
|
**Static Properties:**
|
||
|
|
- `static DateTime INVALID_DATE => new DateTime(1970, 1, 1)` - Sentinel value for unset date fields
|
||
|
|
|
||
|
|
**Instance Properties (Key Database Columns):**
|
||
|
|
- `int DASId { get; set; }` - Primary key (`[Key]`, mapped to column "DASId")
|
||
|
|
- `string SerialNumber { get; set; }` - Required, max length 50
|
||
|
|
- `int DASType { get; set; }` - DAS type identifier
|
||
|
|
- `int MaxModules { get; set; }` - Maximum module count
|
||
|
|
- `long MaxMemory { get; set; }` - Maximum memory in bytes
|
||
|
|
- `double MaxSampleRate { get; set; }` - Maximum sample rate (decimal(18,0) in DB)
|
||
|
|
- `double MinSampleRate { get; set; }` - Minimum sample rate (decimal(18,0) in DB)
|
||
|
|
- `string FirmwareVersion { get; set; }` - Firmware version string (max 50 chars)
|
||
|
|
- `DateTime CalDate { get; set; }` - Calibration date (defaults to `INVALID_DATE`)
|
||
|
|
- `int ProtocolVersion { get; set; }` - Protocol version number
|
||
|
|
- `DateTime LastModified { get; set; }` - Last modification timestamp
|
||
|
|
- `string LastModifiedBy { get; set; }` - User who last modified (max 50 chars)
|
||
|
|
- `int Version { get; set; }` - Record version
|
||
|
|
- `bool LocalOnly { get; set; }` - Whether record is local-only
|
||
|
|
- `DateTime LastUsed { get; set; }` - Last usage timestamp (defaults to `INVALID_DATE`)
|
||
|
|
- `string LastUsedBy { get; set; }` - User who last used (max 50 chars)
|
||
|
|
- `string Connection { get; set; }` - Connection string/info (max 50 chars)
|
||
|
|
- `int Channels { get; set; }` - Channel count
|
||
|
|
- `string Position { get; set; }` - Required position string (max 50 chars)
|
||
|
|
- `int[] ChannelTypes { get; set; }` - Array of channel type identifiers (max 255 chars in DB)
|
||
|
|
- `bool IsProgrammable { get; set; }` - Whether DAS is reprogrammable
|
||
|
|
- `bool IsReconfigurable { get; set; }` - Whether DAS is reconfigurable
|
||
|
|
- `bool IsModule { get; set; }` - Whether this is a module
|
||
|
|
- `int PositionOnDistributor { get; set; }` - Position index on distributor
|
||
|
|
- `int PositionOnChain { get; set; }` - Position index on chain
|
||
|
|
- `int Port { get; set; }` - Port number
|
||
|
|
- `string ParentDAS { get; set; }` - Parent DAS serial number (max 50 chars)
|
||
|
|
- `DateTime? FirstUseDate { get; set; }` - Nullable first use date
|
||
|
|
- `int? TestId { get; set; }` - Nullable test ID
|
||
|
|
- `int? GroupId { get; set; }` - Nullable group ID
|
||
|
|
- `bool StandIn { get; set; }` - Stand-in flag
|
||
|
|
- `double MaxAAFRate { get; set; }` - Maximum Anti-Alias Filter rate (decimal(18,0) in DB)
|
||
|
|
- `bool IsFirstUseValid { get; set; }` - Whether first use date is valid (references issue 15524)
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### DASChannelDBRecord
|
||
|
|
Entity class representing a DAS channel database record. Implements `IDASChannelDBRecord` and extends `BasePropertyChanged`.
|
||
|
|
|
||
|
|
**Constructors:**
|
||
|
|
- `DASChannelDBRecord()` - Default constructor
|
||
|
|
- `DASChannelDBRecord(IDataReader reader)` - Constructs from database reader
|
||
|
|
- `DASChannelDBRecord(IDASChannelDBRecord copy)` - Copy constructor
|
||
|
|
|
||
|
|
**Constants (Bitmask Defaults):**
|
||
|
|
- `const int DEFAULT_SUPPORTED_BRIDGES = 12` - Default: half bridge (4) + full bridge (8)
|
||
|
|
- `const int DEFAULT_SUPPORTED_EXCITATIONS = 16` - Default: 5V excitation
|
||
|
|
- `const int DEFAULT_SUPPORTED_DI_MODES = 16` - Default digital input mode (CCNC)
|
||
|
|
- `const int DEFAULT_SQUIB_FIRE_MODES = 16` - Default squib fire mode
|
||
|
|
- `const int DEFAULT_SUPPORTED_DO_MODES = 16` - Default digital output mode
|
||
|
|
|
||
|
|
**Properties:**
|
||
|
|
- `string HardwareId { get; set; }` - Composite ID: "{serialnumber}_{dastype}"
|
||
|
|
- `int DaschannelId { get; set; }` - Primary key (`[Key]`, mapped to "DASChannelId")
|
||
|
|
- `int? Dasid { get; set; }` - Foreign key to parent DAS record
|
||
|
|
- `int ChannelIdx { get; set; }` - Physical channel index on DAS
|
||
|
|
- `int SupportedBridges { get; set; }` - Bitmask: IEPE(0), quarter(1), half(2), full(3), DI(4), squib(5), DO(6), half-bridge-signal-plus(7), RTC(8), UART(9)
|
||
|
|
- `int SupportedExcitations { get; set; }` - Bitmask: invalid(0), 2V(1), 2.5V(2), 3V(3), 5V(4), 10V(5), 1V(6)
|
||
|
|
- `int DASDisplayOrder { get; set; }` - Display order (may differ from physical order)
|
||
|
|
- `bool LocalOnly { get; set; }` - Deprecated; indicates local-only storage
|
||
|
|
- `int SupportedDigitalInputModes { get; set; }` - Bitmask: invalid(0), TLH(1), THL(2), CCNO(3), CCNC(4)
|
||
|
|
- `int SupportedSquibFireModes { get; set; }` - Bitmask: invalid(0), capacitor-discharge(1), constant-current(2), AC-discharge(3)
|
||
|
|
- `int SupportedDigitalOutputModes { get; set; }` - Bitmask: FVLH(0), FVHL(1), CCNO(2), CCNC(3)
|
||
|
|
- `string ModuleSerialNumber { get; set; }` - Serial of containing module (max 16 chars)
|
||
|
|
- `int SettingId { get; set; }` - Setting ID reference
|
||
|
|
- `int ModuleArrayIndex { get; set; }` - Index of module within DAS/Rack
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### DASMonitorInfo
|
||
|
|
Class for persisting and retrieving DAS monitor configuration including tilt sensor calibration data. Implements `IDASMonitorInfo`.
|
||
|
|
|
||
|
|
**Constructors:**
|
||
|
|
- `DASMonitorInfo(IDASCommunication das, IsoViewMode mode)` - Constructs from live DAS communication object
|
||
|
|
- `DASMonitorInfo(string path)` - Constructs by reading from file at specified path
|
||
|
|
|
||
|
|
**Properties:**
|
||
|
|
- `string SerialNumber { get; private set; }` - DAS serial number
|
||
|
|
- `double[] TiltSensorCals { get; private set; }` - 18-element array of tilt sensor calibration values
|
||
|
|
- `short[] TiltSensorDataPre { get; private set; }` - 3-element array of pre-capture tilt data
|
||
|
|
- `DFConstantsAndEnums.TiltAxes TiltAxes { get; private set; }` - Tilt axis configuration (default: IXIYIZ)
|
||
|
|
- `int AxisIgnored { get; private set; }` - Which axis is ignored
|
||
|
|
- `double MountOffsetAxisOne { get; private set; }` - Mount offset for axis one (default: NaN)
|
||
|
|
- `double MountOffsetAxisTwo { get; private set; }` - Mount offset for axis two (default: NaN)
|
||
|
|
|
||
|
|
**Methods:**
|
||
|
|
- `string GetChannelName(int index)` - Returns channel name or generates default "Ch#XX" format
|
||
|
|
- `double GetOffsetTolerancemVHigh(int index)` - Returns high offset tolerance in mV
|
||
|
|
- `double GetOffsetTolerancemVLow(int index)` - Returns low offset tolerance in mV
|
||
|
|
- `void ReadFromFile(string path)` - Populates instance from file
|
||
|
|
- `void WriteToFile(string path)` - Serializes instance to file
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Invariants
|
||
|
|
|
||
|
|
1. **DASDBRecord.InvalidDate**: The `INVALID_DATE` constant (1970-01-01) serves as a sentinel value for unset date fields. Code comparing dates should account for this.
|
||
|
|
|
||
|
|
2. **DASDBRecord.FirstUseDate Validity**: `FirstUseDate` is only considered valid when `IsFirstUseValid` is `true`. A null `FirstUseDate` with `IsFirstUseValid == false` indicates the feature is not in use.
|
||
|
|
|
||
|
|
3. **DASDBRecord.ChannelTypes**: The `ChannelTypes` array is never null (defaults to `new int[0]`). The copy constructor performs a deep copy via `Array.Copy`.
|
||
|
|
|
||
|
|
4. **DASChannelDBRecord Bitmasks**: All `Supported*` properties use bit positions documented in XML comments. Bit 0 typically indicates "invalid" or "unset" for mode properties.
|
||
|
|
|
||
|
|
5. **DASMonitorInfo Array Sizes**:
|
||
|
|
- `TiltSensorCals` is
|