Files
DP44/enriched-qwen3-coder-next/DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts.md
2026-04-17 14:55:32 -04:00

11 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts/Test.Module.Channel.Sensor.Bridge.cs
DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts/Test.Module.Channel.Sensor.SensorUnits.cs
DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts/Test.Module.Channel.Sensor.ZeroMethod.cs
DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts/DigitalInputScaleMultiplier.cs
DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts/Test.Module.Channel.Sensor.ExcitationVoltage.cs
DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts/InitialOffset.cs
DataPRO/Modules/PreviousDBVersions/Version57/DatabaseExport/DASConcepts/LinearizationFormula.cs
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 as ZeroMethodType.AverageOverTime.
    • UsePreCalZero — Zero calculated using pre-calibration diagnostics.
    • None — Same as ZeroMethodType.None.
  • Notes: Distinct from ZeroMethodType to preserve original enum values during migration; UsePreCalZero maps to UsePreEventDiagnosticsZero semantically.

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 configurable DefaultValue/ActiveValue.

Public Classes

DigitalInputScaleMultiplier

  • Namespace: DatabaseExport
  • Properties:
    • Form (Forms) — Format of the scale multiplier; currently only ArbitraryLowAndHigh.
    • DefaultValue (double) — Value displayed for digital input 0 (OFF).
    • ActiveValue (double) — Value displayed for digital input 1 (ON); defaults to 1.0.
  • Constructors:
    • DigitalInputScaleMultiplier() — Initializes with DefaultValue = 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 if s == null.

InitialOffset

  • Namespace: DatabaseExport
  • Properties:
    • Form (InitialOffset.Forms) — Format: None, EU, or EUAtMV.
    • EU (double) — Offset in Engineering Units (used for EU and EUAtMV forms).
    • MV (double) — Millivolt value at which EU is observed (used only for EUAtMV form).
  • Constructors:
    • InitialOffset() — Initializes with Form = 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; throws InvalidDataException/FormatException on malformed input.

LinearizationFormula

  • Namespace: DatabaseExport
  • Properties:
    • Style (LinearizationFormula.Styles) — Linearization method; defaults to IRTraccDiagnosticsZero.
    • PolynomialSensitivity (double) — Sensitivity factor for polynomial scaling; defaults to 1.0.
    • LinearizationExponent (double) — Exponent used in power-law linearization; defaults to 1.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 for IRTraccManual).
    • CalibrationFactor, ZeroPositionIntercept (double) — Used for IRTraccCalFactor.
    • UsemVOverVForPolys (bool) — If true, polynomial inputs are converted to mV/V; defaults to true.
  • 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; throws NotSupportedException on 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); GetExcitationVoltageMagnitudeFromEnum and GetExcitationVoltageEnumFromMagnitude enforce bijection between enum and magnitude via VoltageMagnitudeAttribute.
  • ZeroMethodType: Enum values are fixed for backward compatibility; UsePreEventDiagnosticsZero (value 1) corresponds to UsePreCalZero in OriginalZeroMethodType.
  • DigitalInputScaleMultiplier.Form: Only ArbitraryLowAndHigh is implemented; other forms would throw NotSupportedException.
  • InitialOffset.Form:
    • EU: EU is the direct offset in engineering units.
    • EUAtMV: EU is the engineering unit value observed at MV; actual offset in EU must be computed (not stored).
    • None: EU and MV are ignored.
  • LinearizationFormula.Style: Each style has a required set of fields; e.g., Polynomial requires _coefficients and _exponents, while IRTraccManual requires Slope and Intercept.

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., DatabaseExport namespace implies integration with legacy DB layers), sensor configuration UIs, and calibration tools.
  • Depends on:
    • AttributeCoder<TEnum, TAttr, TValue> (not shown in source) — Used by VoltageMagnitudeAttributeCoder.
    • 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.

5. Gotchas

  • DigitalInputScaleMultiplier.FromDbSerializeString is unimplemented: The method body is commented out; calling it will silently return if s == null but otherwise throw NotImplementedException (or similar) at runtime.
  • InitialOffset copy constructor ignores null: InitialOffset(InitialOffset copy) returns without error if copy == null, leaving the new instance in default state.
  • ZeroMethodType vs OriginalZeroMethodType: The two enums have overlapping semantics but different names for UsePreCalZero/UsePreEventDiagnosticsZero; migration code must map them explicitly.
  • ExcitationVoltageOption values are powers of two, not sequential: Volt1 = 64, Volt2 = 2, etc. — Do not assume ordering.
  • LinearizationFormula serialization is style-specific: Each Style has a unique serialization format (e.g., polynomial uses comma-separated cxe pairs with S= and mV= suffixes); deserialization fails on unrecognized styles or malformed tokens.
  • Polynomial serialization assumes mV/V by default: UsemVOverVForPolys = true converts input to mV/V before applying coefficients; GM-style inputs may require false.
  • SensUnits.mVperVperEU (value 3): Rarely used; ensure downstream logic handles this case if present in legacy data.