6.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:01:19.271156+00:00 | zai-org/GLM-5-FP8 | 1 | b9213b8d6a0e210e |
Documentation: PSDReportSettingsModel
1. Purpose
PSDReportSettingsModel is a model class that stores and manages configuration settings for Power Spectral Density (PSD) report generation within the DTS Viewer application. It encapsulates filter parameters (low-pass and high-pass), windowing configuration (width, type, averaging, overlapping), and data range boundaries. The class implements INotifyPropertyChanged via BasePropertyChanged and coordinates with a parent view model through the IPSDReportSettingsModel interface, automatically notifying the parent of changes when CanPublishChanges is enabled.
2. Public Interface
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
Parent |
IPSDReportSettingsViewModel |
null |
Reference to the parent view model. Setter includes equality check to avoid redundant updates. |
CanPublishChanges |
bool |
true |
Controls whether property changes trigger Parent.PublishChanges() notification. |
LowPassFilterEnabled |
bool |
false |
Enables/disables low-pass filter. Sets ReadData = true on change. |
LowPassFilterFrequency |
double |
2000 |
Low-pass filter cutoff frequency. Sets ReadData = true on change. |
LowPassFilterType |
PassFilterType |
PassFilterType.Butterworth |
Low-pass filter algorithm type. Sets ReadData = true on change. |
LowPassFilterOrder |
int |
8 |
Low-pass filter order. Sets ReadData = true on change. |
HighPassFilterEnabled |
bool |
false |
Enables/disables high-pass filter. Sets ReadData = true on change. |
HighPassFilterFrequency |
double |
5 |
High-pass filter cutoff frequency. Sets ReadData = true on change. |
HighPassFilterType |
PassFilterType |
PassFilterType.Butterworth |
High-pass filter algorithm type. Sets ReadData = true on change. |
HighPassFilterOrder |
int |
8 |
High-pass filter order. Sets ReadData = true on change. |
WindowWidth |
WindowWidth |
WindowWidth.FortyNinetySix |
Window width for spectral analysis. Sets ReadData = true on change. |
WindowType |
WindowType |
WindowType.Hanning |
Window function type. Sets ReadData = true on change. |
WindowAveragingType |
WindowAveragingType |
WindowAveragingType.Averaging |
Averaging method for windows. Sets ReadData = true on change. |
WindowOverlappingPercent |
double |
50 |
Window overlap percentage. Sets ReadData = true on change. |
ShowEnvelope |
bool |
false |
Controls envelope display. Sets ReadData = true on change. |
IsSaved |
bool |
(not visible) | Read-only property indicating save state. No setter visible in source. |
ReadData |
bool |
false |
Flag indicating whether data should be re-read. |
DataStart |
double |
0D |
Start boundary for data range. Sets ReadData = true on change. |
DataEnd |
double |
0D |
End boundary for data range. Sets ReadData = true on change. |
Methods
| Method | Signature | Description |
|---|---|---|
OnPropertyChanged |
void OnPropertyChanged(string propertyName) |
Override that raises PropertyChanged event and conditionally calls Parent?.PublishChanges() unless the property is CanPublishChanges, Parent, or ReadData. |
Events
| Event | Type | Description |
|---|---|---|
PropertyChanged |
PropertyChangedEventHandler |
Override of base event; raised when any property value changes. |
3. Invariants
-
ReadData Side Effect: The following properties always set
ReadData = truewhen modified:LowPassFilterEnabled,LowPassFilterFrequency,LowPassFilterType,LowPassFilterOrderHighPassFilterEnabled,HighPassFilterFrequency,HighPassFilterType,HighPassFilterOrderWindowWidth,WindowType,WindowAveragingType,WindowOverlappingPercent,ShowEnvelopeDataStart,DataEnd
-
Publishing Exclusion: Changes to
CanPublishChanges,Parent, orReadDatado not triggerParent.PublishChanges(). -
Publishing Gate:
Parent?.PublishChanges()is only invoked whenCanPublishChanges == true. -
Parent Equality Check: The
Parentproperty setter checks_parent != null && _parent.Equals(value)before updating, preventing redundant property change notifications. -
IsSaved Immutability:
IsSavedhas no setter visible in the source; its value is determined externally (possibly via constructor or reflection).
4. Dependencies
This Module Depends On:
DTS.Common.Enums.Viewer.Reports— ProvidesPassFilterType,WindowWidth,WindowType,WindowAveragingTypeenumsDTS.Common.Interface— ProvidesIPSDReportSettingsViewModelinterfaceCommon.Base.BasePropertyChanged— Base class providingSetPropertymethod andINotifyPropertyChangedinfrastructure
Consumers (Inferred):
- Any module implementing
IPSDReportSettingsViewModel(the parent view model) - Any code referencing
IPSDReportSettingsModelinterface
5. Gotchas
-
ReadData Never Auto-Resets: Setting
ReadData = truevia property changes never automatically resets it back tofalse. The consuming code must manage this flag's lifecycle. -
IsSaved Has No Setter: The
IsSavedproperty is read-only with no initialization visible in this file. Its value must be set through a mechanism not shown in the source (possibly constructor injection, reflection, or partial class extension). -
Parent Can Be Null: The
Parentproperty is not validated for null before use inOnPropertyChanged. WhileParent?.PublishChanges()uses null-conditional operator, ifParentis null during other operations, behavior is undefined. -
Inconsistent Setter Patterns: The
Parentsetter uses manual equality checking andOnPropertyChanged("Parent"), while most other properties useSetProperty(). TheCanPublishChangessetter uses direct field assignment withOnPropertyChanged("CanPublishChanges"). This inconsistency may lead to subtle behavioral differences. -
No Validation on Numeric Inputs: Properties like
LowPassFilterFrequency,HighPassFilterFrequency,WindowOverlappingPercent,DataStart, andDataEndaccept anydoublevalue without bounds checking. Invalid values (e.g., negative frequencies, overlapping > 100) are not prevented at the model level.