5.3 KiB
5.3 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T02:47:19.043189+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 6c4242c9e13326a0 |
Sensors
Documentation: Sensor Event Definitions
1. Purpose
This module defines Prism-based pub/sub events used to propagate changes in sensor configuration and filtering behavior across the application. Specifically, it enables decoupled components to react to changes in calibration behavior settings (CalibrationBehaviorSettingChangedEvent) and sensor filter type selections (SensorFilterTypeChangedEvent), which may involve ISO code mappings or filter class assignments. These events support dynamic UI updates and state synchronization in sensor data processing pipelines.
2. Public Interface
CalibrationBehaviorSettingChangedEvent
- Type:
class(inherits fromCompositePresentationEvent<CalibrationBehaviors>) - Generic Payload:
DTS.Common.Enums.Sensors.CalibrationBehaviors - Behavior: Publishes when the global or context-specific calibration behavior setting changes. Subscribers receive the new
CalibrationBehaviorsenum value.
SensorFilterTypeChangedEvent
- Type:
class(inherits fromCompositePresentationEvent<SensorFilterTypeChangedEventArgs>) - Payload:
SensorFilterTypeChangedEventArgs - Behavior: Publishes when the sensor filter type (either ISO code character or filter class) is modified. Triggers updates to ISO code lists or filter logic.
SensorFilterTypeChangedEventArgs
- Properties:
char ISOCodeChar: Set only whenEventType == EventTypes.ISOCodeChar. Represents the selected ISO code character (e.g.,'A','B').enum EventTypes { ISOCodeChar, FilterClass }: Indicates which constructor was used to initialize the instance.FilterClassType FilterClass: Set only whenEventType == EventTypes.FilterClass. Represents the selected filter class.ISensorCalibration Calibration: The calibration object associated with the sensor at the time of change.ISensorData Sensor: The sensor instance whose filter type is changing.bool UseISOCodeFilterMapping: Flag indicating whether ISO code–based filtering is enabled.bool UseZeroForUnfiltered: Flag indicating whether unfiltered readings should be represented as0.
- Constructors:
SensorFilterTypeChangedEventArgs(char code, ISensorData sensor, ISensorCalibration sensorCalibration, bool useISOCodeFilterMapping, bool bUseZeroForUnfiltered)
Initializes for ISO code changes (EventType = ISOCodeChar).SensorFilterTypeChangedEventArgs(FilterClassType filterClassType, ISensorData sensor, ISensorCalibration sensorCalibration, bool useISOCodeFilterMapping, bool bUseZeroForUnfiltered)
Initializes for filter class changes (EventType = FilterClass).
3. Invariants
SensorFilterTypeChangedEventArgsmust be constructed using exactly one of its two constructors—never both parameters sets.EventTypeis set at construction time and never changes; it determines which ofISOCodeCharorFilterClassis valid.ISOCodeCharis only meaningful whenEventType == EventTypes.ISOCodeChar; otherwise, its value is undefined (but not null-checked, ascharis non-nullable).FilterClassis only meaningful whenEventType == EventTypes.FilterClass.Calibration,Sensor,UseISOCodeFilterMapping, andUseZeroForUnfilteredare always set in both constructors and must be non-null (exceptCalibration/Sensorcould benullif passed as such—no explicit validation is present in the source).
4. Dependencies
- Depends on:
Microsoft.Practices.Prism.Events.CompositePresentationEvent<T>(for event infrastructure).DTS.Common.Enums.Sensors(forCalibrationBehaviorsandSensorFilterTypeChangedEventArgs.EventTypes).DTS.Common.Interface.Sensors(forISensorCalibrationandISensorDatainterfaces).
- Used by:
- Components that subscribe to
CalibrationBehaviorSettingChangedEventto adjust calibration logic. - Components that subscribe to
SensorFilterTypeChangedEventto recompute ISO code mappings, filter tables, or UI filter controls. - Likely consumed by sensor UI modules, data processing pipelines, or configuration managers (inferred from event semantics).
- Components that subscribe to
5. Gotchas
SensorFilterTypeChangedEventArgsdoes not validate thatISOCodeCharis a valid ISO code character (e.g., range or allowed set). Consumers must enforce this.- The
FilterClassproperty is of typeFilterClassType, but its definition is not included in the provided source—its valid values and semantics are unknown here. CalibrationandSensorare passed as interfaces but may benullif passed as such in the constructor; no null-checking is evident in this class.- The namespace
DTS.Common.Events.Sensorsis used forSensorFilterTypeChangedEvent, whileCalibrationBehaviorSettingChangedEventresides in the parentDTS.Common.Eventsnamespace—this may cause discoverability issues. - The
bUseZeroForUnfilteredparameter name uses Hungarian notation (bprefix), inconsistent with C# naming conventions (though preserved in the source).