13 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:31:44.880303+00:00 | zai-org/GLM-5-FP8 | 1 | ef8fc2aacbeebadc |
DTS.Common.Enums.Sensors Module Documentation
1. Purpose
This module provides the core enumerations, constants, and utility methods for sensor management within the DTS data acquisition system. It defines sensor lifecycle states, calibration behaviors, filter configurations, zero methods, CSV import/export field mappings, and various sensor-related constants. The module serves as a foundational layer for sensor configuration, validation, and data interchange across the application.
2. Public Interface
Enumerations
SensorChangeTypes
public enum SensorChangeTypes { OffsetTolerance }
Defines types of sensor changes. Currently only OffsetTolerance is defined.
SensorStatus
public enum SensorStatus { Available, InUse, OutForService, OutForCalibration, Retired }
Defines the lifecycle states of a sensor.
PossibleFilters
public enum PossibleFilters { All, Analog, Squib, DigitalIn, DigitalOut, UART, StreamOut, StreamIn, CAN }
Describes different ways of filtering channels and sensors by type.
NonLinearStyles
public enum NonLinearStyles { IRTraccManual, IRTraccDiagnosticsZero, IRTraccZeroMMmV, IRTraccAverageOverTime, Polynomial, IRTraccCalFactor }
Defines linearization formula styles for non-linear sensor processing.
NonLinearSLICEWareStyles
public enum NonLinearSLICEWareStyles { Manual, DiagnosticZeroMMmV, ZeroMMmV, AverageOverTime, Polynomial }
SLICEWare-specific linearization styles.
CalibrationEnforcement
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum CalibrationEnforcement { None, NonLinear, Linear }
Defines calibration enforcement modes. Uses EnumDescriptionTypeConverter for display string conversion.
SensitivityInspectionType
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum SensitivityInspectionType { NotSet = 0, Required = 1, Cleared = 2 }
Defines sensitivity inspection states with explicit integer values.
CalibrationBehaviors
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum CalibrationBehaviors { LinearIfAvailable, NonLinearIfAvailable, UseBothIfAvailable }
Defines how calibration data should be selected when available.
InitialOffsetTypes
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum InitialOffsetTypes { None = 0, EU = 1, EUAtMV = 2, LHS = 3, RHS = 4, FRONTAL = 5 }
Defines the format of initial offset values with explicit integer values.
FilterClassType
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum FilterClassType { None = 0, AdHoc = -1, Unfiltered = -2, CFC10 = 17, CFC60 = 100, CFC180 = 300, CFC600 = 1000, CFC1000 = 1650 }
Defines SAE filter class types. Values represent cutoff frequencies in Hz. Uses DescriptionResourceAttribute for localized display strings.
ZeroMethodType
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum ZeroMethodType { AverageOverTime = 0, UsePreEventDiagnosticsZero = 1, None = 2 }
Defines methods for calculating electrical zero. Order and values are critical for legacy compatibility.
OriginalZeroMethodType
public enum OriginalZeroMethodType { AverageOverTime, UsePreCalZero, None }
Original version of zero method types for backward compatibility.
CSVImportTags Class
public abstract class CSVImportTags
Constants
public const int MIN_VALID_VERSION = 0;
public const int MAX_VALID_VERSION = 6;
Static Methods
public static bool IsSensorTag(int version)
Returns true if the version is in the sensor tags set (versions 0, 2, 3, or 4).
public static Tags[] GetVersionTags(int version)
Returns all tags applicable to a given CSV import version. Returns empty array if version not found.
public static string GetStringForTag(Tags tag)
Returns the display string for a given tag using DisplayAttribute.
public static Tags GetTagForString(string s)
Returns the tag enum value for a display string. Returns Tags.Unknown if not found.
public static int GetVersionForTag(Tags t)
Returns the version number in which a tag was introduced. Returns int.MaxValue if not found.
Nested Tags Enum
Contains 100+ tag values for CSV import/export fields, each decorated with [Display(Name = "...")] and [Version(int)] attributes indicating the field name and the version in which it was introduced.
SensorConstants Class
public abstract class SensorConstants
Static Properties (Cached Configuration Values)
| Property | Type | Default/Initial Value |
|---|---|---|
UseInitSignalTOM |
bool |
false |
δThorax, δAbdomen, D0Thorax, D0Abdomen, δThoraxLower, D0ThoraxLower |
double |
Various IR-TRACC 3D values |
UseSensorFirstUseDate |
bool |
false |
DontAllowDataCollectionIfOverused |
bool |
false |
AllowInspectBeforeUse |
bool |
false |
UsageRemainingForWarning |
int |
(uninitialized) |
DefaultMaxUsageAllowed |
int |
(uninitialized) |
UseISOCodeFilterMapping |
bool |
true |
DefaultZeroMethodType |
ZeroMethodType |
AverageOverTime |
DefaultZeroMethodStart |
double |
-0.05D |
DefaultZeroMethodEnd |
double |
-0.02D |
DefaultRangeHiG |
double |
400D |
DefaultRangeLowG |
double |
64D |
DefaultRangeLowGDisplay |
double |
50D |
DefaultRangeARS |
double |
2000D |
DefaultRangeTemperature |
double |
85D |
DefaultRangeHumidity |
double |
100D |
DefaultRangePressure |
double |
16D |
DisableAutoSense |
bool |
(uninitialized) |
DefaultBridgeOffsetMVTolLow |
double |
-100 |
DefaultBridgeOffsetMVTolHigh |
double |
100 |
DefaultIEPEOffsetMVTolLow |
double |
-2000 |
DefaultIEPEOffsetMVTolHigh |
double |
2000 |
SensorCalOutOfDateWarningPeriodDays |
int |
14 |
SensorCalPolicyCurrent |
SensorCalPolicy |
DONT_ALLOW |
Static Methods
public static bool IsTestSpecificDigitalOut(string sn)
public static bool IsTestSpecificSquib(string sn)
public static bool IsTestSpecificDigitalIn(string sn)
public static bool IsTestSpecificEmbedded(string sn)
public static bool IsTestSpecificThermoCouple(string sn)
public static bool IsTestSpecificEmbeddedClock(string sn)
public static bool IsTestSpecificStreamOut(string sn)
public static bool IsTestSpecificStreamIn(string sn)
public static bool IsTestSpecificUart(string sn)
public static bool IsTestSpecificThermocoupler(string sn)
public static bool IsTestSpecificCAN(string sn)
Each returns true if the serial number starts with the corresponding test-specific prefix.
public static bool IsTSRAirHighGChannel(string moduleSerialNumber)
public static bool IsTSRAirLowGChannel(string moduleSerialNumber)
public static bool IsTSRAirARSChannel(string moduleSerialNumber)
public static bool IsTSRAirAtmChannel(string moduleSerialNumber)
public static bool IsTSRAirHumidityChannel(string moduleSerialNumber, int channelNumber)
Identify TSR AIR module channel types by suffix or channel number.
public static BridgeType ConvertIntToBridgeType(int bridge)
Converts integer database values to BridgeType enum.
public static int ConvertBridgeToInt(BridgeType bridge)
Converts BridgeType enum to integer for database storage (non-bitmask values).
Nested Types
public enum SensorSettings { Range, CFC, Polarity, Position, LimitDuration, Duration, Delay, OutputMode, SQMode, DIMode, DefaultValue, ActiveValue, SquibLimitDuration, SquibDuration, SquibDelay, DigitalOutLimitDuration, DigitalOutDuration, DigitalOutDelay, SquibCurrent, ZeroMethod, ZeroMethodStart, ZeroMethodEnd, UserValue1, UserValue2, UserValue3, InitialOffset, FilterClass, UartBaudRate, UartDataBits, UartStopBits, UartParity, UartFlowControl, UartDataFormat, StreamOutUDPProfile, StreamOutUDPAddress, StreamOutUDPTimeChannelId, StreamOutUDPDataChannelId, StreamOutUDPTmNSConfig, StreamOutIRIGTimeDataPacketIntervalMs, StreamInUDPAddress, ACCouplingEnabled, BridgeType }
public enum SensorType { Analog, DigitalIn, DigitalOut, Squib, Clock, UART, StreamOut, StreamIn, Thermocoupler }
public enum SensUnits { NONE = 0, mV = 1, mVperV = 2, mVperVperEU = 3, mVperEU = 4 }
public enum BridgeType { IEPE = 1, QuarterBridge = 2, HalfBridge = 4, FullBridge = 8, DigitalInput = 16, SQUIB = 32, TOMDigital = 64, HalfBridge_SigPlus = 128, RTC = 256, UART = 512, StreamOut = 1024, StreamIn = 2048, Thermocoupler = 4096, CAN = 8192 }
public enum SensorCalPolicy { AllowAlways, DONT_ALLOW }
public enum CouplingModes { AC = 0, DC }
public enum AvailableRangesLowG { LowG64D = 64 }
public enum AvailableRangesARS { ARS2000D = 2000 }
public abstract class SensUnitStringConverter
{
public static SensUnits ConvertFromString(string s)
}
3. Invariants
-
CSV Version Range: Valid CSV import versions are between
MIN_VALID_VERSION(0) andMAX_VALID_VERSION(6), inclusive. -
Sensor Tag Versions: Only versions 0, 2, 3, and 4 are considered "sensor tag" versions as defined in
_SensorTagsVersions. -
Bridge Resistance Limits: Valid bridge resistance values must be between
MIN_BRIDGE_RESISTANCE_OHMS(1) andMAX_BRIDGE_RESISTANCE_OHMS(32000). -
ZeroMethodType Enum Ordering: The order and explicit values of
ZeroMethodTypeenum members must not be changed due to legacy compatibility requirements (e.g., GM ISF import). -
BridgeType Bitmask vs. Storage:
BridgeTypeuses bitmask values (powers of 2), but database storage uses sequential integers (0-4, 8) viaConvertBridgeToInt. -
FilterClassType Values: Filter class values represent actual cutoff frequencies in Hz (e.g.,
CFC60 = 100Hz, not 60). -
TSR AIR Channel Numbers: Humidity channel is channel 10, Pressure is channel 11, Temperature is channel 9 within TSR AIR atmospheric modules.
4. Dependencies
This module depends on:
System- Core .NET typesSystem.ComponentModel-TypeConverter,DescriptionAttributeSystem.ComponentModel.DataAnnotations-DisplayAttributeSystem.IO.Ports-StopBits,Parity,HandshakeenumsSystem.Collections.Generic-Dictionary,HashSet,ListSystem.Linq- LINQ extension methodsDTS.Common.Converters-EnumDescriptionTypeConverterDTS.Common.Attributes-DisplayAttribute,VersionAttribute(custom attributes)DTS.Common.Base.Classes-DescriptionResourceAttribute
What depends on this module:
- Unknown from source alone. This is a foundational enums/constants module likely used throughout the DTS application for sensor configuration, data acquisition, and import/export functionality.
5. Gotchas
-
Static Property State: Many static properties in
SensorConstants(e.g.,UseInitSignalTOM,UseSensorFirstUseDate,DisableAutoSense) are described as "holding values between processes" and do not serialize/deserialize. They must be set by using applications on startup. -
ZeroMethodType Legacy Compatibility: The comment explicitly warns: "Lots of legacy compatibility (e.g. importing GM ISF) depends on the order/value of this enum." Do not reorder or reassign values.
-
BridgeType Integer Conversion: The
ConvertBridgeToIntmethod uses non-bitmask integer values for database storage, which is described as "needed for historical reasons." The mapping is not 1:1 with bitmask values (e.g.,HalfBridge_SigPlus = 128in enum but stores as4). -
Deprecated SensorSettings:
LimitDuration,Duration, andDelayinSensorSettingsenum are marked as "deprecated in 2.1" but remain in the enum. -
FilterClassType None Behavior: Per comments,
None = 0has special behavior: "Code = P unless UseZeroForUnfiltered is True, then Code = 0". This behavior is not defined in this source file. -
Uninitialized Static Properties:
UsageRemainingForWarningandDefaultMaxUsageAllowedare declared without initialization, implying they must be set before use. -
Test-Specific Serial Number Prefixes: Multiple similar prefixes exist (
TEST_SPECIFIC_THERMO = "TST_"vsTEST_SPECIFIC_THERMOCOUPLER = "TST_TestSpecific"). The relationship between short prefixes and full serial formats is not fully documented in source. -
CSVImportTags Thread Safety: All public methods use
lock(MY_LOCK)for thread-safe lazy initialization of lookup dictionaries.