16 KiB
16 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:14:41.949051+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 584219a9653a657a |
Sensor Data Model Documentation
1. Purpose
This module provides core data structures and utility classes for representing sensor metadata, calibration, and configuration within the DTS system. It serves as the foundational data layer for sensor management, enabling serialization/deserialization of sensor records from databases, handling of various sensor types (thermocouple, stream input/output, CAN, UART, digital output), and supporting calibration workflows including zero-reference methods and calibration mode configurations. The module bridges raw database records and higher-level business logic by encapsulating sensor-specific properties, validation rules, and conversion utilities.
2. Public Interface
Classes
DisplayedCalibrationBehavior
- Properties:
CalibrationBehavior(DTS.Common.Enums.Sensors.CalibrationBehaviors): The underlying calibration behavior enum value.DisplayString(string): Human-readable string representation of the behavior.
- Methods:
ToString(): ReturnsDisplayString.
ChannelSerialNumber
- Methods:
SerialNumberFromChannel(bool isTestSpecificEmbedded, string testSpecificEmbeddedSensor, string sensorDataSerialNumber): ReturnstestSpecificEmbeddedSensorifisTestSpecificEmbeddedis true; otherwise returnssensorDataSerialNumber.
ChannelTypeUtility
- Nested Enum:
KnownChannelTypes: Enum of known 2-character channel type codes (VS, VU, SB, TI, TC, CT, XP, P4, VF, NB, EX, X1, R1, VO, CO, CP).
- Methods:
ParseSensorKnownChannelType(string sensorName): Extracts the first two characters ofsensorName(uppercased) and returns them if they match aKnownChannelTypesvalue; otherwise returnsstring.Empty. Returnsstring.EmptyifsensorNameis null/empty or shorter than 2 characters.
ZeroRef
- Nested Enum:
ZeroType: Defines zeroing methods:AverageOverTime(0),UsePreEventDiagnostics(1),UseZeroMv(2).
- Properties:
ZeroMethod(ZeroType): The selected zeroing method.
- Constructors:
ZeroRef(string zeroref): Parseszeroref("0", "1", or "2") intoZeroType; throwsNotSupportedExceptionfor invalid values.ZeroRef(ZeroType type): Initializes with specifiedZeroType.
- Methods:
ToString(): Returns "0", "1", or "2" based onZeroMethod.
CalMode
- Properties:
ShuntCheck(bool): True if first character is 'S', false if 'I'.FullBridge(bool): True if second character is 'D', false if 'S'.Filter(bool): True if third character is 'F', false if 'B'.
- Constructors:
CalMode(string value): Parses a 3-character string (value[0]= shunt,value[1]= bridge,value[2]= filter); throwsNotSupportedExceptionfor invalid characters.CalMode(): Parameterless constructor (properties default tofalse).
- Methods:
ToString(): Returns a 3-character string in format[S/I][D/S][F/B].
SensorDbRecord
- Properties:
id(int): Database ID.SensorType(short): Sensor type identifier.SerialNumber(string): Sensor serial number.
- Constructors:
SensorDbRecord(IDataReader reader): Initializes properties from database reader usingUtility.GetInt,Utility.GetShort, andUtility.GetString.
- Inherits:
TagAwareBasewithTagTypeoverridden toTagTypes.SensorModels.
ThermocouplerRecord
- Properties:
Id(int): Database ID.SerialNumber(string): Serial number.LastModified(DateTime): Last modification timestamp.LastUpdatedBy(string): User who last modified.DoNotUse(bool): Flag indicating sensor should not be used.Broken(bool): Flag indicating sensor is broken.
- Constructors:
ThermocouplerRecord(ISensorData sd): Initializes fromISensorDatainterface.ThermocouplerRecord(IDataReader reader): Initializes from database reader usingUtilitymethods.
- Inherits:
TagAwareBasewithTagTypeoverridden toTagTypes.Sensors.
- Note: All constructors include try/catch blocks logging failures via
APILogger.
StreamInputRecord
- Properties:
Id(int): Database ID.SerialNumber(string): Serial number.LastModified(DateTime): Last modification timestamp.LastUpdatedBy(string): User who last modified.DoNotUse(bool): Flag indicating sensor should not be used.Broken(bool): Flag indicating sensor is broken.StreamInUDPAddress(string): UDP address for streaming input; defaults to"UDP://239.1.2.10:8400".
- Constructors:
StreamInputRecord(ISensorData sd): Initializes fromISensorData.StreamInputRecord(IDataReader reader): Initializes from database reader.
- Inherits:
TagAwareBasewithTagTypeoverridden toTagTypes.Sensors.
CANRecord
- Properties:
Id(int): Database ID.SerialNumber(string): Serial number.LastModified(DateTime): Last modification timestamp.LastUpdatedBy(string): User who last modified.DoNotUse(bool): Flag indicating sensor should not be used.Broken(bool): Flag indicating sensor is broken.CanIsFD(bool): Indicates if CAN FD is enabled; defaults toEmbeddedSensors.CANISFD_DEFAULT.CanArbBaseBitrate(int): Arbitration base bitrate; defaults toEmbeddedSensors.CANFD_ARB_BASE_BITRATE_DEFAULT.CanArbBaseSJW(int): Arbitration base SJW; defaults toEmbeddedSensors.CANFD_1000000_ARB_BASE_SJW_MAX.CanDataBitrate(int): Data bitrate; defaults toEmbeddedSensors.DATA_BITRATE_DEFAULT.CanDataSJW(int): Data SJW; defaults toEmbeddedSensors.DATA_SJW_DEFAULT.CanFileType(string): File type; defaults toEmbeddedSensors.FILETYPE_DEFAULT.
- Constructors:
CANRecord(ISensorData sensor): Initializes fromISensorData.CANRecord(IDataReader reader): Initializes from database reader.
- Inherits:
TagAwareBasewithTagTypeoverridden toTagTypes.Sensors.
UARTRecord
- Properties:
Id(int): Database ID.SerialNumber(string): Serial number.LastModified(DateTime): Last modification timestamp.LastUpdatedBy(string): User who last modified.DoNotUse(bool): Flag indicating sensor should not be used.Broken(bool): Flag indicating sensor is broken.UartBaudRate(uint): Baud rate; defaults toEmbeddedSensors.BAUD_RATE_DEFAULT.UartDataBits(uint): Data bits; defaults to8.UartStopBits(StopBits): Stop bits; defaults toStopBits.None.UartParity(Parity): Parity; defaults toParity.None.UartFlowControl(Handshake): Flow control; defaults toHandshake.None.UartDataFormat(UartDataFormat): Data format; defaults toUartDataFormat.Binary.
- Constructors:
UARTRecord(ISensorData sensor): Initializes fromISensorData.UARTRecord(IDataReader reader): Initializes from database reader usingEnum.Parsefor enum properties.
- Inherits:
TagAwareBasewithTagTypeoverridden toTagTypes.Sensors.
DigitalOutDbRecord
- Properties:
SerialNumber(string): Serial number.DODelay(double): Digital output delay in ms.DODuration(double): Digital output duration in ms.ModifiedBy(string): User who last modified.LastModified(DateTime): Last modification timestamp.DatabaseId(int): Database ID.ISOCode(string): ISO code.ISOChannelName(string): ISO channel name.UserCode(string): User code.UserChannelName(string): User channel name.Broken(bool): Flag indicating sensor is broken.DoNotUse(bool): Flag indicating sensor should not be used.DOMode(DigitalOutputModes): Digital output mode; defaults toDigitalOutputModes.CCNC.LimitDuration(bool): Flag limiting duration; defaults totrue.Version(int): Record version.TagsBlobBytes(byte[]): Binary blob for user tags.
- Constructors:
DigitalOutDbRecord(): Parameterless constructor.DigitalOutDbRecord(ISensorData copy, byte[] tagsBlobBytes): Initializes fromISensorData.DigitalOutDbRecord(IDigitalOutDbRecord copy): Copy constructor.DigitalOutDbRecord(IDataReader reader): Initializes from database reader.
- Inherits:
BasePropertyChanged.
SensorCalDbRecord
- Properties:
CalibrationId(int?): Database calibration ID; null if unknown.SerialNumber(string): Sensor serial number.CalibrationDate(DateTime): Calibration date.Username(string): User who performed calibration.LocalOnly(bool): Flag indicating local-only calibration.NonLinear(bool): Flag indicating non-linear calibration.Records(ICalibrationRecords): Calibration records.ModifyDate(DateTime): Last modification date.IsProportional(bool): Flag indicating proportional calibration.RemoveOffset(bool): Flag indicating offset removal.SensitivityInspection(SensitivityInspectionType): Sensitivity inspection type.CalibrationNote(string): Calibration note (max 2048 chars).UsageCount(int): Number of times calibration has been used.ZeroMethods(ZeroMethods): Zeroing method definitions.CertificationDocuments(string[]): Array of certification document paths.InitialOffsets(InitialOffsets): Initial offset values.LinearAdded(bool): Computed property indicating if linearization was added (based onNonLinear,Records, andZeroMethodsstructure).
- Constructors:
SensorCalDbRecord(): Parameterless constructor.SensorCalDbRecord(ISensorCalDbRecord copy): Copy constructor.SensorCalDbRecord(IDataReader reader, int actualDbVersion): Initializes from database reader; handles version-specific fields.
- Inherits:
BasePropertyChanged.
- Note: Constructors include try/catch blocks logging failures via
APILogger.NonLinearsetter has side effects: setsRecords.Records[0].Sensitivity = 1D,RemoveOffset = false.
StreamOutputRecord
- Properties:
Id(int): Database ID.SerialNumber(string): Serial number.LastModified(DateTime): Last modification timestamp.LastUpdatedBy(string): User who last modified.DoNotUse(bool): Flag indicating sensor should not be used.Broken(bool): Flag indicating sensor is broken.StreamOutUDPProfile(UDPStreamProfile): UDP streaming profile; defaults toUDPStreamProfile.CH10_ANALOG_2HDR.StreamOutUDPAddress(string): UDP address; defaults to"UDP://239.1.2.10:8400".StreamOutUDPTimeChannelId(ushort): Time channel ID; defaults to1, range[10, 100].StreamOutUDPDataChannelId(ushort): Data channel ID; defaults to3, range[10, 100].StreamOutUDPTmNSConfig(string): TMNS config; defaults to"(1,6,60,0,0,0,0,0)".StreamOutIRIGTimeDataPacketIntervalMs(ushort): IRIG time data packet interval; defaults to500, range[10, 1000].StreamOutTMATSIntervalMs(ushort): TMATS interval; defaults to1000, range[0, 65535].
- Constructors:
StreamOutputRecord(ISensorData sd): Initializes fromISensorData.StreamOutputRecord(IDataReader reader, int ClientDbVersion, int ConnectionDbVersion): Initializes from database reader; conditionally loadsTMATS_IntervalMSbased on version checks.
- Static Methods:
AvailableUDPStreamProfiles(int ConnectionDbVersion, bool UseAdvancedStreamingProfiles): Returns array of supportedUDPStreamProfilevalues based on version and flag.
- Inherits:
TagAwareBasewithTagTypeoverridden toTagTypes.Sensors.
DigitalInputScaleMultiplier
- Properties:
Form(Forms): Scaling form; defaults toForms.ArbitraryLowAndHigh.DefaultValue(double): Value for digital 0 (OFF); defaults to0.ActiveValue(double): Value for digital 1 (ON); defaults to1.
- Constructors:
DigitalInputScaleMultiplier(): InitializesDefaultValue = 0.DigitalInputScaleMultiplier(DigitalInputScaleMultiplier copy): Copy constructor.
- Methods:
SimpleEquals(IDigitalInputScaleMultiplier rhs): ComparesForm,DefaultValue, andActiveValue.Equals(object obj): OverridesEqualsfor equality comparison.GetHashCode(): OverridesGetHashCodeusing primes (31, 79, 127, 23).ToSerializeDbString(): Serializes to string (onlyArbitraryLowAndHighsupported).FromDbSerializeString(string s): Deserializes from string; throwsNotSupportedExceptionfor invalid formats.
- Inherits:
IDigitalInputScaleMultiplier.
ParseParameters
- Purpose: Internal helper class to bundle parameters for CSV import operations (used in Wizard and DataPRO CSV import code).
- Properties:
ImportContainedSensorRanges(bool): Defaultfalse.SensorData(ISensorData): Sensor data source.ImportCulture(IFormatProvider): Culture for parsing.Errors(List<string>): Error list.IrtraccExponent(double): IRTRACC exponent.SensorCal(ISensorCalibration): Calibration data.Sensitivity(double): Sensitivity value.SavedIsProportional(bool): Saved proportional flag.SavedRemoveOffset(bool): Saved remove offset flag.StripBackslash(bool): Flag for backslash stripping.OriginalOffset(double): Original offset value; defaults todouble.NaN.ZeroType(ZeroMethodType): Zero method type.ZeroEnd(double): Zero method end value.ZeroStart(double): Zero method start value.SquibDefaults(ISquibSettingDefaults): Squib defaults.DigitalOutDefaults(IDigitalOutDefaults): Digital output defaults.SensorGroupNameLookup(Dictionary<string, string>): Sensor group name lookup.SensorGroupTypeLookup(Dictionary<string, string>): Sensor group type lookup.GroupNameToTestObjectLookup(Dictionary<string, string>): Group name to test object lookup.SensorTestObject(string): Sensor test object.UseISOCodeFilterMapping(bool): Flag for ISO code filter mapping.UseZeroForUnfiltered(bool): Flag for zeroing unfiltered data.SensorISOCode(Dictionary<string, string>): Sensor ISO code mapping.SensorISOChannelName(Dictionary<string, string>): Sensor ISO channel name mapping.SensorUserCode(Dictionary<string, string>): Sensor user code mapping.SensorUserChannelName(Dictionary<string, string>): Sensor user channel name mapping.SensorDASSerialNumber(Dictionary<string, string>): Sensor DAS serial number mapping.SensorDASChannelIndex(Dictionary<string, int>): Sensor DAS channel index mapping.
- Note: Documentation states this class is internal and may be refactored when DataPRO CSV import is removed.
3. Invariants
ChannelSerialNumber.SerialNumberFromChannel: Returns exactly one of the two input serial number strings based onisTestSpecificEmbedded; never returns `