4.5 KiB
4.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T02:32:41.267985+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | aacb0b18894c95e6 |
ViewerSettings
Documentation: Viewer Settings Module Interfaces
1. Purpose
This module defines the contract interfaces for the viewer settings UI layer, implementing the Model-View-ViewModel (MVVM) pattern. It provides a standardized abstraction between the view (UI) and view model (logic/data) for configuring viewer-specific settings—specifically calibration behavior and visibility of settings sections. The interfaces IViewerSettingsView and IViewerSettingsViewModel enable decoupled development and testing of the viewer settings UI, ensuring separation of concerns while integrating into the broader DTS.Common framework.
2. Public Interface
IViewerSettingsView
- Inherits:
IBaseView - Description: A marker interface representing the view (e.g., a WPF
UserControl) responsible for rendering viewer settings. It carries no additional members beyond those defined inIBaseView, implying it relies on base view conventions (e.g., binding context, lifecycle hooks) defined elsewhere.
IViewerSettingsViewModel
- Inherits:
IBaseViewModel - Properties:
IViewerSettingsView View { get; set; }
Gets or sets the associated view instance. Enables two-way binding and view-model-to-view coordination.IBaseViewModel Parent { get; set; }
Gets or sets the parent view model, supporting hierarchical view model composition (e.g., for navigation or context propagation).Visibility CalibrationBehaviorSettingVisibility { get; set; }
Controls the visibility of the calibration behavior setting UI element (e.g., a dropdown or group box). Read-write, allowing runtime toggling.Visibility OverallSettingsVisibility { get; }
Read-only visibility flag for the entire settings section (e.g., to hide/show the whole panel). Likely derived from application state or permissions.DisplayedCalibrationBehavior[] AvailableCalibrationBehaviors { get; }
Returns an array of available calibration behavior options, represented asDisplayedCalibrationBehaviorobjects (defined inDTS.Common.Classes.Sensors). Used to populate a selection UI.
- Methods:
void PublishChanges()
Commits or broadcasts any pending changes made in the settings UI (e.g., to a sensor configuration service or settings store). Behavior is implementation-defined but implies persistence or notification.
3. Invariants
Viewmust be assigned to an instance implementingIViewerSettingsViewbefore the view model is used (enforced by MVVM framework conventions, though not explicitly validated in the interface).CalibrationBehaviorSettingmust be one of the values inAvailableCalibrationBehaviorsat all times; invalid assignments are expected to be rejected by the implementation (not enforced by interface).OverallSettingsVisibilityis read-only and must remain consistent with higher-level application state (e.g., user role, active sensor type).AvailableCalibrationBehaviorsmust be non-null and immutable once set; modifications require reassignment.
4. Dependencies
- Depends on:
DTS.Common.Base(providesIBaseView,IBaseViewModel)System.Windows(forVisibilitytype)DTS.Common.Classes.Sensors(forDisplayedCalibrationBehaviortype)
- Depended on by:
- Likely consumed by a WPF UI project (via
IViewerSettingsView) and a core logic/service layer (viaIViewerSettingsViewModel). - Implementation classes (e.g.,
ViewerSettingsViewModel,ViewerSettingsView) would depend on this interface for decoupled instantiation and testing.
- Likely consumed by a WPF UI project (via
5. Gotchas
DisplayedCalibrationBehavioris referenced but not defined in this source; its structure (e.g., properties likeName,Value) is unknown here and must be verified inDTS.Common.Classes.Sensors.PublishChanges()has no documented error handling or rollback semantics—implementation may throw or silently fail.OverallSettingsVisibilityis read-only; callers cannot directly control it, which may limit flexibility if dynamic reconfiguration is needed.- No validation or null-safety guarantees are specified for
VieworParent; implementations must handle null references. - None identified from source alone.