This module defines core data structures for representing sensor metadata, calibration, and configuration within the DTS system. It provides concrete implementations of interfaces for database persistence (SensorDbRecord, StreamInputRecord, UARTRecord, StreamOutputRecord, DigitalOutDbRecord, SensorCalDbRecord), helper classes for parsing and serializing configuration strings (ZeroRef, CalMode, DigitalInputScaleMultiplier), and supporting infrastructure for calibration and zeroing behavior (ZeroMethod, ZeroMethods, DisplayedCalibrationBehavior). These classes serve as the foundational data layer for sensor management, enabling consistent representation of sensor properties across database operations, CSV import/export workflows, and UI binding contexts.
2. Public Interface
DisplayedCalibrationBehavior
CalibrationBehavior (DTS.Common.Enums.Sensors.CalibrationBehaviors): Stores the underlying calibration behavior enum value.
DisplayString (string): Human-readable string representation of the calibration behavior.
ToString() (override string): Returns "0", "1", or "2" based on ZeroMethod.
CalMode
ShuntCheck (bool): true if shunt check enabled ('S' in position 0), false otherwise ('I').
FullBridge (bool): true if full bridge mode ('D' in position 1), false otherwise ('S').
Filter (bool): true if filter enabled ('F' in position 2), false otherwise ('B').
Constructor CalMode(string value): Parses 3-character string (e.g., "SDF") into properties; throws NotSupportedException for invalid characters at any position.
Constructor CalMode(): Default constructor initializes all properties to false.
ToString() (override string): Serializes to 3-character string (e.g., "SDF").
StreamInputRecord
Id (int): Database ID of the sensor.
SerialNumber (string): Sensor serial number.
LastModified (DateTime): Timestamp of last modification.
LastUpdatedBy (string): User who last modified the record.
DoNotUse (bool): Flag indicating sensor should be excluded from use.
Broken (bool): Flag indicating sensor is broken.
StreamInUDPAddress (string): UDP address for streaming input; defaults to "UDP://239.1.2.10:8400".
DigitalOutDefaults (IDigitalOutDefaults): Digital output defaults.
SensorGroupNameLookup, SensorGroupTypeLookup, etc.: Multiple Dictionary<string, string> fields for mapping group names, ISO codes, user codes, DAS serial numbers, and channel indices.
SensorTestObject (string): Test object identifier.
AvailableUDPStreamProfiles(int ConnectionDbVersion, bool UseAdvancedStreamingProfiles) (static UDPStreamProfile[]): Returns list of supported profiles based on version and profile type.
Constructor StreamOutputRecord(ISensorData sd): Initializes from ISensorData.
Constructor StreamOutputRecord(IDataReader reader, int ClientDbVersion, int ConnectionDbVersion): Initializes from database reader; conditionally reads TMATS_IntervalMS if versions permit.
ZeroMethod
Method (ZeroMethodType): Zeroing method type; defaults to SensorConstants.DefaultZeroMethodType.
Start (double): Start value for zeroing window; defaults to SensorConstants.DefaultZeroMethodStart.
End (double): End value for zeroing window; defaults to SensorConstants.DefaultZeroMethodEnd.
ToSerializedString() (string): Serializes using "__x__" separator; escapes separator characters.
ToDisplayString(...) (string): Human-readable display string for all methods.
ToString() (override string): Calls ToDisplayString with localized format strings.
3. Invariants
ZeroRef: String serialization is strictly "0", "1", or "2"; invalid inputs throw NotSupportedException.
CalMode: String serialization is exactly 3 characters; positions 0, 1, 2 must be S/I, D/S, and F/B respectively; invalid inputs throw NotSupportedException.
DigitalInputScaleMultiplier: Serialization format is "Form,DefaultValue,ActiveValue"; only Forms.ArbitraryLowAndHigh is supported; invalid formats throw NotSupportedException.
ZeroMethod: Serialization format is "Method,Start,End"; XML serialization uses "UsePreCalZero" as legacy alias for UsePreEventDiagnosticsZero.
ZeroMethods: Serialization uses "__x__" as primary separator and "___xx___" as backup escape sequence; ToString() uses localized format strings.
SensorCalDbRecord.NonLinear: Setting to true forces RemoveOffset = false.
StreamOutputRecord.StreamOutUDPTimeChannelId and StreamOutUDPDataChannelId: Valid range is [10, 100].
StreamOutputRecord.StreamOutIRIGTimeDataPacketIntervalMs: Valid range is [10, 1000].
UARTRecord: All UART configuration fields have defined default values (UartBaudRate=57600, UartDataBits=8, UartStopBits=None, UartParity=None, UartFlowControl=None, UartDataFormat=Binary).
StreamInputRecord.StreamInUDPAddress: Defaults to "UDP://239.1.2.10:8400".
StreamOutputRecord.StreamOutUDPAddress: Defaults to "UDP://239.1.2.10:8400".
DigitalOutDbRecord.DatabaseId: Default is -1 (indicating no database assignment).
DigitalOutDbRecord.LimitDuration: Defaults to true.
DigitalOutDbRecord.DOMode: Defaults to DigitalOutputModes.CCNC.
4. Dependencies
Dependencies of this module:
DTS.Common.Base: Provides BasePropertyChanged (used by DigitalOutDbRecord, SensorCalDbRecord, ZeroMethod).
DTS.Common.Interface.Tags: Provides TagAwareBase (base class for SensorDbRecord, StreamInputRecord, StreamOutputRecord).