9.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:33:34.206978+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 99208da86b0faad5 |
Graph View Module Documentation
1. Purpose
This module defines the interface contracts for the graphing subsystem within the DTS Viewer, enabling separation of concerns between UI views and their corresponding view models in a MVVM pattern. It provides a structured set of interfaces for managing graph displays, channel selection, test data series, and property views—supporting both time-domain and frequency-domain (FFT/PSD) visualization of test data. The interfaces collectively enable modular UI composition where graph-related functionality (e.g., channel grouping, cursor tracking, report export) is decoupled from implementation details.
2. Public Interface
Interfaces (View Layer)
-
IGraphMainView
Represents the main graph tab view. InheritsIBaseView. No additional members defined. -
IGraphChannelView
Represents the channel selection/view tab. InheritsIBaseView. No additional members defined. -
IGraphPropertyView
Represents the property display tab. InheritsIBaseView. No additional members defined. -
ITestDataView
Represents the test data tab. InheritsIBaseView. No additional members defined. -
ITestDataSeriesView
Represents the view for a single test data series. InheritsIBaseView.bool SaveReportToPDF(string directory)– Saves the series report to PDF in the specified directory.bool SaveReportToCSV(string directory)– Saves the series report to CSV in the specified directory.
-
IGraphView
Represents the main graph display view. InheritsIBaseView.- Commented-out method:
void SetGraphs(ObservableCollection<ITestDataSeries> graphs);— Not active in current interface.
- Commented-out method:
Interfaces (ViewModel Layer)
-
IGraphMainViewModel
Manages the main graph view and channel/group selection logic. InheritsIBaseViewModel.IGraphMainView View { get; set; }IBaseViewModel Parent { get; set; }List<ITestChannel> LockedChannelList { get; set; }List<ITestChannel> SelectedChannelList { get; set; }string LockedGroupName { get; set; }void PublishSelectedChannels()– Commits selected channels for display.void AddSelectedChannel(ITestChannel channel)– Adds a single channel to the selected list.void AddSelectedGroupChannels(string groupName, List<ITestChannel> channels)– Adds a group of channels to the selected list.void AddLockedChannel(ITestChannel channel, bool isLocked)– Adds a channel to the locked list;isLockedindicates lock status.void AddLockedGroupChannels(string testName, string groupName, List<ITestChannel> channels, bool isLocked)– Adds a group of channels to the locked list.void GraphList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)– Handles collection change events for the graph list.
-
IGraphChannelViewModel
Manages channel selection and grouping for graphing. InheritsIBaseViewModel.IGraphChannelView View { get; }ObservableCollection<ITestChannel> GraphChannelList { get; set; }ObservableCollection<ITestChannel> SelectedGraphChannelList { get; set; }TestChannel SelectedGraphChannel { get; set; }
-
IGraphPropertyViewModel
Manages property view. InheritsIBaseViewModel.IGraphPropertyView View { get; }
-
IGraphViewModel
Coordinates the main graph view and its data series view. InheritsIBaseViewModel.IGraphView View { get; }ITestDataSeriesView DataSeriesView { get; set; }
-
ITestDataViewModel
Manages a single test data series view. InheritsIBaseViewModel.ITestDataView View { get; set; }ITestDataSeries Model { get; set; }
-
ITestDataSeriesViewModel
Manages a single test data series view and cursor interaction. InheritsIBaseViewModel.ITestDataSeriesView View { get; set; }ITestDataSeries Model { get; set; }void MoveCursor(object sender, KeyEventArgs e)– Handles cursor movement (e.g., keyboard navigation).string CurrentCursorValues { get; set; }– Holds the current cursor position values (e.g., X/Y coordinates).
3. Invariants
- All view interfaces (
IGraph*View,ITestData*View) inheritIBaseView, implying a consistent base contract for UI components. - All view model interfaces (
IGraph*ViewModel,ITestData*ViewModel) inheritIBaseViewModel, implying a consistent base contract for view models. - Each view model exposes a strongly-typed
Viewproperty (e.g.,IGraphView,ITestDataSeriesView)—ensuring one-to-one view/viewmodel pairing. ITestDataSeriesimplements metadata properties (e.g.,TestGroup,ChannelName,EngineeringUnits) and computed statistics (MinY,MaxY,AvgY,StdDevY,PeakFrequency,PeakMagnitude,GRMS)—some conditional onFFTorPSDmode.ITestDataSeries.FFTindicates whether the series is frequency-domain data;PeakFrequencyandPeakMagnitudeare only populated whenFFT == true.ITestDataSeries.HICis a boolean flag;HICValueis a string (likely formatted value).ITestDataSeries.GRMSis only calculated in PSD results graphs (per documentation).ITestDataSeries.Description,SensorSNDisplay,MinY,MaxY,AvgY,StdDevY,T1Time,T2Time,RecordingModeare read-only (get;only).ITestDataSeriesViewModel.MoveCursoruses WPF’sKeyEventArgs, implying keyboard-based cursor interaction.
4. Dependencies
Internal Dependencies
DTS.Common.Base– All interfaces depend onIBaseViewandIBaseViewModelfrom this namespace.DTS.Common.Events–ITestDataSeriesViewdepends on this (though no event types are used in the provided snippet).DTS.Common.Classes.Viewer.TestMetadata–IGraphChannelViewModeldepends onTestChannel(imported from this namespace).System.Collections.Generic,System.Collections.ObjectModel,System.Collections.Specialized,System.Windows.Input,System.Windows.Media– Used for collections, commands, and UI types.
External Dependencies
- WPF – Indicated by use of
KeyEventArgs,ObservableCollection<T>, andBrush. - Unknown types:
ITestChannel,ITestDataSeries,TestChannel— referenced but not defined in this module; must be defined elsewhere (likely inDTS.Common.Classes.Viewer.TestMetadataor similar).
5. Gotchas
IGraphView.SetGraphs(...)is commented out — The method signature exists only as a comment, suggesting incomplete or deprecated functionality. Do not assume this method is implemented or callable.ITestDataSeriesmetadata is mixed: Some properties are read-only (Description,SensorSNDisplay,MinY, etc.), others are read-write (TestGroup,ChannelName, etc.). Ensure consumers respect mutability.ITestDataSeriesViewModel.MoveCursoruses WPF types — This implies tight coupling to WPF; non-WPF UI implementations may require adaptation or stubbing.ITestDataSeriesViewModel.CurrentCursorValuesis a string — Its format is not specified; consumers must agree on parsing/formatting (e.g.,"X: 1.23, Y: 4.56").ITestDataSeriesViewModel.Modelis of typeITestDataSeries— The interface name matches the model type, but the property is namedModel, notTestDataSeries. Ensure consistency in naming.- Namespace consistency via
// ReSharper disable CheckNamespace— Indicates intentional namespace alignment across files; do not assume additional namespace nesting. - No explicit validation or error handling — Interfaces do not define exception behavior or validation rules; these are likely implementation-specific.
ITestDataSeriesView.SaveReportToPDFandSaveReportToCSVreturnbool— Success/failure semantics are not documented; callers must infer meaning (e.g.,true= success,false= failure or cancellation).IGraphMainViewModelusesList<ITestChannel>for locked/selected lists — Not thread-safe; concurrent modifications may cause issues if not externally synchronized.LockedGroupNameandTestNameparameters inAddLockedGroupChannels— Ambiguity:testNameis used in locked group context butgroupNameis used elsewhere for grouping; ensure naming consistency across consumers.