init
This commit is contained in:
173
docs/ai/Common/DTS.Common/Enums/Hardware.md
Normal file
173
docs/ai/Common/DTS.Common/Enums/Hardware.md
Normal file
@@ -0,0 +1,173 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Enums/Hardware/HardwareListTags.cs
|
||||
- Common/DTS.Common/Enums/Hardware/SLICETCConfigurations.cs
|
||||
- Common/DTS.Common/Enums/Hardware/SLICEConfigurations.cs
|
||||
- Common/DTS.Common/Enums/Hardware/HardwareTypes.cs
|
||||
generated_at: "2026-04-17T15:38:25.598144+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "ed0388408df57875"
|
||||
---
|
||||
|
||||
# Documentation: DTS.Common.Enums.Hardware
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module defines the core hardware enumeration types and constants for the DTS (Data Translation System) hardware platform. It provides a centralized definition of hardware types (SLICE, TDAS, TSR, and embedded sensor modules), hardware list metadata tags, configuration variants, and an abstract `HardwareConstants` class containing utility methods for hardware capability detection, recording mode validation, and feature support queries. This module serves as the foundational type system for hardware identification and capability negotiation throughout the DTS codebase.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Enums
|
||||
|
||||
#### `HardwareListTags`
|
||||
Defines metadata tags for hardware list entries.
|
||||
```csharp
|
||||
public enum HardwareListTags
|
||||
{
|
||||
Included,
|
||||
SerialNumber,
|
||||
HardwareType,
|
||||
ChannelCount,
|
||||
Firmware,
|
||||
MaxSampleRate,
|
||||
TestSampleRate,
|
||||
DSPStreamingFilter,
|
||||
CalDate,
|
||||
CalDueDate,
|
||||
IPAddress,
|
||||
FirstUseDate
|
||||
}
|
||||
```
|
||||
|
||||
#### `SLICETCConfigurations`
|
||||
Defines SLICE-TC configuration variants. Decorated with `[TypeConverter(typeof(EnumDescriptionTypeConverter))]`.
|
||||
```csharp
|
||||
public enum SLICETCConfigurations
|
||||
{
|
||||
[Description("SLICETC_CONFIGURATION_24")] TWENTYFOUR,
|
||||
[Description("SLICETC_CONFIGURATION_16")] SIXTEEN,
|
||||
[Description("SLICETC_CONFIGURATION_8")] EIGHT
|
||||
}
|
||||
```
|
||||
|
||||
#### `SLICEPROSIMConfigurations`
|
||||
Defines SLICE Pro/ProSim configuration variants. Decorated with `[TypeConverter(typeof(EnumDescriptionTypeConverter))]`.
|
||||
```csharp
|
||||
public enum SLICEPROSIMConfigurations
|
||||
{
|
||||
[Description("SLICE_CONFIGURATION_MEGA")] MEGA,
|
||||
[Description("SLICE_CONFIGURATION_800K")] EIGHT_HUNDRED,
|
||||
[Description("SLICE_CONFIGURATION_700K")] SEVEN_HUNDRED,
|
||||
[Description("SLICE_CONFIGURATION_600K")] SIX_HUNDRED
|
||||
}
|
||||
```
|
||||
|
||||
#### `HardwareTypes`
|
||||
Defines all supported hardware device types with explicit integer values (0-60). Decorated with `[TypeConverter(typeof(EnumDescriptionTypeConverter))]`. Key values include:
|
||||
- `SLICE_Base = 0` through `SLICE_PRO_CAN_FD = 60`
|
||||
- Notable families: SLICE, SLICE2, SLICE6, TDAS, TSR, embedded sensor modules (EMB_*), and special types like `UNDEFINED = 38`
|
||||
|
||||
#### `SLICEBridgeTypes`
|
||||
Defines bridge module types. Decorated with `[TypeConverter(typeof(EnumDescriptionTypeConverter))]`.
|
||||
```csharp
|
||||
public enum SLICEBridgeTypes
|
||||
{
|
||||
Bridge, IEPE, ARS, ACC, RTC, UART, StreamOut, Thermocoupler, CAN
|
||||
}
|
||||
```
|
||||
|
||||
#### `RackSizes`
|
||||
Defines rack size configurations. Decorated with `[TypeConverter(typeof(EnumDescriptionTypeConverter))]`.
|
||||
```csharp
|
||||
public enum RackSizes
|
||||
{
|
||||
[Description("RACK_SIZE_4M")] FOUR,
|
||||
[Description("RACK_SIZE_8M")] EIGHT
|
||||
}
|
||||
```
|
||||
|
||||
### HardwareConstants Class
|
||||
|
||||
#### Constants
|
||||
```csharp
|
||||
public const int TSRAIR_MAXSLICENABLE_VERSION = 28;
|
||||
public const int TSR_AIR_MAX_MODULES = 6;
|
||||
public const string TSR_AIR_PREPEND = "TA";
|
||||
public const int INVALID_IDASCOMMUNICATION_RECORD_ID = -1;
|
||||
public const int DEFAULTMEMORYSIZE_PRO = 16000000;
|
||||
public const int DEFAULTMEMORYSIZE_DIM = 2000000;
|
||||
public const int DEFAULTMEMORYSIZE_TOM = 2000000;
|
||||
```
|
||||
|
||||
#### Properties
|
||||
```csharp
|
||||
public static bool AllowSoftDisconnects { get; set; } = false;
|
||||
```
|
||||
|
||||
#### Methods
|
||||
|
||||
```csharp
|
||||
public static bool IsTSRAIRSerialNumber(string serialNumber)
|
||||
```
|
||||
Returns `true` if the serial number starts with "TA" prefix; returns `false` for null or empty strings.
|
||||
|
||||
```csharp
|
||||
public static SolidColorBrush GetBrushForVoltageStatus(DFConstantsAndEnums.VoltageStatusColor status)
|
||||
```
|
||||
Maps voltage status colors to WPF brush objects from `BrushesAndColors`.
|
||||
|
||||
```csharp
|
||||
public static bool SupportsTriggerInversion(HardwareTypes type, int protocolVersion)
|
||||
```
|
||||
Returns `true` for SLICE1, SLICE1.5, SLICE2 variants (including IEPE, Nano, Micro, SIM, DIM, TOM, SLS, G5Stack, SLT, SLD). Returns `false` for all other hardware types. Note: `protocolVersion` parameter is accepted but not used in the implementation.
|
||||
|
||||
```csharp
|
||||
public static bool SupportsStartInversion(HardwareTypes type, int protocolVersion)
|
||||
```
|
||||
Returns `true` for the same hardware types as `SupportsTriggerInversion` plus `SLICE6_AIR`. Note: `protocolVersion` parameter is accepted but not used in the implementation.
|
||||
|
||||
```csharp
|
||||
public static bool IsEthernetRecorder(HardwareTypes type)
|
||||
```
|
||||
Returns `true` only for `HardwareTypes.S6A_EthernetRecorder`.
|
||||
|
||||
```csharp
|
||||
public static bool HasEmbeddedSensors(HardwareTypes hardware)
|
||||
```
|
||||
Returns `true` for EMB_* module types, TSR_AIR variants, DIR, DKR, and SLICE6_AIR_TC.
|
||||
|
||||
```csharp
|
||||
public static bool HasEmbeddedChannelType(HardwareTypes hardware, string channelType)
|
||||
```
|
||||
Determines if a channel type is supported by embedded hardware. Uses `DFConstantsAndEnums` string constants for channel type comparison. TSR_AIR and TSR_AIR_RevB always return `true`.
|
||||
|
||||
```csharp
|
||||
public static bool IsRecordingModeSupported(RecordingModes mode, HardwareTypes dasType, int protocolVersion, bool includeNativeSupportOnly = false)
|
||||
```
|
||||
Dispatches to hardware-specific recording mode validation. Delegates to `SLICE1_5`, `SLICE6`, `SLICE6AIR`, `SLICE6AIRBR`, `SLICE2_TOM`, `TSRAIR`, `SLICE6AIRTC`, `SLICE6DB` classes based on hardware type.
|
||||
|
||||
```csharp
|
||||
public static double MaxSampleRateForRecordingMode(IDASHardware h, RecordingModes mode, int protocolVersion = 1, uint baudRate = 0)
|
||||
```
|
||||
Returns maximum sample rate for a recording mode. Dispatches to `SLICE6AIR.MaxSampleRateHzForRecordingMode` for SLICE6_AIR, or `SLICE6AIR.MaxSampleRateHz_OBRDDR` for S6A_EthernetRecorder; otherwise uses `IDASHardware.GetMaxSampleRateDouble()`.
|
||||
|
||||
```csharp
|
||||
public static bool IsStreamingProfileSupported(UDPStreamProfile profile, HardwareTypes dasType, int protocolVersion, bool includeNativeSupportOnly = false)
|
||||
```
|
||||
Dispatches streaming profile validation to `SLICE6`, `SLICE6AIR`, `SLICE6AIRBR`, `TSRAIR`, or `SLICE6AIRTC` classes.
|
||||
|
||||
```csharp
|
||||
public static bool IsClockSyncProfileSupported(ClockSyncProfile profile, HardwareTypes dasType, int protocolVersion, bool includeNativeSupportOnly, bool master)
|
||||
```
|
||||
Dispatches clock sync profile validation to hardware-specific implementation classes.
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **HardwareTypes enum values are explicitly assigned** and must remain stable for serialization/persistence compatibility (values 0-60 defined, with 22 and 35 commented out/unused).
|
||||
- **TSR_AIR serial numbers** must start with "TA" prefix to be identified by `IsTSRAIRSerialNumber`.
|
||||
- **HardwareConstants.AllowSoftDisconnects** is a global mutable state that must be set by the application at startup
|
||||
Reference in New Issue
Block a user