Files
2026-04-17 14:55:32 -04:00

2.5 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestModification/ViewModel/TestModificationViewModel.cs
2026-04-17T15:59:06.360686+00:00 zai-org/GLM-5-FP8 1 7c56b83b77bf5525

Documentation: TestModificationViewModel

1. Purpose

TestModificationViewModel is a Prism-based ViewModel that manages the test modification UI panel in the DTS Viewer application. It enables users to modify test data properties (T0 timing, sensitivity, line fit, EU multiplier/offset, filters, data flags) for selected channels, persist those modifications to files, and optionally update sensor calibration data back to the Sensor Database. The module coordinates between the UI, event-driven channel selection, and the TestModelManipulation helper class for actual data operations.

2. Public Interface

Constructor

public TestModificationViewModel(ITestModificationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)

Initializes the ViewModel, sets up the View's DataContext, creates interaction requests, and subscribes to RaiseNotification, GraphSelectedChannelsNotification, ShiftT0Event, and SetUseZeroForUnfilteredEvent events.

Public Methods

Method Signature Description
UpdateDatabaseMethod void UpdateDatabaseMethod() Updates calibration in the Sensor Database. Sets CalibrationId = -1, updates ModifyDate to DateTime.Now, creates a SensorCalibration from Model.Cal, and inserts via DbOperations.SensorCalibrationsInsert. Refreshes Model.Cal from latest database record.
Initialize void Initialize() Empty override.
Initialize void Initialize(object parameter) Sets Parent property from parameter cast to IBaseViewModel.
PublishChanges void PublishChanges() If not populating and Model.IsModifiedDataFlag is true, immediately saves data flag modification via TestModelManipulation.SaveModificationDataFlag. Publishes TestModificationChangedEvent with the Model.

Commands

Command Method Description
PreviewCommand PreviewMethod() Calls TestModelManipulation.PreviewLineFit(Model).
WriteCommand WriteMethod() Validates T0 if modified, prompts user with Yes/No dialog, retrieves UseISOCodeFilterMapping setting, and calls TestModelManipulation.SaveModification. Updates IsBackedUp.
UndoCommand UndoMethod()