5.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T03:07:33.846375+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | cbdae98784eb0e4b |
ViewerSettings
Documentation: Viewer Settings Module
1. Purpose
This module defines the foundational interfaces for the Viewer Settings feature, which manages user-configurable display and calibration behaviors within the DTS Viewer application. It implements the Model-View-ViewModel (MVVM) pattern to decouple UI presentation (IViewerSettingsView) from business logic and state (IViewerSettingsViewModel). The module exists to provide a standardized contract for implementing settings UI and logic related to sensor calibration behavior and overall viewer configuration visibility—enabling consistent behavior across different viewer implementations while maintaining separation of concerns.
2. Public Interface
IViewerSettingsView
- Namespace:
DTS.Common.Interface - Inherits:
IBaseView - Description: A view interface representing the UI layer for viewer settings. It has no additional members beyond those inherited from
IBaseView, implying it serves as a marker or placeholder interface—actual UI implementation details are not defined here.
IViewerSettingsViewModel
- Namespace:
DTS.Common.Interface - Inherits:
IBaseViewModel - Members:
IViewerSettingsView View { get; set; }- Gets or sets the associated view instance (MVVM binding context).
IBaseViewModel Parent { get; set; }- Gets or sets the parent view model in the hierarchy (e.g., main settings or viewer root).
void PublishChanges();- Commits or propagates any pending configuration changes (e.g., to sensor calibration settings).
Visibility CalibrationBehaviorSettingVisibility { get; set; }- Controls the visibility of the calibration behavior setting control in the UI (read/write).
Visibility OverallSettingsVisibility { get; }- Controls the visibility of the overall settings section (read-only).
DisplayedCalibrationBehavior[] AvailableCalibrationBehaviors { get; }- Returns the list of supported calibration behavior options (e.g.,
Auto,Manual,Disabled).
- Returns the list of supported calibration behavior options (e.g.,
DisplayedCalibrationBehavior CalibrationBehaviorSetting { get; set; }- Gets or sets the currently selected calibration behavior from
AvailableCalibrationBehaviors.
- Gets or sets the currently selected calibration behavior from
Note
:
DisplayedCalibrationBehavioris defined inDTS.Common.Classes.Sensors(imported viausing), but its structure is not included in the provided source files.
3. Invariants
IViewerSettingsViewModel.Viewmust be assigned to a valid instance implementingIViewerSettingsViewbefore UI interaction occurs (enforced by MVVM binding conventions, though not explicitly validated in the interface).CalibrationBehaviorSettingmust be one of the values inAvailableCalibrationBehaviorsat all times (assumed invariant; no validation logic is visible in the interface).OverallSettingsVisibilityis read-only, implying its value is computed internally (e.g., based on feature flags or runtime conditions) and not externally modifiable.PublishChanges()is expected to be called explicitly to persist changes—no automatic persistence is implied by the interface.
4. Dependencies
- Depends on:
DTS.Common.Base(providesIBaseView,IBaseViewModel).System.Windows(forVisibilitytype—indicating WPF UI usage).DTS.Common.Classes.Sensors(forDisplayedCalibrationBehaviortype).
- Depended on by:
- Any concrete implementation of
IViewerSettingsView/IViewerSettingsViewModel(e.g., WPF user controls and view models in the viewer project). - Likely consumed by higher-level view models (via
Parent) or a settings management service (not visible in source).
- Any concrete implementation of
5. Gotchas
- Ambiguity in
DisplayedCalibrationBehavior: Its definition (e.g., properties likeName,Value, or enum vs. class) is not included here—implementation details are critical for correctly populatingAvailableCalibrationBehaviorsand interpretingCalibrationBehaviorSetting. - No validation in interface: The interface does not enforce that
CalibrationBehaviorSettingis inAvailableCalibrationBehaviors; implementations must handle this (e.g., via setter validation or initialization logic). OverallSettingsVisibilityis read-only: Developers may mistakenly attempt to set it directly—its value must be managed internally by the view model.PublishChanges()semantics undefined: The interface does not specify whether changes are persisted synchronously, to disk, or to a sensor configuration service—implementation-specific behavior.Viewproperty is mutable: While common in MVVM, allowingsetonViewmay introduce risks if reassigned during the view model’s lifetime (e.g., during UI re-creation).