Files
DP44/docs/ai/Common/DTS.Common/Interface/Hardware/AddEditHardware.md

60 lines
3.5 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Interface/Hardware/AddEditHardware/IAddEditHardwareView.cs
- Common/DTS.Common/Interface/Hardware/AddEditHardware/IAddEditHardwareDASModule.cs
- Common/DTS.Common/Interface/Hardware/AddEditHardware/IAddEditHardwareViewModel.cs
- Common/DTS.Common/Interface/Hardware/AddEditHardware/IAddEditHardwareHardware.cs
generated_at: "2026-04-17T16:22:07.565840+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "47afc474465cb2e8"
---
# AddEditHardware
### Purpose
This module defines the interfaces for adding and editing hardware (Data Acquisition Systems/DAS) within the DTS application. It provides a comprehensive contract for managing hardware properties, DAS modules, validation, and persistence. The module supports various hardware types including SLICE PRO SIM and SLICE6 AIR-TC configurations, with features for rack sizing, IP addressing, and module management.
### Public Interface
**IAddEditHardwareView** (`IAddEditHardwareView.cs`)
- Signature: `public interface IAddEditHardwareView : IBaseView`
- Members:
- `void Activated()` - Notifies the view it has been activated for post-activation work.
- `int ViewDbVersion { get; set; }` - Gets or sets the database version for the view.
**IAddEditHardwareDASModule** (`IAddEditHardwareDASModule.cs`)
- Signature: `public interface IAddEditHardwareDASModule`
- Members:
- `HardwareTypes ModuleType { get; set; }` - The type of the DAS module.
- `string SerialNumber { get; set; }` - Serial number of the module.
- `ImageSource DASImage { get; }` - Image representing the DAS (read-only).
- `IAddEditHardwareHardware OwningHardware { get; set; }` - Parent hardware that owns this module.
- `SLICEBridgeTypes SLICEBridgeType { get; set; }` - Bridge type for SLICE modules.
- `string GetSerialNumberPrefix()` - Returns the prefix for modules of this ModuleType.
**IAddEditHardwareViewModel** (`IAddEditHardwareViewModel.cs`)
- Signature: `public interface IAddEditHardwareViewModel : IBaseViewModel`
- Members:
- `IAddEditHardwareView View { get; set; }` - Associated view instance.
- `void Unset()` - Clears/unsets the ViewModel state.
- `IAddEditHardwareHardware Hardware { get; set; }` - Hardware being operated on.
- `int? TestId { get; set; }` - Optional test identifier.
- `void SetHardware(IDASHardware hw, IISOHardware isoHW)` - Initializes ViewModel with given hardware.
- `bool NotificationsOn { get; set; }` - Controls whether change notifications are sent.
- `bool Validate(IISOHardware isoHW, ref List<string> errors, ref List<string> warnings, bool displayWindow, bool IsAdd)` - Validates hardware; returns true if commit-able.
- `void PublishPageError(bool displayWindow, List<string> errors, List<string> warnings)` - Publishes validation errors/warnings.
- `void Save()` - Commits changes.
- `IISOHardware GetISOHardware()` - Retrieves ISO hardware representation.
- `bool AllowStandin { get; set; }` - Whether stand-in hardware is supported.
- `void SetSLICE6TreeView(ISLICE6TreeView treeView, IHardwareListViewModel treeViewModel)` - Sets SLICE6 treeview module access.
- `ISLICE6TreeView SLICE6TreeView { get; }` - Access to current SLICE6TreeView.
**IAddEditHardwareHardware** (`IAddEditHardwareHardware.cs`)
- Signature: `public interface IAddEditHardwareHardware`
- Members:
- `HardwareTypes HardwareType { get; set; }` - DAS hardware type.
- `string SerialNumber { get; set; }` - Serial number.
- `string FirmwareVersion { get; set; }` - Firmware version.
- `string IPAddress { get; set; }` - IP address (if supported).
- `bool SupportsIPAddress