8.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T11:11:47.054703+00:00 | zai-org/GLM-5-FP8 | 1 | 47d9a78e7853eabc |
Documentation: DTS.Viewer.GraphList.Models
1. Purpose
This module provides the data model classes for the Graph List functionality within the DTS Viewer application. It defines the structure for individual graph objects (GraphObject, GraphPropertyObject) and the hierarchical view models required to populate WPF TreeView controls (TreeViewChannels, TreeViewIds). The module bridges raw data with UI-specific behaviors, implementing INotifyPropertyChanged for data binding and handling complex selection logic for channel and event navigation.
2. Public Interface
Class: GraphPropertyObject
Located in DTS.Viewer.GraphList.Model. A POCO-style class decorated with attributes for the Xceed WPF Toolkit PropertyGrid.
GraphPropertyObject(): Default constructor.int Id: Read-only property categorized under "Information".string Name: Read-only property categorized under "Information".string Description: Read-only property categorized under "Information".string Filter: Categorized under "Parameters"; usesItemsSource(typeof(CFCFilterItemSource)).string DataFlag: Categorized under "Parameters".double ShiftT0: Categorized under "Parameters".double EuMultiplier: Categorized under "Parameters".double EuOffset: Categorized under "Parameters".
Class: GraphObject
Located in DTS.Viewer.GraphList.Model. Implements IBaseClass. Represents a single graph entity containing both data and display parameters.
GraphObject(): Constructor that callsLoadGraphs().int RecordId: Gets or sets the record ID; notifies property change.int Id: Gets or sets the ID; synchronizes withProperty.Id.string Name: Gets or sets the name; synchronizes withProperty.Name.string Description: Gets or sets the description; synchronizes withProperty.Description.CFCFilter Filter: Gets or sets the filter; synchronizes withProperty.Filter(converted to string).string DataFlag: Gets or sets the data flag; synchronizes withProperty.DataFlag.double ShiftT0: Gets or sets the T0 shift; synchronizes withProperty.ShiftT0.double EuMultiplier: Gets or sets the EU multiplier; synchronizes withProperty.EuMultiplier.double EuOffset: Gets or sets the EU offset; synchronizes withProperty.EuOffset.List<double> Data: Gets or sets the list of data points.bool Visable: Gets or sets the visibility state.GraphPropertyObject Property: Gets or sets the internal property object wrapper.event PropertyChangedEventHandler PropertyChanged: Event for property change notification.void OnPropertyChanged(string propertyName): Invokes thePropertyChangedevent.
Class: TreeViewChannels
Located in DTS.Viewer.GraphList. Implements IBaseModel. Root node for binding a channel-based TreeView.
string Name: Gets or sets the node name.ObservableCollection<TestGroup> Groups: Gets or sets the child groups; updatesGroupsCounton set.int GroupsCount: Gets or sets the count of groups.string Path: Gets or sets the path.bool IsSaved: Getter only (read-only).bool IsExpanded: Gets or sets the expanded state of the TreeView node.bool IsSelected: Gets or sets the selected state.
Class: TestGroup
Located in DTS.Viewer.GraphList. Child node for TreeViewChannels.
IBaseViewModel Parent: Gets or sets the parent ViewModel.bool IsLocked: Gets or sets the locked state; calls((IGraphMainViewModel)Parent).AddLockedGroupChannels(...)on set.bool IsSelected: Gets or sets the selected state; calls((IGraphMainViewModel)Parent).AddSelectedGroupChannels(...)on set. Ignores selection ifNamestarts with "Test Channels" or "Calculated Channels".bool CanLock: Controls whether the item can be locked.ObservableCollection<ITestChannel> Channels: Gets or sets the collection of channels.- Other Properties:
Path,DTSFile,IsGraph,IsExpanded,TestName,Name,DisplayName,ChannelCount.
Class: TreeViewIds
Located in DTS.Viewer.GraphList. Implements IBaseModel. Root node for binding an ID/Event-based TreeView.
IBaseViewModel Parent: Gets or sets the parent ViewModel.int TreeIndex: Gets or sets the index of this tree node.ObservableCollection<ITestEvent> Events: Gets or sets child events.bool IsSelected: Gets or sets the selected state; manages cascading selection to children viaSetChildNodes.void SetChildNodes(bool isSelected): Iterates throughEventsand sets theirIsSelectedproperty.static void SetIsItemSelected(UIElement element, bool value): Attached property setter forIsItemSelectedProperty.
Class: TestEvent
Located in DTS.Viewer.GraphList. Implements ITestEvent. Child node for TreeViewIds.
bool IsSelected: Complex setter that handles Shift/Ctrl key logic for multi-selection. Interacts withIExportGraphMainViewModelto manage selection lists (AddToSelectedEvents,RemoveFromSelectedEvents).bool IsLocked: Gets or sets locked state; calls((IExportGraphMainViewModel)parent).AddLockedEvents(...)on set.- Other Properties:
Path,Parent,IsGraph,IsExpanded,CanLock,TestName,Name,TestSetupName,TestItem,DTSFile,DataType,Events,TestId,TreeIndex.
3. Invariants
- Synchronization: When
GraphObject.Id,Name,Description,Filter,DataFlag,ShiftT0,EuMultiplier, orEuOffsetare set, the corresponding property on the internalGraphPropertyObjectinstance (accessed viaProperty) must be updated immediately. - Type Conversion:
GraphObject.Filteris of typeCFCFilter(enum), but it is stored as astringinGraphPropertyObject.Filter. - Collection Counts: Setting
TreeViewChannels.Groupsautomatically updatesGroupsCount. SettingTestGroup.Channelsautomatically updatesChannelCount. SettingTreeViewIds.Eventsautomatically updatesEventCount. - Parent Interface Requirements:
TestGrouprequires itsParentto be castable toIGraphMainViewModel.TreeViewIdsandTestEventrequire theirParentto be castable toIExportGraphMainViewModel.
4. Dependencies
Internal Dependencies (Inferred from imports):
DTS.Common: UsesCFCFilterenum andCFCFilterItemSource.DTS.Common.Base: UsesIBaseClass,IBaseModel.DTS.Common.Interface: UsesIBaseViewModel,ITestChannel,ITestEvent,IGraphMainViewModel,IExportGraphMainViewModel.
External Dependencies:
Xceed.Wpf.Toolkit.PropertyGrid.Attributes: Used forCategory,DisplayName,ReadOnly,Description, andItemsSourceattributes inGraphPropertyObject.System.Windows: Used forDependencyProperty,UIElement,Input.Keyboard,Controls.ItemsControl.
5. Gotchas
- Typo in Property Name:
GraphObject.Visableappears to be a typo for "Visible". - Silent Failures in Selection Logic: In
TreeViewIds.IsSelected, ifParentis null or not of typeIExportGraphMainViewModel, the setter returns early without setting the backing field or notifying property change. - Complex Setter Logic (Side Effects):
- Setting
TestGroup.IsSelectedorTestEvent.IsSelectedtriggers logic in the parent ViewModel that modifies global state (selection lists). TestEvent.IsSelectedreads static keyboard state (Keyboard.IsKeyDown) directly within the property setter. This ties the model tightly to the UI input state and can cause unpredictable behavior if the property is set programmatically rather than via user interaction.
- Setting
- **Hardcoded String Comparisons