9.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:42:18.353896+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | b040e834d4537e76 |
DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableAttribute Implementations
1. Purpose
This module provides a set of concrete ReviewableAttribute subclasses used to expose specific channel metadata and calibration-related values for review in the DTS Slice control/event system. Each attribute encapsulates a named, human-readable property of an AnalogInputChannel (e.g., serial number, filter settings, shunt calibration metrics), formatted as a string via a delegate. These attributes are intended for use in UI review workflows or audit logs where static or quasi-static channel configuration and calibration state must be presented consistently.
2. Public Interface
All classes inherit from Slice.Control.Event.Module.Channel.ReviewableAttribute. Each constructor accepts a single Event.Module.Channel parameter and passes a display name and a Func<string> to the base constructor.
| Class | Constructor | Display Name | Behavior |
|---|---|---|---|
ReviewableShuntDeflectionAttribute |
ReviewableShuntDeflectionAttribute(Channel) |
"Shunt Deflection (mV)" |
Returns channel.MeasuredShuntDeflectionMv.ToString("F1"). Requires channel to implement DTS.DAS.Concepts.DAS.Channel.IShuntAware. |
ReviewableFilterFrequencyAttribute |
ReviewableFilterFrequencyAttribute(Channel) |
"Filter Frequency" |
Returns (int)(channel.CurrentFilter as SaeJ211Filter).CutoffFrequencyHz.ToString("N"). Requires channel.CurrentFilter to be a SaeJ211Filter. |
ReviewableIsoCodeAttribute |
ReviewableIsoCodeAttribute(Channel) |
"ISO Code" |
Returns (channel as AnalogInputChannel).IsoCode.ToString(). Requires channel to be an AnalogInputChannel. |
ReviewableDescriptionAttribute |
ReviewableDescriptionAttribute(Channel) |
"Description" |
Returns channel.ChannelDescriptionString. |
ReviewableSerialNumberAttribute |
ReviewableSerialNumberAttribute(Channel) |
"Serial Number" |
Returns (channel as AnalogInputChannel).SerialNumber.ToString(). Requires channel to be an AnalogInputChannel. |
ReviewableUnitsAttribute |
ReviewableUnitsAttribute(Channel) |
"Units" |
Returns channel.EngineeringUnits.ToString(). Requires channel to implement DTS.DAS.Concepts.DAS.Channel.IEngineeringUnitAware. |
ReviewableMinMaxEuAttribute |
ReviewableMinMaxEuAttribute(Channel) |
"Max/Min (EU)" |
Returns channel.DataMaxFilteredEu.ToString("F1") + "/" + channel.DataMinFilteredEu.ToString("F1"). |
ReviewableCfcAttribute |
ReviewableCfcAttribute(Channel) |
"CFC" |
Returns "N/A" if channel.CurrentFilter.Type == ChannelFilter.AdHoc; otherwise returns (new CfcValueAttributeCoder()).DecodeAttributeValue((channel.CurrentFilter as SaeJ211Filter).Type).ToString(). Requires channel.CurrentFilter to be a SaeJ211Filter. |
ReviewableTargetShuntDeflectionAttribute |
ReviewableTargetShuntDeflectionAttribute(Channel) |
"Target Shunt Deflection (mV)" |
Returns channel.TargetShuntDeflectionMv.ToString("F1"). Requires channel to implement IShuntAware. |
ReviewableTargetCalSignalAttribute |
ReviewableTargetCalSignalAttribute(Channel) |
"Target Calibration Signal (mV)" |
Returns channel.TargetCalSignalMv.ToString("F1"). Requires channel to implement DTS.DAS.Concepts.DAS.Channel.ICalSignalAware. |
ReviewableMeasuredShuntDeflectionAttribute |
ReviewableMeasuredShuntDeflectionAttribute(Channel) |
"Measured Shunt Deflection (mV)" |
Returns channel.MeasuredShuntDeflectionMv.ToString("F1"). Requires channel to implement IShuntAware. |
ReviewableMeasuredCalSignalAttribute |
ReviewableMeasuredCalSignalAttribute(Channel) |
"Measured Calibration Signal (mV)" |
Returns channel.MeasuredCalSignalMv.ToString("F1"). Requires channel to implement ICalSignalAware. |
ReviewableShuntDeflectionPercentageAttribute |
ReviewableShuntDeflectionPercentageAttribute(Channel) |
"Shunt Error (%)" |
Returns 100.0 * (MeasuredShuntDeflectionMv - TargetShuntDeflectionMv) / TargetShuntDeflectionMv.ToString("F1"). Requires channel to implement IShuntAware. |
ReviewableCalSignalPercentageAttribute |
ReviewableCalSignalPercentageAttribute(Channel) |
"Calibration Signal Error (%)" |
Returns 100.0 * (MeasuredCalSignalMv - TargetCalSignalMv) / TargetCalSignalMv.ToString("F1"). Requires channel to implement ICalSignalAware. |
3. Invariants
- All attributes are read-only: Each attribute’s value is computed on-demand via a delegate passed to the base class; no internal state is stored beyond the delegate capture.
- Type assumptions: Each attribute assumes the
channelparameter supports specific interfaces or concrete types:IShuntAwarefor shunt-related attributes (ReviewableShuntDeflectionAttribute,ReviewableTargetShuntDeflectionAttribute,ReviewableMeasuredShuntDeflectionAttribute,ReviewableShuntDeflectionPercentageAttribute).ICalSignalAwarefor calibration signal attributes (ReviewableTargetCalSignalAttribute,ReviewableMeasuredCalSignalAttribute,ReviewableCalSignalPercentageAttribute).IEngineeringUnitAwareforReviewableUnitsAttribute.SaeJ211FilterforReviewableFilterFrequencyAttributeandReviewableCfcAttribute.AnalogInputChannel(viaas) forReviewableIsoCodeAttributeandReviewableSerialNumberAttribute.
- Null-safety: None of the attributes perform explicit null checks. If
channelisnull, or if the required interface/type cast fails (e.g.,channel.CurrentFilteris not aSaeJ211Filter), aNullReferenceExceptionorInvalidCastExceptionwill occur at evaluation time. - Formatting consistency: All numeric values are formatted with
"F1"(1 decimal place) or"N"(thousands separator, no decimals) as shown.
4. Dependencies
Internal Dependencies (from source):
DTS.Slice.Control.Event.Module.Channel.ReviewableAttribute(base class, not shown but referenced).DTS.DAS.Concepts.DAS.Channel.IShuntAware,ICalSignalAware,IEngineeringUnitAware(interfaces).DTS.DAS.Concepts.DAS.Channel.SaeJ211Filter,ChannelFilter(types).DTS.Utilities.CfcValueAttributeCoder(used inReviewableCfcAttribute).DTS.Slice.Control.Event.Module.AnalogInputChannel(namespace context and partial class definitions).
External Dependencies:
System(core runtime).DTS.Utilities(assembly reference required forCfcValueAttributeCoderandSaeJ211Filter).
Inferred Usage:
- These attributes are likely instantiated and collected by a higher-level component that iterates over
AnalogInputChannelinstances and exposes their reviewable metadata (e.g., for calibration reports or UI inspection panels). The repeated pattern suggests a factory or registration mechanism exists elsewhere (not visible here).
5. Gotchas
- Ambiguous naming:
ReviewableShuntDeflectionAttribute(in first file) andReviewableMeasuredShuntDeflectionAttribute(in later file) have identical implementation logic and display names. This duplication is likely unintentional or legacy; only one should be used, or naming should be clarified (e.g., “Shunt Deflection (mV)” vs. “Measured Shunt Deflection (mV)”). - Missing null guards: All attributes assume
channelis non-null and implements required interfaces. A cast failure (e.g.,channel as DTS.DAS.Concepts.DAS.Channel.IShuntAwarereturningnull) will cause aNullReferenceExceptionat delegate invocation time, not construction. ReviewableCfcAttributelogic: The commented-out line suggests a previous implementation usingCfcValueAttributeCoder.DecodeAttributeValuedirectly, but the current version adds a special case forChannelFilter.AdHoc. This implies thatAdHocfilters may not have a validTypefor decoding, and the attribute must handle this explicitly.ReviewableFilterFrequencyAttributecastschannel.CurrentFiltertoSaeJ211Filterwithout checking: IfCurrentFilteris not aSaeJ211Filter, this will throwInvalidCastException.ReviewableIsoCodeAttributecomment is incorrect: Its summary says “serial number attribute” but the class name and implementation clearly indicate it’s for ISO code. Likely copy-paste error in documentation.- No validation of division-by-zero: In
ReviewableShuntDeflectionPercentageAttributeandReviewableCalSignalPercentageAttribute, ifTargetShuntDeflectionMvorTargetCalSignalMvis zero, aDivideByZeroExceptionwill occur.