8.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:19:24.422198+00:00 | zai-org/GLM-5-FP8 | 1 | a2e58408ee52b3f9 |
Documentation: ChartOptionsModel.cs
1. Purpose
ChartOptionsModel is a state-bearing model class that encapsulates all configuration options for chart display within the DTS Viewer application. It manages chart unit types (EU, mV, V, PSD, FFT), time units, Y-axis scaling modes, filter selections, cursor behavior, and axis locking states. The class implements INotifyPropertyChanged (via BasePropertyChanged) to support data binding and coordinates with a parent IChartOptionsViewModel to publish changes and execute commands.
2. Public Interface
Class Signature
public class ChartOptionsModel : Common.Base.BasePropertyChanged, IChartOptionsModel
Properties
| Property | Type | Default | Description |
|---|---|---|---|
DisplayingVolts |
bool |
false |
Toggles between Volts (true) and millivolts (false) display. Raises OnPropertyChanged for "MVOrV" and "UnitTypeDescription" when changed. |
MVOrV |
string |
— | Read-only. Returns "V" if DisplayingVolts is true, otherwise "mV". |
IsDigitalChannel |
bool |
false |
Indicates whether the channel is digital. |
SupportsADC |
bool |
true |
Indicates ADC support. |
SupportsMV |
bool |
true |
Indicates millivolt support. |
UnitType |
ChartUnitTypeEnum |
ChartUnitTypeEnum.EU |
The unit type for the chart. Changing this sets ReadData = true and auto-adjusts Filter based on unit type. |
UnitTypeDescription |
string |
— | Read-only. Returns "V" or "mV" for ChartUnitTypeEnum.mV, otherwise returns UnitType.ToString(). |
TimeUnitType |
TimeUnitTypeEnum |
TimeUnitTypeEnum.MS |
Time unit for the X-axis. Sets ReadData = true on change. |
TimeUnitTypeDescription |
string |
"MS" |
String representation of TimeUnitType. |
SelectedFilter |
IFilterClass |
FilterClass(Unfiltered) |
The selected software filter. Sets ReadData = true on change. |
MinFixedY |
double |
0.00 |
Minimum Y-axis value for fixed range. |
MaxFixedY |
double |
0.00 |
Maximum Y-axis value for fixed range. |
MinFixedT |
double |
0.00 |
Minimum X-axis (time) value for fixed range. |
MaxFixedT |
double |
0.00 |
Maximum X-axis (time) value for fixed range. |
FullScaleValues |
List<double> |
— | Returns _euValues for EU/PSD unit types, otherwise _fullScaleValues. |
SelectedFullScaleValue |
double |
100 |
Currently selected full-scale value. |
LockedT |
bool |
false |
Indicates if the X-axis is locked. |
LockedY |
bool |
false |
Indicates if the Y-axis is locked. |
ShowCursor |
bool |
false |
Cursor visibility. Calls Parent?.ShowCusor(value) on change. |
CurrentCursorValues |
string |
"" |
String representation of current cursor values. |
YRange |
YRangeScaleEnum |
YRangeScaleEnum.AutoRange |
Y-axis range mode. Setting to Fixed automatically sets LockedY = true. |
Filter |
FilterOptionEnum |
FilterOptionEnum.TestSetupDefault |
Filter option enum. Sets ReadData = true on change. |
Parent |
IChartOptionsViewModel |
null |
Reference to parent view model. |
CanPublishChanges |
bool |
true |
Controls whether property changes trigger Parent?.PublishChanges(). |
IsCursorsAvailable |
bool |
false |
Indicates if cursors are available for the current context. |
T0Cursor |
bool |
false |
T0 cursor flag. |
MinMaxCursors |
bool |
false |
Min/Max cursors flag. |
ReadData |
bool |
false |
Flag indicating data should be re-read. |
IsSaved |
bool |
— | Read-only auto-property (no setter visible). |
DecimateData |
bool |
false |
Getter returns false if UnitType is PSD or FFT, otherwise returns backing field value. |
WidthPoints |
long |
0 |
Width points for decimation. |
Commands
| Command | Type | Description |
|---|---|---|
ResetZoomCommand |
DelegateCommand |
Executes ResetZoomMethod(), which delegates to Parent.ResetZoomMethod(). |
ResetTCommand |
DelegateCommand |
Executes ResetTMethod(), which delegates to Parent.ResetTMethod(). |
SaveToPDFCommand |
DelegateCommand |
Executes SaveToPDFMethod(), which delegates to Parent.SaveToPDFMethod(). |
Methods
| Method | Signature | Description |
|---|---|---|
ChartOptionsModel |
ctor() |
Empty parameterless constructor. |
SetSelectedFilterToUnfilteredNoRead |
void SetSelectedFilterToUnfilteredNoRead() |
Sets _selectedFilter to FilterClass(Unfiltered) with ReadData = false. Raises OnPropertyChanged("SelectedFilter"). |
OnPropertyChanged |
void OnPropertyChanged(string propertyName) |
Raises PropertyChanged event. Conditionally calls Parent?.PublishChanges() unless the property is in an exclusion list. |
Events
| Event | Type | Description |
|---|---|---|
PropertyChanged |
PropertyChangedEventHandler |
Standard INotifyPropertyChanged event. |
3. Invariants
-
UnitType → Filter coupling: When
UnitTypeis set to anything other thanEUorPSD,Filteris automatically set toFilterOptionEnum.Unfiltered. WhenUnitTypeisEUorPSD,Filteris set toFilterOptionEnum.TestSetupDefault. -
YRange → LockedY coupling: Setting
YRangetoYRangeScaleEnum.Fixedautomatically setsLockedY = true. -
DecimateData conditional return: The
DecimateDatagetter always returnsfalsewhenUnitTypeisChartUnitTypeEnum.PSDorChartUnitTypeEnum.FFT, regardless of the backing field_decimateData. -
FullScaleValues selection: The property returns
_euValueslist whenUnitTypeisEUorPSD; otherwise returns_fullScaleValues. -
Change publishing exclusion: The following properties do not trigger
Parent?.PublishChanges()when changed:CanPublishChanges,Parent,ReadData,UnitTypeDescription,ShowCursor,LockedT,LockedY,MVOrV,DisplayingVolts,DecimateData,WidthPoints
4. Dependencies
This Module Depends On
System,System.Collections.Generic,System.ComponentModel(BCL)DTS.Common— Base namespaceDTS.Common.Base.BasePropertyChanged— Base class providingSetPropertymethodDTS.Common.Classes.Sensors—FilterClassimplementationDTS.Common.Enums.Viewer—ChartUnitTypeEnum,TimeUnitTypeEnum,FilterOptionEnum,YRangeScaleEnumDTS.Common.Interface—IChartOptionsModel(implied),IChartOptionsViewModelDTS.Common.Interface.Sensors.SoftwareFilters—IFilterClassPrism.Commands—DelegateCommand
What Depends On This Module
- Unknown from source alone — The
IChartOptionsViewModelinterface references this model via theParentproperty, but concrete consumers are not visible in this file.
5. Gotchas
-
Typo in method call: In the
ShowCursorsetter, the code callsParent?.ShowCusor(_showCursor)— note the spelling "Cusor" instead of "Cursor". This is either a typo in the method name onIChartOptionsViewModelor a historical naming quirk. -
SetSelectedFilterToUnfilteredNoRead exists as a workaround: The method
SetSelectedFilterToUnfilteredNoRead()specifically bypasses the automaticReadData = truebehavior that occurs when settingSelectedFiltervia the property. This suggests the automatic data refresh is sometimes undesirable and requires explicit circumvention. -
Inconsistent property setter patterns: Some properties use
SetProperty(ref _field, value, "PropertyName")(e.g.,IsDigitalChannel,DisplayingVolts), while others manually implement equality checks andOnPropertyChangedcalls (e.g.,UnitType,MinFixedY). This inconsistency may reflect different authors or refactoring over time. -
IsSaved is unassigned: The
IsSavedproperty has no setter and no initialization. The ReSharper annotation// ReSharper disable UnassignedGetOnlyAutoPropertyat the top of the file suppresses warnings about this. Accessing this property will returndefault(bool)(false). -
ReadData side effects are implicit: Setting
UnitType,TimeUnitType,SelectedFilter, orFiltersilently setsReadData = true. Callers must be aware that these property changes have side effects beyond the property value itself. -
Historical comment FB 13120: The comment
// FB 13120 does not need to set SelectedFilter any more since it's not using enumand// FB 13120 use filter class instead of cfc filter enumreference a past bug/feature (likely FogBugz case 13120) where filter handling was refactored from an enum to a class-based approach.