5.5 KiB
5.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:01:17.710649+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | bf3c4958ff00a0d7 |
Realtime
Documentation: Realtime Channel Selection Module
1. Purpose
This module defines the foundational interfaces for a channel selection UI component in the Realtime domain. It establishes the contract between the view (IRealtimeChannelSelectView), its associated view model (IRealtimeChannelSelectViewModel), and the data model for individual channels (IRealtimeChannel). Its role is to enable users to select from a list of available real-time measurement channels—each representing a sensor or data source—while supporting search, channel population, and selection state management. It serves as the UI layer abstraction for channel selection workflows in real-time monitoring or analysis applications.
2. Public Interface
IRealtimeChannelSelectView
- Inherits:
IBaseView - Description: A marker interface representing the view layer for channel selection. It carries no additional members beyond its base contract, implying the view implementation is expected to be driven entirely by its associated view model.
IRealtimeChannelSelectViewModel
- Inherits:
IBaseViewModel - Properties:
IRealtimeChannelSelectView ChannelSelectView { get; set; }
Gets or sets the view instance bound to this view model. Enables two-way binding or manual view assignment.
- Methods:
void SetAvailableChannels(IRealtimeChannel[] channels)
Populates the list of selectable channels. The view should render these channels (e.g., in a dropdown or list).void SetSearchText(string searchText)
Sets the current search/filter text input. The view/model should use this to filter the available channels.void SetRealtimeChannel(IRealtimeChannel channel)
Records the user’s selection of a specific channel. This likely triggers state updates or navigation in the broader UI flow.
IRealtimeChannel
- Description: Represents a single real-time data channel (e.g., a sensor output). Provides metadata and identification for display and logic purposes.
- Properties:
double Capacityint DisplayOrderstring SensorNamestring ChannelNamestring[] DasNamesstring SensorSerialstring Unitsstring UserValue1string GroupNamestring DisplayUnitstring HardwareChannelStringstring ISOCodestring SensorsStringstring DasNamestring GetId()(method, not property)bool HasPassedLevelTriggerstring Name
- Note:
GetId()is declared as a method, not a property, despite other identifiers being properties.
3. Invariants
- Channel Identity: Each
IRealtimeChannelmust provide a unique identifier viaGetId()(implied by naming and usage, though not explicitly stated in the interface). - Display Consistency:
DisplayOrderandGroupNamelikely govern UI ordering/grouping, but no ordering guarantees are enforced by the interface itself. - Search Filtering:
SetSearchTextis expected to filter the list provided viaSetAvailableChannels, but the interface does not specify how filtering is implemented (e.g., substring match, case sensitivity). - Selection State:
SetRealtimeChannelimplies a single active selection, but the interface does not enforce uniqueness or prevent null/invalid selections. - Null Safety: No nullability annotations or guarantees are present in the source; implementations must handle nulls (e.g.,
channelsarray,searchText, orchannelparameter).
4. Dependencies
- Depends On:
DTS.Common.Base.IBaseViewandDTS.Common.Base.IBaseViewModel(via inheritance).
- Depended On By:
- Any module implementing or consuming the channel selection UI (e.g., a real-time dashboard, configuration wizard, or channel setup screen).
- Concrete implementations of
IRealtimeChannel(e.g., sensor data adapters) must be provided by other modules.
- No direct dependencies on other
DTS.Common.Interface.Realtimeinterfaces beyondIRealtimeChanneland itself.
5. Gotchas
GetId()is a method, not a property: This is inconsistent with other identifier-like properties (SensorSerial,ISOCode, etc.) and may cause confusion or misuse (e.g., expectingchannel.Idsyntax).- Ambiguous
DasNamesvs.DasName:DasNamesis an array (string[]), whileDasNameis a singlestring. Their relationship and which to use for display/logic is not clarified. - No validation on
SetAvailableChannels: Passingnull, empty, or duplicate channels is not guarded against by the interface. - No event/notification mechanism: The interface provides no way to notify consumers when selection changes (e.g., via event or callback), implying selection state must be polled or handled externally.
UserValue1purpose unclear: Its meaning is undocumented; may be legacy or domain-specific.- No ordering guarantee:
DisplayOrderexists but is not used in the interface methods—implementation may ignore it. - None identified from source alone for behavior beyond the above (e.g., thread-safety, lifecycle, or concurrency rules are not specified).