12 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:34:47.007360+00:00 | zai-org/GLM-5-FP8 | 1 | ba30fc370955c9dd |
DTS.Slice.Control.Event.Module.Channel Documentation
1. Purpose
This module provides the channel-level data structures and filtering mechanisms for the DTS Slice Control Event system. It defines classes for storing channel data values (with optional memory-mapped file support for large datasets), implements SAE J211-compliant digital filters for signal processing, and provides a hierarchy of calculated channel types for derived data operations such as integration, differentiation, FFT analysis, and vector mathematics. The module exists to support data acquisition and analysis workflows within the larger DTS Slice framework.
2. Public Interface
Event.Module.Channel.DataValues
A class representing a channel's data, inheriting from Exceptional.
Constructors:
DataValues()— Initializes with memory-mapped file support enabled by default.DataValues(bool useMemoryMappedFile)— Initializes with explicit control over memory-mapped file usage.
Properties:
bool UseMemoryMappedFile { get; set; }— Controls whether the class uses memory-mapped files instead of in-memory lists for data storage.
Event.Module.Channel.ReviewableAttribute.NotApplicableException
An exception class for attempts to use a channel attribute that is not applicable to the associated channel. Inherits from ApplicationException.
Constructors:
NotApplicableException()NotApplicableException(string msg)NotApplicableException(string msg, System.Exception innerEx)
Event.Module.Channel.Filter (Abstract)
Abstract base class for channel filters. Implements Exceptional and IFilter.
Abstract Properties:
string Name { get; }— Descriptive designation for the filter.bool IsCfc { get; }— Indicates whether the filter corresponds to a CFC (Channel Filter Class) value.ChannelFilter Type { get; }— TheChannelFilterdesignation for this filter.double CutoffFrequencyHz { get; }— The cutoff frequency in Hz.
Abstract Methods:
double[] Apply(Channel input, DataDisplayUnits displayUnits, bool bUseLegacyTDCSoftwareFilterAdjustment)— Applies the filter to a channel.double[] Apply(double[] data, double sampleRate, bool bUseLegacyTDCSoftwareFilterAdjustment)— Applies the filter to raw data.string ToBaseString()— Returns the base name without decoration (contrast withToString()).
Event.Module.Channel.SaeJ211Filter
Concrete implementation of SAE J211-based filters. Inherits from Filter.
Constructors:
SaeJ211Filter(SaeJ211Filter originalFilter)— Copy constructor.SaeJ211Filter(ChannelFilter originalType)— Initializes from aChannelFilterenum value. ThrowsExceptionifChannelFilter.AdHocis passed.SaeJ211Filter(double cutoffFrequencyHz)— Initializes an ad hoc filter with a specific cutoff frequency.
Properties:
override bool IsCfc { get; }— Returnstrueif the filter is CFC-compliant (notUnfilteredand notAdHoc).override ChannelFilter Type { get; }— Returns the best-fittingChannelFiltervalue.char IsoDescription { get; }— Returns the ISO description character.override double CutoffFrequencyHz { get; }— The cutoff frequency.ChannelFilter OriginalType { get; }— The original filter type specified at construction.override string Name { get; }— The filter name (e.g., "1000Hz" for ad hoc, or the CFC description).
Methods:
override double[] Apply(Channel channel, DataDisplayUnits displayUnits, bool bUseLegacyTDCSoftwareFilterAdjustment)— Applies the filter to channel data.override double[] Apply(double[] data, double sampleRate, bool bUseLegacyTDCSoftwareFilterAdjustment)— Applies the filter to raw data.override string ToString()— ReturnsName.override string ToBaseString()— ReturnsName.override bool Equals(object obj)— Compares filters by name (case-insensitive).override int GetHashCode()— Returns hash based on lowercase name.static Filter Parse(string serialization)— Creates a filter from a string representation.
Event.Module.Channel.DefaultSaeJ211Filter
A default wrapper for SAE J211 filters. Inherits from SaeJ211Filter.
Constructors:
DefaultSaeJ211Filter(SaeJ211Filter filter)— Wraps an existing filter.DefaultSaeJ211Filter(ChannelFilter filterType)— Creates a filter from aChannelFiltertype.DefaultSaeJ211Filter(double adHocFrequency)— Creates an ad hoc filter with specified frequency.
Properties:
override string Name { get; }— Returns"Default (" + base.Name + ")".
Methods:
override string ToBaseString()— Returnsbase.Name.override string ToString()— ReturnsName.
Event.Module.Channel.CalculatedChannel (Abstract)
Abstract base class for calculated/derived channels. Inherits from Channel and implements IEngineeringUnitAware.
Nested Enum:
Operation— Values:Integral,Derivative,HeadInjuryCriteria,FFT,ImportedCSV,Resultant,TSR,Scale,Offset,Sine,Cosine.
Nested Enum:
XUnits— Values:msec,sec,Hz,samples.
Properties:
Operation CalculationType { get; }— The calculation type.double[] X { get; }— X-axis values.double[] Y { get; }— Y-axis values.XUnits XAxis { get; }— X-axis unit type.string XUnitsString { get; }— String representation of X units.string EngineeringUnits { get; set; }— Y-axis engineering units.override bool SupportsADC { get; }— Returnsfalse.override bool SupportsEU { get; }— Returnstrue.override bool SupportsmV { get; }— Returnsfalse.override double ActualMaxRangeEu { get; }— ReturnsY.Max().override double ActualMinRangeEu { get; }— ReturnsY.Min().override double DataHalfRangeValueEu { get; },DataMaxEu { get; },DataMinEu { get; },DataRangeEu { get; }— Statistical properties of Y data.override bool IsConfigured { get; set; }— Alwaystrue; setter throwsNotSupportedException.
Constructor:
CalculatedChannel(string name, XUnits xAxis, string yAxis, double[] xValues, double[] yValues, Operation calcType, int number, Module parentModule)
Methods that throw NotSupportedException or NotImplementedException:
override void FromDtsSerializationTestModuleChannel(Serialization.Test.Module.Channel that)override void SetPropertyValuesFrom(DASLib.Service.DASChannel dasChannel)override void SetPropertyValuesFrom(DASLib.Service.DiagnosticsResult diagResults)override Serialization.Test.Module.Channel ToDtsSerializationTestModuleChannel(Serialization.Test.Module parentModule)override double ActualMaxRangeMv { get; }override double ActualMinRangeMv { get; }override double SensorCapacityEU { get; }override double DesiredRangeEU { get; }override List<double> GetUnfilteredDataMV()
Methods:
override List<double> GetUnfilteredDataEu()— Returns a copy of Y values.override string ToString()— ReturnsChannelDescriptionStringor"N/A".
Concrete Calculated Channel Types
All inherit from CalculatedChannel and have identical constructor signatures:
FFTCalculatedChannel— Additional property:double PeakFrequency { get; }. Constructor includes extradouble peakFrequencyparameter.IntegralCalculatedChannelDerivativeCalculatedChannelScaleCalculatedChannelOffsetCalculatedChannelResultantCalculatedChannelAdditiveVectorCalculatedChannelSineCalculatedChannelCosineCalculatedChannel
3. Invariants
-
Filter Type Consistency:
SaeJ211Filter.Typewill never returnChannelFilter.AdHocif the cutoff frequency exactly matches a CFC value; it will return the matching CFC type instead. -
CFC Compliance:
SaeJ211Filter.IsCfcreturnstrueonly whenTypeis neitherUnfilterednorAdHoc. -
Filter Equality: Two
SaeJ211Filterinstances are considered equal if theirNameproperties match case-insensitively. Consequently,GetHashCode()is based on the lowercase name. -
Calculated Channel Data Immutability: X and Y data arrays in
CalculatedChannelare stored inreadonly List<double>fields and exposed as copies viaToArray(). -
Calculated Channel Capabilities: All
CalculatedChannelderivatives haveSupportsADC = false,SupportsEU = true, andSupportsmV = false. -
Parse Round-Trip:
SaeJ211Filter.Parse()can parse filter names produced byToString(); unrecognized strings return anUnfilteredfilter.
4. Dependencies
This module depends on:
DTS.Common.Utilities— ProvidesExceptionalbase class,Exception,Property<T>,APILogger.DTS.Common.Utilities.DotNetProgrammingConstructs— ProvidesProperty<T>.DTS.Common.Utilities.SaeJ211— ProvidesFilterUtility,CfcValueAttributeCoder,DescriptionAttributeCoder<T>,IsoDescriptionAttributeCoder.DTS.Common.Utilities.Logging— ProvidesAPILogger.DTS.Common.DAS.Concepts.DAS.Channel— ProvidesChannelFilter,IFilter,IEngineeringUnitAware.DTS.Slice.Control.DAS.Channel— Referenced inFilter.cs.DASLib.Service— ProvidesDASChannel,DiagnosticsResult(used inCalculatedChannel).Systemnamespaces — Standard .NET types.
What depends on this module:
- Cannot be fully determined from source alone, but the partial class structure (
Event.Module.Channel) indicates this is part of a largerDTS.Slice.Controlnamespace hierarchy.
5. Gotchas
-
Empty Memory-Mapped File Implementation: In
DataValues.DataValues(bool useMemoryMappedFile), theif (UseMemoryMappedFile)block is empty. The feature appears to be a stub or incomplete implementation. -
Legacy TDC Filter Adjustment: The
Applymethods on filters accept abool bUseLegacyTDCSoftwareFilterAdjustmentparameter (referenced as "8747" in comments) that adjusts filtered data by one sample to match legacy TDC behavior. This may produce unexpected results if not understood. -
NotSupportedException on CalculatedChannel: Many methods on
CalculatedChannelthrowNotSupportedExceptionorNotImplementedException. These include serialization methods, mV-related properties, and some range properties. Callers must handle these exceptions. -
AdHoc Filter Construction Restriction:
SaeJ211Filter(ChannelFilter originalType)throws anExceptionif passedChannelFilter.AdHoc. Use theSaeJ211Filter(double cutoffFrequencyHz)constructor instead. -
Large Data Handling in Filter.Apply: When filtering ADC data, the method checks for
ILargeDataAware.IsDataArraySizedand throwsDataTooBigForArrayExceptionif data is too large. This is a runtime consideration for large datasets. -
Commented-Out Code: Significant blocks of code are commented out in
CalculatedChannel.cs, including the entireHICCalculatedChannelclass andInitializeReviewableAttributesimplementations. This suggests incomplete features or tech debt. -
Filter Name Ambiguity:
DefaultSaeJ211Filter.Namereturns"Default (" + base.Name + ")", whileToBaseString()returns justbase.Name. TheToString()returns the decorated name. UseToBaseString()when the undecorated name is needed.