init
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IHardwareScanView.cs
|
||||
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IChannelSummary.cs
|
||||
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IDasSummary.cs
|
||||
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IHardwareSummaryRecord.cs
|
||||
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IHardwareScanViewModel.cs
|
||||
generated_at: "2026-04-16T03:13:13.284640+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "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. Extends `IBaseView`, 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 the `Total` property 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 triggers `UpdateTotal()` 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.Total` is 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 via `Update()`) to ensure `Total` remains consistent after any count modification.
|
||||
- `IChannelSummary.Requested = Assigned + Unassigned` must hold for all records (implied by semantics, though not enforced by interface).
|
||||
- `IDasSummary` properties (`BatteryVoltageStatus`, `InputVoltageStatus`) and their associated color brushes (`BatteryVoltageColor`, `InputVoltageColor`) must be kept in sync (e.g., "OK" ↔ green, "LOW" ↔ red).
|
||||
- `IHardwareScanViewModel.HardwareRecords` is 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 interfaces `IBaseView`, `IBaseClass`, and `IBaseViewModel`.
|
||||
- **`System.Windows.Media`**: Used for `SolidColorBrush` in `IDasSummary` (WPF-specific).
|
||||
- **`DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile`**: References `ITTSChannelRecord[]` in `IHardwareScanViewModel.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`, and `IDasSummary`.
|
||||
|
||||
---
|
||||
|
||||
### 5. Gotchas
|
||||
- **`IHardwareSummaryRecord.Total` is read-only**: Its value is *not* automatically updated when individual counts change; callers *must* invoke `UpdateTotal()` or `Update()` to maintain correctness.
|
||||
- **`IHardwareScanViewModel.HardwareRecords` is 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., `IHardwareSummaryRecord` objects) may still be mutable—callers should assume reference semantics and avoid external mutation unless documented otherwise.
|
||||
- **WPF dependency**: `IDasSummary` uses `System.Windows.Media.SolidColorBrush`, making this module tightly coupled to WPF. It cannot be used in non-UI or cross-platform contexts without abstraction.
|
||||
- **`SetChannelSummaryList` signature**: Takes `ITTSChannelRecord[]`, but `ITTSChannelRecord` is not defined in the provided files. Its structure and relationship to `IChannelSummary` must be inferred from external sources.
|
||||
- **No error handling exposed**: `HardwareScan()` and `SetChannelSummaryList()` lack explicit error reporting (e.g., exceptions, return codes, or status callbacks). Error handling is likely implicit (e.g., via `SetStatus()` or exceptions thrown by implementations).
|
||||
- **`HardwareScanDelegate` is 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.
|
||||
Reference in New Issue
Block a user