11 KiB
11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T02:44:03.050936+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 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
EnumDescriptionTypeConverterfor 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) throughSLICE2_SLD(30)- Embedded modules:
EMB_LIN_ACC_LO(44) toEMB_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
EnumDescriptionTypeConverterwith 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
VoltageStatusColorenum value to a WPFSolidColorBrushfor UI rendering.Green→BrushesAndColors.BrushApplicationStatusPowerGreenRed→BrushesAndColors.BrushApplicationStatusPowerRedYellow→BrushesAndColors.BrushApplicationStatusPowerYellowOffor default →BrushesAndColors.BrushApplicationStatusPowerClear
SupportsTriggerInversion(HardwareTypes type, int protocolVersion)
- Return Type:
bool - Behavior: Returns
trueif 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:
protocolVersionparameter is unused in current implementation.
SupportsStartInversion(HardwareTypes type, int protocolVersion)
- Return Type:
bool - Behavior: Returns
trueif the device supports start inversion. Includes all devices fromSupportsTriggerInversion, plusSLICE6_AIR. - Note:
protocolVersionparameter is unused.
IsEthernetRecorder(HardwareTypes type)
- Return Type:
bool - Behavior: Returns
trueonly forHardwareTypes.S6A_EthernetRecorder.
HasEmbeddedSensors(HardwareTypes hardware)
- Return Type:
bool - Behavior: Returns
truefor 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 returntrue.DIR: SupportsHIGHG_SERIAL_APPEND.DKR: Only supports embedded channels (perHasEmbeddedSensors).- Other devices: Strict per-channel-type logic (e.g.,
MICROPHONE_SERIAL_APPENDsupported on all exceptDKR).
IsRecordingModeSupported(RecordingModes mode, HardwareTypes dasType, int protocolVersion, bool includeNativeSupportOnly = false)
- Return Type:
bool - Behavior: Checks if a
RecordingModesvalue is supported by the hardware.- Non-
TSR_AIRdevices: SupportCircularBufferandRecorder(and optionally their UART variants). SLICE6DB_InDummy,SLICE6DB3,SLICE6DB: SupportRAMActiveandMultipleEventRAMActive.- Specific devices delegate to dedicated static classes (e.g.,
SLICE6AIR.IsRecordingModeSupported). - Unsupported devices (
DIM,G5INDUMMY,Ribeye,TDAS_Pro_Rack, etc.) returnfalse.
- Non-
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 toSLICE6AIR.MaxSampleRateHzForRecordingMode. - For
S6A_EthernetRecorder: ReturnsSLICE6AIR.MaxSampleRateHz_OBRDDR. - Otherwise: Calls
h.GetMaxSampleRateDouble().
- For
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, andTSR_AIR_RevBsupport streaming. Others returnfalse.
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 returnfalse.
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) == truemust only expose channels defined inHasEmbeddedChannelType.
- Devices with
- Recording Modes:
TSR_AIR/TSR_AIR_RevBdevices have restricted recording mode support (handled byTSRAIR.IsRecordingModeSupported).SLICE6DB_InDummy,SLICE6DB3,SLICE6DBhave unique support forRAMActivemodes.
- 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.
- Supported only for SLICE-family devices (SLICE1, SLICE1.5, SLICE2) and embedded modules (
- Ethernet Recorders:
- Only
S6A_EthernetRecorderis recognized as an Ethernet recorder.
- Only
4. Dependencies
Imports/References
DTS.Common.Converters:EnumDescriptionTypeConverterfor UI localization.System.ComponentModel:DescriptionAttributefor enum descriptions.System.Windows.Media:SolidColorBrushandBrushesAndColorsfor UI rendering.DTS.Common.Constant.DASSpecific: Constants likeLOWG_SERIAL_APPENDused inHasEmbeddedChannelType.DTS.Common.Interface.DataRecorders:IDASHardwareinterface forMaxSampleRateForRecordingMode.DFConstantsAndEnums:VoltageStatusColorand serial append constants (e.g.,LOWG_SERIAL_APPEND).
Used By
- UI layers (via
HardwareListTagsandGetBrushForVoltageStatus). - Device configuration and discovery modules (via
HardwareTypes,SLICEConfigurations). - Recording/streaming logic (via
IsRecordingModeSupported,IsStreamingProfileSupported). - Embedded sensor validation (via
HasEmbeddedSensors,HasEmbeddedChannelType).
5. Gotchas
protocolVersionUnused: Parameters inSupportsTriggerInversion,SupportsStartInversion, andIsRecordingModeSupportedare declared but not used in current implementation.AllowSoftDisconnectsGlobal 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:
HasEmbeddedChannelTypereturnstruefor all channel types onTSR_AIR/TSR_AIR_RevB, butfalsefor others—even if embedded sensors exist (e.g.,EMB_ATMhas no channel type mapping). IsRecordingModeSupported"HACK": Non-TSR_AIRdevices unconditionally support UART variants (CircularBufferPlusUART,RecorderPlusUART) unlessincludeNativeSupportOnly=true, which may mislead callers expecting strict mode validation.SLICE6DB_AIRCommented Out: The enum valueSLICE6DB_AIR = 35is commented as "doesn't exist", but the infrastructure comment suggests future use.SLICE6AIRBRvsSLICE6_AIR_BR: The enum usesSLICE6_AIR_BR(with underscore), but the code referencesSLICE6AIRBR(no underscore) inIsRecordingModeSupported—indicating a potential naming inconsistency.MaxSampleRateForRecordingModeSignature: UsesIDASHardwareinterface, butSLICE6AIR.MaxSampleRateHz_OBRDDRis a static property—suggesting tight coupling to specific implementations.