11 KiB
11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T04:57:48.606656+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | af9c7b6d258fe03e |
Documentation: DAS Sensor Concepts (Version 57)
1. Purpose
This module defines core enumerations and data structures used to configure and process sensor data within the DTS DAS (Data Acquisition System) framework, specifically for database export in Version 57. It provides type-safe representations of sensor bridge configurations, sensitivity units, zeroing methods, excitation voltages, and linearization formulas—enabling consistent interpretation of sensor metadata across data import, processing, and export pipelines. These constructs serve as a bridge between legacy database formats and current system logic, preserving historical behavior while supporting extensibility.
2. Public Interface
Nested Enumerations (within DatabaseExport.Test.Module.Channel.Sensor)
BridgeType
- Definition:
public enum BridgeType - Values:
IEPE = 1 << 0— Sensor uses IEPE (Integrated Electronics Piezo-Electric) setup.QuarterBridge = 1 << 1— Sensor uses quarter-bridge configuration.HalfBridge = 1 << 2— Sensor uses half-bridge configuration.FullBridge = 1 << 3— Sensor uses full-bridge configuration.DigitalInput = 1 << 4— Sensor acts as a digital input.SQUIB = 1 << 5— Sensor uses SQUIB (a proprietary DTS technology).TOMDigital = 1 << 6— TOM digital input mode.
- Behavior: Bitwise flags; intended for combination via OR operations.
SensUnits
- Definition:
public enum SensUnits - Values:
NONE = 0— No sensitivity units (used for polynomial sensors).mV = 1— Sensitivity in millivolts at full-scale (Capacity EU).mVperV = 2— Excitation-proportional sensitivity in mV/V at full-scale.mVperVperEU = 3— Sensitivity in mV/V per Engineering Unit.mVperEU = 4— Sensitivity in mV per Engineering Unit.
- Behavior: Represents sensitivity unit types for sensor calibration.
ZeroMethodType
- Definition:
public enum ZeroMethodType - Values:
AverageOverTime = 0— Electrical zero calculated as average over time.UsePreEventDiagnosticsZero = 1— Zero calculated using pre-event diagnostics.None = 2— Zero set via absolute/injected value.
- Notes: Order and values are preserved for legacy compatibility (e.g., GM ISF import).
OriginalZeroMethodType
- Definition:
public enum OriginalZeroMethodType - Values:
AverageOverTime— Same asZeroMethodType.AverageOverTime.UsePreCalZero— Zero calculated using pre-calibration diagnostics.None— Same asZeroMethodType.None.
- Notes: Distinct from
ZeroMethodTypeto preserve original enum values during migration;UsePreCalZeromaps toUsePreEventDiagnosticsZerosemantically.
ExcitationVoltageOption
- Definition:
public enum ExcitationVoltageOption - Values:
Undefined = 1— Voltage magnitude 0.0 V.Volt2 = 2— 2.0 V.Volt2_5 = 4— 2.5 V.Volt3 = 8— 3.0 V.Volt5 = 16— 5.0 V.Volt10 = 32— 10.0 V.Volt1 = 64— 1.0 V.
- Behavior: Bitwise flags (powers of two); values are not sequential.
DigitalInputScaleMultiplier.InputModes
- Definition:
public enum InputModes - Values:
TLH = 1 << 1— Transition Low-to-High.THL = 1 << 2— Transition High-to-Low.CCNO = 1 << 3— Contact Closure, Normally Open.CCNC = 1 << 4— Contact Closure, Normally Closed.
DigitalInputScaleMultiplier.Forms
- Definition:
public enum Forms - Values:
ArbitraryLowAndHigh— Only supported form; maps digital 0/1 to configurableDefaultValue/ActiveValue.
Public Classes
DigitalInputScaleMultiplier
- Namespace:
DatabaseExport - Properties:
Form(Forms) — Format of the scale multiplier; currently onlyArbitraryLowAndHigh.DefaultValue(double) — Value displayed for digital input0(OFF).ActiveValue(double) — Value displayed for digital input1(ON); defaults to1.0.
- Constructors:
DigitalInputScaleMultiplier()— Initializes withDefaultValue = 0.0,ActiveValue = 1.0.DigitalInputScaleMultiplier(DigitalInputScaleMultiplier copy)— Copy constructor.
- Methods:
string ToSerializeDbString()— Serializes to"ArbitraryLowAndHigh{sep}DefaultValue{sep}ActiveValue"using invariant culture list separator.void FromDbSerializeString(string s)— Currently unimplemented (body commented out). Returns early ifs == null.
InitialOffset
- Namespace:
DatabaseExport - Properties:
Form(InitialOffset.Forms) — Format:None,EU, orEUAtMV.EU(double) — Offset in Engineering Units (used forEUandEUAtMVforms).MV(double) — Millivolt value at whichEUis observed (used only forEUAtMVform).
- Constructors:
InitialOffset()— Initializes withForm = None,EU = 0,MV = 0.InitialOffset(InitialOffset copy)— Copy constructor.
- Methods:
string ToDbSerializeString()— Serializes to"Form{sep}EU{sep}MV".void FromDbSerializeString(string input)— Parses serialized string; throwsInvalidDataException/FormatExceptionon malformed input.
LinearizationFormula
- Namespace:
DatabaseExport - Properties:
Style(LinearizationFormula.Styles) — Linearization method; defaults toIRTraccDiagnosticsZero.PolynomialSensitivity(double) — Sensitivity factor for polynomial scaling; defaults to1.0.LinearizationExponent(double) — Exponent used in power-law linearization; defaults to1.0.MMPerV(double) — Millimeters per volt (slope for IRTracc-style linearization).MVAt0MM(double) — Millivolts at zero millimeters (offset for diagnostics/average zeroing).Slope,Intercept(double) — Linear coefficients (used forIRTraccManual).CalibrationFactor,ZeroPositionIntercept(double) — Used forIRTraccCalFactor.UsemVOverVForPolys(bool) — Iftrue, polynomial inputs are converted to mV/V; defaults totrue.
- Constructors:
LinearizationFormula()— Initializes with default coefficients[0,0,0,0]and exponents[0,1,2,3].LinearizationFormula(LinearizationFormula copy)— Copy constructor.
- Methods:
bool IsValid()/void MarkValid(bool)— Tracks validity state.string ToSerializeString()— Serializes to"{Style}_{params}"format (e.g.,"Polynomial_c0xe0,c1xe1,...,S=...,mV=...").void FromSerializeString(string s)— Parses serialized string; throwsNotSupportedExceptionon invalid format.string ToPolynomialString()/void FromPolynomialString(...)— Handles polynomial-specific serialization.
3. Invariants
BridgeType: Values are powers of two (bit flags); valid combinations are bitwise ORs of distinct values.ExcitationVoltageOption: Values are powers of two (bit flags);GetExcitationVoltageMagnitudeFromEnumandGetExcitationVoltageEnumFromMagnitudeenforce bijection between enum and magnitude viaVoltageMagnitudeAttribute.ZeroMethodType: Enum values are fixed for backward compatibility;UsePreEventDiagnosticsZero(value1) corresponds toUsePreCalZeroinOriginalZeroMethodType.DigitalInputScaleMultiplier.Form: OnlyArbitraryLowAndHighis implemented; other forms would throwNotSupportedException.InitialOffset.Form:EU:EUis the direct offset in engineering units.EUAtMV:EUis the engineering unit value observed atMV; actual offset in EU must be computed (not stored).None:EUandMVare ignored.
LinearizationFormula.Style: Each style has a required set of fields; e.g.,Polynomialrequires_coefficientsand_exponents, whileIRTraccManualrequiresSlopeandIntercept.
4. Dependencies
Imports/Usings
System.ComponentModel— For[Description]attributes on enums.System— Core types (Exception,Attribute,AttributeUsage,List,StringBuilder, etc.).
Inferred Usage
- Consumers: Likely used by database import/export logic (e.g.,
DatabaseExportnamespace implies integration with legacy DB layers), sensor configuration UIs, and calibration tools. - Depends on:
AttributeCoder<TEnum, TAttr, TValue>(not shown in source) — Used byVoltageMagnitudeAttributeCoder.System.Globalization.CultureInfo— For culture-invariant serialization/deserialization.
- Depended on by:
- Sensor configuration classes (e.g.,
Test.Module.Channel.Sensor). - Data processing pipelines that apply linearization or zero corrections.
- Sensor configuration classes (e.g.,
5. Gotchas
DigitalInputScaleMultiplier.FromDbSerializeStringis unimplemented: The method body is commented out; calling it will silently return ifs == nullbut otherwise throwNotImplementedException(or similar) at runtime.InitialOffsetcopy constructor ignores null:InitialOffset(InitialOffset copy)returns without error ifcopy == null, leaving the new instance in default state.ZeroMethodTypevsOriginalZeroMethodType: The two enums have overlapping semantics but different names forUsePreCalZero/UsePreEventDiagnosticsZero; migration code must map them explicitly.ExcitationVoltageOptionvalues are powers of two, not sequential:Volt1 = 64,Volt2 = 2, etc. — Do not assume ordering.LinearizationFormulaserialization is style-specific: EachStylehas a unique serialization format (e.g., polynomial uses comma-separatedcxepairs withS=andmV=suffixes); deserialization fails on unrecognized styles or malformed tokens.- Polynomial serialization assumes mV/V by default:
UsemVOverVForPolys = trueconverts input to mV/V before applying coefficients; GM-style inputs may requirefalse. SensUnits.mVperVperEU(value3): Rarely used; ensure downstream logic handles this case if present in legacy data.