7.6 KiB
7.6 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:07:00.161504+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 43122e167ffc47f8 |
TestModification
Purpose
This module defines the core interfaces for the Test Modification feature within the DTS Viewer application, enabling users to inspect and modify channel-specific calibration and configuration parameters (e.g., description, Eu multiplier/offset, T0/T1/T2 line-fit settings, sensitivity, software filters, and data flags). It implements the MVVM pattern across three layers—ITestModificationView (UI), ITestModificationViewModel (presentation logic), and ITestModificationModel (data/access to calibration and channel state)—to support interactive editing of test channel metadata and calibration values, including integration with the sensor database for calibration updates.
Public Interface
ITestModificationView
- Inherits:
IBaseView - Description: A marker interface representing the view layer for the test modification UI. No additional members beyond base view contract.
ITestModificationViewModel
- Inherits:
IBaseViewModel - Properties:
ITestModificationView View { get; set; }— Binds to the associated view instance.IBaseViewModel Parent { get; set; }— Reference to the parent view model (e.g., main viewer or channel list).bool UseISOCodeFilterMapping { get; set; }— Controls whether modifying a software filter should trigger automatic ISO code updates.bool UseZeroForUnfiltered { get; set; }— Determines whether0(vs.P) is used as the ISO code value when the software filter is set to "unfiltered".
- Methods:
void PublishChanges()— Commits pending modifications (likely to the model or underlying data layer).void UpdateDatabaseMethod()— Updates the sensor calibration record in the database (see case 43615).
ITestModificationModel
- Inherits:
IBaseModel - Properties:
ITestModificationViewModel Parent { get; set; }— Reference to the owning view model.ITestChannel SelectedChannel { get; set; }— The channel currently being modified.string Description { get; set; }— Channel description string;IsModifiedDescriptiontracks changes.double EuMultiplier { get; set; }— Eu multiplier;IsModifiedEuMultipliertracks changes.double EuOffset { get; set; }— Eu offset;IsModifiedEuOffsettracks changes.double T0 { get; set; }— T0 offset in ms;IsModifiedT0tracks changes.bool IsModifiedLineFit { get; set; }— Whether T1/T2 line-fit parameters are modified.double T1 { get; set; }— Line-fit start time (ms).double T2 { get; set; }— Line-fit end time (ms).double Sensitivity { get; set; }— Channel sensitivity;IsModifiedSensitivitytracks changes.IFilterClass SelectedFilter { get; set; }— Software filter for the channel (per FB 13120, usesIFilterClassinstead of legacyCFCFilter).T0Mode T0Mode { get; set; }— T0 adjustment mode (enum value; type defined elsewhere).DataFlag SelectedDataFlag { get; set; }— Data flag setting;IsModifiedDataFlagtracks changes.ISensorDbRecord Sensor { get; set; }— Sensor record in the database corresponding to the channel.ISensorCalDbRecord Cal { get; set; }— Latest calibration record for the sensor.double CalSensitivity { get; set; }— Sensitivity value from the calibration record.bool ShowSensorCal { get; }— Whether sensor calibration UI should be visible.bool NonLinear { get; }— Whether the calibration is non-linear.bool ProportionalToExcitation { get; }— Whether the sensor output is proportional to excitation voltage.
- Computed Flags (read-only):
bool IsModified { get; }—trueif any field differs from its default/unmodified state.bool IsModifiedDescription { get; }bool IsModifiedEuMultiplier { get; }bool IsModifiedEuOffset { get; }bool IsModifiedT0 { get; }bool IsModifiedSensitivity { get; }bool IsModifiedFilter { get; }bool IsModifiedDataFlag { get; }
- Methods:
bool ValidateT0()— ReturnstrueifT0is within the valid time range of the current dataset;falseotherwise.
Invariants
SelectedChannelmust be non-null for all model properties to be meaningful; behavior is undefined ifSelectedChannelisnull.IsModified*flags are derived from comparisons against default/unmodified values and must be consistent with the corresponding property values.ValidateT0()must returnfalseifT0falls outside the time span of the dataset associated withSelectedChannel.CalSensitivity,NonLinear,ProportionalToExcitation, andShowSensorCalare derived from theCalandSensorrecords and must reflect their current state.SelectedFiltermust be assignable toIFilterClass(no direct dependency on legacyCFCFilterper comment).UseISOCodeFilterMappingandUseZeroForUnfilteredcontrol ISO code behavior only when a software filter is modified; they do not affect other fields.
Dependencies
- Internal Dependencies:
DTS.Common.Base— ProvidesIBaseView,IBaseViewModel,IBaseModel.DTS.Common.Interface.Sensors— ProvidesISensorDbRecord,ISensorCalDbRecord.DTS.Common.Interface.Sensors.SoftwareFilters— ProvidesIFilterClass.ITestChannel— Referenced but not defined in these files; assumed to be defined elsewhere inDTS.Common.Interface.T0Mode— Enum type referenced but not defined here.DataFlag— Enum type referenced but not defined here.
- Depended Upon By:
- Concrete implementations of
ITestModificationView,ITestModificationViewModel, andITestModificationModel(e.g., WPF views, view models, and data models in the viewer module). - Likely consumed by higher-level modules managing test channel editing workflows (e.g., main viewer, channel list, or calibration manager).
- Concrete implementations of
Gotchas
IsModifiedLineFitis the onlyboolproperty inITestModificationModelwith a public setter (set); all otherIsModified*properties are read-only. This may indicate that line-fit modification state can be externally forced (e.g., reset), but usage is unclear without implementation context.UpdateDatabaseMethod()lacks parameterization; it likely operates on the currentSelectedChannel,Sensor, andCalstate. Side effects (e.g., DB write, validation) are not documented beyond the XML comment.UseZeroForUnfilteredandUseISOCodeFilterMappingare not validated or enforced in the interface—behavior depends on implementation.- No explicit error handling or exception contracts are defined (e.g., for
PublishChanges()orUpdateDatabaseMethod()). ValidateT0()’s validity criteria ("within the dataset") are underspecified: dataset bounds are not defined in the interface.- None of the
IsModified*flags are resettable via the interface—implementation may require external reset (e.g., afterPublishChanges()). - None identified from source alone.