Files
DP44/docs/ai/DataPRO/IService/SLICE Service.md

76 lines
4.0 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- DataPRO/IService/SLICE Service/SystemAttribute.cs
- DataPRO/IService/SLICE Service/Attribute.cs
- DataPRO/IService/SLICE Service/EventAttribute.cs
generated_at: "2026-04-17T15:40:14.448178+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "59bc9d04c12dd004"
---
# Documentation: DTS.Slice.Service Attribute Classes
## 1. Purpose
This module provides an attribute hierarchy for the SLICE Service within the DataPRO system. The `Attribute` class serves as a base class for typed attributes associated with different stores (Arm, Event, System, User), with serialization support for dictionary-to-byte-array conversions. `SystemAttribute` and `EventAttribute` are derived classes intended to represent system-level and event-level attributes respectively. **Note: The majority of the implementation in `SystemAttribute` and `EventAttribute` is currently commented out, leaving these classes as essentially empty shells.**
## 2. Public Interface
### `Attribute` (Base Class)
**Constructor:**
- `protected Attribute()` — Parameterless constructor is protected, preventing direct instantiation.
**Constants:**
- `public const int MaxSingleAttributeSize = 500` — Maximum size for a single attribute.
- `public const int BulkAttributeStartNumber = 3000` — Starting number for bulk attributes.
**Protected Properties:**
- `protected AttributeInterface Store { get; set; }` — The attribute store type (Arm, Event, System, User).
- `protected AttributeTypes.AttributeDataTypes datatype` — The data type of the attribute.
- `protected ushort key` — The attribute key.
- `protected object value` — The attribute value.
**Protected Methods:**
- `protected Dictionary<byte, double> ByteArrayToDict(byte[] bytes)` — Deserializes a byte array into a `Dictionary<byte, double>`. Each pair consists of 1 byte key + 8 bytes double value (9 bytes total per pair).
- `protected byte[] DictToByteArray(Dictionary<byte, double> dict)` — Serializes a `Dictionary<byte, double>` into a byte array using the same 9-byte-per-pair format.
**Protected Enum:**
- `AttributeInterface` — Values: `Arm`, `Event`, `System`, `User`
---
### `SystemAttribute` (Derived Class)
- Inherits from `Attribute`
- **No active members.** The class body contains only commented-out code referencing a `TypeValues` enum and derived attribute classes (`SerialNumberAttribute`, `TotalEventsStoredAttribute`).
---
### `EventAttribute` (Derived Class)
- Inherits from `Attribute`
- **No active members.** The class body contains only commented-out code referencing a `TypeValues` enum and numerous derived attribute classes (`EventNumber`, `EventName`, `EventSampleRate`, `EventDescription`, `EventTotalSamples`, `EventTriggerSampleNumber`, `EventStartRecordSampleNumber`, `EventTotalChannels`, `EventFilterFrequency`, `EventStartTime`, `EventExcitation`, `PreEventScaleFactors`, `PostEventScaleFactors`, `EventConfigAttributes`).
## 3. Invariants
- The `Attribute` constructor is protected; only derived classes can instantiate.
- Dictionary serialization format: Each key-value pair occupies exactly 9 bytes (1 byte for key + 8 bytes for double).
- `ByteArrayToDict` assumes the input byte array length is evenly divisible by the pair size (9 bytes); behavior is undefined otherwise.
- The `Store` property must be one of the four `AttributeInterface` values.
## 4. Dependencies
**This module depends on:**
- `System` (mscorlib)
- `System.Collections.Generic` (mscorlib)
- `System.Text` (mscorlib)
- `DTS.Common.Utils` — Imported in `Attribute.cs` but no types from this namespace are actively used in the visible code.
- `DTS.DASLib.Command.SLICE` — Provides `ByteConvertor` class (referenced in commented code) and `AttributeTypes.AttributeDataTypes` (referenced in active code).
**What depends on this module:**
- Cannot be determined from the provided source files alone.
**Referenced but not defined in these files:**
- `AttributeTypes.AttributeDataTypes` — Used for the `datatype` field; location unclear (possibly in `DTS.DASLib.Command