15 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:43:43.565732+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 5790c6a0caacf995 |
Sensor Enums and Constants Module Documentation
1. Purpose
This module defines a comprehensive set of enumerations and constants used throughout the DTS system to represent sensor metadata, configuration, calibration behavior, and I/O channel types. It serves as the canonical source of truth for sensor-related semantic values—enabling consistent interpretation of sensor data, configuration, and import/export formats across the application. The module supports legacy compatibility (e.g., CSV import versions, zero method ordering), provides unit and range defaults for specific sensor families (e.g., TSR AIR), and includes helper methods for serial number classification and sensitivity unit parsing.
2. Public Interface
Enums
SensorChangeTypes
- Members:
OffsetTolerance - Purpose: Represents types of changes that can be tracked for sensors. Currently only supports
OffsetTolerance.
SensorStatus
- Members:
Available,InUse,OutForService,OutForCalibration,Retired - Purpose: Represents the current lifecycle status of a physical sensor.
PossibleFilters
- Members:
All,Analog,Squib,DigitalIn,DigitalOut,UART,StreamOut,StreamIn - Purpose: Specifies filter categories for channel/sensor selection (e.g., in UI or channel grouping).
NonLinearStyles
- Members:
IRTraccManual,IRTraccDiagnosticsZero,IRTraccZeroMMmV,IRTraccAverageOverTime,Polynomial,IRTraccCalFactor - Purpose: Defines nonlinear calibration styles for sensors (primarily IR-TRACC).
NonLinearSLICEWareStyles
- Members:
Manual,DiagnosticZeroMMmV,ZeroMMmV,AverageOverTime,Polynomial - Purpose: Defines nonlinear calibration styles specific to SLICEWare devices.
CalibrationEnforcement
- Members:
None,NonLinear,Linear - Purpose: Indicates whether calibration enforcement is applied and which type (linear/nonlinear). Uses
EnumDescriptionTypeConverterand[Description]attributes.
CalibrationBehaviors
- Members:
LinearIfAvailable,NonLinearIfAvailable,UseBothIfAvailable - Purpose: Specifies preference for calibration style when both linear and nonlinear calibrations are available. Uses
EnumDescriptionTypeConverterand[Description]attributes.
InitialOffsetTypes
- Members:
None = 0,EU = 1,EUAtMV = 2,LHS = 3,RHS = 4,FRONTAL = 5 - Purpose: Indicates the format and meaning of the initial offset value. Uses
EnumDescriptionTypeConverterand[Description]attributes.
FilterClassType
- Members:
None = 0,AdHoc = -1,Unfiltered = -2,CFC10 = 17,CFC60 = 100,CFC180 = 300,CFC600 = 1000,CFC1000 = 1650 - Purpose: Represents SAE filter class definitions (e.g., CFC 100 = 100 Hz cutoff). Uses
EnumDescriptionResourceattributes for localization.
ZeroMethodType
- Members:
AverageOverTime = 0,UsePreEventDiagnosticsZero = 1,None = 2 - Purpose: Specifies the method used to compute the software zero reference. Legacy ordering is preserved for CSV import compatibility. Uses
EnumDescriptionTypeConverter.
OriginalZeroMethodType
- Members:
AverageOverTime,UsePreCalZero,None - Purpose: Original version of zero method types; likely retained for backward compatibility or migration.
SensorConstants.SensorType
- Members:
Analog,DigitalIn,DigitalOut,Squib,Clock,UART,StreamOut,StreamIn - Purpose: High-level classification of sensor/channel types.
SensorConstants.BridgeType
- Members:
IEPE,QuarterBridge,HalfBridge,FullBridge,DigitalInput,SQUIB,TOMDigital,HalfBridge_SigPlus,RTC,UART,StreamOut,StreamIn - Purpose: Bitmask-style enumeration representing bridge configuration and channel type. Includes helper methods
ConvertIntToBridgeTypeandConvertBridgeToInt.
SensorConstants.SensUnits
- Members:
NONE,mV,mVperV,mVperVperEU,mVperEU - Purpose: Sensitivity unit types. Includes
SensUnitStringConverter.ConvertFromStringfor parsing.
SensorConstants.SensorCalPolicy
- Members:
AllowAlways,DONT_ALLOW - Purpose: Policy for handling out-of-calibration sensors.
SensorConstants.CouplingModes
- Members:
AC = 0,DC - Purpose: IEPE/analog coupling mode.
SensorConstants.AvailableRangesLowG
- Members:
LowG64D,LowG32D,LowG16D,LowG8D - Purpose: Valid low-g ranges for TSR AIR sensors.
SensorConstants.AvailableRangesARS
- Members:
ARS2000D,ARS250D - Purpose: Valid angular rate sensor (ARS) ranges.
Constants & Static Properties (in SensorConstants)
Unit Strings
VOLTAGE_INSERTION_UNIT = "mV"TSRAIR_ACCEL_UNIT = "g"TSRAIR_ARS_UNIT = "deg/sec"TSRAIR_TEMPERATURE_UNIT = "C"TSRAIR_HUMIDITY_UNIT = "%"TSRAIR_PRESSURE_UNIT = "PSI"DEGREES = "deg"DEGREE_ANGLE = "deg-ang"LinearValuesSeparator = "||"
Bridge Resistance Limits
MIN_BRIDGE_RESISTANCE_OHMS = 1MAX_BRIDGE_RESISTANCE_OHMS = 32000
Calibration Defaults
SENSOR_FIRST_USE_DEFAULT = falseUseSensorFirstUseDate = false(cached, mutable)UseISOCodeFilterMapping = true(cached, mutable)DefaultZeroMethodType = ZeroMethodType.AverageOverTime(cached, mutable)DefaultZeroMethodStart = -0.05DDefaultZeroMethodEnd = -0.02DCAL_SENSOR_POLICY_DEFAULT = DONT_ALLOWCAL_SENSOR_POLICY_WARNING_DAYS_DEFAULT = 14SensorCalOutOfDateWarningPeriodDays = 14(mutable)SensorCalPolicyCurrent = DONT_ALLOW(mutable)
TSR AIR Default Ranges
DefaultRangeHiG = 400DDefaultRangeLowG = 64DDefaultRangeLowGDisplay = 50DDefaultRangeARS = 2000DDefaultRangeTemperature = 85DDefaultRangeHumidity = 100DDefaultRangePressure = 16D
Squib & Digital Output Defaults (for "Restore Defaults")
SQUIB_DELAY_CONSTANT = 0DSQUIB_LIMIT_DURATION_CONSTANT = trueSQUIB_DURATION_CONSTANT = 10DSQUIB_LOW_TOLERANCE_CONSTANT = 1DSQUIB_HIGH_TOLERANCE_CONSTANT = 10DSQUIB_CURRENT_CONSTANT = 1.5DDIGITALOUT_DELAY_CONSTANT = 0DDIGITALOUT_LIMITDURATION_CONSTANT = trueDIGITALOUT_DURATION_CONSTANT = 10D
UART Defaults
UART_BAUDRATE_CONSTANT = 57600UART_DATABITS_CONSTANT = 8UART_STOPBITS_CONSTANT = StopBits.OneUART_PARITY_CONSTANT = Parity.NoneUART_FLOWCONTROL_CONSTANT = Handshake.NoneUART_DATAFORMAT_CONSTANT = UartDataFormat.Binary
Stream I/O Defaults
STREAMIN_ADDRESS_CONSTANT = "UDP://239.1.2.10:8400"STREAMOUT_PROFILE_CONSTANT = UDPStreamProfile.CH10_PCM_128BIT_2HDRSTREAMOUT_ADDRESS_CONSTANT = "UDP://239.1.2.10:8400"STREAMOUT_TIME_CHID_CONSTANT = 1STREAMOUT_DATA_CHID_CONSTANT = 3STREAMOUT_TMNS_CONFIG_CONSTANT = "(1,6,60,0,0,0,0,0)"STREAMOUT_IRIG_TDP_INTERVAL_CONSTANT = 500
Test-Specific Serial Number Prefixes
TEST_SPECIFIC_DOUT = "TSD_"TEST_SPECIFIC_SQUIB = "TSQ_"TEST_SPECIFIC_DIN = "TSI_"TEST_SPECIFIC_EMB = "TSA_"TEST_SPECIFIC_EMB_CLK = "TSC_"TEST_SPECIFIC_UART = "TSU_"TEST_SPECIFIC_STREAM_OUT = "TSS_"TEST_SPECIFIC_STREAM_IN = "TSN_"
Helper Methods
IsTestSpecificDigitalOut(string sn)IsTestSpecificSquib(string sn)IsTestSpecificDigitalIn(string sn)IsTestSpecificEmbedded(string sn)IsTestSpecificEmbeddedClock(string sn)IsTestSpecificStreamOut(string sn)IsTestSpecificStreamIn(string sn)IsTestSpecificUart(string sn)IsTSRAirHighGChannel(string moduleSerialNumber)IsTSRAirLowGChannel(string moduleSerialNumber)IsTSRAirARSChannel(string moduleSerialNumber)IsTSRAirAtmChannel(string moduleSerialNumber)IsTSRAirHumidityChannel(string moduleSerialNumber, int channelNumber)
CSVImportTags (abstract class)
Constants
MIN_VALID_VERSION = 0MAX_VALID_VERSION = 6IsSensorTag(int version)→bool(returnstruefor versions{0, 2, 3, 4})
Static Methods
GetVersionTags(int version)→Tags[]GetStringForTag(Tags tag)→stringGetTagForString(string s)→Tags(returnsTags.Unknownif not found)GetVersionForTag(Tags t)→int(returnsint.MaxValueif not found)
CSVImportTags.Tags Enum (partial list)
-
Version 0:
DatabaseReferenceNumber,SensorSN,ChannelName,Location,SensorType,EU,FullScale,Exc,OutputAtEXCFSmV,Sensitivity,FilterClass,SoftwareZeroReference,SoftwareZeroEquivalentEU,OffsetToleranceLow,OffsetToleranceHigh,BridgeResistance,ShuntResistorValue,CalInterval,ZeroMethod,ZeroMethodStart,ZeroMethodEnd,InitialOffset,NonLinear,NonLinearCalibration,DisplayUnits,UserCode,UserChannelName,ISOChannelName,UserChannelName,AdditionalLinearSensitivity,AdditionalLinearZeroMethod,AdditionalInitialOffsets,GroupName,GroupType,DASSerialNumber,DASChannelIndex,StreamProfile,UDPAddress,TimeChannelId,DataChannelId,TmNSConfig,IRIGTimeDataPacketIntervalMS,TMATSIntervalMS,BaudRate,DataBits,StopBits,Parity,DataFormat,TestUserCode,TestUserChannelName,TestIsoCode,TestIsoChannelName,ClockMasterInputType,ClockMasterOutputType,ManageClocksOutsideDPMaster,ManageClocksOutsideDPSlave,ClockSlaveInputType,ClockSlaveOutputType,DASSerial,DASSampleRate,PTPDomainId,ClockMaster,Version,TestSetupName,TestSetupDescription,RecordingMode,SampleRate,PreTriggerSec,PostTriggerSec,Tags,TwoVoltExcSensitivity,FiveVoltExcSensitivity,TenVoltExcSensitivity,RangeLow,RangeMedium,RangeHigh,SupportedExcitation,BridgeType,Unipolar,AxisNumber,NumberOfAxes,Polarity,PhysicalDimension,Direction,CheckOffset,Broken,DoNotUse,AtCapacity,CapacityOutputIsBasedOn,SensitivityUnits,CouplingMode,DelayMS,DigitalOutputDelayMS,DurationMS,DigitalOutputDurationMS,DigitalOutputMode,LimitDuration,SquibFireMode,SquibMeasurementType,SquibOutputCurrent,DigitalScaleMultiplier,DigitalInputMode,ZeroMethod,ZeroMethodStart,ZeroMethodEnd,BridgeLegMode,Created,TimesUsed,IRTRACCExponent,Unknown -
Version 1: Adds
Version,TestSetupName,TestSetupDescription,RecordingMode,SampleRate,PreTriggerSec,PostTriggerSec,Tags -
Version 2: Adds many fields (e.g.,
TwoVoltExcSensitivity,ZeroMethod,InitialOffset,NonLinear,DigitalOutputMode,SquibFireMode,CouplingMode,DelayMS,DigitalOutputDelayMS,DurationMS,DigitalOutputDurationMS,DigitalOutputMode,LimitDuration,SquibFireMode,SquibMeasurementType,SquibOutputCurrent,DigitalScaleMultiplier,DigitalInputMode,NonLinearCalibration,DisplayUnits,AtCapacity,CapacityOutputIsBasedOn,SensitivityUnits,CheckOffset,Broken,DoNotUse,ISOChannelName,UserCode,UserChannelName,AdditionalLinearSensitivity,AdditionalLinearZeroMethod,AdditionalInitialOffsets,GroupName,GroupType,DASSerialNumber,DASChannelIndex,StreamProfile,UDPAddress,TimeChannelId,DataChannelId,TmNSConfig,IRIGTimeDataPacketIntervalMS,TMATSIntervalMS,BaudRate,DataBits,StopBits,Parity,DataFormat,TestUserCode,TestUserChannelName,TestIsoCode,TestIsoChannelName,ClockMasterInputType,ClockMasterOutputType,ManageClocksOutsideDPMaster,ManageClocksOutsideDPSlave,ClockSlaveInputType,ClockSlaveOutputType,DASSerial,DASSampleRate,PTPDomainId,ClockMaster) -
Version 3: Adds
GroupName,GroupType -
Version 4: Adds
DASSerialNumber,DASChannelIndex,StreamProfile,UDPAddress,TimeChannelId,DataChannelId,TmNSConfig,IRIGTimeDataPacketIntervalMS,TMATSIntervalMS,BaudRate,DataBits,StopBits,Parity,DataFormat,TestUserCode,TestUserChannelName,TestIsoCode,TestIsoChannelName -
Version 5: Adds
ClockMasterInputType,ClockMasterOutputType,ManageClocksOutsideDPMaster,ManageClocksOutsideDPSlave,ClockSlaveInputType,ClockSlaveOutputType -
Version 6: Adds
DASSerial,DASSampleRate,PTPDomainId,ClockMaster
Note:
Tags.Unknownis returned for unrecognized strings inGetTagForString.
3. Invariants
- CSV Import Versions: Valid import versions are
0,2,3,4(per_SensorTagsVersions). Versions1,5, and6are not included inIsSensorTag, but are still valid for general import (asGetVersionTagssupports them). - Zero Method Ordering:
ZeroMethodTypeenum values are ordered to preserve legacy compatibility (e.g.,AverageOverTime = 0,UsePreEventDiagnosticsZero = 1,None = 2). Changing order may break CSV import/export. - Bridge Type Conversion:
ConvertBridgeToIntandConvertIntToBridgeTypeuse non-bitmask integer mappings (e.g.,FullBridge → 3,QuarterBridge → 1). Do not assume bitmask semantics for storage. - Sensitivity Unit Parsing:
SensUnitStringConverter.ConvertFromStringis case-insensitive and accepts multiple aliases (e.g.,"mvperv"→mVperV). ThrowsInvalidCastExceptionfor unrecognized strings. - TSR AIR Channel Detection: Channel type detection is based on serial number suffixes (
"-High g","-Low g","-ARS","-Atm"). Case-sensitive. - Test-Specific Serial Number Prefixes: Prefixes are exact string matches (e.g.,
"TSQ_"). No wildcard or partial matching. - Calibration Policy Defaults:
CAL_SENSOR_POLICY_DEFAULT = DONT_ALLOW,CAL_SENSOR_POLICY_WARNING_DAYS_DEFAULT = 14. Mutable statics (SensorCalPolicyCurrent,SensorCalOutOfDateWarningPeriodDays) may be updated at runtime.
4. Dependencies
Internal Dependencies
DTS.Common.Converters.EnumDescriptionTypeConverterDTS.Common.Attributes.VersionAttribute,System.ComponentModel.DataAnnotations.DisplayAttributeSystem.IO.Ports(forStopBits,Parity,Handshake)System.IO(forInvalidCastExceptioninSensUnitStringConverter)
External Dependencies
System(core types:string,int,double,bool,Enum,Dictionary,HashSet,Exception)System.ComponentModel.DataAnnotations(forDisplayAttribute)System.IO.Ports(forStopBits,Parity,Handshake)
Usage
- This module is referenced by modules handling sensor configuration, CSV import/export, channel filtering, diagnostics, and calibration enforcement.
5. Gotchas
ZeroMethodTypevsOriginalZeroMethodType: