Files

63 lines
2.6 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Classes/ClockSync/IClockSyncProfile.cs
- Common/DTS.Common/Classes/ClockSync/ClockSyncProfile.cs
- Common/DTS.Common/Classes/ClockSync/ClockSyncProfileConverter.cs
- Common/DTS.Common/Classes/ClockSync/ClockSyncProfileCollection.cs
generated_at: "2026-04-17T15:37:46.003596+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "3a836b4af12d4326"
---
# ClockSync Profile Module Documentation
## 1. Purpose
This module provides configuration management for clock synchronization profiles within the DTS system. It defines various time synchronization methods (PTP IEEE 1588, IRIG-B, GPS, 1PPS) that can be used to synchronize system clocks. The module implements a singleton-based collection pattern with XML persistence, enabling runtime profile configuration while providing default profiles for standard clock sync scenarios. It is designed to integrate with property grid UI components for configuration interfaces.
---
## 2. Public Interface
### IClockSyncProfile (Interface)
**File:** `IClockSyncProfile.cs`
Defines the contract for clock synchronization profiles.
| Property | Type | Description |
|----------|------|-------------|
| `ProfileId` | `int` | Unique identifier for the profile |
| `ProfileName` | `string` | Display name of the profile |
| `ProfileDesc` | `string` | Description of the profile |
| `DisplayOrder` | `int` | Sort order for UI display |
| `Visible` | `bool` | Whether the profile is visible in UI |
| `FilterRestrictions` | `DASRestriction[]` | Array of restrictions applied to the profile |
---
### ClockSyncProfile (Class)
**File:** `ClockSyncProfile.cs`
Concrete implementation of `IClockSyncProfile`.
**Constructors:**
- `ClockSyncProfile()` — Default parameterless constructor.
- `ClockSyncProfile(int profileId, string profileName, string profileDesc, int displayOrder, bool visible, DASRestriction[] filterRestrictions)` — Initializes with all property values.
- `ClockSyncProfile(ClockSyncProfileCollection.ClockSyncProfileDefaults defaults, DASRestriction[] restrictions)` — Initializes from a defaults enum value; extracts display metadata via reflection.
**Methods:**
- `ToString()` — Override returning `ProfileName`.
---
### ClockSyncProfileConverter (Class)
**File:** `ClockSyncProfileConverter.cs`
Extends `ArrayConverter` for property grid integration.
**Properties:**
- `Values``ClockSyncProfile[]` — Lazily-loaded, filtered, and sorted array of visible profiles. Filters out null and non-visible entries; sorts by `DisplayOrder`.
**Methods:**
- `CanConvertFrom(ITypeDescriptorContext context,