5.6 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T03:08:03.543997+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | d4749d84d62ef814 |
CalculatedChannel
Documentation: IAddCalculatedChannelView and IAddCalculatedChannelViewModel
1. Purpose
This module defines the MVVM (Model-View-ViewModel) interface contract for a UI component used to add a calculated channel—a derived data channel computed from one or more existing channels—within the DTS Viewer application. The IAddCalculatedChannelView interface represents the view layer (UI), while IAddCalculatedChannelViewModel represents the corresponding ViewModel responsible for managing state, user input, and coordination with the rest of the system (e.g., publishing changes, handling search context). Together, they enable users to configure and submit a new calculated channel definition, including options like ISO export behavior and encoding.
2. Public Interface
IAddCalculatedChannelView
- Definition:
public interface IAddCalculatedChannelView : IBaseView - Behavior:
A marker interface extendingIBaseView, indicating this interface represents the view (e.g., XAML page or control) in the MVVM pattern. No additional members are declared—implementation details are assumed to reside in concrete classes.
IAddCalculatedChannelViewModel
- Definition:
public interface IAddCalculatedChannelViewModel : IBaseViewModel - Members:
IBaseView View { get; set; }
Gets or sets the associated view instance (e.g., theIAddCalculatedChannelViewimplementation). Enables the ViewModel to interact with or update the view.IBaseViewModel Parent { get; set; }
Gets or sets the parent ViewModel in the hierarchy, supporting navigation or command relay.void PublishChanges();
Commits or broadcasts the current configuration (e.g., channel definition, settings) to the system—likely triggering validation, channel creation, or persistence.bool IncludeGroupNameInISOExport { get; set; }
Gets or sets a flag indicating whether the group name should be included when exporting channel data to ISO format.int DefaultDTSEncoding { get; set; }
Gets or sets the default encoding (e.g., numeric ID for encoding type like UTF-8, ASCII) used for the calculated channel.ICommand AddCalculatedChannelCommand { get; }
Exposes a command (e.g., bound to a UI button) that, when executed, initiates the process of adding the calculated channel—likely invokingPublishChanges()internally.object ContextSearchRegion { get; set; }
Gets or sets an object representing the context or scope for channel search operations (e.g., a region ID, selection context, or search filter). Type isobject, suggesting flexibility but requiring runtime type knowledge.
3. Invariants
IAddCalculatedChannelViewmust be implemented by a concrete UI class that satisfiesIBaseViewcontract (e.g., implements view lifecycle or binding infrastructure).IAddCalculatedChannelViewModelmust maintain a valid reference to its associatedView(via theViewproperty) for proper MVVM binding and communication.AddCalculatedChannelCommandmust be non-null and executable; its execution must result in a call toPublishChanges()(or equivalent logic) to finalize the operation.DefaultDTSEncodingandIncludeGroupNameInISOExportare mutable properties—changes must be persisted or reflected in the final channel definition uponPublishChanges().ContextSearchRegionis expected to be set beforeAddCalculatedChannelCommandis executed, as it likely influences channel search/selection behavior.
4. Dependencies
This module depends on:
DTS.Common.Base.IBaseView(viaIAddCalculatedChannelView)DTS.Common.Base.IBaseViewModel(viaIAddCalculatedChannelViewModel)System.Windows.Input.ICommand(forAddCalculatedChannelCommand)
This module is depended on by:
- Concrete implementations of
IAddCalculatedChannelView(e.g., WPF/XAML view classes). - Concrete implementations of
IAddCalculatedChannelViewModel(e.g., view model classes handling calculated channel creation logic). - Likely consumed by a parent ViewModel (e.g.,
CalculatedChannelManagerViewModel) that instantiates and coordinates this component.
5. Gotchas
ContextSearchRegionis typed asobject: Its expected runtime type (e.g.,string,Guid, custom context object) is not specified in the interface. Consumers must infer or document the expected type externally.- No explicit validation or error handling exposed: The interface does not define properties/methods for validation state (e.g.,
IsValid,ErrorMessage), suggesting validation may be internal to the ViewModel implementation or handled via external mechanisms. PublishChanges()behavior is unspecified: The interface does not define side effects, error conditions, or return values—implementation may throw, silently fail, or require specific preconditions (e.g., non-empty channel definition).- No documentation on
IncludeGroupNameInISOExportsemantics: It is unclear whether this flag affects all channels in a group or only the newly added one, or how it interacts with global export settings.
None of the above are explicitly stated in the source; they are inferred from design patterns and naming.