init
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.CommonCore/Events/Sensors/SensorsList/SensorsListSensorSelectedEvent.cs
|
||||
- Common/DTS.CommonCore/Events/Sensors/SensorsList/SensorChangedEvent.cs
|
||||
generated_at: "2026-04-16T02:48:55.256595+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "3ae767ae71f8e4ec"
|
||||
---
|
||||
|
||||
# SensorsList
|
||||
|
||||
## Documentation: Sensors List Events Module
|
||||
|
||||
### 1. Purpose
|
||||
This module defines Prism-based event types used for inter-module communication within the DTS application related to sensor management in the Sensors List UI. It enables decoupled notification of sensor selection, changes to sensor properties (e.g., sensitivity, excitation, nonlinearity), and sensor lifecycle events (addition/update). These events facilitate synchronization across UI components and business logic layers without tight coupling—specifically supporting scenarios such as saving sensor configurations, updating filter selections, and responding to user edits in sensor settings.
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
- **`SensorsListSensorSelectedEvent`**
|
||||
*Inherits from:* `CompositePresentationEvent<string[]>`
|
||||
*Behavior:* Published when a sensor (or sensors) is selected in the Sensors List UI. The payload is an array of strings—interpreted as serial numbers of the selected sensors (based on naming and usage context, though not explicitly documented in source).
|
||||
|
||||
- **`SensorSavedEvent`**
|
||||
*Inherits from:* `CompositePresentationEvent<double>`
|
||||
*Behavior:* Published after a new sensor is added via the settings menu (per comment referencing FB 13120). The payload is a `double`, likely representing the database ID or timestamp of the newly saved sensor (exact meaning not documented in source).
|
||||
|
||||
- **`SensorUpdatedEvent`**
|
||||
*Inherits from:* `CompositePresentationEvent<bool>`
|
||||
*Behavior:* Published when a sensor is added or deleted, to notify consumers (e.g., filter list UI) to re-evaluate or update the default filter selection. The `bool` payload likely indicates success or some state flag, but its precise semantics are not documented.
|
||||
|
||||
- **`SensorChangedEvent`**
|
||||
*Inherits from:* `CompositePresentationEvent<SensorChangedArgs>`
|
||||
*Behavior:* Published when a user modifies a sensor property in the UI (e.g., sensitivity, excitation, nonlinearity). Triggers dependent UI updates (e.g., sensitivity controls). Payload is a `SensorChangedArgs` object describing which properties changed.
|
||||
|
||||
- **`SensorChangedArgs`**
|
||||
*Fields:*
|
||||
- `SerialNumber` (`string`): Serial number of the changed sensor (currently unused, reserved for future use).
|
||||
- `DatabaseId` (`int`): Database ID of the changed sensor (currently unused, reserved for future use).
|
||||
- `CurrentModelLoading` (`bool`): `true` if the current model is being loaded.
|
||||
- `NonLinearChanged` (`bool`): `true` if the nonlinear calibration setting changed.
|
||||
- `SensitivityChanged` (`bool`): `true` if the sensitivity value changed.
|
||||
- `IsProportionalChanged` (`bool`): `true` if the proportionality setting changed.
|
||||
- `ExcitationChanged` (`bool`): `true` if the excitation setting changed.
|
||||
*Constructor:* `SensorChangedArgs(string serialNumber, int databaseId, bool currentModelLoading, bool nonLinearChanged, bool sensitivityChanged, bool isProportionalChanged, bool excitationChanged)`
|
||||
|
||||
### 3. Invariants
|
||||
- All events derive from `CompositePresentationEvent<T>` (Prism), implying they support subscription on any thread and marshaling to the UI thread via `ThreadOption.UIThread` (default behavior), though the source does not specify subscription options.
|
||||
- The `SensorChangedArgs` payload is immutable: all properties have `private set` (implicitly via auto-property with only `get`), and the constructor enforces initialization of all fields.
|
||||
- The `SerialNumber` and `DatabaseId` fields are *not currently used* (per comments), so consumers must not rely on them for active logic.
|
||||
- The `bool` payloads in `SensorSavedEvent` and `SensorUpdatedEvent` lack explicit semantic documentation; their meaning is inferred from usage context and may be ambiguous.
|
||||
|
||||
### 4. Dependencies
|
||||
- **Dependencies *of* this module:**
|
||||
- `Microsoft.Practices.Prism.Events` (Prism library for event aggregation).
|
||||
- Namespace `DTS.Common.Events.Sensors.SensorsList` (self-contained; no external module dependencies beyond Prism).
|
||||
- **Dependencies *on* this module:**
|
||||
- UI components handling sensor list selection (subscribe to `SensorsListSensorSelectedEvent`).
|
||||
- Sensor configuration/save logic (publishes `SensorSavedEvent`).
|
||||
- Filter list UI or related components (subscribe to `SensorUpdatedEvent`).
|
||||
- Sensitivity/excitation control panels or validation logic (subscribe to `SensorChangedEvent`).
|
||||
|
||||
### 5. Gotchas
|
||||
- **Misleading documentation:** The XML comment for `SensorsListSensorSelectedEvent` incorrectly states it is the `TTSImportSummaryImportEvent` and describes an "Import button" scenario—this is clearly a copy-paste error and does not match the class name or usage context.
|
||||
- **Ambiguous payloads:**
|
||||
- `SensorSavedEvent` uses `double` for its payload without documentation—this could be a database ID, timestamp, or other numeric identifier.
|
||||
- `SensorUpdatedEvent` uses `bool` without specifying what `true`/`false` signifies (e.g., success/failure, add/delete).
|
||||
- **Unused fields:** `SerialNumber` and `DatabaseId` in `SensorChangedArgs` are explicitly marked as unused; consumers should ignore them until future use is documented.
|
||||
- **No validation guarantees:** The source provides no indication of validation on `SensorChangedArgs` constructor inputs (e.g., whether `SerialNumber` can be `null`, or `DatabaseId` negative). Consumers should assume inputs are accepted as-is.
|
||||
- **No ordering guarantees:** As Prism events, subscribers receive notifications in the order they subscribed, but no cross-event ordering (e.g., between `SensorChangedEvent` and `SensorUpdatedEvent`) is implied or documented.
|
||||
|
||||
None identified beyond the above.
|
||||
Reference in New Issue
Block a user