8.0 KiB
8.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T02:34:12.071463+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | a0d576d041a71e53 |
ChartOptions
Documentation Page: Chart Options Module
1. Purpose
This module defines the core interfaces for the chart options UI layer in the DTS Viewer subsystem. It establishes the MVVM (Model-View-ViewModel) contract for configuring chart display parameters—such as timebase, voltage range, filtering, cursor visibility, and data export—within a charting context. The interfaces IChartOptionsView, IChartOptionsViewModel, and IChartOptionsModel collectively enable separation of concerns between UI presentation, state management, and business logic, supporting features like zoom/t-scale resets, PDF export, and dynamic unit display (e.g., V vs. mV).
2. Public Interface
IChartOptionsView
- Inherits:
IBaseView - Description: Marker interface for the view (UI) component of the chart options panel. No additional members beyond base view contract.
IChartOptionsViewModel
- Inherits:
IBaseViewModel - Properties:
IBaseView View { get; set; }– Reference to the associated view instance.IBaseViewModel Parent { get; set; }– Reference to the parent view model (e.g., main chart view model).IChartOptionsModel Model { get; set; }– Reference to the underlying data model.object ContextSearchRegion { get; set; }– Context object for search/region operations (type not specified; likely used for interop or region selection).
- Methods:
void PublishChanges()– Commits pending configuration changes (e.g., updated filters, scale, units).void ResetZoomMethod()– Resets Y-axis zoom to default/full scale.void ResetTMethod()– Resets T-axis (timebase) zoom/limits to default.void SaveToPDFMethod()– Triggers export of the current chart view to PDF.void ShowCusor(bool value)– Controls visibility of the primary cursor (note: typo in method name—Cusorinstead ofCursor).void ShowMinMaxCursor(bool value)– Controls visibility of min/max cursor indicators.
IChartOptionsModel
- Inherits:
IBaseModel - Properties:
bool SupportsADC { get; set; }– True if all channels support analog-to-digital conversion.bool SupportsMV { get; set; }– True if all channels support millivolt measurements.bool DisplayingVolts { get; set; }– True if units are displayed in Volts; false implies mV.string MVOrV { get; }– Returns"V"or"mV"based onDisplayingVolts.List<double> FullScaleValues { get; set; }– Available full-scale range options (e.g., [1, 5, 10] for Volts).double SelectedFullScaleValue { get; set; }– Currently selected full-scale value.double MinFixedY { get; set; }/MaxFixedY { get; set; }– Fixed Y-axis range limits.double MinFixedT { get; set; }/MaxFixedT { get; set; }– Fixed T-axis (time) range limits.bool LockedT { get; set; }– True if T-axis range is locked (immutable).bool LockedY { get; set; }– True if Y-axis range is locked.bool ShowCursor { get; set; }– Controls primary cursor visibility.string CurrentCursorValues { get; set; }– String representation of current cursor positions (e.g., "t=1.23s, y=4.56mV").YRangeScaleEnum YRange { get; set; }– Enumerated Y-axis scaling mode (e.g., Auto, Fixed, Full).ChartUnitTypeEnum UnitType { get; set; }– Enumerated unit type for Y-axis (e.g., Voltage, Current).TimeUnitTypeEnum TimeUnitType { get; set; }– Enumerated unit type for T-axis (e.g., Seconds, Milliseconds).string UnitTypeDescription { get; }– Human-readable description ofUnitType(e.g., "Voltage (mV)").FilterOptionEnum Filter { get; set; }– Selected filter option (e.g., None, Lowpass, Highpass).IFilterClass SelectedFilter { get; set; }– Concrete filter instance corresponding toFilter.bool IsCursorsAvailable { get; set; }– True if cursor functionality is enabled for the current chart.bool CanPublishChanges { get; set; }– Indicates whetherPublishChanges()should be allowed (e.g., after validation).bool ReadData { get; set; }– Controls whether live data acquisition is active.bool IsDigitalChannel { get; set; }– True if the chart displays digital (logic) channel data.bool DecimateData { get; set; }– True if data decimation is applied for performance.long WidthPoints { get; set; }– Number of data points displayed horizontally (resolution).
- Commands (Prism
DelegateCommand):DelegateCommand ResetZoomCommand { get; }– Binds toResetZoomMethod()(via ViewModel).DelegateCommand ResetTCommand { get; }– Binds toResetTMethod()(via ViewModel).DelegateCommand SaveToPDFCommand { get; }– Binds toSaveToPDFMethod()(via ViewModel).
- Relationships:
IChartOptionsViewModel Parent { get; set; }– Back-reference to the owning view model.
3. Invariants
IChartOptionsModel.MVOrVis derived fromDisplayingVoltsand must return"V"whenDisplayingVolts == true, otherwise"mV".IChartOptionsModel.UnitTypeDescriptionis derived fromUnitTypeand must reflect the current unit type’s human-readable form.IChartOptionsModel.FilterandSelectedFiltermust be kept in sync: settingFiltershould updateSelectedFilterto a correspondingIFilterClassinstance.IChartOptionsModel.IsCursorsAvailablemust befalsefor digital channels (IsDigitalChannel == true), as cursors are typically analog-only.IChartOptionsModel.LockedTandLockedYimply thatMinFixedT/MaxFixedTandMinFixedY/MaxFixedYare immutable during the lock period.IChartOptionsViewModel.Modelmust be non-null and consistent withIChartOptionsModel.Parent.
4. Dependencies
- Dependencies of this module:
DTS.Common.Base(providesIBaseView,IBaseViewModel,IBaseModel).DTS.Common.Enums.Viewer(providesYRangeScaleEnum,ChartUnitTypeEnum,TimeUnitTypeEnum).DTS.Common.Interface.Sensors.SoftwareFilters(providesIFilterClass).Microsoft.Practices.Prism.Commands(providesDelegateCommand).
- Dependencies on this module:
- Any charting UI component requiring configuration (e.g.,
IChartView/IChartViewModel) likely consumesIChartOptionsViewModeland/orIChartOptionsModel. - Data acquisition or rendering logic may depend on
IChartOptionsModelproperties (e.g.,DecimateData,ReadData,SelectedFilter).
- Any charting UI component requiring configuration (e.g.,
5. Gotchas
- Typo in method name:
ShowCusor(bool)(should beShowCursor). This is consistent across the source and likely reflects legacy naming. - Ambiguous
ContextSearchRegion: Type isobjectwith no documentation—consumers must infer contract (e.g., likely expects a region object from a parent view model or chart control). MVOrVandUnitTypeDescriptionare read-only: Their values are computed from other properties; direct assignment is impossible.SelectedFilteris of typeIFilterClass: Implementation must ensure the selected filter instance matches theFilterenum value (per comment: "FB 13120 Updated to use IFilterClass").- No validation rules exposed:
CanPublishChangesis a boolean flag but its update logic (e.g., when it becomestrue) is not defined in this interface. - No thread-safety guarantees: All methods/properties assume single-threaded access (common in WPF MVVM but not explicit here).
- None identified from source alone for digital channel behavior beyond
IsCursorsAvailable.