8.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:41:50.953091+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | ac685bc8f1311025 |
Documentation: DTS.Slice.Control.Event.Module.ReviewableAttribute and Related Classes
1. Purpose
This module provides a framework for defining reviewable attributes—read-only, human-readable metadata properties attached to a specific Event.Module instance—that can be used during test review or reporting workflows. Specifically, it defines an abstract base class ReviewableAttribute and several concrete subclasses (e.g., ReviewableDasSerialNumberAttribute, ReviewableSampleRateAttribute, ReviewableHardwareFrequencyAttribute, ReviewableTestDescriptionAttribute) that expose module-level data (such as DAS serial number, sample rate, hardware anti-aliasing filter rate, and test description) in a standardized, reviewable format. These attributes are intended to be consumed by downstream review UIs or export tools that need to display or validate module-level metadata.
2. Public Interface
ReviewableAttribute (Abstract Base Class)
- Namespace:
DTS.Slice.Control.Event.Module - Inherits from:
Slice.Control.ReviewableAttribute(external type, not shown in provided sources) - Purpose: Base class for all reviewable attributes attached to a
Module.
Constructors
-
protected ReviewableAttribute(string name, DetermineValueString calculateValue)- Parameters:
name:string– The display name of the attribute.calculateValue:DetermineValueString– A delegate (function pointer) that returns the attribute’s value as astring.
- Behavior: Initializes the base class with the provided name and value calculation delegate. This is the only constructor intended for use by subclasses.
- Parameters:
-
public ReviewableAttribute(Event.Module module)(non-functional)- Behavior: Throws a
NotImplementedExceptionwrapped in aModule.ReviewableAttribute.Exception. This constructor exists only to enforce that subclasses must use the parameterized constructor.
- Behavior: Throws a
Nested Exception Type
public class Exception : Exception- Purpose: Custom exception type used internally by
ReviewableAttributefor constructor failures.
- Purpose: Custom exception type used internally by
ReviewableDasSerialNumberAttribute
- Namespace:
DTS.Slice.Control.Event.Module - Inherits from:
ReviewableAttribute - Purpose: Exposes the DAS serial number of the parent
Module.
Constructor
public ReviewableDasSerialNumberAttribute(Event.Module module)- Parameters:
module:Event.Module– The module to which this attribute is attached.
- Behavior: Calls the base constructor with:
name = "DAS Serial Number"calculateValue = () => module.DasSerialNumber
- Result: The attribute’s value is the string value of
module.DasSerialNumber.
- Parameters:
ReviewableSampleRateAttribute
- Namespace:
DTS.Slice.Control.Event.Module - Inherits from:
ReviewableAttribute - Purpose: Exposes the sample rate of the module, formatted with thousand separators.
Constructor
public ReviewableSampleRateAttribute(Event.Module module)- Parameters:
module:Event.Module
- Behavior: Calls base constructor with:
name = "Sample Rate"calculateValue = () => module.SampleRateHz.ToString("N")
- Result: The attribute’s value is
module.SampleRateHz.ToString("N")(e.g.,"10,000.00").
- Parameters:
ReviewableTestDescriptionAttribute
- Namespace:
DTS.Slice.Control.Event.Module - Inherits from:
ReviewableAttribute - Purpose: Exposes the description of the parent event (not the module itself).
Constructor
public ReviewableTestDescriptionAttribute(Event.Module module)- Parameters:
module:Event.Module
- Behavior: Calls base constructor with:
name = "Test Description"calculateValue = () => module.ParentEvent.Description
- Result: The attribute’s value is
module.ParentEvent.Description.
- Parameters:
ReviewableHardwareFrequencyAttribute
- Namespace:
DTS.Slice.Control.Event.Module - Inherits from:
ReviewableAttribute - Purpose: Exposes the hardware anti-aliasing filter rate, formatted to two decimal places.
Constructor
public ReviewableHardwareFrequencyAttribute(Event.Module module)- Parameters:
module:Event.Module
- Behavior: Calls base constructor with:
name = "HW AAF"calculateValue = () => module.AaFilterRateHz.ToString("N2")
- Result: The attribute’s value is
module.AaFilterRateHz.ToString("N2")(e.g.,"5,000.00").
- Parameters:
3. Invariants
- Attribute Name Consistency: Each subclass hardcodes its
namein the base constructor call. The names used are:"DAS Serial Number""Sample Rate""Test Description""HW AAF"
- Value Calculation Must Not Be Null: The
calculateValuedelegate passed to the base constructor must return a non-nullstring. Ifmodule.DasSerialNumber,module.SampleRateHz, etc., arenullor0, theToString()call may produce"0"or empty string, but no validation is performed. - Parent Module Must Be Non-null: The
moduleparameter passed to any subclass constructor must be non-null; otherwise, dereferencingmodule.DasSerialNumber,module.SampleRateHz, etc., will throwNullReferenceException. - No Runtime Validation: There is no validation in the constructors or elsewhere to ensure the attribute name or value format conforms to any external schema—only formatting is applied via
ToString().
4. Dependencies
Dependencies of this module:
DTS.Slice.Control.Event.Module(Module.cs): Provides theModuleclass whose properties (DasSerialNumber,SampleRateHz,AaFilterRateHz,ParentEvent.Description) are accessed by the attribute subclasses.DTS.Slice.Control.ReviewableAttribute(external): Base class forReviewableAttribute. ItsDetermineValueStringdelegate type is assumed to be defined there.DTS.Utilities: Used only for logging (not directly used in these files, but imported).System: Standard .NET types (string,delegate,Exception, etc.).
Dependencies on this module:
- Unknown from source alone: No direct callers are visible in the provided files. However, the naming and structure suggest this is used by a review/reporting subsystem (e.g., UI or export tool) that instantiates these attributes and calls into the base
ReviewableAttributeAPI (e.g., to retrieveNameandValue).
5. Gotchas
- Misleading XML Comments:
ReviewableSampleRateAttributeandReviewableHardwareFrequencyAttributeare documented as “A reviewable filter frequency attribute attached to a specific channel.” — but they are attached to aModule, not aChannel. This is likely copy-paste error in comments. ReviewableTestDescriptionAttributeaccessesParentEvent.Description, notmodule.Description. This may be intentional (e.g., to avoid duplication if description is event-level), but it’s non-obvious and could cause confusion.ReviewableAttributeconstructor withmoduleparameter is non-functional: The constructor throwsNotImplementedException. Subclasses must use theprotectedconstructor withnameandcalculateValue. This is a safeguard, but could mislead developers into thinking the single-parameter constructor is usable.- No
ToString()formatting validation: Ifmodule.SampleRateHzormodule.AaFilterRateHzisNaNorInfinity,ToString("N")orToString("N2")may produce"NaN","Infinity", or"–Infinity"—which may not be desired for review displays. StartRecordTimestampNanoSecbug inFromDtsSerializationTestModule: InModule.cs, lineTriggerTimestampNanoSec = that.StartRecordTimestampNanoSec;appears to be a typo (should bethat.TriggerTimestampNanoSec). While not directly in this module, it suggests potential data inconsistency risk in related code.- No
Equals/GetHashCodeoverride inReviewableAttributesubclasses: Since these are likely used as keys or in collections, lack of value-based equality may cause subtle bugs. However, this is not evident from the source alone—no usage patterns are shown.
Note
: No usage of
ReviewableAttributebeyond construction is visible in the provided files. The actual mechanism for invokingcalculateValue(e.g., via a publicValueproperty inherited fromSlice.Control.ReviewableAttribute) is not documented here and must be assumed from the base class.