33 lines
2.0 KiB
Markdown
33 lines
2.0 KiB
Markdown
---
|
|
source_files:
|
|
- DataPRO/IService/Classes/CAN/CANConfig.cs
|
|
- DataPRO/IService/Classes/CAN/CANModuleConfig.cs
|
|
generated_at: "2026-04-17T15:40:12.991077+00:00"
|
|
model: "zai-org/GLM-5-FP8"
|
|
schema_version: 1
|
|
sha256: "ee9e17e59c3434b9"
|
|
---
|
|
|
|
# Documentation: CAN Configuration Module
|
|
|
|
## 1. Purpose
|
|
|
|
This module provides XML-serializable configuration management for CAN (Controller Area Network) data acquisition system modules. It exists to persist and retrieve hardware module configurations—including serial numbers, test metadata, recording parameters, and channel definitions—to/from XML files stored in a `DASConfigs` subdirectory relative to the executing assembly. The module serves as the configuration persistence layer for DAS (Data Acquisition System) hardware, enabling test configurations to survive application restarts.
|
|
|
|
---
|
|
|
|
## 2. Public Interface
|
|
|
|
### CANConfig Class
|
|
|
|
**Namespace:** `DTS.DASLib.Service`
|
|
|
|
| Member | Signature | Description |
|
|
|--------|-----------|-------------|
|
|
| `Modules` | `Dictionary<string, CANModuleConfig> Modules { get; }` | Read-only accessor for the internal module dictionary, keyed by serial number string. |
|
|
| `FileName` | `string FileName { get; }` | Read-only accessor for the full path to the configuration file. |
|
|
| `CANConfig()` | Constructor | Default constructor. Initializes an empty configuration with no file association. |
|
|
| `CANConfig(string fileName, bool deleteIfPresent)` | Constructor | Loads configuration from `{ExecutingAssemblyLocation}\DASConfigs\{fileName}`. If `deleteIfPresent` is true, deletes existing file; otherwise reads and deserializes it. |
|
|
| `SetModule(CANModuleConfig module)` | `void SetModule(CANModuleConfig module)` | Adds a new module or updates an existing one (keyed by `module.SerialNumber`). |
|
|
| `GetModule(CANModuleConfig module)` | `CANModuleConfig GetModule(CANModuleConfig module)` | Returns existing module by serial number, or adds the passed module if not found and returns it. |
|
|
| `GetSchema()` | `XmlSchema GetSchema()` | Returns `null`. Required by |