5.6 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T03:21:01.092126+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | d044aea8e131ba46 |
Documentation: DTS.Common.Enums.TTS.TTSEnums
1. Purpose
This module defines enumerations and a custom attribute used to manage field-level metadata for TTS (likely Test & Test System or Twin-Tee Sensor) import configurations, specifically in the context of Toyota-specific sensor channel definitions. It addresses issue #18396, where TTS import files contain a large number of columns, leading to confusion about which fields are actively used. The FieldSupportLevel enum and FieldSupportAttribute allow developers to declaratively mark enum fields as RequiredParameter, RemainedButNotUsed, or RemovedParameter, enabling runtime introspection to filter or validate fields during import processing.
2. Public Interface
FieldSupportLevel
Type: enum
Values:
RequiredParameter: Field is actively required and used.RemainedButNotUsed: Field exists in the data model/import but is not currently used.RemovedParameter: Field has been deprecated and should be ignored.
FieldSupportAttribute
Type: class (custom attribute)
Namespace: DTS.Common.Enums.TTS
Usage: [FieldSupport(FieldSupportLevel)] applied to enum fields.
Properties:
SupportLevel(FieldSupportLevel): Gets or sets the support level assigned to the attributed field.
Methods:FieldSupportAttribute(FieldSupportLevel value): Constructor.static FieldSupportLevel GetSupportLevel(Enum genericEnum): Returns theFieldSupportLevelfor a given enum value by reflecting on itsFieldSupportAttribute. If no attribute is present, defaults toFieldSupportLevel.RemovedParameter.
ToyotaFieldOrder
Type: enum
Purpose: Defines the column order (0-based index) for fields in Toyota TTS import files. Each field is annotated with a FieldSupportAttribute indicating its current support status.
Key Fields (selected):
ChannelNumber(0) →RequiredParameterSensorID(5) →RemainedButNotUsedInitialOffsetVoltageTolerance(17) →RemovedParameterKyowaSpecificField_1(32) →RemovedParameter(with FogBugz reference)
ToyotaBridgeType
Type: enum
Purpose: Represents supported bridge configurations for sensors.
Values:
FullBridge,HalfBridge,Voltage,PotentionmeterFullBridge,PotentionmeterHalfBridge,IRTRACC,LinearChestPot
Note: Values use[Description]attributes (fromSystem.ComponentModel) but noFieldSupportAttribute; support level is not explicitly declared here.
ToyotaZeroMethods
Type: enum
Purpose: Defines zeroing methods for sensor calibration.
Values:
None(0)AverageOverTime(1)UsePreEventDiagnosticsZero(2)
Note: Values use[Description]attributes (e.g.,"0","1") but noFieldSupportAttribute; support level is not explicitly declared here.
3. Invariants
FieldSupportAttribute.GetSupportLevel(Enum)behavior:- Always returns a valid
FieldSupportLevel. - If the provided enum value has no
FieldSupportAttributeapplied, returnsFieldSupportLevel.RemovedParameteras a safe default.
- Always returns a valid
ToyotaFieldOrderfields:- Each field must have exactly one
FieldSupportAttribute(enforced by design, though not compile-time validated). - The integer values are fixed and correspond to column indices in the TTS import file (0–32).
- Each field must have exactly one
ToyotaBridgeTypeandToyotaZeroMethods:- No
FieldSupportAttributeis applied to any of their fields. Their support status is not managed by this module and must be handled elsewhere (e.g., in documentation or other attributes).
- No
4. Dependencies
Dependencies of this module:
System(core runtime)System.ComponentModel(for[Description]attribute used inToyotaBridgeTypeandToyotaZeroMethods)System.Linq(used inFieldSupportAttribute.GetSupportLevelvia.Any()and.ElementAt())
Dependencies on this module:
- Not specified in source, but implied usage:
- TTS import logic (e.g., a parser or validator) likely consumes
FieldSupportAttribute.GetSupportLevel()to filter columns. - UI or configuration tools may use
ToyotaFieldOrderto map UI controls to import columns. ToyotaBridgeTypeandToyotaZeroMethodsare likely used in sensor configuration classes (not shown here).
- TTS import logic (e.g., a parser or validator) likely consumes
5. Gotchas
- Default support level:
FieldSupportAttribute.GetSupportLevel(Enum)silently defaults toRemovedParameterfor enums without the attribute—this may mask missing annotations. - Reflection overhead:
GetSupportLeveluses reflection (GetMember,GetCustomAttributes) on every call. Not suitable for high-frequency use without caching. ToyotaBridgeType/ToyotaZeroMethodslackFieldSupportAttribute: Their support status is undefined in this module. Developers must infer or document separately.- Typos in enum names:
PotentionmeterFullBridgeandPotentionmeterHalfBridgeare misspelled (should be Potentiometer). - Historical references:
KyowaSpecificField_1includes a FogBugz URL (http://fogbugz/fogbugz/default.asp?5433), which may be internal-only and inaccessible externally. - No validation of
FieldSupportAttributeplacement: The attribute is only valid on fields (AttributeTargets.Field), but misuse (e.g., on properties) will compile but fail at runtime inGetSupportLevel.