Files
DP44/enriched-qwen3-coder-next/Common/DTS.CommonCore/Enums/DTS.Viewer/ChartOptions.md
2026-04-17 14:55:32 -04:00

5.9 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.CommonCore/Enums/DTS.Viewer/ChartOptions/TimeUnitType.cs
Common/DTS.CommonCore/Enums/DTS.Viewer/ChartOptions/FilterOption.cs
Common/DTS.CommonCore/Enums/DTS.Viewer/ChartOptions/YRangeScale.cs
Common/DTS.CommonCore/Enums/DTS.Viewer/ChartOptions/WakeMethodType.cs
Common/DTS.CommonCore/Enums/DTS.Viewer/ChartOptions/ChartUnitType.cs
2026-04-16T02:45:21.946060+00:00 Qwen/Qwen3-Coder-Next-FP8 1 50e4739cba57afa5

Chart Options Enumerations Documentation

1. Purpose

This module defines a set of strongly-typed enumerations used to configure chart display and behavior in the DTS Viewer application. Each enumeration represents a distinct chart configuration option—such as time unit, filtering strategy, Y-axis scaling, wake-up method, and unit type—and provides associated metadata (e.g., user-facing descriptions) and item source implementations for UI binding (e.g., property grid dropdowns). These enums are part of the DTS.Common.Enums.Viewer namespace and serve as foundational configuration primitives for chart rendering and user interaction.

2. Public Interface

All public types reside in the DTS.Common.Enums.Viewer namespace.

Enumerations

Name Values Description
TimeUnitTypeEnum MS = 0 (displayed as "ms"), Seconds = 1 (displayed as "Seconds") Specifies the time axis unit for chart display.
FilterOptionEnum Unfiltered = 0 ("Unfiltered"), TestSetupDefault = 1 ("Test Setup Default"), Custom = 2 ("Custom") Defines the filtering strategy applied to chart data.
YRangeScaleEnum AutoRange = 0 ("Auto Range"), FullScale = 1 ("% Full Scale"), Fixed = 2 ("Fixed"), Manual = 3 ("Manual") Controls how the Y-axis range is determined for a chart.
WakeMethodTypeEnum None = 0 ("None"), MotionDetect = 1 ("Motion detect"), TimeSession = 2 ("Time session"), Magnet = 3 ("Magnet") Specifies the method used to trigger or wake a data acquisition session.
ChartUnitTypeEnum EU = 0 ("EU"), mV = 1 ("mV"), ADC = 2 ("ADC"), FFT = 3 ("FFT"), PSD = 4 ("PSD") Defines the unit type displayed on the Y-axis of a chart. Includes support for FFT and PSD (Power Spectral Density) as noted in inline comments.

Item Source Classes

Each enum has a corresponding IItemsSource implementation for populating UI controls (e.g., property grid dropdowns). All use EnumUtil.GetValuesList<T>() internally.

Name Returns Purpose
TimeUnitTypeItemSource ItemCollection of TimeUnitTypeEnum values Provides list of time unit options for UI binding.
FilterOptionEnumItemSource ItemCollection of FilterOptionEnum values Provides list of filter options for UI binding.
YRangeScaleItemSource ItemCollection of YRangeScaleEnum values Provides list of Y-axis scaling modes for UI binding.
WakeMethodTypeItemSource ItemCollection of WakeMethodTypeEnum values Provides list of wake-up methods for UI binding.
ChartUnitTypeItemSource ItemCollection of ChartUnitTypeEnum values Provides list of chart unit types for UI binding.

All enums are decorated with [TypeConverter(typeof(EnumDescriptionTypeConverter))], indicating they support localized or descriptive string conversion (e.g., for display in UI).

3. Invariants

  • Enum values are stable: The underlying integer values (0, 1, 2, etc.) are fixed and must not be changed without backward-compatibility review.
  • Descriptions are non-empty: Each enum member has a [Description(...)] attribute with a non-null, non-empty string; this is required for correct UI rendering via EnumDescriptionTypeConverter.
  • Item sources are exhaustive: Each IItemsSource.GetValues() implementation returns all defined enum values via EnumUtil.GetValuesList<T>(), ensuring UI controls show all available options.
  • Namespace consistency: All types reside in DTS.Common.Enums.Viewer; no cross-namespace inheritance or extension is present.

4. Dependencies

Internal Dependencies

  • DTS.Common.Converters.EnumDescriptionTypeConverter: Used for type conversion (e.g., enum → display string).
  • DTS.Common.Utils.EnumUtil: Provides GetValuesList<T>() for populating ItemCollections.
  • Xceed.Wpf.Toolkit.PropertyGrid.Attributes.IItemsSource: Interface implemented by item source classes for WPF property grid integration.

External Dependencies

  • System.ComponentModel: For DescriptionAttribute and TypeConverterAttribute.
  • Xceed.Wpf.Toolkit: For IItemsSource and ItemCollection types.

Consumers (Inferred)

  • UI components using property grids (e.g., chart configuration panels) likely consume these item sources to populate dropdowns.
  • Chart rendering logic likely consumes these enums to configure axis units, scaling, filtering, and time base.

5. Gotchas

  • ChartUnitTypeEnum.FFT and PSD are marked with issue references (//6402 and //25554), indicating incomplete or future implementation. These values may be present in the enum but lack full runtime support.
  • No validation logic is present in the enums themselves: The enums are pure data definitions; validation (e.g., ensuring Custom filter option has associated parameters) must be handled elsewhere.
  • Descriptions are hard-coded strings: Changes to [Description(...)] values may affect localization or UI consistency if not coordinated across resources.
  • No deprecation markers: Older enum values (e.g., TimeUnitTypeEnum.MS) are not marked obsolete, even if deprecated in practice.
  • No documentation for EnumDescriptionTypeConverter behavior: It is unclear whether descriptions are localized or culture-sensitive—this is implementation-specific to DTS.Common.Converters.

None identified beyond the above.