8.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:13:13.284640+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 8526536e9586e406 |
HardwareScan
Documentation: Hardware Scan Module
1. Purpose
This module defines the core interfaces for the Hardware Scan feature within the DTS (Diagnostic Test System) framework. It provides a contract layer for view-model and view implementations that handle hardware inventory scanning, status reporting, and channel summary aggregation—specifically for TTS (Test Tool Suite) import workflows. The interfaces standardize how hardware components (e.g., DOut, DIn, Squib, Analog, ECM, SPS, SPD, SPT, G5, Rack) are tracked, summarized, and displayed during a scan operation, enabling decoupled UI and business logic for hardware diagnostics.
2. Public Interface
Interfaces
-
IHardwareScanView : IBaseView
Marker interface for the view layer of the hardware scan UI. ExtendsIBaseView, implying it participates in the standard view lifecycle (e.g., binding, lifecycle management). No additional members defined. -
IChannelSummary : IBaseClass
Represents aggregated statistics for a channel type.string ChannelType { get; set; }– Identifier for the channel category (e.g., "DOUT", "ANALOG").int Requested { get; set; }– Number of channels requested for this type.int Assigned { get; set; }– Number of channels assigned during scan.int Unassigned { get; set; }– Number of channels requested but not assigned.
-
IDasSummary : IBaseClass
Encapsulates DAS (Data Acquisition System) hardware status.string DASSerial { get; set; }– Serial number of the DAS unit.string EIDFound { get; set; }– EID (Equipment ID) detected on the DAS.string BatteryVoltageStatus { get; set; }– Status string for battery voltage (e.g., "OK", "LOW").System.Windows.Media.SolidColorBrush BatteryVoltageColor { get; set; }– UI color brush for battery status.string InputVoltageStatus { get; set; }– Status string for input voltage.System.Windows.Media.SolidColorBrush InputVoltageColor { get; set; }– UI color brush for input voltage status.
-
IHardwareSummaryRecord
Represents a single hardware summary record (e.g., per subsystem or test station).uint DOut { get; set; }– Count of digital output channels.uint DIn { get; set; }– Count of digital input channels.uint Squib { get; set; }– Count of squib (explosive device) channels.uint Analog { get; set; }– Count of analog channels.uint Total { get; }– Read-only total of all channel counts (computed).uint SPS { get; set; }– Count of SPS (Switch Power Supply) units.uint SPD { get; set; }– Count of SPD (Switch Power Distributor) units.uint SPT { get; set; }– Count of SPT (Switch Power Terminal) units.uint ECM { get; set; }– Count of ECM (Engine Control Module) units.uint Rack { get; set; }– Count of rack-mounted units.uint G5 { get; set; }– Count of G5 units.void UpdateTotal()– Recalculates and updates theTotalproperty based on current counts.void Update(uint analog, uint squib, uint din, uint dout, uint ecm, uint sps, uint spt, uint spd, uint g5, uint rack)– Updates all channel/unit counts in one call; likely triggersUpdateTotal()internally.
-
IHardwareScanViewModel : IBaseViewModel
View-model interface for orchestrating the hardware scan process.IHardwareScanView View { get; set; }– Reference to the associated view.IHardwareSummaryRecord[] HardwareRecords { get; }– Read-only array of hardware summary records.void SetStatus(string status)– Updates the UI status text (e.g., "Scanning...", "Complete").void SetProgress(double progress)– Updates progress indicator (range: 0.0–1.0).void HardwareScan()– Initiates the hardware scan operation.void SetChannelSummaryList(ITTSChannelRecord[] channelRecords)– Populates channel summary data from raw channel records.
Delegates
HardwareScanDelegate
Delegate signature for hardware scan operations:void HardwareScanDelegate(). Used to decouple scan invocation (e.g., for threading or event handling).
3. Invariants
IHardwareSummaryRecord.Totalis a computed property and must reflect the sum of all channel/unit counts (DOut + DIn + Squib + Analog + ECM + SPS + SPD + SPT + G5 + Rack).IHardwareSummaryRecord.UpdateTotal()must be called (explicitly or implicitly viaUpdate()) to ensureTotalremains consistent after any count modification.IChannelSummary.Requested = Assigned + Unassignedmust hold for all records (implied by semantics, though not enforced by interface).IDasSummaryproperties (BatteryVoltageStatus,InputVoltageStatus) and their associated color brushes (BatteryVoltageColor,InputVoltageColor) must be kept in sync (e.g., "OK" ↔ green, "LOW" ↔ red).IHardwareScanViewModel.HardwareRecordsis read-only; modifications require reassignment or internal mutation via the view-model’s logic (interface does not expose setters for the array itself).
4. Dependencies
Dependencies of this module:
DTS.Common.Base: Provides base interfacesIBaseView,IBaseClass, andIBaseViewModel.System.Windows.Media: Used forSolidColorBrushinIDasSummary(WPF-specific).DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile: ReferencesITTSChannelRecord[]inIHardwareScanViewModel.SetChannelSummaryList().DTS.Common.Utils: Imported but no direct usage visible in this module (may be used in implementations).
Dependencies on this module:
- Any UI layer implementation (e.g., WPF views) must implement
IHardwareScanView. - View-model implementations (e.g., for TTS hardware scan workflows) must implement
IHardwareScanViewModel. - Components consuming hardware scan results (e.g., reporting, validation) depend on
IHardwareSummaryRecord,IChannelSummary, andIDasSummary.
5. Gotchas
IHardwareSummaryRecord.Totalis read-only: Its value is not automatically updated when individual counts change; callers must invokeUpdateTotal()orUpdate()to maintain correctness.IHardwareScanViewModel.HardwareRecordsis an array: Arrays are mutable in C#, but the interface exposes it as read-only (get;only). However, the contents of the array (i.e.,IHardwareSummaryRecordobjects) may still be mutable—callers should assume reference semantics and avoid external mutation unless documented otherwise.- WPF dependency:
IDasSummaryusesSystem.Windows.Media.SolidColorBrush, making this module tightly coupled to WPF. It cannot be used in non-UI or cross-platform contexts without abstraction. SetChannelSummaryListsignature: TakesITTSChannelRecord[], butITTSChannelRecordis not defined in the provided files. Its structure and relationship toIChannelSummarymust be inferred from external sources.- No error handling exposed:
HardwareScan()andSetChannelSummaryList()lack explicit error reporting (e.g., exceptions, return codes, or status callbacks). Error handling is likely implicit (e.g., viaSetStatus()or exceptions thrown by implementations). HardwareScanDelegateis unused in interfaces: Defined but not referenced in any interface method—likely intended for internal use in concrete implementations (e.g., async/await or threading).
None identified beyond the above.