4.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T11:39:55.789807+00:00 | zai-org/GLM-5-FP8 | 1 | 00bbefe8072cdb62 |
Documentation: Test.Module.Channel.Sensor
1. Purpose
This module defines sensor-related concepts within the DAS (Data Acquisition System) domain model. Specifically, it provides an enumeration for sensitivity unit types (SensUnits) and utility methods for converting between excitation voltage enum values and their numeric magnitudes. The module is part of a larger nested class hierarchy representing test configuration concepts for channel/sensor setup.
2. Public Interface
Enum: Test.Module.Channel.Sensor.SensUnits
Defines all available sensitivity unit types for sensor configuration.
| Member | Value | Description Attribute | Purpose |
|---|---|---|---|
NONE |
0 | "NONE" | No Sensitivity Units (Polynomial Sensor) |
mV |
1 | "mV" | Sensitivity expressed in mV with output at Capacity EU |
mVperV |
2 | "mV/V" | Excitation proportional sensitivity expressed in mV/V with output at Capacity EU |
mVperVperEU |
3 | "mV/V/EU" | Excitation proportional sensitivity expressed in mV/V/EU |
mVperEU |
4 | "mV/EU" | Sensitivity expressed in mV/EU |
Method: GetExcitationVoltageMagnitudeFromEnum
Signature:
public static double GetExcitationVoltageMagnitudeFromEnum(
ExcitationVoltageOptions.ExcitationVoltageOption target)
Behavior: Converts an ExcitationVoltageOptions.ExcitationVoltageOption enum value to its associated numeric voltage magnitude (in volts) using a VoltageMagnitudeAttributeCoder. Throws ArgumentException if the conversion fails.
Method: GetExcitationVoltageEnumFromMagnitude
Signature:
public static ExcitationVoltageOptions.ExcitationVoltageOption GetExcitationVoltageEnumFromMagnitude(
double magnitude)
Behavior: Converts a numeric voltage magnitude to the corresponding ExcitationVoltageOptions.ExcitationVoltageOption enum value. On failure, logs the exception via APILogger.Log and returns ExcitationVoltageOptions.ExcitationVoltageOption.Undefined rather than throwing.
3. Invariants
- The
SensUnitsenum values are explicitly assigned sequential integers starting at 0. - The
Moduleclass is declaredsealed, preventing further inheritance. - The
ExcitationVoltageOptions.ExcitationVoltageOptiontype (defined externally inDTS.Common.Enums) is expected to have an associatedVoltageMagnitudeAttributefor each enum member that these methods can decode/encode. - The two conversion methods have asymmetric error handling:
GetExcitationVoltageMagnitudeFromEnumthrows on failure, whileGetExcitationVoltageEnumFromMagnitudereturnsUndefinedand logs.
4. Dependencies
This module depends on:
System- Core .NET typesSystem.ComponentModel-DescriptionAttributeused on enum membersDTS.Common.Enums- ProvidesExcitationVoltageOptions.ExcitationVoltageOptionandExcitationVoltageOptions.VoltageMagnitudeAttributeCoderDTS.Common.Utilities- Likely provides the baseAttributeCoder<TEnum, TAttribute, TValue>pattern (inferred from usage)DTS.Common.Utilities.Logging- ProvidesAPILoggerfor error logging
What depends on this module:
- Cannot be determined from source alone. The partial class structure suggests other files extend
Test,Test.Module,Test.Module.Channel, andTest.Module.Channel.Sensor.
5. Gotchas
-
Commented-out code suggests refactoring: The
ExcitationVoltage.csfile contains a fully commented-outExcitationVoltageOptionenum and related classes (VoltageMagnitudeAttribute,VoltageMagnitudeAttributeCoder). The active methods referenceExcitationVoltageOptions.ExcitationVoltageOptionfromDTS.Common.Enums, indicating this functionality was moved to a different namespace. The commented code may cause confusion about where the enum is actually defined. -
Asymmetric error handling: The two conversion methods handle errors differently.
GetExcitationVoltageMagnitudeFromEnumthrows anArgumentException(wrapping the inner exception), whileGetExcitationVoltageEnumFromMagnitudesilently logs and returnsUndefined. Callers must handle both throwing and non-throwing failure modes. -
Partial class structure: The
Test,Module,Channel, andSensorclasses are all partial, spread across multiple files (indicated by comments like// *** see Test.cs ***). The full API surface requires examining all partial file definitions.