This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
---
source_files:
- Common/DTS.Common/Interface/Sensors/SensorSettingsModule/ISensorSettingsView.cs
- Common/DTS.Common/Interface/Sensors/SensorSettingsModule/ISensorSettingsViewModel.cs
- Common/DTS.Common/Interface/Sensors/SensorSettingsModule/ICalibrationPolicy.cs
generated_at: "2026-04-17T16:23:28.254054+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "14988a2958fb721f"
---
# SensorSettingsModule
### Purpose
This module defines the contract for the Sensor Settings user interface component within the DTS application. It provides interfaces for configuring sensor-related defaults including squib settings, digital I/O, IEPE sensors, calibration policies, and analog settings. The module follows a Model-View-ViewModel (MVVM) pattern, separating the view concerns from the business logic of persisting and validating sensor configuration defaults per user.
### Public Interface
**ISensorSettingsView**
- `interface ISensorSettingsView : IBaseView` - Marker interface for the Sensor Settings view. No members defined beyond the base interface.
**ISensorSettingsViewModel**
- `string User { get; set; }` - User identifier used when saving/reading defaults from the database.
- `int UserID { get; set; }` - Numeric user ID used when saving/reading defaults from the database.
- `ISensorSettingsView View { get; set; }` - The associated view instance for this ViewModel.
- `ISquibSettingDefaults SquibSettings { get; set; }` - Defaults for squib configuration.
- `IDigitalOutDefaults DigitalOutSettings { get; set; }` - Defaults for digital output configuration.
- `IDigitalInputDefaults DigitalInputDefaults { get; set; }` - Defaults for digital input configuration.
- `IIEPESensorDefaults IEPESensorDefaults { get; set; }` - Defaults for IEPE sensor configuration.
- `ICalibrationPolicy SensorCalibrationDefaults { get; set; }` - Calibration policy defaults.
- `IAnalogDefaults AnalogDefaults { get; set; }` - Analog settings defaults (FB 13120 default filter class setting).
- `void RestoreOriginalSettings()` - Restores all settings to their original/pre-modification values.
- `void Unset()` - Uninitializes the display and frees memory resources.
- `void OnSetActive()` - Initializes the display when the view becomes active.
- `bool ValidateAndSave()` - Validates current settings; returns true if valid and saves, returns false if invalid without saving.
**ICalibrationPolicy**
- `SensorConstants.SensorCalPolicy SelectedCalPolicy { get; set; }` - The currently selected calibration policy.
- `SensorConstants.SensorCalPolicy[] AvailableSensorCalPolicies { get; }` - Array of all available calibration policies.
- `int WarningPeriod { get; set; }` - Period in days before calibration is due for a warning.
- `bool UseSensorFirstUseDate { get; set; }` - Whether calibration interval starts after calibration date or first use date.
- `bool DontAllowDataCollectionIfOverused { get; set; }` - Whether to validate Test Setup based on sensor usage limits.
- `int UsageRemainingForWarning { get; set; }` - Threshold for warning when sensor usage approaches maximum.
- `int DefaultMaxUsageAllowed { get; set; }` - Default maximum number of uses for sensors.
- `bool SensorAssemblyEnabled { get; }` - Whether the database supports sensor usage policy.
- `bool AllowInspectBeforeUseEnabled { get; }` - Whether the database supports "inspect before use" feature.
- `bool AllowInspectBeforeUse { get; set; }` - Whether to allow inspect before use (FB43142).
- `void ReadXML(System.Xml.XmlElement root)` - Imports settings from XML (FB15758).
- `void WriteXML(ref System.Xml.XmlWriter writer)` - Exports settings to XML (FB15758).
### Invariants
- `ValidateAndSave()` must not persist invalid settings; it returns false and performs no save operation.
- `RestoreOriginalSettings()` should return all configurable properties to their state as of the last successful load or save.
- XML import/export methods (`ReadXML`/`WriteXML`) are paired operations for settings migration.
### Dependencies
- **Depends on**: `DTS.Common.Base` (IBaseView, IBaseViewModel), `DTS.Common.Enums.Sensors` (SensorConstants.SensorCalPolicy).
- **Referenced interfaces not defined in this module**: `ISquibSettingDefaults`, `IDigitalOutDefaults`, `IDigitalInputDefaults`, `IIEPESensorDefaults`, `IAnalogDefaults` (all used as property types).
### Gotchas
- The `User` and `UserID` properties are used for database persistence context; their synchronization with