6.1 KiB
6.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T02:43:11.533810+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | f097505e03f0c09d |
TTS
Documentation: DTS.Common.Enums.TTS.TTSEnums
1. Purpose
This module defines enumerations and supporting attributes used to manage field-level metadata for TTS (likely Test & Test System or Transducer Test System) import configurations, specifically addressing legacy column mapping issues (e.g., issue #18396). It provides a structured way to classify fields by their current relevance (RequiredParameter, RemainedButNotUsed, RemovedParameter) and supports parsing and validation of TTS import data through the FieldSupportAttribute. The enums ToyotaFieldOrder, ToyotaBridgeType, and ToyotaZeroMethods model domain-specific configuration options for sensor/channel setup.
2. Public Interface
FieldSupportLevel enum
- Values:
RequiredParameter: Field is actively used and required.RemainedButNotUsed: Field exists in legacy data but is ignored in processing.RemovedParameter: Field is obsolete and no longer present in current data formats.
FieldSupportAttribute class
- Inherits:
Attribute - Usage: Applied to enum fields to declare their support status.
- Properties:
SupportLevel: Gets or sets theFieldSupportLevelvalue assigned to the attributed enum member.
- Methods:
FieldSupportAttribute(FieldSupportLevel value): Constructor settingSupportLevel.static FieldSupportLevel GetSupportLevel(Enum genericEnum):- Returns the
FieldSupportLevelassociated with the given enum value via itsFieldSupportAttribute. - If no attribute is present, returns
FieldSupportLevel.RemovedParameteras default.
- Returns the
ToyotaFieldOrder enum
- Purpose: Represents ordered column indices for TTS import (e.g., CSV/Excel), with each member annotated with
FieldSupportAttribute. - Key Members:
ChannelNumber,ChannelCode,JCodeOrDescription,ChannelRange,ChannelFilterHz,SensorSerialNumber,SensorExcitationVolts,SensorPolarity: MarkedRequiredParameter.SensorID,SensorSensitivity,SensorCapacity,SensorEU,ChannelType,Description,ProportionalToExcitation,BridgeResistance,InitialOffsetVoltage,RemoveOffset,ZeroMethod: MarkedRemainedButNotUsed.InitialOffsetVoltageTolerance,CableCompensationMultiplier,InitialEUInMV,InitialEUInEU,IRTRACCExponent,PolynomialConstant,PolynomialCoefficentC/B/A/Alpha,ISOCode,ISODescription,ISOPolarity,KyowaSpecificField_1: MarkedRemovedParameter.
ToyotaBridgeType enum
- Purpose: Defines supported bridge configurations for sensors.
- Values:
FullBridge,HalfBridge,Voltage,PotentionmeterFullBridge,PotentionmeterHalfBridge,IRTRACC,LinearChestPot.
- Notes: Each value has a
[Description]attribute (fromSystem.ComponentModel), but no custom attribute or behavior is defined for it in this file.
ToyotaZeroMethods enum
- Purpose: Specifies zeroing methods for sensor calibration.
- Values:
None = 0(Description:"0"),AverageOverTime = 1(Description:"1"),UsePreEventDiagnosticsZero = 2(Description:"2").
- Notes: Only
[Description]attributes are present; no custom support-level metadata.
3. Invariants
FieldSupportAttribute.GetSupportLevelbehavior:- For any
Enumvalue, if the field lacks aFieldSupportAttribute, the method always returnsFieldSupportLevel.RemovedParameter. - The method relies on reflection (
GetMember,GetCustomAttributes) and is not optimized; performance may degrade with frequent use.
- For any
ToyotaFieldOrderordering:- Values are explicitly assigned sequential integer indices starting at
0, implying strict positional semantics (e.g., column order in an import file). - The
FieldSupportLevelannotations are static metadata and do not affect runtime behavior unless explicitly consumed elsewhere.
- Values are explicitly assigned sequential integer indices starting at
- No validation logic is defined in this module: The enums and attribute serve as declarative metadata; enforcement of support levels occurs in dependent code.
4. Dependencies
- Dependencies on other modules:
System(core runtime types),System.ComponentModel(forDescriptionAttribute),System.Linq(forAny(),ElementAt()inGetSupportLevel).
- Used by:
- Not specified in this file, but
FieldSupportAttribute.GetSupportLevelis clearly designed for use in TTS import/parsing logic (e.g., to filter columns during data loading). ToyotaFieldOrderis likely referenced by import handlers to map columns to properties.ToyotaBridgeTypeandToyotaZeroMethodsare likely used in sensor configuration classes or UI components.
- Not specified in this file, but
5. Gotchas
GetSupportLeveldefault behavior:- Missing
FieldSupportAttributeon an enum field silently defaults toRemovedParameter, which may mask omissions during refactoring.
- Missing
- Typos in
ToyotaBridgeType:PotentionmeterFullBridgeandPotentionmeterHalfBridgeare misspelled (should be Potentiometer). This is preserved in the source.
ToyotaZeroMethodsdescriptions are numeric strings:- Descriptions (
"0","1","2") match the underlying values but provide no semantic clarity. This may cause confusion if used in UI or logs.
- Descriptions (
- No runtime enforcement of
FieldSupportLevel:- The enum and attribute are metadata-only; consumers must explicitly check
GetSupportLevelto act on support status.
- The enum and attribute are metadata-only; consumers must explicitly check
- Historical context:
- The
KyowaSpecificField_1comment references an internal Fogbugz link (http://fogbugz/fogbugz/default.asp?5433), suggesting legacy vendor-specific handling that may be obsolete or poorly documented.
- The
- Reflection overhead:
GetSupportLeveluses reflection on every call; caching is not implemented. Repeated use in hot paths may impact performance.