Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common/Interface/Hardware/HardwareList.md

87 lines
9.2 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Interface/Hardware/HardwareList/ISLICE6TreeView.cs
- Common/DTS.Common/Interface/Hardware/HardwareList/IHardwareListView.cs
- Common/DTS.Common/Interface/Hardware/HardwareList/IHardwareListOverdueView.cs
- Common/DTS.Common/Interface/Hardware/HardwareList/IHardwareListReplaceView.cs
- Common/DTS.Common/Interface/Hardware/HardwareList/IHardwareListSelectView.cs
- Common/DTS.Common/Interface/Hardware/HardwareList/ISLICE6TreeNode.cs
- Common/DTS.Common/Interface/Hardware/HardwareList/IHardware.cs
- Common/DTS.Common/Interface/Hardware/HardwareList/IHardwareListViewModel.cs
generated_at: "2026-04-16T03:06:05.557409+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "a6c557fc6025ec40"
---
# HardwareList
## Documentation: Hardware List Module (DTS.Common.Interface.DASFactory.Diagnostics.HardwareList)
---
### 1. Purpose
This module defines the interfaces for a hardware management and diagnostics view layer in the DASFactory system, specifically supporting the display, selection, association, and replacement of hardware units (e.g., DAS units, SLICE6 modules, bridges) within test setups. It provides a structured abstraction for UI components (views) and their corresponding state and logic (view model), enabling operations such as filtering, sorting, calibration tracking, sample rate configuration, clock synchronization (PTP), and hardware tree navigation (e.g., SLICE6 units associated with a SLICE6DB). Its role is to decouple UI rendering from business logic while supporting multiple specialized views (e.g., overdue, replace, select, tree) for different hardware management workflows.
---
### 2. Public Interface
#### Interfaces (All in namespace `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList`)
| Interface | Signature | Behavior |
|-----------|-----------|----------|
| **`ISLICE6TreeView`** | `interface ISLICE6TreeView : IBaseView` | Represents the view responsible for rendering the SLICE6 hardware tree. No additional behavior beyond `IBaseView`. |
| **`IHardwareListView`** | `interface IHardwareListView : IBaseView` | General-purpose view for displaying the main hardware list. No additional behavior beyond `IBaseView`. |
| **`IHardwareListOverdueView`** | `interface IHardwareListOverdueView : IBaseView` | View for displaying hardware with overdue calibration. No additional behavior beyond `IBaseView`. |
| **`IHardwareListReplaceView`** | `interface IHardwareListReplaceView : IBaseView` | View for the hardware replacement workflow. No additional behavior beyond `IBaseView`. |
| **`IHardwareListSelectView`** | `interface IHardwareListSelectView : IBaseView` | View for selecting hardware. Includes `InitializeColumns(bool bSteamingTest)` to configure column layout based on streaming test mode. |
| **`ISLICE6TreeNode`** | `interface ISLICE6TreeNode` | Represents a SLICE6 unit node in a tree. Properties: `DASId`, `SerialNumber`, `Port`, `PortString` (read-only), `Number`, `PositionOnChain`, `PositionOnChainString` (read-only). |
| **`IHardware`** | `interface IHardware` | Represents a hardware unit (e.g., DAS, SLICE6, bridge). Includes properties for identification (`DASId`, `SerialNumber`, `HardwareType`, `IPAddress`), configuration (`Disabled`, `Included`, `DSPStreamingFilter`, `TestSampleRate`, `PTPDomainID`), calibration (`CalDate`, `CalDueDate`, `FirstUseDate`, `IsFirstUseValid`), channel counts (`AnalogChannels`, `SquibChannels`, etc.), and methods: `SetIncluded`, `SetMixedRates`, `Filter`, `DetermineChannelCount`. |
| **`IHardwareListViewModel`** | `interface IHardwareListViewModel : IBaseViewModel, IFilterableListView` | Core view model managing hardware state, associations, and view coordination. Key members: <br>• **Properties**: `SelectedSLICE6`, `AvailableSLICE6`, `SelectedSLICE6DB`, `AvailableSLICE6DB`, `Hardware`, `OverdueHardware`, `HardwareInTest`, `HardwareToReplace`, `AvailableHardware`, `ReplacementHardware`, `SLICE6TreeNodes`, `ShowCompact`, `TestAAFRateHzColumnWidth`, `TestSampleRateColumnWidth`, `TestClockMasterColumnWidth`, `PTPDomainColumnWidth`, `TDASCalPeriod`, `G5CalPeriod`, etc. <br>• **Methods**: `InitializeReplace`, `GetHardware`, `GetAvailableSampleRates`, `SetTestSampleRates`, `UpdateTestSampleRate`, `SetTestAAFRates`, `UpdateTestAAFilterRate`, `SetTestClockProfiles`, `SetTestClockMasters`, `UpdateTestClockMaster`, `SetTestPTPDomainIDs`, `UpdateTestPTPDomainID`, `CheckForMixedDAS`, `SetParentMixedRates`, `SetIncluded`, `Filter`, `Sort`, `SortOverdue`, `LoadTreeView`, `Associate`, `UnAssociate`, `SaveSLICE6Associations`, `Replace`, `SetCalPeriods`, `GetSelectedItems`, `SetCache`, `Unset`. |
---
### 3. Invariants
- **`IHardware.Included` and `IHardware.Disabled`**: These boolean flags are mutable via `SetIncluded(bool)` and direct property assignment. Their semantics are not explicitly defined in the source, but `SetIncluded` is provided as a dedicated method, suggesting it may trigger additional logic (e.g., cascading updates).
- **`IHardware.DetermineChannelCount`**: The `ChannelCount` string is *not* auto-updated; it must be explicitly set via `DetermineChannelCount(bool showCompact, IHardware[] allHardware)`. The `showCompact` parameter controls whether SLICEPro units connected to ECMs are omitted.
- **`IHardware.FirstUseDate` and `IsFirstUseValid`**: `FirstUseDate` is only meaningful when `IsFirstUseValid` is `true`. A `null` value for `FirstUseDate` indicates the hardware has not been used since calibration.
- **`ISLICE6TreeNode` association**: `SLICE6TreeNodes` is populated by `LoadTreeView(string serialNumber)`. Associations (`Associate`, `UnAssociate`) are *not* committed until `SaveSLICE6Associations(string serialNumber)` is called.
- **`IHardwareListViewModel` state**: The `IsEdit` flag is exposed but not defined in behavior; its usage is implied to control edit vs. read-only mode.
- **`IBaseView` and `IBaseViewModel` inheritance**: All views and the view model derive from `DTS.Common.Base.IBaseView` and `IBaseViewModel` respectively, implying standard lifecycle/interaction patterns (e.g., initialization, binding) are expected but not detailed here.
---
### 4. Dependencies
#### Dependencies *of* this module:
- **Core types**: `System`, `System.Collections.Generic`, `System.Collections.ObjectModel`
- **Base layer**: `DTS.Common.Base` (for `IBaseView`, `IBaseViewModel`)
- **DSP & hardware classes**: `DTS.Common.Classes.DSP` (`IStreamingFilterProfile`), `DTS.Common.Classes.Hardware` (`IISOHardware`)
- **Enums**: `DTS.Common.Enums` (e.g., `IsoViewMode`)
- **Pagination**: `DTS.Common.Interface.Pagination` (for `IFilterableListView`)
- **Test setups**: `DTS.Common.Interface.TestSetups.TestSetupsList` (`ITestSetup`)
- **Clock sync**: `DTS.Common.ClockSyncProfile` (used in `SetTestClockProfiles`)
#### Dependencies *on* this module:
- **UI layer**: Concrete implementations of `IHardwareListView`, `IHardwareListOverdueView`, `IHardwareListReplaceView`, `IHardwareListSelectView`, `ISLICE6TreeView` (e.g., WPF/WinForms views).
- **View model consumers**: Controllers or presenters that use `IHardwareListViewModel` to drive hardware management workflows.
- **Hardware data sources**: Code that populates `IHardware[]` and `ISLICE6TreeNode[]` arrays (e.g., data access or service layers).
---
### 5. Gotchas
- **`IHardwareListSelectView.InitializeColumns(bool bSteamingTest)`**: The parameter name `bSteamingTest` appears to be a typo for `bStreamingTest`. This could cause confusion during implementation or maintenance.
- **`IHardware.DetermineChannelCount`**: The method *does not* automatically update `ChannelCount`; callers must ensure it is invoked after hardware changes to keep the display accurate.
- **`SLICE6` association workflow**: `Associate`/`UnAssociate` operations are *not* committed to persistent storage until `SaveSLICE6Associations` is called. This two-step process (select → save) is critical to avoid data loss.
- **`HardwareToReplace` vs. `ReplacementHardware`**: The `Replace()` method uses `HardwareToReplace` (the unit being replaced) and `ReplacementHardware` (the new unit). Confusing these could lead to incorrect replacements.
- **`ShowCompact` flag**: Controls whether rack modules (e.g., SLICEPro units connected to ECMs) are shown in `ChannelCount` and possibly the UI. Its effect is limited to `DetermineChannelCount` per the XML comment.
- **`GetHardware` parameters**: The `bIncludeModules`, `bIncludeOverdue`, `bIncludeBridges`, `testId`, and `groupId` parameters suggest flexible filtering, but their exact semantics (e.g., how `groupId` relates to test setups) are not documented in the interface.
- **`SetTestSampleRates` vs. `UpdateTestSampleRate`**: `SetTestSampleRates` takes a `Dictionary<string, double>` (likely bulk initialization), while `UpdateTestSampleRate` updates a single unit. Mixing them carelessly could cause state inconsistencies.
- **`CheckForMixedDAS` and `SetParentMixedRates`**: These methods suggest support for mixed sample rates within a DAS chain, but the logic for detecting/propagating mixed rates is not visible here. Callers must ensure correct ordering (e.g., `SetParentMixedRates` after `CheckForMixedDAS`).
- **`PTPDomainID` type**: Defined as `byte`, but no range validation is visible in the interface. Implementers must ensure values are within valid PTP domain ranges (typically 0127).
*None identified from source alone.*