8.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T12:24:47.346735+00:00 | zai-org/GLM-5-FP8 | 1 | 8c9d2e027679c71f |
Documentation: DTS.Common.Interface.Hardware.AddEditHardware
1. Purpose
This module defines the contract layer for the Add/Edit Hardware feature within the DTS system. It provides four interfaces that establish the boundaries between the view layer (IAddEditHardwareView), presentation logic (IAddEditHardwareViewModel), hardware domain model (IAddEditHardwareHardware), and modular hardware components (IAddEditHardwareDASModule). These interfaces enable the creation, modification, validation, and persistence of Data Acquisition System (DAS) hardware configurations, including support for modular hardware components like SLICE bridges.
2. Public Interface
IAddEditHardwareView
Inherits from: IBaseView
| Member | Signature | Description |
|---|---|---|
Activated |
void Activated() |
Notifies the view that it has been activated and should handle any post-activation work. |
ViewDbVersion |
int ViewDbVersion { get; set; } |
Gets or sets the database version associated with the view. |
IAddEditHardwareDASModule
Inherits from: None
| Member | Signature | Description |
|---|---|---|
ModuleType |
HardwareTypes ModuleType { get; set; } |
Gets or sets the type of the DAS module. |
SerialNumber |
string SerialNumber { get; set; } |
Gets or sets the serial number for the DAS module. |
DASImage |
ImageSource DASImage { get; } |
Gets an image representing the DAS (read-only). |
OwningHardware |
IAddEditHardwareHardware OwningHardware { get; set; } |
Gets or sets a reference to the parent hardware that owns this module. |
SLICEBridgeType |
SLICEBridgeTypes SLICEBridgeType { get; set; } |
Gets or sets the SLICE bridge type for this module. |
GetSerialNumberPrefix |
string GetSerialNumberPrefix() |
Returns the prefix for any modules of this ModuleType. |
IAddEditHardwareHardware
Inherits from: None
| Member | Signature | Description |
|---|---|---|
HardwareType |
HardwareTypes HardwareType { get; set; } |
Gets or sets the DAS hardware type. |
SerialNumber |
string SerialNumber { get; set; } |
Gets or sets the serial number for the DAS. |
FirmwareVersion |
string FirmwareVersion { get; set; } |
Gets or sets the firmware version of the DAS. |
IPAddress |
string IPAddress { get; set; } |
Gets or sets the IP address of the DAS (if supported). |
SupportsIPAddress |
bool SupportsIPAddress { get; } |
Indicates whether the DAS supports an IP address (read-only). |
SupportsRackSize |
bool SupportsRackSize { get; } |
Indicates whether the DAS supports rack sizes (read-only). |
SupportsConfiguration |
bool SupportsConfiguration { get; } |
Indicates whether the DAS supports configuration (read-only). |
SLICEConfiguration |
SLICEConfigurations SLICEConfiguration { get; set; } |
Gets or sets the SLICE configuration of the DAS. |
RackSize |
RackSizes RackSize { get; set; } |
Gets or sets the size of the rack (if supported). |
DASImage |
ImageSource DASImage { get; } |
Gets an image representing the DAS (read-only). |
Modules |
ObservableCollection<IAddEditHardwareDASModule> Modules { get; set; } |
Gets or sets the collection of DAS modules attached to this hardware. |
StandIn |
bool StandIn { get; set; } |
Indicates whether this is actual physical hardware or stand-in/placeholder hardware. |
IsModule |
bool IsModule { get; set; } |
Indicates whether this hardware is a module. |
IsAdd |
bool IsAdd { get; set; } |
Indicates whether this record already exists in the database (false) or is a new entry (true). |
RemoveModule |
void RemoveModule(IAddEditHardwareDASModule module) |
Removes the specified module from the hardware. |
AddModule |
void AddModule() |
Adds a new module to the hardware. |
ToISOHardware |
IISOHardware ToISOHardware() |
Returns a new IISOHardware representation of the hardware. |
IAddEditHardwareViewModel
Inherits from: IBaseViewModel
| Member | Signature | Description |
|---|---|---|
View |
IAddEditHardwareView View { get; set; } |
Gets or sets the associated view instance. |
Hardware |
IAddEditHardwareHardware Hardware { get; set; } |
Gets or sets the hardware being operated on in the viewmodel. |
TestId |
int? TestId { get; set; } |
Gets or sets an optional test identifier. |
NotificationsOn |
bool NotificationsOn { get; set; } |
Controls whether change notifications are sent. Can be disabled during initialization to avoid spurious notifications. |
AllowStandin |
bool AllowStandin { get; set; } |
Indicates whether stand-in hardware is supported by the current model. |
SLICE6TreeView |
ISLICE6TreeView SLICE6TreeView { get; } |
Provides access to the current SLICE6 tree view (read-only). |
Unset |
void Unset() |
Clears or resets the viewmodel state. |
SetHardware |
void SetHardware(IDASHardware hw, IISOHardware isoHW) |
Initializes the viewmodel with the given hardware. |
Validate |
bool Validate(IISOHardware isoHW, ref List<string> errors, ref List<string> warnings, bool displayWindow, bool IsAdd) |
Validates the hardware. Returns true if the hardware can be committed. Populates errors and warnings lists. |
Save |
void Save() |
Commits any changes present. |
GetISOHardware |
IISOHardware GetISOHardware() |
Returns the IISOHardware representation. |
SetSLICE6TreeView |
void SetSLICE6TreeView(ISLICE6TreeView treeView, IHardwareListViewModel treeViewModel) |
Allows access to the SLICE6 treeview module. |
3. Invariants
-
Module Ownership: An
IAddEditHardwareDASModulemust have a validOwningHardwarereference to function properly within the module hierarchy. -
Support Capability Flags: The boolean support properties (
SupportsIPAddress,SupportsRackSize,SupportsConfiguration) onIAddEditHardwareHardwareare read-only and their values are determined by theHardwareType. Consumers should check these before attempting to set related properties. -
Validation Before Save: The
Validatemethod onIAddEditHardwareViewModelshould be called and returntruebefore callingSave()to ensure data integrity. -
Notifications Control:
NotificationsOnshould be set tofalseduring programmatic initialization to prevent unwanted change notification events, then set back totruefor normal operation. -
IsAdd State: The
IsAddproperty onIAddEditHardwareHardwaremust accurately reflect whether the hardware record is new (true) or existing (false) to ensure correct database operations.
4. Dependencies
This module depends on:
DTS.Common.Base— ProvidesIBaseViewandIBaseViewModelbase interfacesDTS.Common.Enums.Hardware— ProvidesHardwareTypes,SLICEBridgeTypes,SLICEConfigurations,RackSizesenumsDTS.Common.Interface.DASFactory.Diagnostics— ProvidesIDASHardwareDTS.Common.Interface.DASFactory.Diagnostics.HardwareList— ProvidesIHardwareListViewModel,ISLICE6TreeViewDTS.Common.Interface.DataRecorders— ProvidesIISOHardwareSystem.Collections.Generic— ForList<T>System.Collections.ObjectModel— ForObservableCollection<T>System.Windows.Media— ForImageSource
What depends on this module:
- Not determinable from the provided source files alone. Implementations of these interfaces would exist elsewhere in the codebase.
5. Gotchas
-
XML Documentation Issue: In
IAddEditHardwareViewModel, theNotificationsOnproperty has a malformed XML comment — the closing tag is<summary>instead of</summary>. This may cause documentation generation warnings or incorrect IntelliSense output. -
ref Parameters in Validate: The
Validatemethod usesrefparameters forerrorsandwarningslists rather thanout. Callers must initialize these lists before calling the method, or the behavior is undefined. -
AddModule Parameterless: The
AddModule()method onIAddEditHardwareHardwaretakes no parameters, suggesting the implementation is responsible for constructing and configuring the new module internally. The exact mechanism for how the new module is initialized is unclear from the interface alone. -
ViewDbVersion Purpose: The purpose and usage of
ViewDbVersiononIAddEditHardwareViewis not documented in the source; its relationship to database versioning or migration is unclear.