--- source_files: - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphMainView.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphChannelView.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphPropertyView.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataView.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphPropertyViewModel.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataSeriesView.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphView.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphViewModel.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataViewModel.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataSeriesViewModel.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphChannelViewModel.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphMainViewModel.cs - Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataSeries.cs generated_at: "2026-04-16T12:24:37.475119+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "99208da86b0faad5" --- # Documentation: DTS.Common.Interface Graph Module ## 1. Purpose This module defines the interface contracts for a graph visualization subsystem following the Model-View-ViewModel (MVVM) architectural pattern. It provides abstractions for rendering test data series, managing graph channels, editing graph properties, and coordinating channel selection/locking across the application. The interfaces serve as boundaries between UI components and business logic, enabling test-driven development and loose coupling between the graph visualization components and their consumers. --- ## 2. Public Interface ### View Interfaces #### `IGraphMainView` - **Signature:** `public interface IGraphMainView : IBaseView` - **Behavior:** Marker interface for the main graph view container. No members defined; extends `IBaseView`. #### `IGraphChannelView` - **Signature:** `public interface IGraphChannelView : IBaseView` - **Behavior:** Marker interface for the graph channel selection/configuration view. No members defined; extends `IBaseView`. #### `IGraphPropertyView` - **Signature:** `public interface IGraphPropertyView : IBaseView` - **Behavior:** Marker interface for the graph property editing view. No members defined; extends `IBaseView`. #### `ITestDataView` - **Signature:** `public interface ITestDataView : IBaseView` - **Behavior:** Marker interface for the test data view. No members defined; extends `IBaseView`. #### `ITestDataSeriesView` - **Signature:** `public interface ITestDataSeriesView : IBaseView` - **Members:** - `bool SaveReportToPDF(string directory)` — Exports the report to PDF format to the specified directory. - `bool SaveReportToCSV(string directory)` — Exports the report to CSV format to the specified directory. - **Behavior:** Provides export capabilities for test data series reports. #### `IGraphView` - **Signature:** `public interface IGraphView : IBaseView` - **Members:** - `//void SetGraphs(ObservableCollection graphs);` (commented out) - **Behavior:** Marker interface for the graph rendering view. Contains one commented-out method for setting graph collections. --- ### ViewModel Interfaces #### `IGraphPropertyViewModel` - **Signature:** `public interface IGraphPropertyViewModel : IBaseViewModel` - **Members:** - `IGraphPropertyView View { get; }` — Gets the associated property view. - **Behavior:** ViewModel contract for managing graph property view state. #### `IGraphViewModel` - **Signature:** `public interface IGraphViewModel : IBaseViewModel` - **Members:** - `IGraphView View { get; }` — Gets the associated graph view. - `ITestDataSeriesView DataSeriesView { get; set; }` — Gets or sets the data series view. - **Behavior:** ViewModel contract for the main graph view coordination. #### `ITestDataViewModel` - **Signature:** `public interface ITestDataViewModel : IBaseViewModel` - **Members:** - `ITestDataView View { get; set; }` — Gets or sets the associated test data view. - `ITestDataSeries Model { get; set; }` — Gets or sets the underlying test data series model. - **Behavior:** ViewModel contract for test data display and editing. #### `ITestDataSeriesViewModel` - **Signature:** `public interface ITestDataSeriesViewModel : IBaseViewModel` - **Members:** - `ITestDataSeriesView View { get; set; }` — Gets or sets the associated view. - `ITestDataSeries Model { get; set; }` — Gets or sets the underlying test data series model. - `void MoveCursor(object sender, KeyEventArgs e)` — Handles cursor movement events. - `string CurrentCursorValues { get; set; }` — Gets or sets the current cursor position values for display. - **Behavior:** ViewModel for test data series with interactive cursor functionality. #### `IGraphChannelViewModel` - **Signature:** `public interface IGraphChannelViewModel : IBaseViewModel` - **Members:** - `IGraphChannelView View { get; }` — Gets the associated channel view. - `ObservableCollection GraphChannelList { get; set; }` — Collection of all available graph channels. - `ObservableCollection SelectedGraphChannelList { get; set; }` — Collection of currently selected graph channels. - `TestChannel SelectedGraphChannel { get; set; }` — The currently single-selected graph channel. - **Behavior:** ViewModel for managing graph channel selection and display. #### `IGraphMainViewModel` - **Signature:** `public interface IGraphMainViewModel : IBaseViewModel` - **Members:** - `IGraphMainView View { get; set; }` — Gets or sets the main graph view. - `IBaseViewModel Parent { get; set; }` — Gets or sets the parent ViewModel reference. - `List LockedChannelList { get; set; }` — List of locked channels. - `List SelectedChannelList { get; set; }` — List of selected channels. - `string LockedGroupName { get; set; }` — Name of the locked group. - `void PublishSelectedChannels()` — Publishes the current channel selection. - `void AddSelectedChannel(ITestChannel channel)` — Adds a single channel to the selection. - `void AddSelectedGroupChannels(string groupName, List channels)` — Adds multiple channels from a group to the selection. - `void AddLockedChannel(ITestChannel channel, bool isLocked)` — Adds or updates a channel's locked state. - `void AddLockedGroupChannels(string testName, string groupName, List channels, bool isLocked)` — Adds or updates multiple channels' locked state as a group. - `void GraphList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)` — Handler for graph list collection changes. - **Behavior:** Primary ViewModel for graph coordination, managing channel selection and locking state. --- ### Model Interface #### `ITestDataSeries` - **Signature:** `public interface ITestDataSeries : IBaseModel` - **Members (Identification):** - `string TestGroup { get; set; }` - `string TestSetupName { get; set; }` - `string TestId { get; set; }` - `string ChannelId { get; set; }` - `string HardwareChannel { get; set; }` - `string Bridge { get; set; }` - `string GroupName { get; set; }` - `string ChannelName { get; set; }` - `string Description { get; }` - **Members (Data):** - `double[] Xvalue { get; set; }` — X-axis data points. - `double[] Yvalue { get; set; }` — Y-axis data points. - `Brush GraphColor { get; set; }` — Visual color for the graph line. - **Members (Configuration):** - `string SWAAF { get; set; }` - `string HWAAF { get; set; }` - `string SampleRate { get; set; }` - `string ISOCode { get; set; }` - `string ISOChannelName { get; set; }` - `string UserCode { get; set; }` - `string UserChannelName { get; set; }` - `string EngineeringUnits { get; set; }` - `string Excitation { get; set; }` - `string Polarity { get; set; }` - `string RecordingMode { get; set; }` - **Members (Sensor):** - `string SensorSN { get; }` - `string SensorSNDisplay { get; }` - **Members (Statistics - read-only):** - `string MinY { get; }` - `string MaxY { get; }` - `string AvgY { get; }` - `string StdDevY { get; }` - `string T0EUValue { get; }` - **Members (FFT Analysis):** - `bool FFT { get; }` — Indicates if this series is an FFT of signal data. - `double PeakFrequency { get; }` — Peak frequency by magnitude (only populated when `FFT` is true). - `double PeakMagnitude { get; }` — Peak magnitude of frequencies (only populated when `FFT` is true). - `double GRMS { get; set; }` — Root-mean-squared acceleration (calculated in PSD results graphs). - **Members (HIC - Head Injury Criterion):** - `bool HIC { get; }` — Indicates if HIC calculation applies. - `string HICValue { get; }` - `string T1Time { get; }` - `string T2Time { get; }` - **Behavior:** Data model representing a complete test data series with metadata, raw data, and computed statistics. Supports both time-domain and frequency-domain (FFT) data representations. --- ## 3. Invariants 1. **Inheritance Hierarchy:** All view interfaces (`IGraphMainView`, `IGraphChannelView`, `IGraphPropertyView`, `ITestDataView`, `ITestDataSeriesView`, `IGraphView`) must extend `IBaseView`. 2. **Inheritance Hierarchy:** All ViewModel interfaces (`IGraphPropertyViewModel`, `IGraphViewModel`, `ITestDataViewModel`, `ITestDataSeriesViewModel`, `IGraphChannelViewModel`, `IGraphMainViewModel`) must extend `IBaseViewModel`. 3. **Inheritance Hierarchy:** `ITestDataSeries` must extend `IBaseModel`. 4. **FFT Data Population:** `PeakFrequency` and `PeakMagnitude` are only valid when `FFT` is `true`. Consumers must check `FFT` before accessing these properties. 5. **GRMS Context:** `GRMS` is only calculated for PSD (Power Spectral Density) results graphs. 6. **Observable Collections:** `IGraphChannelViewModel` uses `ObservableCollection` for both `GraphChannelList` and `SelectedGraphChannelList`, implying UI binding expectations for collection change notifications. 7. **Read-Only Statistics:** Statistical properties (`MinY`, `MaxY`, `AvgY`, `StdDevY`, `T0EUValue`, `PeakFrequency`, `PeakMagnitude`) are read-only and presumably computed from `Xvalue` and `Yvalue` arrays. --- ## 4. Dependencies ### This Module Depends On: | Dependency | Usage | |------------|-------| | `DTS.Common.Base` | `IBaseView`, `IBaseViewModel`, `IBaseModel` base interfaces | | `DTS.Common.Classes.Viewer.TestMetadata` | `TestChannel`, `ITestChannel` types | | `DTS.Common.Events` | Referenced in `ITestDataSeriesView.cs` (specific types not visible in source) | | `System.Windows.Input` | `KeyEventArgs` in `ITestDataSeriesViewModel` | | `System.Windows.Media` | `Brush` type in `ITestDataSeries` | | `System.Collections.ObjectModel` | `ObservableCollection` | | `System.Collections.Specialized` | `NotifyCollectionChangedEventArgs` | ### What Depends On This Module: **Cannot be determined from source alone.** This module defines only interfaces; consumers would be concrete implementations and other modules that reference these contracts. --- ## 5. Gotchas 1. **Namespace Inconsistency:** Four files (`ITestDataView.cs`, `ITestDataSeriesView.cs`, `IGraphView.cs`, `ITestDataSeriesViewModel.cs`, `IGraphMainViewModel.cs`, `ITestDataSeries.cs`) contain `// ReSharper disable CheckNamespace`, suggesting the declared namespace `DTS.Common.Interface` may not match the file path structure. This could cause confusion when locating types. 2. **Commented-Out Code:** `IGraphView` contains a commented-out method `SetGraphs(ObservableCollection graphs)`. The reason for its removal and whether it should be restored or permanently deleted is unclear from source. 3. **Malformed XML Comment:** In `ITestDataSeries.cs`, the XML comment for `PeakMagnitude` has a malformed closing tag (``), which may break documentation generation tools. 4. **Mixed Collection Types:** `IGraphChannelViewModel` uses `ObservableCollection` while `IGraphMainViewModel` uses `List`. This inconsistency in collection types across related ViewModels may indicate differing lifecycle or notification requirements, but could also be an oversight. 5. **Type Mismatch in `IGraphChannelViewModel`:** The `SelectedGraphChannel` property is typed as `TestChannel` (concrete class), while the collections use `ITestChannel` (interface). This breaks consistency with the interface-based design pattern used elsewhere. 6. **Setter Accessibility:** Several read-only properties in `ITestDataSeries` (e.g., `Description`, `SensorSN`, `MinY`, `MaxY`, etc.) have only getters, but it's unclear whether these are computed properties or set via constructor/mutable backing field. The implementation strategy is not specified.