6.1 KiB
6.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:24:51.949729+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 0b8580fe5a59ce51 |
Sensors
Documentation: Sensor Configuration Event Definitions
1. Purpose
This module defines event types used to propagate changes in sensor configuration settings across the application, leveraging the Prism EventAggregator pattern for decoupled communication. Specifically, it publishes notifications when calibration behavior settings change (for both general and export contexts) and when the filter type applied to a sensor changes—enabling UI components and business logic modules to react to these changes without tight coupling. These events are part of the shared DTS.Common library and are intended for use across modules that manage sensor data acquisition, filtering, and calibration.
2. Public Interface
CalibrationBehaviorSettingChangedEvent
- Signature:
public class CalibrationBehaviorSettingChangedEvent : PubSubEvent<DTS.Common.Enums.Sensors.CalibrationBehaviors> { } - Behavior:
Publishes a change in the general calibration behavior setting. Payload is a value of theCalibrationBehaviorsenum, representing the new behavior.
ExportCalibrationBehaviorSettingChangedEvent
- Signature:
public class ExportCalibrationBehaviorSettingChangedEvent : PubSubEvent<DTS.Common.Enums.Sensors.CalibrationBehaviors> { } - Behavior:
Publishes a change in the export-specific calibration behavior setting. Payload is a value of theCalibrationBehaviorsenum, representing the new behavior for export operations.
SensorFilterTypeChangedEvent
- Signature:
public class SensorFilterTypeChangedEvent : PubSubEvent<SensorFilterTypeChangedEventArgs> { } - Behavior:
Publishes a change in the filter type applied to a sensor. Payload is aSensorFilterTypeChangedEventArgsobject containing details about the change (e.g., ISO code character, filter class, associated sensor/calibration objects, and configuration flags).
SensorFilterTypeChangedEventArgs
- Properties:
char ISOCodeChar— The ISO code character used whenEventType == EventTypes.ISOCodeChar.EventTypes EventType— Indicates whether the change was triggered by an ISO code character (ISOCodeChar) or a filter class (FilterClass).FilterClassType FilterClass— The new filter class type used whenEventType == EventTypes.FilterClass.ISensorCalibration Calibration— The calibration object associated with the sensor at the time of change.ISensorData Sensor— The sensor instance whose filter type changed.bool UseISOCodeFilterMapping— Flag indicating whether ISO code filtering is enabled/mapped.bool UseZeroForUnfiltered— Flag indicating whether zero should be used for unfiltered values.
- Constructors:
SensorFilterTypeChangedEventArgs(char code, ISensorData sensor, ISensorCalibration sensorCalibration, bool useISOCodeFilterMapping, bool bUseZeroForUnfiltered)
Initializes for ISO code–based filter changes (EventType = EventTypes.ISOCodeChar).SensorFilterTypeChangedEventArgs(FilterClassType filterClassType, ISensorData sensor, ISensorCalibration sensorCalibration, bool useISOCodeFilterMapping, bool bUseZeroForUnfiltered)
Initializes for filter class–based changes (EventType = EventTypes.FilterClass).
3. Invariants
SensorFilterTypeChangedEventArgsmust be constructed with exactly one ofISOCodeCharorFilterClasspopulated, depending onEventType. The other field remains default (\0ordefault(FilterClassType)).EventTypeis immutable after construction and is set based on which constructor overload is used.- All
SensorFilterTypeChangedEventArgsinstances must include non-nullSensorandCalibrationreferences (no null checks are performed in the source, implying callers are expected to ensure validity). UseISOCodeFilterMappingandUseZeroForUnfilteredare boolean flags passed directly from the caller and are not validated or normalized.
4. Dependencies
- Depends on:
Prism.Events(forPubSubEvent<T>base class).DTS.Common.Enums.Sensors(forCalibrationBehaviors,SensorFilterTypeChangedEventArgs.EventTypes, andFilterClassType).DTS.Common.Interface.Sensors(forISensorCalibrationandISensorDatainterfaces).
- Used by:
- Modules consuming sensor configuration changes (e.g., UI views, data processing pipelines, export services).
- Likely subscribed to by components that update filter UI, reconfigure sensor pipelines, or regenerate filtered data exports.
5. Gotchas
- Namespace inconsistency:
CalibrationBehaviorSettingChangedEventandExportCalibrationBehaviorSettingChangedEventreside inDTS.Common.Events, whileSensorFilterTypeChangedEventresides inDTS.Common.Events.Sensors. This may cause confusion when registering/subscribing (e.g.,eventAggregator.GetEvent<SensorFilterTypeChangedEvent>()vsGetEvent<CalibrationBehaviorSettingChangedEvent>()). - No validation in constructor:
The constructors do not enforce thatsensororsensorCalibrationare non-null. Callers must ensure this, or riskNullReferenceExceptionat event handling time. - Ambiguous
FilterClassTypeusage:
The typeFilterClassTypeis referenced but not defined in the provided source—its possible values and semantics are unknown here. - Dual constructor overloads:
The twoSensorFilterTypeChangedEventArgsconstructors are not symmetric in naming or parameter order (e.g.,codevsfilterClassTypefirst), increasing risk of misuse. - No documentation on
CalibrationBehaviorsenum:
The meaning of specificCalibrationBehaviorsvalues is not included in this module and must be inferred from elsewhere.
Documentation generated from provided source files only.