5.3 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:56:30.099134+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 61f87a0978ab0f91 |
SLICE Service
Documentation: SLICE Service Attribute Infrastructure
1. Purpose
This module provides foundational infrastructure for handling SLICE device attributes within the DTS.Slice.Service namespace. It defines base abstractions (Attribute, SystemAttribute, EventAttribute) intended to encapsulate metadata and configuration data associated with system-level, event-level, and user-level attributes. Although the current source files contain only commented-out implementations (no active code), the structure indicates a planned design for typed attribute classes that map to specific data types (e.g., UInt16, Ascii, DoubleDict) and store categories (e.g., System, Event). The module supports serialization/deserialization of dictionary-based attributes (Dictionary<byte, double>) via helper methods in Attribute, and is intended to integrate with the DTS.DASLib.Command.SLICE command layer.
2. Public Interface
No public types or members are currently active. All classes and methods in the provided files are commented out. The following are intended public interfaces based on the commented code:
SystemAttribute (class)
- Inherits from:
Attribute - Purpose: Base class for system-level attributes (e.g., serial number, flash size).
- Note: Contains no active members; only commented-out nested
TypeValuesenum and subclasses (SerialNumberAttribute,TotalEventsStoredAttribute) are present.
EventAttribute (class)
- Inherits from:
Attribute - Purpose: Base class for event-level attributes (e.g., event number, sample rate, timestamps).
- Note: Contains no active members; only commented-out nested
TypeValuesenum and subclasses (e.g.,EventNumber,EventName,EventStartTime,PreEventScaleFactors) are present.
Attribute (class)
- Inherits from:
object - Protected members:
protected enum AttributeInterface { Arm, Event, System, User }protected AttributeInterface Store { get; set; }protected AttributeTypes.AttributeDataTypes datatype;protected ushort key;protected object value;
- Public constants:
public const int MaxSingleAttributeSize = 500;public const int BulkAttributeStartNumber = 3000;
- Protected methods:
protected Dictionary<byte, double> ByteArrayToDict(byte[] bytes)
Parses a byte array into a dictionary ofbyte → doublepairs. Assumes format:[byte][double][byte][double]..., where eachdoubleis 8 bytes.protected byte[] DictToByteArray(Dictionary<byte, double> dict)
Serializes aDictionary<byte, double>into a byte array in the same format as above.
3. Invariants
- No runtime invariants can be verified from the source, as all logic is commented out and no constructors, properties, or methods are active.
- Based on commented code, the intended invariants include:
MaxSingleAttributeSize = 500bytes — likely a hard limit on serialized attribute size.BulkAttributeStartNumber = 3000— likely an offset indicating where bulk attributes begin (e.g., IDs ≥ 3000 are bulk).- Dictionary serialization assumes fixed-size pairs: 1 byte key + 8 bytes double = 9 bytes per entry.
EventStartTimeserialization uses 8 bytes total: 4 bytes for seconds (since Unix epoch) + 4 bytes for milliseconds.
4. Dependencies
- Internal dependencies:
DTS.Common.Utils— likely containsByteConvertor(used in commented code for type conversion).DTS.DASLib.Command.SLICE— providesAttributeTypes.AttributeDataTypes(used in commented subclasses).
- No external dependencies beyond these namespaces.
- Depended upon by: Unknown — no usages are visible in the provided files.
5. Gotchas
- Critical: All functionality is commented out. This module is non-functional as-is and likely represents a work-in-progress or legacy design artifact.
- Ambiguity in
EventStartTimeimplementation: The setter computesUInt32 fractions = (UInt32)(leftOver.TotalSeconds - (double)seconds);, which is incorrect — it should useleftOver.TotalMilliseconds % 1000or similar to extract milliseconds. This is a likely bug if uncommented. - Inconsistent enum references: Subclasses reference
QueryArmAttribute.AttributeDataTypes(e.g.,QueryArmAttribute.AttributeDataTypes.Ascii), but the baseAttributeclass usesAttributeTypes.AttributeDataTypes. This suggests either:- A naming inconsistency (e.g.,
QueryArmAttributeshould beAttributeTypes), or - A missing import/namespace alias.
- A naming inconsistency (e.g.,
- Missing
ByteConvertorusage context: The helper methodsByteArrayToDict/DictToByteArrayassumeByteConvertorexists and supportsConvert(byte[], int, out T)andToByteArray(T), but its implementation is not provided. - No validation on dictionary keys:
ByteArrayToDictdoes not check for duplicate keys — adding an existing key would throwArgumentException.
Note
: Since no active code exists, these "gotchas" pertain to the commented design, not runtime behavior.