11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-17T15:37:11.649380+00:00 | zai-org/GLM-5-FP8 | 1 | c98b9bdc3b18b6bf |
Hardware Data Model Documentation
Purpose
This module provides the data model layer for Data Acquisition System (DAS) hardware management within the DTS system. It encompasses three distinct concerns: DASSettings captures test-specific DAS configuration parameters (sample rates, trigger timing, voltage thresholds) for serialization into tblTestSetupDASSettings; DASHardwareList serves as a singleton registry for DAS hardware instances with caching and database persistence operations; and DasBatteryInputSettings/InputAndBatterySettings manage hardware-type-specific battery and input voltage threshold defaults with serialization support.
Public Interface
DASSettings (DataPROWin7.DataModel)
Constructors:
DASSettings()— Default parameterless constructor.DASSettings(DASSettings setting)— Copy constructor that clones all property values from another instance.
Properties:
| Property | Type | Description |
|---|---|---|
DASSerialNumber |
string |
Serial number identifier for the DAS unit. |
SampleRate |
double |
Data acquisition sample rate. |
ExcitationWarmupTimeMS |
int |
Excitation warmup time in milliseconds. |
HardwareAAF |
double |
Hardware Anti-Aliasing Filter setting. |
PreTriggerSeconds |
double |
Pre-trigger duration in seconds. |
PostTriggerSeconds |
double |
Post-trigger duration in seconds. |
StatusLineCheck |
bool |
Flag indicating whether status line checking is enabled. |
BatteryCheck |
bool |
Flag indicating whether battery checking is enabled. |
InputVoltageMin |
double |
Minimum input voltage threshold. |
InputVoltageMax |
double |
Maximum input voltage threshold. |
BatteryVoltageMin |
double |
Minimum battery voltage threshold. |
BatteryVoltageMax |
double |
Maximum battery voltage threshold. |
DASHardwareList (DataPROWin7.DataModel.Classes.Hardware)
Static Properties:
Cache(bool) — Enables/disables cached data mode. Setting tofalseclears_cachedDASHardware.
Static Methods:
DASHardwareList GetList()— Returns the singleton instance, creating it if necessary.DASHardware[] GetAllHardware()— Retrieves all DAS hardware, using cache ifCacheistrue.List<int> GetEmbeddedModules(IDASHardware[] hardware, int id)— Returns module IDs for embedded hardware matching the given DAS ID.Dictionary<string, double> GetEmbeddedModuleInfo(DASHardware[] hardware, int id)— Returns a dictionary of serial number to max sample rate for embedded modules.void UnassociateParentDAS(string distributorSerialNumber)— Calls stored proceduresp_DASChildrenUnAssociateto unassociate child DAS units from a parent.
Instance Methods:
void ReloadAll()— Intended to repopulate hardware (currently commented out).void SetCache(ICachedContainer container)— Sets anICachedContainerfor hardware caching.void ClearCache()— Clears the_cachedHardwarereference.string GetDASSerialNumberFromId(int id)— Queries database for serial number by DAS ID usingDbOperations.DASGet.DASHardware GetHardware(int id)— Retrieves hardware by integer ID.DASHardware GetHardware(string id, bool bUseCache = true)— Retrieves hardware by serial number string.DASHardware[] GetHardware(string[] ids, bool bUseCache = true)— Retrieves multiple hardware instances by serial number array.DASHardware GetHardware(string id, bool bThrowExceptionIfChanged, out bool changed, bool bUseCache = true)— Full retrieval method with change detection output parameter.DASHardware GetHardware(string serialNumber, string ipaddress)— Retrieves hardware by serial number (ipaddress parameter is unused).void UpdateMaxMemory(DASHardware h, long newMaxMemory)— Updates theMaxMemoryproperty and persists to database.DASHardware GetPrototypeHardware(string serial, int type)— Retrieves prototype hardware usingDbOperations.DAS.PROTOTYPE_POSITION.void Commit(DASHardware hardware, bool bExisting = false, bool bCheckExisting = true, bool Unassociate = true)— Persists hardware to database viaDTS.Common.ISO.Hardwareinsertion or update.void Delete(IHardware hardware)— Deletes hardware implementingIISOHardware.void Delete(DASHardware hardware)— Deletes aDASHardwareinstance, unassociating children if pseudo-rack.void Delete(IHardware[] hardware)— Batch delete forIHardwarearray.void Delete(DASHardware[] hardware)— Batch delete forDASHardwarearray.
Nested Types:
HardwareTypeChangedException— Inner exception class extendingException.enum Tags— ContainsHardwarevalue for property change notification.
DasBatteryInputSettings (DataPROWin7.DataModel.BatteryAndInputVoltageDefaults)
Nested Enum:
Settings— Enum defining 16 threshold types. Order is significant for serialization.
Constructors:
DasBatteryInputSettings(string s)— Deserializes from comma-separated string; parses values in enum order.DasBatteryInputSettings(DasBatteryInputSettings copy)— Copy constructor.DasBatteryInputSettings()— Default constructor initializing all thresholds to hardcoded defaults.
Properties:
All 16 properties corresponding to Settings enum values, typed as double:
BatteryLowDiagnosticsThreshold,BatteryHighDiagnosticsThresholdBatteryLowArmedThreshold,BatteryHighArmedThresholdInputLowDiagnosticsThreshold,InputHighDiagnosticsThresholdInputLowArmedThreshold,InputHighArmedThresholdMinimumValidBatteryThreshold,MinimumValidInputThresholdMaximumValidBatteryThreshold,MaximumValidInputThresholdBatteryMediumDiagnosticsThreshold,BatteryMediumArmedThresholdInputMediumDiagnosticsThreshold,InputMediumArmedThreshold
Instance Methods:
string ToSerializedString()— Serializes all settings to comma-separated string using invariant culture.double GetValue(Settings setting)— Retrieves value fromSettingsPropertydictionary.void SetValue(Settings setting, double d)— Sets value inSettingsPropertydictionary.
InputAndBatterySettings (Static Class)
Static Methods:
void ClearCache()— Clears the internal_cachedictionary.double GetValue(string DasType, DasBatteryInputSettings.Settings setting)— Gets threshold value by DAS type string.double GetValue(HardwareTypes type, DasBatteryInputSettings.Settings setting)— Gets threshold value byHardwareTypesenum.DasBatteryInputSettings GetDefaultSettingForHWType(HardwareTypes type)— Returns default settings for hardware type, caching ifRunTestVariables.InRunTestandRunTestVariables.CacheVoltageSettingsInRunTestare true.DasBatteryInputSettings GetSettingForHWType(HardwareTypes type)— Returns current settings for hardware type fromCommon.SerializedSettings.void SetSettingForHWType(HardwareTypes type, DasBatteryInputSettings setting)— Persists settings toCommon.SerializedSettingsfor the specified hardware type.
Invariants
-
DASSettings: All property setters use
SetPropertyfromBasePropertyChanged, implying property change notification is raised on every assignment regardless of value equality. -
DASHardwareList Singleton: The
GetList()method returns a lazily-initialized singleton. The_listfield is never reset to null except implicitly by the runtime. -
DASHardwareList Cache Consistency: When
Cacheis set tofalse,_cachedDASHardwareis cleared. The_cachedHardware(instance) and_cachedDASHardware(static) are separate caching mechanisms. -
DasBatteryInputSettings Serialization Order: The
Settingsenum order must remain unchanged; serialization/deserialization relies on enum integer values as array indices. -
Hardware Type Mapping: Multiple
HardwareTypesvalues map to the same settings (e.g.,SLICE2_SIMandSLICE2_Baseshare settings;TDAS_Pro_RackandTDAS_LabRackshare settings). -
Commit Versioning: When updating existing hardware,
h.Versionis incremented by 1 before callingUpdate().
Dependencies
Direct Dependencies (Imports):
| Module | Depends On |
|---|---|
DASSettings |
DTS.Common.Base (BasePropertyChanged) |
DASHardwareList |
DTS.Common.Base, DTS.Common.DataModel, DTS.Common.Interface.DASFactory.Diagnostics, DTS.Common.Interface.DASFactory.Diagnostics.HardwareList, DTS.Common.Interface.DataRecorders, DTS.Common.Storage, System.Windows, DataPROWin7.DataModel.Classes.TestTemplate |
BatteryAndInputVoltageDefaults |
DTS.Common.Enums, DTS.Common.Enums.Hardware, System.Configuration |
External System Dependencies:
DbOperations— Database access layer for DAS queries and stored procedures.DTS.Common.ISO.Hardware— ISO hardware abstraction for persistence operations.Common.SerializedSettings— Persistent settings storage for battery/input thresholds.RunTestVariables— Runtime configuration flags (InRunTest,CacheVoltageSettingsInRunTest).ApplicationProperties.CurrentUser— Current user context for audit fields.
Gotchas
-
DASHardwareList.GetHardware(string, string) Ignores IP Address: The
ipaddressparameter inGetHardware(string serialNumber, string ipaddress)is passed but never used—the method simply callsGetHardware(serialNumber). -
ReloadAll() is a No-Op: The
ReloadAll()method body is entirely commented out. Calling it has no effect. -
Cache Flag Scope Confusion:
DASHardwareListhas two separate caching mechanisms—staticCacheproperty controls_cachedDASHardware, while instance methodSetCachecontrols_cachedHardware. These operate independently. -
Hardware Type Settings Fallthrough: In
GetSettingForHWType, several hardware types (e.g.,DIM,SIM,TOM,Ribeye,SLICE_Base) fall through to defaults with comments indicating they're "not expected" to reach that code path. This may mask configuration errors. -
GetHardware ID Parsing: When using
_cachedHardware, theidparameter is split on underscore (tokens = id.Split('_')) and onlytokens[0]is used. This implies IDs may contain additional underscore-delimited metadata. -
Commit Order Dependency for SLICE6Db: The comment in
Commit()notes that when committing hardware groups containing SLICE6Db, the parent must be committed before children to avoid association issues. -
Prototype Hardware CalDate Reset:
GetPrototypeHardwareexplicitly setsCalDate = DateTime.MinValuefor prototypes, which may affect calibration status checks elsewhere. -
DasBatteryInputSettings Default Constructor Throws on Unknown: The default constructor's switch statement throws
NotSupportedExceptionfor any enum value not explicitly handled, making it fragile to enum extensions.