Files
2026-04-17 14:55:32 -04:00

4.1 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/Modules/DatabaseImporter/DatabaseImport/Enums/Hardware/HardwareTypes.cs
2026-04-16T04:32:55.929056+00:00 Qwen/Qwen3-Coder-Next-FP8 1 38a6927cd83972ad

Hardware

1. Purpose

This module defines the HardwareTypes enumeration, which serves as a canonical type-safe identifier for supported hardware devices within the DatabaseImport subsystem. It enables unambiguous referencing and mapping of physical hardware units (e.g., SLICE variants, TOM, SIM, DIM, G5-series devices) during data import operations—likely when correlating raw sensor data or configuration files with specific hardware models in the database. Its role is foundational: it standardizes hardware type representation across the import pipeline, ensuring consistent interpretation of device metadata.

2. Public Interface

The module exposes a single public type:

  • HardwareTypes (enum)
    A strongly-typed enumeration of hardware device types used in the system. Each member is assigned an explicit integer value starting from 0. The enum includes variants of SLICE hardware (e.g., SLICE_Base, SLICE2_IEPE_Hi, SLICE6DB), legacy/legacy-adjacent devices (TDAS_Pro_Rack, TDAS_LabRack), and specialized modules (TOM, SIM, DIM, Ribeye, G5INDUMMY, SLICE_EthernetController).
    Note: A commented-out entry //G5IPORT=22 exists, indicating a planned or deprecated type.

3. Invariants

  • Sequential integer values (mostly): All explicitly defined enum members have unique, non-overlapping integer values. However, the sequence is not strictly contiguous due to the commented-out G5IPORT=22—the value 22 is unused, and the next entry (G5INDUMMY) is 23.
  • No negative values: All enum values are ≥ 0.
  • No runtime validation: The enum itself enforces no semantic constraints (e.g., it does not prevent invalid combinations or enforce hardware-specific rules). Validation (if any) must occur elsewhere in the codebase.
  • Stable identity: The integer values are part of the public contract; changing them would break persistence (e.g., in database records or serialized configs).

4. Dependencies

  • No external dependencies: The file imports only the System namespace implicitly (via namespace declaration) and contains no using statements or external references.
  • Consumers: This enum is almost certainly referenced by other modules in the DatabaseImport namespace (e.g., classes handling hardware configuration parsing, database schema mapping, or device initialization). Based on naming conventions, consumers may include:
    • Hardware-specific importers (e.g., SLICEImporter, TOMImporter)
    • Database schema mappers (e.g., tables/columns storing HardwareType as an integer)
    • Configuration parsers (e.g., reading hardware type strings and mapping them to HardwareTypes enum values)
      Exact consumers cannot be determined from this file alone.

5. Gotchas

  • Non-contiguous numbering: The gap at value 22 (due to commented-out G5IPORT) may cause issues if downstream code assumes contiguous ranges (e.g., using Enum.GetValues(typeof(HardwareTypes)).Length for array sizing without filtering).
  • Commented-out member: G5IPORT=22 is commented out but not removed, which could mislead developers into expecting support for this type. Its status (deprecated, planned, or obsolete) is unclear.
  • No documentation on semantics: The enum provides no XML comments or inline descriptions explaining what each hardware type does (e.g., "SLICE_Bridge" vs. "SLICE2_Bridge_Hi"). This forces reliance on external documentation or reverse engineering.
  • Case sensitivity in string parsing: If string-to-enum conversion is used (e.g., from config files), the enum is case-sensitive (standard C# behavior), and mismatches (e.g., "slice_base" vs. "SLICE_Base") will fail unless explicitly handled.
  • No Flags attribute: The enum is not marked with [Flags], implying bitwise combinations are not intended—though this is not enforced by the compiler.

None identified beyond these.