9.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:31:25.911180+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 680d00c25a548384 |
Channel
Documentation: DTS.Slice.Control Channel Subsystem — Calculated Channels and Related Types
1. Purpose
This module provides core infrastructure for modeling calculated channels within the DTS control/event data model. It defines abstract and concrete channel types that represent derived time-series data (e.g., integrals, derivatives, FFTs, scaled/offset signals), along with supporting infrastructure such as DataValues (for internal data storage, optionally using memory-mapped files) and NotApplicableException (for enforcing attribute-applicability constraints). The calculated channel hierarchy supports engineering unit (EU) reporting, configurable X-axis units, and integration with review workflows via extensible ReviewableAttribute mechanisms—though the latter is partially commented out in the current source.
2. Public Interface
Event.Module.Channel.DataValues
DataValues()
Initializes an instance using in-memory storage (i.e.,UseMemoryMappedFile = false).DataValues(bool useMemoryMappedFile)
Initializes an instance, optionally enabling memory-mapped file storage for large datasets.UseMemoryMappedFile(property,bool)
Gets/sets whether the instance uses memory-mapped files instead of in-memory lists. Defaults tofalse.
Event.Module.Channel.CalculatedChannel (abstract)
Operationenum
Defines supported calculation types:Integral,Derivative,HeadInjuryCriteria,FFT,ImportedCSV,Resultant,TSR,Scale,Offset,Sine,Cosine.CalculationType(property,Operation)
Immutable operation performed by this channel.X,Y(properties,double[])
Read-only arrays of X and Y data points.XAxis(property,XUnits)
X-axis unit type (Hz,msec,sec,samples).XUnitsString(property,string)
Human-readable unit string for the X-axis (e.g.,"Hz","ms").EngineeringUnits(property,string)
Gets/sets the Y-axis engineering unit label.SupportsADC,SupportsEU,SupportsmV(override properties,bool)
Indicate that this channel does not support raw ADC/mV values (false), but does support engineering units (true).ActualMaxRangeEu,ActualMinRangeEu,DataHalfRangeValueEu,DataMaxEu,DataMinEu,DataRangeEu(override properties,double)
Derived from theYdata array (e.g., min/max, range, half-range).IsConfigured(override property,bool)
Always returnstrue; setting throwsNotSupportedException.GetUnfilteredDataEu()(override method,List<double>)
Returns a copy of the internal_ylist (unfiltered EU data).ToString()(override method,string)
ReturnsChannelDescriptionStringif non-null/empty; otherwise"N/A".- Constructors
CalculatedChannel(string name, XUnits xAxis, string yAxis, double[] xValues, double[] yValues, Operation calcType, int number, Module parentModule)
Initializes the channel with data, units, and metadata.
Event.Module.Channel.FFTCalculatedChannel
PeakFrequency(property,double)
Peak frequency value (computed during FFT processing).- Constructor
FFTCalculatedChannel(..., double peakFrequency)
ExtendsCalculatedChannelwith peak frequency.
Event.Module.Channel.IntegralCalculatedChannel, DerivativeCalculatedChannel, ScaleCalculatedChannel, OffsetCalculatedChannel, ResultantCalculatedChannel, AdditiveVectorCalculatedChannel, SineCalculatedChannel, CosineCalculatedChannel
- Constructors
All follow the same signature asCalculatedChannel, passingcalcTypeto the base class.
Event.Module.Channel.ReviewableAttribute.NotApplicableException
NotApplicableException()
Default constructor.NotApplicableException(string msg)
Constructor with message.NotApplicableException(string msg, Exception innerEx)
Constructor with message and inner exception.
Note
: Several methods in
CalculatedChannel(e.g.,ToDtsSerializationTestModuleChannel,FromDtsSerializationTestModuleChannel,SetPropertyValuesFrom(DASChannel),SetPropertyValuesFrom(IDiagnosticResult)) throwNotSupportedExceptionorNotImplementedException. Similarly,ActualMaxRangeMv,ActualMinRangeMv,DataZeroLevelAdc,SensorCapacityEU,DesiredRangeEU, andGetUnfilteredDataMV()are unimplemented.
3. Invariants
IsConfiguredis immutable: SettingIsConfiguredto any value throwsNotSupportedException.EngineeringUnitsis mutable but not validated: No constraints on theEngineeringUnitsstring value.X/Yarrays are immutable after construction: The underlying_x/_ylists are copied into the constructor;X/Yproperties return arrays (not lists), preventing external mutation.SupportsADC/SupportsmVare fixed tofalse: Calculated channels do not represent raw sensor data.ActualMinRangeEu/ActualMaxRangeEuassume non-emptyY: IfYis empty,.Min()/.Max()will throwInvalidOperationException(not handled in source).DataValues.UseMemoryMappedFileis immutable after construction: Though the property setter exists, the backingProperty<bool>is initialized withfalseforisReadOnly, but the constructor does not enforce immutability post-initialization.
4. Dependencies
-
Imports/Usings:
DTS.Common.UtilitiesandDTS.Common.Utilities.DotNetProgrammingConstructs(DataValuesusesProperty<T>).DTS.Common.Interface.DASFactory.Diagnostics(CalculatedChannelreferencesIDiagnosticResult).DTS.Common.SerializationPlus(CalculatedChannelreferences serialization types likeSerialization.Test.Module.Channel).DTS.Slice.Control(self-referential partial classes).
-
External Types Referenced (but not defined here):
DASLib.Service.DASChannelIDiagnosticResultCommon.DAS.Concepts.DAS.Channel.IEngineeringUnitAware(implemented interface)Serialization.Test.Module.ChannelChannelFilter,DefaultSaeJ211Filter(used in constructor)Module,Event,ReviewableAttribute(via partial class nesting)
-
Depended upon by:
TheCalculatedChannelhierarchy is part of theEvent.Module.Channelnamespace and likely consumed by higher-level event processing, serialization, or UI review components (e.g.,ReviewableAttributesubclasses, though commented out).
5. Gotchas
DataValuesconstructor silently swallows exceptions: Any exception during construction (e.g., memory-mapped file initialization) is rethrown as a genericExceptionwith a fixed message, losing original exception details beyond the inner exception.DataValuesdoes not expose data accessors: The class inherits fromExceptional(not shown), but no public methods/properties to read/write data are visible here—suggesting data access is handled elsewhere (e.g., viaChannelbase class).CalculatedChannelmethods throwNotImplementedException/NotSupportedException: Many methods (e.g.,ToDtsSerializationTestModuleChannel,SetPropertyValuesFrom,GetUnfilteredDataMV) are unimplemented. Calling them will cause runtime failures.DataHalfRangeValueEuuses arithmetic mean, not half-range: Despite the name, it computes0.5 * (min + max)(i.e., midpoint), not half the range (0.5 * (max - min)).XUnitsStringreturns"N/A"for unknownXUnits: This may cause UI/display issues if"N/A"is not handled gracefully.DataValuesconstructor parameteruseMemoryMappedFileis unused in the body: Theif (UseMemoryMappedFile)block is empty—no actual initialization logic is present.CalculatedChannelconstructors copy arrays:new List<double>(xValues)andnew List<double>(yValues)are used, butX/Yreturn arrays—ensuring immutability but potentially causing confusion if callers expect reference equality.OffsetCalculatedChannelhas typo in constructor parameter:yVAlues(capitalA) instead ofyValues.HICCalculatedChannelis commented out: Though referenced in the source, the full implementation is commented out, makingHeadInjuryCriteriasupport incomplete.ReviewableAttributesubclasses are commented out: TheInitializeReviewableAttributesoverride and associated attribute classes (e.g.,ReviewablePeakFrequencyAttribute,ReviewableHICAttribute) are commented out—review functionality is not active in this build.
Documentation generated from source files dated 2009. No runtime behavior beyond what is statically visible in the provided code is assumed.