169 lines
11 KiB
Markdown
169 lines
11 KiB
Markdown
|
|
---
|
|||
|
|
source_files:
|
|||
|
|
- Common/DTS.CommonCore/Enums/Hardware/HardwareListTags.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/Hardware/SLICEConfigurations.cs
|
|||
|
|
- Common/DTS.CommonCore/Enums/Hardware/HardwareTypes.cs
|
|||
|
|
generated_at: "2026-04-16T02:44:03.050936+00:00"
|
|||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
|||
|
|
schema_version: 1
|
|||
|
|
sha256: "3948c1a76438f900"
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# Hardware Enums and Constants Documentation
|
|||
|
|
|
|||
|
|
## 1. Purpose
|
|||
|
|
This module defines core enumerations and static utility methods for hardware type identification, configuration, and capability querying within the DTS system. It serves as a foundational layer for hardware abstraction—enabling consistent representation of device types (`HardwareTypes`), SLICE configurations (`SLICEConfigurations`), and metadata tags (`HardwareListTags`) across the codebase. The `HardwareConstants` class centralizes hardware-specific logic, such as feature support checks (e.g., trigger inversion, recording modes), embedded sensor detection, and sample rate constraints, ensuring consistent behavior across modules that interact with diverse data acquisition systems (DAS).
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 2. Public Interface
|
|||
|
|
|
|||
|
|
### Enumerations
|
|||
|
|
|
|||
|
|
#### `HardwareListTags`
|
|||
|
|
- **Namespace**: `DTS.Common.Enums.Hardware`
|
|||
|
|
- **Purpose**: Defines metadata tags used to identify or display hardware attributes in UI or data structures.
|
|||
|
|
- **Values**:
|
|||
|
|
- `Included`, `SerialNumber`, `HardwareType`, `ChannelCount`, `Firmware`, `MaxSampleRate`, `TestSampleRate`, `CalDate`, `CalDueDate`, `IPAddress`, `FirstUseDate`
|
|||
|
|
|
|||
|
|
#### `SLICEConfigurations`
|
|||
|
|
- **Namespace**: `DTS.Common.Enums.Hardware`
|
|||
|
|
- **Purpose**: Represents SLICE hardware configuration variants. Uses `EnumDescriptionTypeConverter` for localized descriptions.
|
|||
|
|
- **Values**:
|
|||
|
|
- `MEGA` → Description: `"SLICE_CONFIGURATION_MEGA"`
|
|||
|
|
- `EIGHT_HUNDRED` → Description: `"SLICE_CONFIGURATION_800K"`
|
|||
|
|
- `SEVEN_HUNDRED` → Description: `"SLICE_CONFIGURATION_700K"`
|
|||
|
|
- `SIX_HUNDRED` → Description: `"SLICE_CONFIGURATION_600K"`
|
|||
|
|
|
|||
|
|
#### `HardwareTypes`
|
|||
|
|
- **Namespace**: `DTS.Common.Enums.Hardware`
|
|||
|
|
- **Purpose**: Enumerates all supported hardware device types in the system. Uses `EnumDescriptionTypeConverter`. Includes legacy, embedded, and infrastructure devices.
|
|||
|
|
- **Key Values**:
|
|||
|
|
- `SLICE_Base` (0), `SLICE_Bridge` (1), `SLICE_Distributor` (2), `TDAS_Pro_Rack` (3)
|
|||
|
|
- `SLICE2_IEPE_Hi` (4) through `SLICE2_SLD` (30)
|
|||
|
|
- Embedded modules: `EMB_LIN_ACC_LO` (44) to `EMB_RTC_NS_PAD` (54)
|
|||
|
|
- Infrastructure: `TSR_AIR` (40), `TSR_AIR_RevB` (41), `DKR` (42), `DIR` (43)
|
|||
|
|
- `UNDEFINED` (38) for uninitialized/unknown devices
|
|||
|
|
|
|||
|
|
#### `SLICEBridgeTypes`
|
|||
|
|
- **Namespace**: `DTS.Common.Enums.Hardware`
|
|||
|
|
- **Purpose**: Specifies bridge module types for SLICE devices.
|
|||
|
|
- **Values**:
|
|||
|
|
- `Bridge`, `IEPE`, `ARS`, `ACC`, `RTC`, `UART`, `StreamOut`
|
|||
|
|
- All use `EnumDescriptionTypeConverter` with descriptive strings (e.g., `"BRIDGETYPE_BRIDGE_DESCRIPTION"`).
|
|||
|
|
|
|||
|
|
#### `RackSizes`
|
|||
|
|
- **Namespace**: `DTS.Common.Enums.Hardware`
|
|||
|
|
- **Purpose**: Defines rack size configurations.
|
|||
|
|
- **Values**:
|
|||
|
|
- `FOUR` → Description: `"RACK_SIZE_4M"`
|
|||
|
|
- `EIGHT` → Description: `"RACK_SIZE_8M"`
|
|||
|
|
|
|||
|
|
### Static Methods in `HardwareConstants`
|
|||
|
|
|
|||
|
|
#### `GetBrushForVoltageStatus(VoltageStatusColor status)`
|
|||
|
|
- **Return Type**: `SolidColorBrush`
|
|||
|
|
- **Behavior**: Maps a `VoltageStatusColor` enum value to a WPF `SolidColorBrush` for UI rendering.
|
|||
|
|
- `Green` → `BrushesAndColors.BrushApplicationStatusPowerGreen`
|
|||
|
|
- `Red` → `BrushesAndColors.BrushApplicationStatusPowerRed`
|
|||
|
|
- `Yellow` → `BrushesAndColors.BrushApplicationStatusPowerYellow`
|
|||
|
|
- `Off` or default → `BrushesAndColors.BrushApplicationStatusPowerClear`
|
|||
|
|
|
|||
|
|
#### `SupportsTriggerInversion(HardwareTypes type, int protocolVersion)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Returns `true` if the device supports trigger inversion. Currently supported devices include:
|
|||
|
|
- `SLICE1_5_Micro_Base`, `SLICE_Base`, `SLICE2_Base`, `SLICE_IEPE`, `SLICE1_5_Nano_Base`, `SLICE_Micro_Base`, `SLICE_NANO_Base`, `SLICE2_SIM`, `SLICE2_DIM`, `SLICE2_TOM`, `SLICE2_SLS`, `SLICE1_G5Stack`, `SLICE2_SLT`, `SLICE2_SLD`
|
|||
|
|
- **Note**: `protocolVersion` parameter is unused in current implementation.
|
|||
|
|
|
|||
|
|
#### `SupportsStartInversion(HardwareTypes type, int protocolVersion)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Returns `true` if the device supports start inversion. Includes all devices from `SupportsTriggerInversion`, plus `SLICE6_AIR`.
|
|||
|
|
- **Note**: `protocolVersion` parameter is unused.
|
|||
|
|
|
|||
|
|
#### `IsEthernetRecorder(HardwareTypes type)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Returns `true` only for `HardwareTypes.S6A_EthernetRecorder`.
|
|||
|
|
|
|||
|
|
#### `HasEmbeddedSensors(HardwareTypes hardware)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Returns `true` for embedded sensor modules:
|
|||
|
|
- `EMB_ANG_ACC`, `EMB_ANG_ARS`, `EMB_ATM`, `EMB_LIN_ACC_HI`, `EMB_LIN_ACC_LO`, `EMB_MAG`, `EMB_MAG_SWITCH`, `EMB_MIC`, `EMB_OPT`, `EMB_RTC_NS_PAD`, `EMB_RTC_S_MARK`, `TSR_AIR`, `TSR_AIR_RevB`, `DIR`, `DKR`
|
|||
|
|
|
|||
|
|
#### `HasEmbeddedChannelType(HardwareTypes hardware, string channelType)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Determines if a given `channelType` (e.g., `"LOWG_SERIAL_APPEND"`) is supported on the device.
|
|||
|
|
- `TSR_AIR`/`TSR_AIR_RevB`: All channel types return `true`.
|
|||
|
|
- `DIR`: Supports `HIGHG_SERIAL_APPEND`.
|
|||
|
|
- `DKR`: Only supports embedded channels (per `HasEmbeddedSensors`).
|
|||
|
|
- Other devices: Strict per-channel-type logic (e.g., `MICROPHONE_SERIAL_APPEND` supported on all except `DKR`).
|
|||
|
|
|
|||
|
|
#### `IsRecordingModeSupported(RecordingModes mode, HardwareTypes dasType, int protocolVersion, bool includeNativeSupportOnly = false)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Checks if a `RecordingModes` value is supported by the hardware.
|
|||
|
|
- Non-`TSR_AIR` devices: Support `CircularBuffer` and `Recorder` (and optionally their UART variants).
|
|||
|
|
- `SLICE6DB_InDummy`, `SLICE6DB3`, `SLICE6DB`: Support `RAMActive` and `MultipleEventRAMActive`.
|
|||
|
|
- Specific devices delegate to dedicated static classes (e.g., `SLICE6AIR.IsRecordingModeSupported`).
|
|||
|
|
- Unsupported devices (`DIM`, `G5INDUMMY`, `Ribeye`, `TDAS_Pro_Rack`, etc.) return `false`.
|
|||
|
|
|
|||
|
|
#### `MaxSampleRateForRecordingMode(IDASHardware h, RecordingModes mode, int protocolVersion = 1, uint baudRate = 9600)`
|
|||
|
|
- **Return Type**: `double`
|
|||
|
|
- **Behavior**: Returns the maximum sample rate for a given recording mode.
|
|||
|
|
- For `SLICE6_AIR`: Delegates to `SLICE6AIR.MaxSampleRateHzForRecordingMode`.
|
|||
|
|
- For `S6A_EthernetRecorder`: Returns `SLICE6AIR.MaxSampleRateHz_OBRDDR`.
|
|||
|
|
- Otherwise: Calls `h.GetMaxSampleRateDouble()`.
|
|||
|
|
|
|||
|
|
#### `IsStreamingProfileSupported(UDPStreamProfile profile, HardwareTypes dasType, int protocolVersion, bool includeNativeSupportOnly = false)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Checks streaming support. Only `SLICE6_Base`, `SLICE6_AIR`, `SLICE6_AIR_BR`, `TSR_AIR`, and `TSR_AIR_RevB` support streaming. Others return `false`.
|
|||
|
|
|
|||
|
|
#### `IsClockSyncProfileSupported(ClockSyncProfile profile, HardwareTypes dasType, int protocolVersion, bool includeNativeSupportOnly, bool master)`
|
|||
|
|
- **Return Type**: `bool`
|
|||
|
|
- **Behavior**: Checks clock sync support. Delegates to device-specific classes (`SLICE6`, `SLICE6AIR`, `TSRAIR`, `SLICE6DB`). Unsupported devices return `false`.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 3. Invariants
|
|||
|
|
|
|||
|
|
- **HardwareType Values**:
|
|||
|
|
- `UNDEFINED` (38) is reserved for uninitialized/unknown devices.
|
|||
|
|
- Values 0–58 are explicitly defined; gaps (e.g., 22, 35) indicate deprecated/unused entries.
|
|||
|
|
- **Embedded Sensors**:
|
|||
|
|
- Devices with `HasEmbeddedSensors(hardware) == true` must only expose channels defined in `HasEmbeddedChannelType`.
|
|||
|
|
- **Recording Modes**:
|
|||
|
|
- `TSR_AIR`/`TSR_AIR_RevB` devices have restricted recording mode support (handled by `TSRAIR.IsRecordingModeSupported`).
|
|||
|
|
- `SLICE6DB_InDummy`, `SLICE6DB3`, `SLICE6DB` have unique support for `RAMActive` modes.
|
|||
|
|
- **Trigger/Start Inversion**:
|
|||
|
|
- Supported only for SLICE-family devices (SLICE1, SLICE1.5, SLICE2) and embedded modules (`TSR_AIR`, `DIR`, `DKR`).
|
|||
|
|
- USB connectivity is implied as a prerequisite (per comments), though not enforced in code.
|
|||
|
|
- **Ethernet Recorders**:
|
|||
|
|
- Only `S6A_EthernetRecorder` is recognized as an Ethernet recorder.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 4. Dependencies
|
|||
|
|
|
|||
|
|
### Imports/References
|
|||
|
|
- **`DTS.Common.Converters`**: `EnumDescriptionTypeConverter` for UI localization.
|
|||
|
|
- **`System.ComponentModel`**: `DescriptionAttribute` for enum descriptions.
|
|||
|
|
- **`System.Windows.Media`**: `SolidColorBrush` and `BrushesAndColors` for UI rendering.
|
|||
|
|
- **`DTS.Common.Constant.DASSpecific`**: Constants like `LOWG_SERIAL_APPEND` used in `HasEmbeddedChannelType`.
|
|||
|
|
- **`DTS.Common.Interface.DataRecorders`**: `IDASHardware` interface for `MaxSampleRateForRecordingMode`.
|
|||
|
|
- **`DFConstantsAndEnums`**: `VoltageStatusColor` and serial append constants (e.g., `LOWG_SERIAL_APPEND`).
|
|||
|
|
|
|||
|
|
### Used By
|
|||
|
|
- UI layers (via `HardwareListTags` and `GetBrushForVoltageStatus`).
|
|||
|
|
- Device configuration and discovery modules (via `HardwareTypes`, `SLICEConfigurations`).
|
|||
|
|
- Recording/streaming logic (via `IsRecordingModeSupported`, `IsStreamingProfileSupported`).
|
|||
|
|
- Embedded sensor validation (via `HasEmbeddedSensors`, `HasEmbeddedChannelType`).
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 5. Gotchas
|
|||
|
|
|
|||
|
|
- **`protocolVersion` Unused**: Parameters in `SupportsTriggerInversion`, `SupportsStartInversion`, and `IsRecordingModeSupported` are declared but not used in current implementation.
|
|||
|
|
- **`AllowSoftDisconnects` Global State**: A mutable static property (`HardwareConstants.AllowSoftDisconnects`) must be set by the application; its default (`false`) may cause unexpected behavior if not explicitly configured.
|
|||
|
|
- **Embedded Channel Logic**: `HasEmbeddedChannelType` returns `true` for all channel types on `TSR_AIR`/`TSR_AIR_RevB`, but `false` for others—even if embedded sensors exist (e.g., `EMB_ATM` has no channel type mapping).
|
|||
|
|
- **`IsRecordingModeSupported` "HACK"**: Non-`TSR_AIR` devices unconditionally support UART variants (`CircularBufferPlusUART`, `RecorderPlusUART`) unless `includeNativeSupportOnly=true`, which may mislead callers expecting strict mode validation.
|
|||
|
|
- **`SLICE6DB_AIR` Commented Out**: The enum value `SLICE6DB_AIR = 35` is commented as "doesn't exist", but the infrastructure comment suggests future use.
|
|||
|
|
- **`SLICE6AIRBR` vs `SLICE6_AIR_BR`**: The enum uses `SLICE6_AIR_BR` (with underscore), but the code references `SLICE6AIRBR` (no underscore) in `IsRecordingModeSupported`—indicating a potential naming inconsistency.
|
|||
|
|
- **`MaxSampleRateForRecordingMode` Signature**: Uses `IDASHardware` interface, but `SLICE6AIR.MaxSampleRateHz_OBRDDR` is a static property—suggesting tight coupling to specific implementations.
|