This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
---
source_files:
- Common/DTS.CommonCore/Attributes/VersionAttribute.cs
generated_at: "2026-04-16T12:02:23.720037+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "97df6c62ae44caee"
---
# Documentation: VersionAttribute
## 1. Purpose
`VersionAttribute` is a custom attribute class that allows developers to annotate code elements (classes, methods, properties, etc.) with an integer version number. It provides a simple mechanism for versioning components within the DTS system, which may be used for tracking API evolution, serialization compatibility, or feature versioning.
## 2. Public Interface
### `VersionAttribute` Class
**Namespace:** `DTS.Common.Attributes`
**Base Class:** `System.Attribute`
#### Constructor
```csharp
public VersionAttribute(int version)
```
Creates a new instance of the attribute with the specified version number. The `version` parameter is stored in the read-only `Version` property.
#### Properties
```csharp
public int Version { get; private set; }
```
Returns the version number specified when the attribute was instantiated. This property is read-only externally; it can only be set via the constructor.
## 3. Invariants
- The `Version` property is immutable after construction (private setter).
- The `Version` value is always an `int`; no null state is possible since `int` is a value type.
- No constraints are enforced on the range of `version` (negative values, zero, and positive values are all accepted).
## 4. Dependencies
### This module depends on:
- `System` — Provides the `Attribute` base class.
- `System.Linq` — Imported but **not used** in the current implementation.
### What depends on this module:
- Cannot be determined from the source file alone. This attribute is defined in `DTS.CommonCore`, suggesting it is part of a core utilities library that other modules likely reference.
## 5. Gotchas
- **Unused import:** The `using System.Linq;` directive is present but not utilized in the code. This may be leftover from refactoring or template code.
- **No `AttributeUsage` declaration:** The attribute lacks an `[AttributeUsage]` specification, meaning it can be applied to any target (classes, methods, assemblies, etc.) with default behavior (allowing multiple instances = false, inherited = true). If specific usage constraints are intended, they are not enforced at the attribute definition level.
- **No version validation:** The constructor accepts any integer, including negative values. If semantic versioning or positive-only constraints are expected by consumers, they are not enforced here.

View File

@@ -0,0 +1,172 @@
---
source_files:
- Common/DTS.CommonCore/Behaviors/StringMetaDataAttr.cs
- Common/DTS.CommonCore/Behaviors/TrimTextBoxBehavior.cs
- Common/DTS.CommonCore/Behaviors/InteractivityTemplate.cs
- Common/DTS.CommonCore/Behaviors/TextBoxPasteBehavior.cs
- Common/DTS.CommonCore/Behaviors/MultiSelectionBehavior.cs
generated_at: "2026-04-16T12:04:47.328170+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c2b7aea8fc779731"
---
# DTS.Common.Behaviors Namespace Documentation
## 1. Purpose
This module provides a collection of WPF behaviors, attached properties, and utility attributes for the DTS CommonCore library. It enables declarative UI interactions through `System.Windows.Interactivity`, including text trimming on focus loss, multi-selection synchronization for `ListBox` controls, paste command handling for `TextBox` derivatives, and a mechanism for applying behaviors/triggers via data templates. It also provides a reflection-based attribute system for attaching string metadata to enum values and objects.
---
## 2. Public Interface
### StringMetaDataAttr
**Kind:** Class (inherits `Attribute`)
**Purpose:** Stores string metadata on objects or enum members.
| Member | Signature | Description |
|--------|-----------|-------------|
| `MetaData` | `public string MetaData { get; }` | Read-only property containing the stored metadata string. |
| `GetStringMetaData` | `public static string GetStringMetaData(object o)` | Retrieves the `MetaData` value from a `StringMetaDataAttr` applied to the object's member (typically enum values). Returns `null` if no attribute is found or if the object is null. |
**Constructor:** `internal StringMetaDataAttr(string attr)` — Internal constructor; attributes must be applied declaratively.
---
### TrimTextBoxBehavior
**Kind:** Class (inherits `Behavior<TextBox>`)
**Purpose:** Automatically trims whitespace from a `TextBox` when it loses focus.
| Member | Signature | Description |
|--------|-----------|-------------|
| `OnAttached` | `protected override void OnAttached()` | Subscribes to `AssociatedObject.LostFocus`. |
| `OnDetaching` | `protected override void OnDetaching()` | Unsubscribes from `AssociatedObject.LostFocus`. |
**Behavior:** On `LostFocus`, trims `AssociatedObject.Text`. If the trimmed value differs, updates the text and calls `UpdateSource()` on the `TextBox.TextProperty` binding expression.
---
### InteractivityTemplate
**Kind:** Class (inherits `DataTemplate`)
**Purpose:** Marker class for defining interactivity templates in XAML resources. Contains no additional members.
---
### InteractivityItems
**Kind:** Class (inherits `FrameworkElement`)
**Purpose:** Container for behaviors and triggers that can be loaded from an `InteractivityTemplate`.
| Member | Signature | Description |
|--------|-----------|-------------|
| `Triggers` | `public new List<TriggerBase> Triggers { get; }` | Lazy-initialized list of triggers. Hides inherited `Triggers` property. |
| `Behaviors` | `public List<Behavior> Behaviors { get; }` | Lazy-initialized list of behaviors. |
| `TemplateProperty` | `public static readonly DependencyProperty TemplateProperty` | Attached property for assigning an `InteractivityTemplate` to a `DependencyObject`. |
| `GetTemplate` | `public static InteractivityTemplate GetTemplate(DependencyObject obj)` | Gets the attached `Template` property value. |
| `SetTemplate` | `public static void SetTemplate(DependencyObject obj, InteractivityTemplate value)` | Sets the attached `Template` property value. |
**Behavior:** When `TemplateProperty` changes, loads `InteractivityTemplate` content, casts to `InteractivityItems`, and adds all behaviors/triggers to the target via `Interaction.GetBehaviors()` and `Interaction.GetTriggers()`.
---
### TextBoxPasteBehavior
**Kind:** Static class (attached property host)
**Purpose:** Enables handling paste operations via an `ICommand` binding on `TextBox` and custom controls.
| Member | Signature | Description |
|--------|-----------|-------------|
| `PasteCommandProperty` | `public static readonly DependencyProperty PasteCommandProperty` | Attached property of type `ICommand`. |
| `GetPasteCommand` | `public static ICommand GetPasteCommand(DependencyObject target)` | Gets the attached `PasteCommand`. |
| `SetPasteCommand` | `public static void SetPasteCommand(DependencyObject target, ICommand value)` | Sets the attached `PasteCommand`. |
**Behavior:** When `PasteCommand` is set, registers a handler for `CommandManager.ExecutedEvent` on the target `TextBox`. When a paste command (`ApplicationCommands.Paste` or a `RoutedUICommand` with `Name == "Paste"`) is executed, retrieves clipboard text, splits by newlines, and executes the bound command with the `TextBox` as parameter. Errors are published via `PageErrorEvent`.
**Special handling:** Supports `ChannelCodeBuilder` and `ChannelNameBuilder` controls by extracting their `MainEditBox` property.
---
### MultiSelectionBehavior
**Kind:** Class (inherits `Behavior<ListBox>`)
**Purpose:** Synchronizes a `ListBox`'s `SelectedItems` collection with a bound `IList` source.
| Member | Signature | Description |
|--------|-----------|-------------|
| `SelectedItems` | `public IList SelectedItems { get; set; }` | Dependency property for binding the source collection. |
| `SelectedItemsProperty` | `public static readonly DependencyProperty SelectedItemsProperty` | Backing field for `SelectedItems`. |
| `OnAttached` | `protected override void OnAttached()` | Initializes `AssociatedObject.SelectedItems` from bound collection. |
**Behavior:**
- Two-way sync between `ListBox.SelectedItems` and bound `IList`.
- Listens to `INotifyCollectionChanged.CollectionChanged` on source.
- Listens to `ListBox.SelectionChanged` for UI-driven changes.
- Uses `SelectedItemsStatus.SetUpdating()` to suppress notifications during bulk operations.
- Type-checks added items against `selectedItems.GetType().GenericTypeArguments[0]`.
---
## 3. Invariants
- **StringMetaDataAttr:** The `GetStringMetaData` method always returns `null` for null objects or when no attribute is found. It assumes `o.ToString()` returns a valid member name.
- **TrimTextBoxBehavior:** Only updates the binding source when trimming actually changes the text (`trim != AssociatedObject.Text`).
- **InteractivityItems:** The `TemplateProperty` change handler does nothing if `e.NewValue` is `null`.
- **TextBoxPasteBehavior:**
- The paste handler only executes if `command.CanExecute(null)` returns `true`.
- The command receives the `TextBox` as its parameter, not the clipboard text.
- Clipboard text is split by `Environment.NewLine` but the resulting `lines` array is not passed to the command.
- **MultiSelectionBehavior:**
- Uses `_isUpdatingTarget` and `_isUpdatingSource` flags to prevent recursive update loops.
- Items are only added to `SelectedItems` if they pass `type.IsAssignableFrom(item.GetType())`.
- `SelectedItemsStatus.SetUpdating(SelectedItems, false)` is called before adding the last item in bulk additions.
---
## 4. Dependencies
### This module depends on:
- `System.Windows.Interactivity` — Base classes for behaviors (`Behavior<T>`, `TriggerBase`, `Interaction`)
- `System.Windows` — WPF core types (`DependencyObject`, `DependencyProperty`, `FrameworkElement`, `RoutedEventArgs`)
- `System.Windows.Controls``TextBox`, `ListBox`, `SelectionChangedEventArgs`
- `System.Windows.Input``ICommand`, `CommandManager`, `ApplicationCommands`, `ExecutedRoutedEventArgs`
- `DTS.Common.Controls``ChannelCodeBuilder`, `ChannelNameBuilder` (referenced in `TextBoxPasteBehavior`)
- `DTS.Common.Events``PageErrorEvent`, `PageErrorArg` (used for error publishing)
- `DTS.Common.Enums` — Referenced in `MultiSelectionBehavior` (likely contains `SelectedItemsStatus`)
- `DTS.Common.Utilities.Logging``APILogger.Log()` for exception logging
- `Microsoft.Practices.Prism.Events``IEventAggregator`
- `Microsoft.Practices.ServiceLocation``ServiceLocator`
### What depends on this module:
- Cannot be determined from source alone. Consumers would be XAML views or other modules applying these behaviors.
---
## 5. Gotchas
1. **StringMetaDataAttr constructor is internal:** You cannot instantiate this attribute programmatically; it must be applied declaratively at compile time.
2. **TextBoxPasteBehavior clipboard handling:** The clipboard text is retrieved and split into lines, but the `lines` array is never used—the command is executed with the `TextBox` as the parameter. The split operation appears to be dead code.
3. **TextBoxPasteBehavior null check bug:** In `CommandExecuted`, the line `if (null == sender && sender is ChannelCodeBuilder ccb)` is logically incorrect—it checks if `sender` is null AND is a specific type, which can never be true. This appears to be a copy-paste error; the intended check was likely `if (sender is ChannelCodeBuilder ccb)`.
4. **TextBoxPasteBehavior dependency on ServiceLocator:** Uses service locator pattern to resolve `IEventAggregator`, which is an anti-pattern and makes testing harder.
5. **MultiSelectionBehavior type checking:** Assumes `SelectedItems` is a generic `IList<T>` when accessing `GenericTypeArguments[0]`. Will throw `IndexOutOfRangeException` if bound to a non-generic `IList`.
6. **InteractivityItems.Triggers hides inherited member:** The `new` keyword on `Triggers` hides `FrameworkElement.Triggers`. This could cause confusion if the property is accessed via a `FrameworkElement` reference.
7. **MultiSelectionBehavior Reset handling:** When `NotifyCollectionChangedAction.Reset` is received, clears `AssociatedObject.SelectedItems` but does not re-populate from the source collection.

View File

@@ -0,0 +1,109 @@
---
source_files:
- Common/DTS.CommonCore/BusyIndicatorManager/xBusyIndicator.xaml.cs
- Common/DTS.CommonCore/BusyIndicatorManager/BusyIndicatorManager.cs
generated_at: "2026-04-16T11:56:30.835743+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "85046dce961f12c2"
---
# Documentation: DTS.Common.BusyIndicatorManager
## 1. Purpose
This module provides a centralized mechanism for managing busy indicator UI state across an application. It implements a singleton-based manager (`BusyIndicatorManager`) that tracks multiple concurrent busy operations by unique ID, allowing different parts of the application to show/hide busy indicators without conflicting with each other. The `xBusyIndicator` class serves as a WPF user control for displaying the busy indicator UI.
---
## 2. Public Interface
### `BusyIndicatorManager` (class)
**Inherits from:** `NotificationObject` (Microsoft.Practices.Prism.ViewModel)
#### Singleton Access
```csharp
public static BusyIndicatorManager Instance { get; }
```
Returns the singleton instance of `BusyIndicatorManager`. Thread-safe via lock synchronization on `SyncRoot`.
#### Properties
```csharp
public bool IsBusy { get; }
```
Indicates whether any busy operation is currently active. Read-only from external callers; set internally via `ShowBusy`/`CloseBusy`. Raises `PropertyChanged` notification.
```csharp
public string Message { get; }
```
The current message to display in the busy indicator. Read-only from external callers. Raises `PropertyChanged` notification.
#### Methods
```csharp
public void ShowBusy(int id, string busyMessage)
```
Registers a busy operation with the given `id` and displays `busyMessage`. If the `id` already exists, updates the message. Sets `IsBusy` to `true` and updates `Message`.
```csharp
public void CloseBusy(int id)
```
Removes the busy operation identified by `id`. If no busy operations remain, sets `IsBusy` to `false` and clears `Message`. If other operations remain, keeps `IsBusy` as `true` and sets `Message` to the last entry's value in `busyParameters`.
---
### `xBusyIndicator` (class)
**Inherits from:** Not explicitly shown; appears to be a WPF partial class (likely `UserControl`).
```csharp
public xBusyIndicator()
```
Default constructor that calls `InitializeComponent()`.
```csharp
public void Connect(int connectionId, object target)
```
Method present in the class but **implementation is empty**. Purpose unclear from source alone.
---
## 3. Invariants
- **Singleton guarantee:** Only one instance of `BusyIndicatorManager` can exist per process. Access is always through `BusyIndicatorManager.Instance`.
- **Thread-safe initialization:** The singleton is lazily initialized with lock-based synchronization.
- **ID uniqueness:** Each busy operation is identified by a unique `int` ID. Callers are responsible for ensuring IDs do not collide.
- **State consistency:** `IsBusy` is `true` if and only if `busyParameters.Count > 0`.
- **Message consistency:** When `IsBusy` is `false`, `Message` is an empty string. When `IsBusy` is `true`, `Message` reflects the most recently added/updated busy message.
- **Property change notifications:** `IsBusy` and `Message` raise `PropertyChanged` via `RaisePropertyChanged()` when modified.
---
## 4. Dependencies
### This module depends on:
- `Microsoft.Practices.Prism.ViewModel` — specifically `NotificationObject` for `INotifyPropertyChanged` implementation
- `System.Collections.Generic``Dictionary<TKey, TValue>`
- `System.Linq``Enumerable.Last()` extension method
- `System.Windows.Controls` — referenced in `xBusyIndicator`
- `Xceed.Wpf.Toolkit` — referenced in `xBusyIndicator` (likely provides the actual busy indicator control)
### What depends on this module:
- **Cannot be determined from source alone.** Consumers would bind to `BusyIndicatorManager.Instance.IsBusy` and `Message` properties, or instantiate `xBusyIndicator` in XAML views.
---
## 5. Gotchas
1. **`xBusyIndicator.Connect` is empty:** The method signature suggests it may be generated code (common in WPF for `IComponentConnector`), but the empty implementation has no documented purpose.
2. **Dictionary ordering assumption:** `CloseBusy` uses `busyParameters.Last().Value` to determine the next message to display. While .NET Framework 4.7+ and .NET Core preserve insertion order in `Dictionary`, this is not guaranteed by the interface contract. The "last" message may not be the most recently added in all runtime environments.
3. **No validation of `busyMessage`:** `ShowBusy` accepts any string, including `null` or empty strings, without validation.
4. **No exception handling for missing IDs in `CloseBusy`:** The method silently ignores calls to close non-existent IDs (it checks `ContainsKey` before removing).
5. **Message always updated on `ShowBusy`:** Even if an ID already exists with the same message, `Message` is reassigned and property change notification fires, which may trigger unnecessary UI updates.

View File

@@ -0,0 +1,306 @@
---
source_files:
- Common/DTS.CommonCore/Classes/StatusAndProgressBarEventArgs.cs
- Common/DTS.CommonCore/Classes/Singleton.cs
- Common/DTS.CommonCore/Classes/ImportData.cs
- Common/DTS.CommonCore/Classes/RegionNames.cs
- Common/DTS.CommonCore/Classes/ServiceCall.cs
- Common/DTS.CommonCore/Classes/TagAwareBase.cs
- Common/DTS.CommonCore/Classes/Utility.cs
- Common/DTS.CommonCore/Classes/Tags.cs
generated_at: "2026-04-16T11:58:55.221476+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ab2980ca84007830"
---
# DTS.CommonCore/Classes Module Documentation
---
## 1. Purpose
This module provides foundational infrastructure classes for the DTS application, including a thread-safe singleton pattern implementation, a sequential service call queue, UI region name constants, tag management with database persistence, data transfer objects for import operations, and utility helpers for database reader type conversion. These classes serve as core building blocks used throughout the system for common patterns like status reporting, service coordination, and data import workflows.
---
## 2. Public Interface
### StatusAndProgressBarEventArgs
**Namespace:** `DTS.Common.Classes`
A POCO event argument class for status and progress bar updates.
| Property | Type | Description |
|----------|------|-------------|
| `StatusColor` | `Color` | The color to display for status text |
| `StatusText` | `string` | The status message text |
| `ProgressValue` | `double` | The progress bar value |
| `ProgressBarVisibility` | `Visibility` | Controls progress bar visibility |
| `Requester` | `IBaseViewModel` | Reference to the requesting view model |
| `ErrorText` | `string` | Error message text |
---
### Singleton\<T>
**Namespace:** `DTS.Common.Classes`
Generic singleton base class. Derive via `class MyClass : Singleton<MyClass>`.
| Member | Signature | Description |
|--------|-----------|-------------|
| `Instance` | `public static T Instance { get; }` | Returns the singleton instance, lazily created |
| Constructor | `protected Singleton()` | Protected constructor that throws `InvalidOperationException` if instance already exists |
---
### ServiceCall
**Namespace:** `DTS.Common.Classes`
Represents a unit of work for the service queue.
| Member | Signature | Description |
|--------|-----------|-------------|
| `Started` | `public bool Started { get; set; }` | Indicates if the call has started execution |
| `WorkAction` | `public Action WorkAction { get; set; }` | The action to execute |
| `Name` | `public string Name { get; set; }` | Identifier for the service call |
| `MarkDone` | `public void MarkDone()` | Marks the call as finished, triggering next item in queue |
| Constructor | `public ServiceCall(string name)` | Creates a named service call |
---
### ServiceQueue
**Namespace:** `DTS.Common.Classes`
Manages sequential execution of service calls.
| Member | Signature | Description |
|--------|-----------|-------------|
| `Enqueue` | `public static void Enqueue(ServiceCall call)` | Adds a service call to the queue; starts immediately if queue is empty |
| `MarkFinished` | `public static void MarkFinished(ServiceCall call)` | Removes completed call and starts next if available |
---
### RegionNames
**Namespace:** `DTS.Common.Classes`
Static class containing region name constants for UI composition (likely Prism regions).
**Constants include:**
- `FrontRegion`, `MainRegion`
- `ViewerEuRegion`, `ViewerMvRegion`, `ViewerEdcRegion`, `ViewerTestsRegion`
- `ViewerGraphRegion`, `ViewerGraphsRegion`, `ViewerGraphMainRegion`, `ViewerGraphListRegion`, `ViewerGraphChannelRegion`
- `ViewerTestModificationRegion`, `ViewerLegendRegion`, `ViewerSearchRegion`, `ViewerSettingsRegion`
- `ViewerDiagRegion`, `ViewerDisplayRegion`, `ViewerChartOptionsRegion`, `ViewerStatsRegion`, `ViewerCursorRegion`
- `ViewerFiterRegion` (note: typo preserved from source)
- `MenuRegion`, `NavigationRegion`, `BottomRegion`, `RightRegion`, `TopRegion`
- `VerticalTabRegion`, `HorizontalTabRegion`, `RibbonRegion`
- `PropertyDisplayRegion`, `PropertyModifyRegion`, `PropertyAddRegion`
- `PSDDataSelectRegion`, `PSDGraphRegion`
- `ReportChartOptionsRegion`, `ReportResultsRegion`
---
### ImportPageType
**Namespace:** `DTS.Common.Classes`
Enum defining import types.
| Value | Description |
|-------|-------------|
| `ImportSensor` | Sensor import operation |
| `ImportTestSetup` | Test setup import operation |
---
### SensorImportData
**Namespace:** `DTS.Common.Classes`
DTO for sensor import operations.
| Property | Type |
|----------|------|
| `GroupNameSensorListLookup` | `Dictionary<string, List<string>>` |
| `SensorGroupNameLookup` | `Dictionary<string, string>` |
| `SensorGroupTypeLookup` | `Dictionary<string, string>` |
| `GroupNameTestObjectLookup` | `Dictionary<string, string>` |
| `Errors` | `List<string>` (initialized to empty list) |
| `SensorISOCode` | `Dictionary<string, string>` |
| `SensorISOChannelName` | `Dictionary<string, string>` |
| `SensorUserCode` | `Dictionary<string, string>` |
| `SensorUserChannelName` | `Dictionary<string, string>` |
| `SensorDASSerialNumber` | `Dictionary<string, string>` |
| `SensorChannelIndex` | `Dictionary<string, int>` |
---
### TestSetupImportData
**Namespace:** `DTS.Common.Classes`
DTO for test setup import operations.
| Property | Type | Default |
|----------|------|---------|
| `Name` | `string` | — |
| `Description` | `string` | — |
| `SamplesPerSecond` | `double` | — |
| `PosttriggerSeconds` | `double` | — |
| `PretriggerSeconds` | `double` | — |
| `RecordingMode` | `RecordingModes` | — |
| `CalibrationBehavior` | `CalibrationBehaviors` | — |
| `Version` | `int` | — |
| `TestChannelOrders` | `List<string>` | — |
| `Tags` | `List<string>` | — |
| `ClockMasterInput` | `InputClockSource` | `InputClockSource.None` |
| `ClockMasterOutput` | `OutputClockSource` | `OutputClockSource.None` |
| `ManageClocksOutsideOfDataPROMaster` | `bool` | `false` |
| `ManageClocksOutsideOfDataPROSlave` | `bool` | `false` |
| `ClockSlaveInput` | `OutputClockSource` | `OutputClockSource.None` |
| `ClockSlaveOutput` | `OutputClockSource` | `OutputClockSource.None` |
| `SampleRateForDAS` | `Dictionary<string, int>` | empty dictionary (readonly) |
| `DomainIdForDAS` | `Dictionary<string, uint>` | empty dictionary (readonly) |
| `IsClockMaster` | `Dictionary<string, bool>` | empty dictionary (readonly) |
---
### TagAwareBase
**Namespace:** `DTS.Common.Classes`
Abstract base class for objects that support tagging.
| Member | Signature | Description |
|--------|-----------|-------------|
| `TagType` | `public abstract TagTypes TagType { get; }` | Abstract property defining tag type |
| `TagsBlobBytes` | `public byte[] TagsBlobBytes { get; set; }` | Serializes/deserializes TagIDs as byte array |
| `TagIDs` | `public int[] TagIDs { get; set; }` | Array of tag IDs; defaults to empty array |
| `SetTagsFromCommaSeparatedString` | `public void SetTagsFromCommaSeparatedString(string tagText, Tags.GetSqlCommandDelegate getSqlCommand)` | Parses comma-separated tags and sets them |
| `SetTags` | `public virtual void SetTags(string[] tagsText, Tags.GetSqlCommandDelegate getSqlCommand)` | Sets tags from string array |
| `GetTagsAsCommaSeparatedString` | `public string GetTagsAsCommaSeparatedString(Tags.GetSqlCommandDelegate getSqlCommand)` | Returns tags as comma-separated string |
| `GetTagsArray` | `public virtual string[] GetTagsArray(Tags.GetSqlCommandDelegate getSqlCommand)` | Returns tag text array from IDs |
| `GetTagIDs` | `public virtual int[] GetTagIDs()` | Returns TagIDs array |
| `RemoveTags` | `public virtual void RemoveTags(string[] tagsText)` | Removes tags (implementation incomplete in source) |
| `TagCompatible(string, delegate)` | `public bool TagCompatible(string tags, Tags.GetSqlCommandDelegate getSqlCommand)` | Checks if any tag in comma-separated string matches |
| `TagCompatible(int[])` | `public virtual bool TagCompatible(int[] tags)` | Checks for intersecting tag IDs |
| `HasIntersectingTag` | `public virtual bool HasIntersectingTag(int[] tags)` | Returns true if any tag ID intersects |
| `InsertTagsFromCommaSeparatedString` | `public void InsertTagsFromCommaSeparatedString(int id, TagTypes tagType, string tags, Tags.GetSqlCommandDelegate getSqlCommand)` | Sets and commits tags in one operation |
| `Commit` | `public void Commit(int id, TagTypes tagType, Tags.GetSqlCommandDelegate getSqlCommand)` | Persists tag assignments to database |
| `GetTagIdList` | `public List<int> GetTagIdList(int objectId, TagTypes tagType, Tags.GetSqlCommandDelegate getSqlCommand)` | Retrieves tag IDs for an object from database |
**Nested Enum: TagTypes**
| Value | Description |
|-------|-------------|
| `User` | User tag type |
| `Group` | Group tag type |
| `Template` | Template tag type |
| `TestSetup` | Test setup tag type |
| `Sensors` | Sensor tag type |
| `SensorModels` | Sensor model tag type |
---
### Tags
**Namespace:** `DTS.Common.Classes`
Manages tag persistence and caching.
| Member | Signature | Description |
|--------|-----------|-------------|
| `GetSqlCommandDelegate` | `public delegate SqlCommand GetSqlCommandDelegate(bool bNewConnection)` | Delegate for database command creation |
| `GetTagsInstance` | `public static Tags GetTagsInstance(GetSqlCommandDelegate getSqlCommand)` | Returns singleton instance |
| `AddTag` | `public static bool AddTag(string tagText, GetSqlCommandDelegate getSqlCommand)` | Adds tag if not present; returns true if added |
| `MigrateTag` | `public static bool MigrateTag(string tagText, GetSqlCommandDelegate getSqlCommand)` | Adds/updates tag during migration |
| `AddRange` | `public static bool[] AddRange(string[] tagText, GetSqlCommandDelegate getSqlCommand)` | Adds multiple tags; trims start whitespace |
| `GetIDFromTagText` | `public static int GetIDFromTagText(string tagText, GetSqlCommandDelegate getSqlCommand)` | Gets ID from database for tag text |
| `GetIDsFromTagText` | `public static int[] GetIDsFromTagText(string[] tagText, GetSqlCommandDelegate getSqlCommand)` | Converts tag text array to ID array |
| `GetTagTextFromID` | `public static string GetTagTextFromID(int tagID, GetSqlCommandDelegate getSqlCommand)` | Gets tag text from cached lookup |
| `GetTagTextFromIDs` | `public static string[] GetTagTextFromIDs(int[] tagId, GetSqlCommandDelegate getSqlCommand)` | Converts ID array to tag text array |
| `ContainsTag` | `public bool ContainsTag(string text)` | Checks if tag exists in cache |
| `UpdateList` | `public void UpdateList(GetSqlCommandDelegate getSqlCommand)` | Refreshes tag cache from database |
**Nested Class: Tags.Tag**
| Member | Signature | Description |
|--------|-----------|-------------|
| `INVALID_ID` | `public const int INVALID_ID = -1` | Constant for invalid tag ID |
| `ID` | `public int ID { get; set; }` | Tag identifier |
| `Text` | `public string Text { get; set; }` | Tag text |
| `IsObsolete` | `public bool IsObsolete { get; set; }` | Obsolescence flag |
| Constructor | `public Tag(string tagText, int tagId)` | Creates tag with text and ID |
| Constructor | `public Tag(Tag copy)` | Copy constructor |
| Constructor | `public Tag(IDataRecord reader)` | Creates tag from data reader |
| Constructor | `public Tag(DataRow dr)` | Creates tag from data row |
| `Clone` | `public object Clone()` | ICloneable implementation |
---
### Utility
**Namespace:** `DTS.Common.Classes`
Static utility class with helper methods.
| Method | Signature | Description |
|--------|-----------|-------------|
| `GetBytesFromStringArray` | `public static byte[] GetBytesFromStringArray(string[] array, string separator)` | Joins array with separator and converts to UTF8 bytes |
| `GetAllErrorMessages` | `public static string GetAllErrorMessages(Exception ex)` | Returns all exception messages including inner exceptions |
| `PingNetwork` | `public static bool PingNetwork(string hostNameOrAddress)` | Pings host with 4-second timeout; returns success status |
| `GetUShort` | `public static ushort GetUShort(IDataReader reader, string column, ushort defaultValue = 0)` | Safely reads ushort from reader |
| `GetUInt` | `public static uint GetUInt(IDataReader reader, string column, uint defaultValue = 0)` | Safely reads uint from reader |
| `GetString` | `public static string GetString(IDataReader reader, string column, string defaultValue = "")` | Safely reads string from reader |
| `GetStringArray` | `public static string[] GetStringArray(IDataReader reader, string column, string[] defaultValue, string separator)` | Reads byte array from reader, decodes to UTF8, splits by separator |
| `GetInt` | `public static int GetInt(IDataReader reader, string column, int defaultValue = 0)` | Safely reads int from reader |
| `GetDouble` | `public static double GetDouble(IDataReader reader, string column, double defaultValue = 0D)` | Safely reads double from reader |
| `GetShort` | `public static short GetShort(IDataReader reader, string column, short defaultValue = 0)` | Safely reads short from reader |
| `GetNullableDateTime` | `public static DateTime? GetNullableDateTime(IDataReader reader, string column)` | Reads nullable DateTime from reader |
| `GetUlong` | `public static ulong GetUlong(IDataReader reader, string column, ulong defaultValue = 0)` | Safely reads ulong from reader |
| `GetNullableInt` | `public static int? GetNullableInt(IDataReader reader, string column)` | Reads nullable int from reader |
| `GetByteArray` | `public static byte[] GetByteArray(IDataReader reader, string column)` | Reads byte array; returns empty array for null/DBNull |
| `GetBool` | `public static bool GetBool(IDataReader reader, string column, bool defaultValue = false)` | Safely reads bool from reader |
| `GetDateTime` | `public static DateTime GetDateTime(IDataReader reader, string column, DateTime defaultValue)` | Safely reads DateTime from reader |
| `GetLong` | `public static long GetLong(IDataReader reader, string column, long defaultValue = 0)` | Safely reads long from reader |
---
## 3. Invariants
### Singleton\<T>
- The generic type `T` must have a public parameterless constructor (`where T : new()`).
- `Instance` will always return the same object reference after first creation.
- Calling `new T()` directly after `Instance` has been accessed will throw `InvalidOperationException`.
- If the singleton constructor throws, the exception is captured and re-thrown on subsequent `Instance` access.
### ServiceQueue
- Work items execute sequentially, never concurrently.
- Only the first item in the queue is ever marked as `Started = true`.
- `MarkFinished` must be called by the `WorkAction` to advance the queue.
- Queue operations are thread-safe via `QueueLock`.
### Tags
- `Tag.INVALID_ID` is `-1`.
- Tag IDs of `0` are skipped during cache population.
- Tag text is trimmed of leading whitespace before database operations in `AddRange`.
- The `_tagsLookup` dictionary is keyed by tag text, not ID.
### TagAwareBase
- `TagIDs` is never null; it defaults to an empty array.
- `TagsBlobBytes` format: 4 bytes per int (sizeof(int)), using `Buffer.BlockCopy`.
### Utility
- All `IDataReader` helper methods handle `DBNull.Value` and return default values.
- `GetByteArray` returns an empty array (not null) for null/DBNull columns.
- `PingNetwork` timeout is fixed at 4444ms.
---
## 4. Dependencies
### External Dependencies (Imports)
| Module | Dependencies |
|--------|--------------|
| StatusAndProgressBarEventArgs | `System.Windows`, `System.Windows.Media`, `DTS.Common.Base` (IBaseViewModel) |
| Singleton\<T> | `System` |
| ImportData | `DTS.Common.Enums`, `DTS.Common.Enums.Sensors`, `DTS.Common.Interface.Sensors`, `System`, `System.Collections.Generic` |
| RegionNames | None |
| ServiceCall | `DTS.Common.Utilities.Logging`, `System`, `System.Collections.Generic`, `System.Linq`, `System.Threading.Tasks` |
| TagAwareBase | `System`, `System.Collections.Generic`, `System.Data`, `System.Data.SqlClient`, `System.Linq`, `System.Text`, `DTS.Common.Utilities.Logging` |
| Tags | `System`, `System.Collections.Generic`, `System.Data`, `System.Data.SqlClient`, `System.Linq`, `DTS.Common.Utilities.Logging` |
| Utility | `System`, `System.Text`, `System.Net.NetworkInformation`, `System.Data`, `DTS.Common.Utilities.Logging`, `System

View File

@@ -0,0 +1,233 @@
---
source_files:
- Common/DTS.CommonCore/Constant/XamlConstants.xaml.cs
- Common/DTS.CommonCore/Constant/DigitalInputs.cs
- Common/DTS.CommonCore/Constant/EmbeddedSensors.cs
- Common/DTS.CommonCore/Constant/Constants.cs
generated_at: "2026-04-16T12:03:56.985206+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "02cf11f3a90b1f89"
---
# Documentation: DTS.Common.Constant
## 1. Purpose
This module provides a centralized collection of application-wide constants and configuration values for the DTS (Data Translation System) software. It defines hardware thresholds for digital inputs, sensor range limits and sample rates for embedded devices, graph display parameters, streaming configuration limits, clock synchronization profiles, recording mode definitions, NMEA parsing constants, and database version markers. These constants ensure consistent behavior across the system and serve as the single source of truth for hardware-specific magic numbers, validation boundaries, and default values.
---
## 2. Public Interface
### `DTS.Common.Constant.XamlConstants` (partial class)
- **Signature:** `public partial class XamlConstants`
- **Behavior:** Empty partial class intended as code-behind for XAML resource definitions. No members defined in source.
---
### `DTS.Common.Constant.DigitalInputs` (static class)
| Member | Signature | Description |
|--------|-----------|-------------|
| `ConstantCurrentBreakPointDefault` | `public const double` | Default breakpoint value (19005.0) for contact closure detection. "Magic number from CPB." |
| `VoltageInputBreakPointDefault` | `public const double` | Default breakpoint value (19661.0) for voltage input modes THL and TLH (1.5V with sig- grounded). |
| `DisplaySPDADCDefault` | `public const bool` | Default display setting for SLICE PRO Digital ADC (false). |
| `ConstantCurrentBreakPoint` | `public static double { get; set; }` | Runtime value for constant current breakpoint. Initialized to `ConstantCurrentBreakPointDefault`. Does NOT query storage; relies on external initialization. |
| `VoltageInputBreakPoint` | `public static double { get; set; }` | Runtime value for voltage input breakpoint. Initialized to `VoltageInputBreakPointDefault`. Does NOT query storage. |
| `DisplaySPDADC` | `public static bool { get; set; }` | Runtime control for displaying SLICE Pro Digital analog ADC. Initialized to `DisplaySPDADCDefault`. Does NOT query storage. |
---
### `DTS.Common.Constant.EmbeddedSensors` (static class)
**Power Management / Wake Up:**
| Member | Value | Description |
|--------|-------|-------------|
| `MotionDetectInactivitySMaximum` | 300 | Maximum motion detect inactivity timeout (5 minutes). |
| `MagnetTimeoutMsMaximum` | 300000 | Maximum magnet timeout in milliseconds (5 minutes). |
**Device Trigger Ranges:**
| Member | Value | Description |
|--------|-------|-------------|
| `EmbeddedLowGLinearAccelerometerRange` | 8 | Low-G linear accelerometer range. |
| `EmbeddedHighGLinearAccelerometerRange` | 400 | High-G linear accelerometer range. |
| `EmbeddedAngularAccelerometerRange` | 2000 | Angular accelerometer range. |
| `EmbeddedAngularRateSensorRange` | 2000 | Angular rate sensor range. |
| `HumidityMinimum` / `HumidityMaximum` | 10 / 100 | Humidity valid range. |
| `PressureMinimum` / `PressureMaximum` | 5 / 15 | Pressure valid range. |
| `TemperatureMinimum` / `TemperatureMaximum` | 0 / 65 | Temperature valid range (°C). |
| `TimedIntervalEventDurationMsMinimum` / `Maximum` | 30 / 300000 | Timed interval event duration range. |
| `TimedIntervalNumberOfEventsMaximum` | 100 | Maximum number of timed interval events. |
| `IntervalBetweenEventStartsMinutesMaximum` | 1440 | Maximum interval between event starts (24 hours). |
**Sample Rate Limits (Hz):**
| Sensor | Minimum | Maximum | Default |
|--------|---------|---------|---------|
| Low-G Linear Accelerometer | 1 | 6400 | 6400 |
| High-G Linear Accelerometer | 1 | 5120 | 5120 |
| Angular Accelerometer | 1 | 1600 | 1600 |
| Angular Accelerometer & Rate Sensor | 1 | 5120 | 5120 |
| Atmospheric Sensor | 1 | 157 | 157 |
---
### `DTS.Common.Constants` (static class)
**String Constants:**
| Member | Value | Description |
|--------|-------|-------------|
| `ROI_TAG` | "ROI" | Region of interest tag. |
| `ALL_TAG` | "ALL" | All-encompassing tag. |
| `DAS_TEST_SETUPS` | "DASTestSetup" | DAS test setup identifier. |
| `USB` | "USB" | USB connection identifier. |
| `BACKUP_HEADER_EXTENSION` | ".header.bak" | Backup header file extension. |
| `BACKUP_FILE_EXTENSION` | ".bak" | Backup file extension. |
| `DAS_CONFIGS` | "DASConfigs" | DAS configuration directory name. |
| `TEMP_FILE_EXTENSION` | ".tmp" | Temporary file extension. |
| `UDP_STREAM_CH10_TF2` | "2HDR" | UDP streaming Chapter 10 tag. |
| `EventNumber` | "_Event Number" | Event number identifier. |
| `UseMeasuredExcitation` | "UseMeasuredExcitation" | Measured excitation flag. |
| `ManualsFolder` | "Manuals" | Manuals directory name. |
| `WindowsExplorer` | "explorer.exe" | Windows Explorer executable. |
| `NoValue` | "NOVALUE" | No-value placeholder. |
| `ISO_CH_ONLY_PREFIX` | "__ISO_CH_ONLY__" | ISO channel-only prefix. |
| `DUMMY_MOD_DESCRIP_S6DB` | "slice6db module" | Dummy module description. |
| `DUMMY_MOD_DESCRIP_POWERPRO` | "powerpro module" | Dummy module description. |
| `ISOTestInfo` | "_" | ISO test info marker. |
| `NMEA_GPRMC_HEADER` | "$GPRMC" | NMEA RMC sentence header. |
| `NMEA_GPGGA_HEADER` | "$GPGGA" | NMEA GGA sentence header. |
**Graph & Display Constants:**
| Member | Value | Description |
|--------|-------|-------------|
| `MINIMUM_VOLTAGE_INSERTION_RANGE_MV_SLICE` | 10 | Minimum voltage insertion range for SLICE (mV). |
| `GRAPH_MIN_AUTOZOOM` | 0.01D | Minimum auto-zoom as % of full scale (capacity). |
| `GRAPH_MAX_AUTOZOOM` | 1.2D | Maximum auto-zoom as % of full scale (signal). |
| `MAX_VIEWER_POINTS` | 45000000 | Maximum points for a Viewer graph. |
**Runtime-Configurable Properties:**
| Member | Default | Description |
|--------|---------|-------------|
| `CheckStatusLinesInRealtime` | true | Whether to check status lines during realtime polling. |
| `UpdateIntervalRealtimeCharts` | 100 | Sleep time (ms) between chart updates. |
| `PING_ICMP_TIMEOUT` | 500 | Max time (ms) to wait for individual ping attempt. |
**Hardware & Streaming Constants:**
| Member | Value | Description |
|--------|-------|-------------|
| `XML_HEADER_LENGTH` | 8 | XML header length in bytes. |
| `XML_STORE_MAGIC_BYTES` | `{0xAA, 0x55, 0xA5, 0x5A}` | Magic bytes for XML storage. |
| `FILE_STORE_DSP_FILTER_ID` | 104 | DSP filter ID for file storage. |
| `DEVICE_STREAMING_ONLY` | 1 | Device streaming-only flag. |
| `TDAS_TOM_DIGITAL_OUT_DURATION_MAX` | 1600 | Maximum TDAS Tom digital out duration. |
| `BITS_PER_MINOR_FRAME_S6A` | 128 | Bits per minor frame for SLICE6AIR. |
| `BITS_PER_MINOR_FRAME_TSRAIR` | 320 | Bits per minor frame for TSR AIR. |
| `ADC_MIDPOINT` | 32767 | ADC midpoint (16-bit DAC, 2^15 - 1). |
| `SLICE2_NO_AAF_REALTIME_RATE` | 100000F | AAF realtime rate when disabled via config. |
| `UDP_STREAMPROFILES_MAX` | 15 | Maximum UDP stream profiles. |
| `UART_MODE_MAX_SAMPLERATE` | 30000 | Maximum sample rate in UART recording modes. |
| `SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE` | 10000 | Max sample rate for digital filtering. |
| `SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE_20k` | 20000 | Extended max sample rate for digital filtering. |
| `SLICE6AIR_20K_DIGITAL_FILTER_MIN_PROTOCOL` | 46 | Minimum protocol version for 20k digital filter. |
| `MaxAAFilterRateHz` | 200000 | Maximum AA filter rate. |
| `NANOS_PER_SECOND` | 1000000000m | Nanoseconds per second. |
| `TEN_MILLIS_IN_SEC` | 0.01D | Ten milliseconds in seconds. |
| `EXECUTABLE_TIMEOUT` | 30000 | Wait timeout for 3rd party executables (ms). |
**Clock Synchronization Profiles:**
| Member | Type | Description |
|--------|------|-------------|
| `MasterProfiles` | `readonly ClockSyncProfile[]` | Valid clock master profile selections (14 profiles). |
| `SlaveProfiles` | `readonly ClockSyncProfile[]` | Valid clock slave profile selections (4 profiles). |
| `OnePPSOutProfiles` | `readonly ClockSyncProfile[]` | Profiles supporting 1PPS output (13 profiles). |
**Recording Modes:**
| Member | Type | Description |
|--------|------|-------------|
| `NonStreamingRecordingModes` | `readonly RecordingModes[]` | Non-streaming recording mode selections (15 modes). |
**NMEA Parsing Constants:**
| Member | Value | Description |
|--------|-------|-------------|
| `NMEA_GPRMC_TIME_POSN` | 1 | Position of time in GPRMC sentence. |
| `NMEA_GPRMC_VALID_POSN` | 2 | Position of validity flag in GPRMC. |
| `NMEA_GPRMC_LAT_POSN` / `LAT_LEN` / `LATD_POSN` | 3 / 9 / 4 | Latitude position, length, and direction. |
| `NMEA_GPRMC_LONG_POSN` / `LONG_LEN` / `LONGD_POSN` | 5 / 10 / 6 | Longitude position, length, and direction. |
| `NMEA_GPRMC_VELO_POSN` / `DIR_POSN` / `DATE_POSN` | 7 / 8 / 9 | Velocity, direction, and date positions. |
| `NMEA_GPGGA_TIME_POSN` / `VALID_POSN` / `ALT_POSN` / `ALTU_POSN` | 1 / 6 / 9 / 10 | GPGGA time, validity, altitude, and altitude unit positions. |
**Database Version Markers:**
| Member | Value | Description |
|--------|-------|-------------|
| `ROITables_DB_VERSION` | 92 | ROI tables feature version. |
| `EnableRepeat_DB_VERSION` | 92 | Enable repeat feature version. |
| `IgnoreShorted_DB_VERSION` | 92 | Ignore shorted feature version. |
| `ONEPPS_OUT_DB_VERSION` | 92 | 1PPS out feature version. |
| `UNIX_EPOCH_TIME` | 93 | Unix epoch time feature version. |
| `TMATS_INTERVAL_VERSION` | 93 | TMATS interval UI support version. |
| `ALLOWED_DOWNLOAD_FILE_LENGTH` | 260 | Maximum Windows file name length. |
| `ALLOWED_DOWNLOAD_DIRECTORY_LENGTH` | 248 | Maximum Windows directory name length. |
| `ADC_TO_UART_DB_VERSION` | 93 | ADC to UART feature version. |
| `SLICE6AIR_BR_DB_VERSION` | 95 | SLICE6AIR BR feature version. |
| `PTP_DOMAIN_ID_DB_VERSION` | 95 | PTP domain ID feature version. |
| `BULK_GROUPCHANNELSETTINGS_GET_DB_VERSION` | 95 | Bulk group channel settings version. |
| `MULTIPLE_EVENT_UART_DB_VERSION` | 96 | Multiple-event UART support version. |
| `RECORD_ON_BOOT_VERSION` | 96 | Record on boot feature version. |
**Other:**
| Member | Type | Description |
|--------|------|-------------|
| `ExportNameFilters` | `readonly Dictionary<string, string>` | Name sanitization for exports (maps "(Voltage)" → "Voltage", "(Current)" → "Current"). |
| `PSD_DEFAULT_MAX_POW10` / `MIN_POW10` | 0 / -12 | PSD default power-of-10 bounds. |
---
## 3. Invariants
1. **Digital Input Breakpoints:** `ConstantCurrentBreakPoint` and `VoltageInputBreakPoint` must be set externally before use; they do not auto-initialize from persistent storage.
2. **Sample Rate Defaults:** All default sample rates in `EmbeddedSensors` are set to their respective maximum values.
3. **Clock Sync Profile Arrays:** `MasterProfiles`, `SlaveProfiles`, and `OnePPSOutProfiles` are `readonly` and cannot be modified at runtime.
4. **Database Version Ordering:** Version numbers are monotonically increasing (92 → 93 → 95 → 96). Note: Version 94 is not present in the defined constants.
5. **NMEA Position Indices:** Position constants are 1-indexed (based on NMEA sentence structure), not 0-indexed.
6. **ADC Midpoint:** Fixed at 32767 (2^15 - 1) for 16-bit DACs; this is a hardware constraint.
7. **Windows Path Limits:** `ALLOWED_DOWNLOAD_FILE_LENGTH` (260) and `ALLOWED_DOWNLOAD_DIRECTORY_LENGTH` (248) reflect Windows API limitations.
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Enums` — for `ClockSyncProfile` and `RecordingModes` enum types (imported in `Constants.cs`)
**What depends on this module:**
- Unclear from source alone. Given the central nature of these constants, likely consumed by:
- Device communication/hardware abstraction layers
- Data acquisition and streaming components
- UI components (graph rendering, configuration dialogs)
- Export/import functionality
- Database migration logic
---
## 5. Gotchas
1. **Static Properties Without Storage Persistence:** The properties `ConstantCurrentBreakPoint`, `VoltageInputBreakPoint`, and `DisplaySPDADC` in `DigitalInputs` are explicitly documented as NOT querying values from storage. They rely on being set separately, which could lead to uninitialized or stale values if the initialization sequence is not properly managed.
2. **Magic Numbers Without Clear Origin:** `ConstantCurrentBreakPointDefault` (19005) is documented as a "magic number from CPB" with no explanation of its derivation. The voltage breakpoint (19661) corresponds to "1.5V with sig- grounded" but the conversion formula is not documented.
3. **Commented-Out Clock Sync Profiles:** Several profiles in `MasterProfiles`, `SlaveProfiles`, and `OnePPSOutProfiles` are commented out with notes like "Combinations that are possible in UI, but no device supports." This suggests potential UI/backend mismatch if these values are used elsewhere.
4. **Missing Database Version 94:** The version constants jump from 93 to 95 with no version 94 defined. The significance of this gap is unclear from source.
5. **Hardcoded Internal URLs:** Comments reference internal URLs (e.g., `http://manuscript.dts.local/f/cases/...`) which may be inaccessible outside the development environment.
6. **Mixed Naming Conventions:** Some constants use SCREAMING_SNAKE_CASE (e.g., `ROI_TAG`), others use PascalCase (e.g., `NanosecondsPerSecond` would be expected, but actual is `NANOS_PER_SECOND`). This inconsistency may cause confusion.
7. **Graph Auto-Zoom Units:** `GRAPH_MIN_AUTOZOOM` and `GRAPH_MAX_AUTOZOOM` have different semantic bases—one references "capacity" full scale, the other "signal" full scale. The distinction is subtle and could lead to misuse.

View File

@@ -0,0 +1,343 @@
---
source_files:
- Common/DTS.CommonCore/Controls/RoundedBox.xaml.cs
- Common/DTS.CommonCore/Controls/TestIDView.xaml.cs
- Common/DTS.CommonCore/Controls/checkbox.xaml.cs
- Common/DTS.CommonCore/Controls/GridLengthAnimation.cs
- Common/DTS.CommonCore/Controls/ISOPopup.xaml.cs
- Common/DTS.CommonCore/Controls/LookupPopup.xaml.cs
- Common/DTS.CommonCore/Controls/TestIdPreFixSuffixHelper.cs
- Common/DTS.CommonCore/Controls/AutoSizedGridView.cs
- Common/DTS.CommonCore/Controls/DynamicGrid.cs
- Common/DTS.CommonCore/Controls/TestIDViewModel.cs
- Common/DTS.CommonCore/Controls/TestIDControl.xaml.cs
- Common/DTS.CommonCore/Controls/GridViewColumnHeaderSelectable.xaml.cs
- Common/DTS.CommonCore/Controls/GridViewColumnHeaderSearchable.xaml.cs
- Common/DTS.CommonCore/Controls/GridViewColumnHeaderSearchableCheckBox.xaml.cs
generated_at: "2026-04-16T12:02:29.779799+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "1aa96c65b3ed084a"
---
# DTS.Common.Controls Documentation
## 1. Purpose
This module provides a collection of custom WPF controls and helpers for the DTS application. It includes specialized controls for test ID generation and display, animated grid layouts, popup-based lookup and ISO input validation, and enhanced GridView column headers with search, selection, and filtering capabilities. The controls integrate with the Prism EventAggregator for cross-component communication and support data binding through dependency properties and `INotifyPropertyChanged`.
---
## 2. Public Interface
### RoundedBox
```csharp
public partial class RoundedBox : UserControl
public RoundedBox() // Constructor
public void Connect(int connectionId, object target) // Stub method (implementation commented out)
```
A simple UserControl. The `Connect` method is defined but its implementation is commented out.
---
### TestIDView
```csharp
public partial class TestIDView : UserControl
public TestIDView() // Constructor
```
A simple UserControl with no additional public members beyond the constructor.
---
### checkbox
```csharp
public partial class checkbox
public void ToolTipEventHandler(object sender, ToolTipEventArgs e)
```
Handles tooltip events by publishing a `HelpTextEvent` via the `IEventAggregator`. Sets `e.Handled = true` and forwards the event arguments to subscribers.
---
### GridLengthAnimation
```csharp
public class GridLengthAnimation : AnimationTimeline
public GridLengthAnimation() // Constructor
public GridLength From { get; set; } // Dependency property
public static readonly DependencyProperty FromProperty
public GridLength To { get; set; } // Dependency property
public static readonly DependencyProperty ToProperty
public override Type TargetPropertyType // Returns typeof(GridLength)
public override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
protected override Freezable CreateInstanceCore() // Returns new GridLengthAnimation()
```
Custom animation timeline for animating `GridLength` values. Supports both pixel and star-based grid units, preserving the `GridUnitType` from the `To` property.
---
### ISOPopup
```csharp
public partial class ISOPopup : Popup
public ISOPopup() // Constructor
// Private event handlers (wired via XAML):
private void ISOPart_OnPreviewKeyUp(object sender, KeyEventArgs e) // Filters input to alphanumeric and control keys only
private void ISOPart_OnGotMouseCapture(object sender, MouseEventArgs e) // Selects all text in TextBox
private void ISOPart_OnGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) // Selects all text in TextBox
```
A Popup control that restricts input to letters (A-Z), digits (0-9, NumPad0-9), and control keys (Enter, Tab, Delete, Back, Home, End, OemQuestion, OemBackTab).
---
### LookupPopup
```csharp
public partial class LookupPopup : Popup
public LookupPopup() // Constructor
public IEnumerable<IChannelCode> AllChannelCodes { get; private set; }
public delegate void ChannelCodeSelectedEventHandler(object sender, string code, string name);
public event ChannelCodeSelectedEventHandler ChannelCodeSelected
public static readonly DependencyProperty PossibleChannelsProperty
public IList PossibleChannels { get; set; } // Default: empty list with anonymous objects
// Private event handlers:
private void LookupPopup_OnOpenedClosed(object sender, EventArgs e) // Commented-out implementation
private void PossibleChannels_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) // Raises ChannelCodeSelected
```
A Popup for selecting channel codes from a DataGrid. Uses reflection to extract `Code` and `Name` properties from items.
---
### TestIdPreFixSuffixHelper & Related Classes
```csharp
public enum TestIdFixedPrefixSuffixValues
{
NotFixed = -1,
None = 0,
TimeStamp = 1,
TestSetupName = 2
}
public class TestIdPreFixSuffix
public TestIdPreFixSuffix(TestIdFixedPrefixSuffixValues fixedPrefixSuffix)
public TestIdPreFixSuffix(string dbPrefixSuffix)
public TestIdFixedPrefixSuffixValues FixedValue { get; } // Default: NotFixed
public override string ToString() // Returns "TESTID_PREFIX_SUFFIX_{value}" or the db string
public class TestIdPreFixSuffixHelper : BasePropertyChanged
public TestIdPreFixSuffixHelper(string testIdPreFixSuffix)
public TestIdPreFixSuffixHelper(TestIdFixedPrefixSuffixValues testIdPreFixSuffix)
public TestIdPreFixSuffix TestIdPreFixSuffix { get; }
public override string ToString() // Looks up localized string via ResourceManager
public override bool Equals(object obj)
```
Helper classes for managing test ID prefix/suffix values with support for both fixed enumerated values and database-defined strings.
---
### AutoSizedGridView
```csharp
public class AutoSizedGridView : GridView
protected override void PrepareItem(ListViewItem item)
```
A GridView that automatically resizes columns marked with `Width="Auto"` and restores lost width bindings. Tracks columns via hash codes.
---
### DynamicGrid
```csharp
public class DynamicGrid : Grid, INotifyPropertyChanged
public DynamicGrid() // Constructor, calls Refresh()
public byte GridColumns { get; set; } // Default: 2
public void Refresh()
// INotifyPropertyChanged implementation:
public event PropertyChangedEventHandler PropertyChanged
protected bool SetProperty<T>(ref T storage, T value, string propertyName = null)
protected void OnPropertyChanged(string propertyName = null)
```
A Grid that automatically arranges children in a configurable number of columns. All columns except the last use `Auto` width; the last uses `Star`. Adds a final `Star`-height row at the bottom.
---
### TestIDViewModel
```csharp
public class TestIDViewModel : INotifyPropertyChanged
public string TestSetupLabel { get; set; } // Default: string.Empty
public Visibility TestSetupLabelVisibility { get; } // Collapsed if label is empty
public string TestIdEditableText { get; set; } // Default: string.Empty
public string TestName { get; set; }
public void PopulateAllTestIdPrefixSuffixValues(string[] serializedValues)
public TestIdPreFixSuffixHelper[] AllTestIdPrefixSuffixValues { get; }
public TestIdPreFixSuffixHelper SelectedTestIdPrefixValueItem { get; set; } // Default: None
public TestIdPreFixSuffixHelper SelectedTestIdSuffixValueItem { get; set; } // Default: TimeStamp
public string GetTestId()
public string GetTestIdTimestamp() // Format: "YYYY_MM_DD HH_MM"
```
ViewModel for constructing test IDs from prefix, label, editable text, and suffix components.
---
### TestIdControl
```csharp
public partial class TestIdControl : UserControl, INotifyPropertyChanged
public TestIdControl() // Constructor
// Same public interface as TestIDViewModel:
public string TestSetupLabel { get; set; }
public Visibility TestSetupLabelVisibility { get; }
public string TestIdEditableText { get; set; }
public string TestName { get; set; }
public void PopulateAllTestIdPrefixSuffixValues(string[] serializedValues)
public TestIdPreFixSuffixHelper[] AllTestIdPrefixSuffixValues { get; }
public TestIdPreFixSuffixHelper SelectedTestIdPrefixValueItem { get; set; }
public TestIdPreFixSuffixHelper SelectedTestIdSuffixValueItem { get; set; }
public string GetTestId()
public string GetTestIdTimestamp()
```
**Note:** Comment indicates this control should be removed after TTS module deletion and migration to new test setup wizard.
---
### GridViewColumnHeaderSelectable
```csharp
public partial class GridViewColumnHeaderSelectable : UserControl, IBasePropertyChanged
public GridViewColumnHeaderSelectable() // Constructor, subscribes to ListViewStatusEvent
public string ListviewId { get; set; } // Dependency property, default: ""
public string HeaderTitle { get; set; } // Dependency property, default: "Awesome"
public bool ToggleButtonIsChecked { get; set; } // Default: false
// Routed events:
public static readonly RoutedEvent OpenChangedEvent
public event RoutedEventHandler OpenChanged
public static readonly RoutedEvent ClickEvent
public event RoutedEventHandler ClickHandler
public static readonly RoutedEvent SelectAllEvent
public event RoutedEventHandler SelectAll
```
A column header with a toggle button popup for selection. Raises `OpenChanged`, `ClickHandler`, and `SelectAll` routed events.
---
### GridViewColumnHeaderSearchable
```csharp
public partial class GridViewColumnHeaderSearchable : UserControl, IBasePropertyChanged
public GridViewColumnHeaderSearchable() // Constructor, subscribes to ListViewStatusEvent
public string ListviewId { get; set; } // Dependency property
public string HeaderTitle { get; set; } // Dependency property, default: "Awesome"
public bool ToggleButtonIsChecked { get; set; }
public string HeaderSearchTerm { get; set; } // Dependency property, default: ""
public Geometry ToggleIconGeometry { get; } // Returns DownArrowIconGeometry or FilterIconGeometry
// Routed events:
public static readonly RoutedEvent OpenChangedEvent
public event RoutedEventHandler OpenChanged
public static readonly RoutedEvent ClickEvent
public event RoutedEventHandler ClickHandler
public static readonly RoutedEvent SearchEvent
public event RoutedEventHandler Search
// Converter:
public class BoolToInvertedBoolConverter : IValueConverter
```
A searchable column header with a popup. Displays different icons based on whether a search term is active.
---
### GridViewColumnHeaderSearchableCheckBox
```csharp
public partial class GridViewColumnHeaderSearchableCheckBox : UserControl, IBasePropertyChanged
public GridViewColumnHeaderSearchableCheckBox() // Constructor, subscribes to ListViewStatusEvent
public string ListviewId { get; set; } // Dependency property
public string HeaderTitle { get; set; } // Dependency property, default: "Awesome"
public bool ToggleButtonIsChecked { get; set; }
public string HeaderSearchTerm { get; set; } // Dependency property
public Geometry ToggleIconGeometry { get; }
// Routed events:
public static readonly RoutedEvent OpenChangedEvent
public event RoutedEventHandler OpenChanged
public static readonly RoutedEvent ClickEvent
public event RoutedEventHandler ClickHandler
public static readonly RoutedEvent SearchEvent
public event RoutedEventHandler Search
public static readonly RoutedEvent FilterEvent
public event RoutedEventHandler Filter // Raised with "All", "True", or "False"
```
A column header combining search and boolean filtering with All/True/False buttons.
---
## 3. Invariants
- **GridLengthAnimation**: The `GridUnitType` (Star or Pixel) is always taken from the `To` property, not `From`.
- **ISOPopup**: Input is restricted to alphanumeric characters and specific control keys; all other keys set `e.Handled = true`.
- **DynamicGrid**: The last column always has `GridUnitType.Star`; all others have `GridUnitType.Auto`. A final row with `Star` height is always appended.
- **AutoSizedGridView**: Column tracking uses `GetHashCode()`; if column collection changes, internal caches are rebuilt.
- **LookupPopup**: Items in `PossibleChannels` must have `Code` and `Name` properties accessible via reflection.
- **TestIdPreFixSuffixHelper.Equals**: Two helpers are equal if they have the same `FixedValue` (when not `NotFixed`), or if both are `NotFixed` and their string representations match.
- **TestIDViewModel/TestIdControl**: `GetTestId()` joins non-empty components with underscores in order: prefix → TestSetupLabel → TestIdEditableText → suffix.
- **GridViewColumnHeader* controls**: All subscribe to `ListViewStatusEvent` and clear state when receiving `Unloaded` status matching their `ListviewId`.
---
## 4. Dependencies
### This module depends on:
- `System.Windows` (WPF core)
- `System.Windows.Controls`
- `System.Windows.Controls.Primitives`
- `System.Windows.Data`
- `System.Windows.Input`
- `System.Windows.Media.Animation`
- `Microsoft.Practices.ServiceLocation` (ServiceLocator)
- `Microsoft.Practices.Prism.Events` (IEventAggregator, ThreadOption)
- `DTS.Common.Base` (BasePropertyChanged, IBasePropertyChanged)
- `DTS.Common.Events` (HelpTextEvent, HelpTextEventArg, ListViewStatusEvent, ListViewStatusArg)
- `DTS.Common.Interface.Channels.ChannelCodes` (IChannelCode)
- `DTS.Common.Utilities.Logging` (imported but usage not visible in provided source)
- `DTS.Strings.Strings` (ResourceManager for localization)
### What depends on this module:
- Cannot be determined from source alone; these are UI controls likely used by various modules throughout the DTS application.
---
## 5. Gotchas
1. **TestIdControl is deprecated**: The source explicitly states "Remove this control after deleting the TTS module and migrating to new test setup wizard." New code should use `TestIDViewModel` instead.
2. **LookupPopup uses reflection**: `PossibleChannels_OnMouseDoubleClick` uses `GetProperty("Code")` and `GetProperty("Name")` via reflection on anonymous-type-like objects. This is fragile and will fail silently (returning null) if properties don't exist.
3. **RoundedBox.Connect is a stub**: The method throws `NotImplementedException` (commented out). Its purpose is unclear from source.
4. **GridViewColumnHeaderSelectable.OnListviewStatusEvent has empty body**: When `arg.Id == ListviewId`, there's no actual logic executed—just an empty if block.
5. **AutoSizedGridView uses hash codes for column identity**: Column tracking relies on `GetHashCode()`, which could theoretically collide (though unlikely in practice).
6. **checkbox class lacks constructor**: The partial class `checkbox` has no constructor shown; `InitializeComponent()` must be called from the XAML-generated part.
7. **BoolToInvertedBoolConverter.ConvertBack throws**: The `ConvertBack` method throws `NotImplementedException`, making it unsuitable for two-way bindings.
8. **GridLengthAnimation doesn't validate animationClock.CurrentProgress**: `GetCurrentValue` accesses `animationClock.CurrentProgress.Value` without null checking; could throw if progress is null.
9. **DynamicGrid.Refresh clears and rebuilds all definitions**: Called on every `GridColumns` change and every visual child change; may have performance implications for grids with many children.
10. **TestIDViewModel.TestIdEditableText property notification missing**: The property setter doesn't raise `PropertyChanged`, unlike other properties.

View File

@@ -0,0 +1,138 @@
---
source_files:
- Common/DTS.CommonCore/Converters/BooleanToBorderThicknessConverter.cs
- Common/DTS.CommonCore/Converters/BooleanToBorderBrushConverter.cs
- Common/DTS.CommonCore/Converters/BooleanOrMultiConverter.cs
- Common/DTS.CommonCore/Converters/BooleanToGreenBorderConverter.cs
- Common/DTS.CommonCore/Converters/DateTimeWithMillisecondsToStringConverter.cs
- Common/DTS.CommonCore/Converters/EnumVisibilityConverter.cs
- Common/DTS.CommonCore/Converters/InverseEnumVisibilityConverter.cs
- Common/DTS.CommonCore/Converters/ActiveContentConverter.cs
- Common/DTS.CommonCore/Converters/FaultedTextConverter.cs
- Common/DTS.CommonCore/Converters/TriggerTextConverter.cs
- Common/DTS.CommonCore/Converters/NullableFloatConverter.cs
- Common/DTS.CommonCore/Converters/TriggerColorConverter.cs
- Common/DTS.CommonCore/Converters/FaultedColorConverter.cs
- Common/DTS.CommonCore/Converters/DateConverter.cs
- Common/DTS.CommonCore/Converters/InverseEnumEnabledConverter.cs
- Common/DTS.CommonCore/Converters/IsLessThanConverter.cs
- Common/DTS.CommonCore/Converters/ListToStringConverter.cs
- Common/DTS.CommonCore/Converters/IsGreaterThanConverter.cs
- Common/DTS.CommonCore/Converters/NonZeroToColorConverter.cs
- Common/DTS.CommonCore/Converters/HeightConverter.cs
- Common/DTS.CommonCore/Converters/ErrorToBooleanConverter.cs
- Common/DTS.CommonCore/Converters/WidthConverter.cs
- Common/DTS.CommonCore/Converters/StringListToVisibilityConverter.cs
- Common/DTS.CommonCore/Converters/StatusToBorderThicknessConverter.cs
- Common/DTS.CommonCore/Converters/ArrayVisibilityConverter.cs
- Common/DTS.CommonCore/Converters/ErrorToColorConverter.cs
- Common/DTS.CommonCore/Converters/GreaterThanToBoolConverter.cs
- Common/DTS.CommonCore/Converters/BooleanToColorConverter.cs
- Common/DTS.CommonCore/Converters/BooleanToItalicFontStyleConverter.cs
- Common/DTS.CommonCore/Converters/IntervalToVisibilityConverter.cs
- Common/DTS.CommonCore/Converters/DiagStatusShuntColorConverter.cs
- Common/DTS.CommonCore/Converters/DiagStatusOffsetColorConverter.cs
- Common/DTS.CommonCore/Converters/InverseBooleanToOpacityConverter.cs
- Common/DTS.CommonCore/Converters/StatusToColorConverter.cs
- Common/DTS.CommonCore/Converters/ColorToSolidColorBrushConverter .cs
- Common/DTS.CommonCore/Converters/BooleanAndToVisibiltyMultiConverter.cs
- Common/DTS.CommonCore/Converters/BooleanOrToVisibilityMultiConverter.cs
- Common/DTS.CommonCore/Converters/DoubleFromThousandthUnitToBaseUnit.cs
- Common/DTS.CommonCore/Converters/BooleanToOpacityConverter.cs
- Common/DTS.CommonCore/Converters/DASStatusArmTextConverter.cs
- Common/DTS.CommonCore/Converters/EnumBooleanConverter.cs
- Common/DTS.CommonCore/Converters/InitialOffsetToIEPESensorOffsetConverter.cs
- Common/DTS.CommonCore/Converters/DASStatusColorConverter.cs
- Common/DTS.CommonCore/Converters/DASStatusArmColorConverter .cs
- Common/DTS.CommonCore/Converters/PercentConverter.cs
- Common/DTS.CommonCore/Converters/NumericStringFormatConverter.cs
- Common/DTS.CommonCore/Converters/VisibilityToRowHeightConverter.cs
- Common/DTS.CommonCore/Converters/GroupImportErrorToStringConverter.cs
- Common/DTS.CommonCore/Converters/GroupNameToVisibilityConverter.cs
- Common/DTS.CommonCore/Converters/FilePathsToShortStringConverter.cs
- Common/DTS.CommonCore/Converters/InverseBooleanConverter.cs
- Common/DTS.CommonCore/Converters/EnumDescriptionTypeConverter.cs
- Common/DTS.CommonCore/Converters/TestDataToRegionOfInterestMaximumConverter.cs
generated_at: "2026-04-16T12:00:34.413877+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "8cec2e1657d13038"
---
# Documentation: DTS.Common.Converters
## 1. Purpose
This module provides a comprehensive library of WPF value converters (implementing `IValueConverter` and `IMultiValueConverter`) for the DTS application. It facilitates the binding of UI elements to backend data models by transforming data types (e.g., Booleans to Visibility or Colors, Enums to Strings, numeric formatting) and applying conditional logic within XAML. It serves as the bridge between raw data properties and presentation logic, supporting the MVVM architectural pattern.
## 2. Public Interface
This module contains the following classes:
### Boolean Converters
* **`BooleanToBorderThicknessConverter`** (`IValueConverter`)
* `Convert`: Returns `1` if `value` is `true`, otherwise `2`.
* `ConvertBack`: Returns `null`.
* **`BooleanToBorderBrushConverter`** (`IValueConverter`)
* `Convert`: Returns `BrushesAndColors.Brush_Warning` if `value` is `true`, otherwise `Brushes.Transparent`.
* `ConvertBack`: Returns `null`.
* **`BooleanToGreenBorderConverter`** (`IValueConverter`)
* `Convert`: Returns `BrushesAndColors.BrushApplicationStatusPowerGreen` if `value` is `true`, otherwise `BrushesAndColors.BrushFlatControlDarkForeground`.
* `ConvertBack`: Returns `null`.
* **`BooleanOrMultiConverter`** (`IMultiValueConverter`)
* `Convert`: Returns `true` if any value in the `values` array is `true`. Returns `false` if any value is not a `bool`.
* `ConvertBack`: Throws `NotImplementedException`.
* **`BooleanToColorConverter`** (`IValueConverter`)
* Properties: `Background` (bool), `Inverted` (bool), `AttentionBrush` (bool), `WarningBrush` (bool).
* `Convert`: Returns specific brushes based on boolean `value` and configured properties. Defaults to error/attention brushes for `false`.
* `ConvertBack`: Returns `null`.
* **`BooleanToItalicFontStyleConverter`** (`IValueConverter`)
* `Convert`: Returns `FontStyles.Italic` if `value` is `true`, otherwise `FontStyles.Normal`.
* `ConvertBack`: Returns `null`.
* **`BooleanToOpacityConverter`** (`IValueConverter`)
* `Convert`: Returns `0.5` if `value` is `true`, otherwise `1`.
* `ConvertBack`: Returns `null`.
* **`InverseBooleanToOpacityConverter`** (`IValueConverter`)
* `Convert`: Returns `1.0` if `value` is `true`, otherwise `0.5`.
* `ConvertBack`: Returns `null`.
* **`InverseBooleanConverter`** (`IValueConverter`)
* `Convert`: Returns the logical negation of the boolean `value`.
* `ConvertBack`: Returns the logical negation of the boolean `value`.
* **`BooleanAndToVisibilityMultiConverter`** (`IMultiValueConverter`)
* `Convert`: Returns `Visibility.Visible` if all values are `true`. Supports parameter flags "FALSE" (inverts logic) and "HIDE" (uses `Hidden` instead of `Collapsed`).
* `ConvertBack`: Throws `NotImplementedException`.
* **`BooleanOrToVisibilityMultiConverter`** (`IMultiValueConverter`)
* `Convert`: Returns `Visibility.Visible` if any value is `true`. Supports parameter flags "FALSE" and "HIDE".
* `ConvertBack`: Throws `NotImplementedException`.
### Enum Converters
* **`EnumVisibilityConverter`** (`IValueConverter`)
* `Convert`: Returns `Visibility.Visible` if `value.Equals(parameter)`, otherwise `Visibility.Hidden`.
* `ConvertBack`: Returns `parameter` if `value` is `Visibility.Visible`, otherwise `Binding.DoNothing`.
* **`InverseEnumVisibilityConverter`** (`IValueConverter`)
* `Convert`: Returns `Visibility.Hidden` if `value.Equals(parameter)`, otherwise `Visibility.Visible`.
* `ConvertBack`: Returns `parameter` if `value` is `Visibility.Hidden`, otherwise `Binding.DoNothing`.
* **`InverseEnumEnabledConverter`** (`IValueConverter`)
* `Convert`: Returns `false` if `value.Equals(parameter)`, otherwise `true`.
* `ConvertBack`: Returns `parameter` if `value` is `false`, otherwise `Binding.DoNothing`.
* **`EnumBooleanConverter`** (`IValueConverter`)
* `Convert`: Returns `value.Equals(parameter)`.
* `ConvertBack`: Returns `parameter` if `value` is `true`, otherwise `Binding.DoNothing`.
* **`EnumDescriptionTypeConverter`** (`EnumConverter`)
* `ConvertTo`: Returns the `DescriptionAttribute` value of the enum, looking up the string in `Strings.Strings.ResourceManager`.
* `GetEnumDescription`: Static helper to retrieve description string for an Enum value.
### Numeric & Comparison Converters
* **`IsLessThanConverter`** (`IValueConverter`)
* `Convert`: Parses `value` and `parameter` as decimals. Returns `true` if `left < right`.
* `ConvertBack`: Returns `DependencyProperty.UnsetValue`.
* **`IsGreaterThanConverter`** (`IValueConverter`)
* `Convert`: Parses `value` and `parameter` as decimals. Returns `true` if `left > right`.
* `ConvertBack`: Returns `DependencyProperty.UnsetValue`.
* **`GreaterEqualThanToBoolConverter`** (`IValueConverter`)
* `Convert`: Returns `true` if `value >= parameter`. Handles `int`, `double`, and `ushort`.
* `ConvertBack`: Returns `false`.
* **`

View File

@@ -0,0 +1,102 @@
---
source_files:
- Common/DTS.CommonCore/Dialogs/IRegionManagerAware.cs.cs
- Common/DTS.CommonCore/Dialogs/IPopupWindowActionAware.cs
- Common/DTS.CommonCore/Dialogs/ConfirmationEx.cs
- Common/DTS.CommonCore/Dialogs/ConfirmationWindow.xaml.cs
- Common/DTS.CommonCore/Dialogs/NotificationWindow.xaml.cs
- Common/DTS.CommonCore/Dialogs/PopupWindowAction.cs
- Common/DTS.CommonCore/Dialogs/BrowseForFolderDialog.cs
generated_at: "2026-04-16T12:05:57.382273+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e520922d284c9033"
---
# Documentation: DTS.Common.Dialogs
## 1. Purpose
This module provides a custom dialog management infrastructure for WPF applications built on the Prism framework. It extends Prism's `InteractionRequest` patterns to support custom window styling (such as hiding the system close button), region management within popups, and specific dialog types like confirmations and notifications. Additionally, it provides a wrapper (`BrowseForFolderDialog`) around the Win32 API `SHBrowseForFolder` for folder selection capabilities not natively available in standard WPF dialogs.
## 2. Public Interface
### Interfaces
**`IRegionManagerAware`**
- `IRegionManager RegionManager { get; set; }`: Allows a view or view model to receive a scoped `IRegionManager` when hosted inside a popup window.
**`IPopupWindowActionAware`**
- `Window HostWindow { get; set; }`: Provides access to the hosting window instance.
- `Notification HostNotification { get; set; }`: Provides access to the notification context (e.g., `Confirmation` or `Notification` object) passed to the window.
### Classes
**`ConfirmationEx`** (Inherits `Confirmation`)
- `MessageBoxButton Buttons { get; set; }`: Defaults to `MessageBoxButton.OKCancel`. Defines buttons shown in the confirmation.
- `MessageBoxImage Image { get; set; }`: Defaults to `MessageBoxImage.Question`. Defines the icon shown.
- `MessageBoxResult Result { get; set; }`: Stores the result of the user interaction.
**`ConfirmationWindow`** (Inherits `Window`)
- `DataTemplate ConfirmationTemplate { get; set; }`: Dependency property used to define the visual presentation of the confirmation content.
- `void Connect(int connectionId, object target)`: Throws `NotImplementedException`.
**`NotificationWindow`** (Inherits `Window`)
- `DataTemplate NotificationTemplate { get; set; }`: Dependency property for the notification content layout.
- `Uri ImageUri { get; set; }`: Dependency property for the notification icon. Defaults to a pack URI pointing to `warning_48.png`.
- `void Connect(int connectionId, object target)`: Empty implementation.
**`PopupWindowAction`** (Inherits `TriggerAction<FrameworkElement>`)
- **Properties**:
- `FrameworkElement WindowContent`: The root visual element to display in the popup.
- `DataTemplate ContentTemplate`: The template applied to the content.
- `bool IsModal`: Determines if the window blocks interaction with the owner.
- `WindowPositions StartupPosition`: Enum (`CenterOwner`, `CenterScreen`). Defaults to `CenterScreen`.
- `bool AllowMultipleNotificationWindows`: Prevents or allows concurrent notification windows.
- **Methods**:
- `protected override void Invoke(object parameter)`: Executes the trigger, creates the window, sets up region managers, and shows the dialog.
- `protected Window GetWindow(Notification notification)`: Factory method returning the appropriate `Window` wrapper.
- `protected Window CreateWindow(Notification notification)`: Creates a `ConfirmationWindow` or `NotificationWindow` if `WindowContent` is null.
**`BrowseForFolderDialog`**
- **Properties**:
- `string SelectedFolder`: The path chosen by the user.
- `string Title`: The text displayed above the tree view.
- `string InitialFolder`: The path selected on startup.
- `string InitialExpandedFolder`: The path selected and expanded on startup.
- `string OKButtonText`: Custom text for the confirmation button.
- `BrowseInfoFlags BrowserDialogFlags`: Win32 flags controlling dialog behavior (defaults to `BIF_NEWDIALOGSTYLE`).
- **Methods**:
- `Nullable<bool> ShowDialog()`: Shows the dialog modally.
- `Nullable<bool> ShowDialog(Window owner)`: Shows the dialog modally with a WPF window owner.
## 3. Invariants
1. **Window System Menu Removal**: Both `ConfirmationWindow` and `NotificationWindow` modify the window style upon initialization (`SourceInitialized`) to remove the `WS_SYSMENU` flag. This effectively hides the system menu and the close button from the title bar.
2. **Region Management**: When `PopupWindowAction` invokes a dialog with `WindowContent` set, it guarantees that a scoped `IRegionManager` is attached to that content if one is not already present.
3. **Visual Tree Parenting**: `PopupWindowAction.Invoke` will exit immediately without showing a window if `WindowContent` is already a child of another visual element (`WindowContent.Parent != null`).
4. **Default Dialog Creation**: If `PopupWindowAction.WindowContent` is null, the action defaults to creating either a `ConfirmationWindow` (if the notification is `Confirmation`) or a `NotificationWindow` (if the notification content is `NotificationContentEventArgs`).
## 4. Dependencies
**Internal Dependencies (Inferred):**
- `DTS.Common.Enums`: Required for `PopupWindowImage` enum used in `PopupWindowAction.GetImageUri`.
- `DTS.Common.Events`: Required for `NotificationContentEventArgs` used in `PopupWindowAction.CreateWindow`.
**External Dependencies:**
- `Microsoft.Practices.Prism.Regions`: Used for `IRegionManager` and region scoping.
- `Microsoft.Practices.Prism.Interactivity.InteractionRequest`: Used for `Notification`, `Confirmation`, `InteractionRequestedEventArgs`, and `TriggerAction`.
- `System.Windows.Interactivity`: Used for `TriggerAction<FrameworkElement>`.
- `System.Windows`: Core WPF types.
- `user32.dll`: P/Invoke for window styling (`SetWindowLong`, `GetWindowLong`) and messaging.
- `shell32.dll`: P/Invoke for folder browsing (`SHBrowseForFolderW`, `SHGetPathFromIDList`).
## 5. Gotchas
1. **Hardcoded Clipboard Text**: `NotificationWindow` contains an event handler `CoppyToClibord_Click` (note the typo in method name) that sets the clipboard text to the hardcoded string "Hello, clipboard". This appears to be debug/test code left in the production source.
2. **Inconsistent Image Paths**:
- `NotificationWindow` defaults its `ImageUri` to a path containing `RibbonControl/Images/warning_48.png`.
- `PopupWindowAction.GetImageUri` constructs paths pointing to `Images/` (without `RibbonControl`).
- This inconsistency suggests a refactoring mismatch or missing resource files; developers adding new icons should verify the correct pack URI structure.
3. **Unimplemented Interface Method**: The `Connect` method in `ConfirmationWindow` throws `NotImplementedException`. This method is typically associated with the `IComponentConnector` interface generated by the WPF compiler for XAML parsing. The manual implementation throwing an exception suggests the code-behind may be out of sync with the XAML or manually implementing an interface it shouldn't.
4. **COM Initialization Requirement**: `BrowseForFolderDialog` defaults to `BIF_NEWDIALOGSTYLE`. The Win32 documentation for this flag states that `OleInitialize` must be called before using the API. This class does not call `OleInitialize`; the consuming application is responsible for COM initialization.
5. **Commented Out Features**: Both `ConfirmationEx` and `PopupWindowAction` contain significant blocks of commented-out code related to "Timeout" functionality (auto-closing dialogs). This suggests unfinished or deprecated features that may confuse developers looking for timeout capabilities.

View File

@@ -0,0 +1,395 @@
---
source_files:
- Common/DTS.CommonCore/Enums/IsoRestrictionLevels.cs
- Common/DTS.CommonCore/Enums/GPSSentenceTypes.cs
- Common/DTS.CommonCore/Enums/UartDataFormat.cs
- Common/DTS.CommonCore/Enums/NetworkSelection.cs
- Common/DTS.CommonCore/Enums/ScriptTypes.cs
- Common/DTS.CommonCore/Enums/InitializationTypes.cs
- Common/DTS.CommonCore/Enums/Strings.cs
- Common/DTS.CommonCore/Enums/MigrationResult.cs
- Common/DTS.CommonCore/Enums/SLICE6MulticastProperties.cs
- Common/DTS.CommonCore/Enums/RibbonTabNames.cs
- Common/DTS.CommonCore/Enums/IsoSupportLevels.cs
- Common/DTS.CommonCore/Enums/ImportFormats.cs
- Common/DTS.CommonCore/Enums/TabControlOperation.cs
- Common/DTS.CommonCore/Enums/IncludeOverwriteName.cs
- Common/DTS.CommonCore/Enums/RibbonControlOperation.cs
- Common/DTS.CommonCore/Enums/UICultures.cs
- Common/DTS.CommonCore/Enums/T0Mode.cs
- Common/DTS.CommonCore/Enums/VelocityUnit.cs
- Common/DTS.CommonCore/Enums/ImportStatus.cs
- Common/DTS.CommonCore/Enums/IsoViewMode.cs
- Common/DTS.CommonCore/Enums/PopupWindowImage.cs
- Common/DTS.CommonCore/Enums/UIItemStatus.cs
- Common/DTS.CommonCore/Enums/DigitalOutputs.cs
- Common/DTS.CommonCore/Enums/DigitalInputs.cs
- Common/DTS.CommonCore/Enums/DataFlag.cs
- Common/DTS.CommonCore/Enums/Squibs.cs
- Common/DTS.CommonCore/Enums/SupportedExportFormatBitFlags.cs
- Common/DTS.CommonCore/Enums/UartBaudRate.cs
- Common/DTS.CommonCore/Enums/EnumBindingSourceExtension.cs
- Common/DTS.CommonCore/Enums/UDPStreamProfile.cs
- Common/DTS.CommonCore/Enums/ExcitationVoltageOptions.cs
- Common/DTS.CommonCore/Enums/RecordingModes.cs
- Common/DTS.CommonCore/Enums/ApplicationStatusTypes.cs
- Common/DTS.CommonCore/Enums/ExportHeaderLine.cs
- Common/DTS.CommonCore/Enums/StreamDigitalFilterTypes.cs
- Common/DTS.CommonCore/Enums/CFCFilter.cs
- Common/DTS.CommonCore/Enums/ClockSource.cs
generated_at: "2026-04-16T12:00:02.414495+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b809df2688f575c2"
---
# Documentation: DTS.CommonCore.Enums
## 1. Purpose
This module defines the canonical enumeration types and related utility classes for the DTS (Data Acquisition System) common core library. It provides strongly-typed constants for hardware configuration (UART, digital I/O, squibs, excitation voltages), data processing (CFC filters, recording modes, streaming profiles), application state management (status types, import/export formats), and UI concerns (cultures, popup images, ribbon controls). The enums serve as the shared vocabulary between hardware drivers, business logic, and presentation layers.
## 2. Public Interface
### Enums
#### `GPSSentenceTypes`
```csharp
public enum GPSSentenceTypes { GPGGA, GPRMC }
```
Defines NMEA GPS sentence types for parsing GPS data streams.
#### `UartDataFormat`
```csharp
public enum UartDataFormat { Binary, PlainText, NMEA }
```
Specifies the data format for UART communication.
#### `NetworkSelection`
```csharp
public enum NetworkSelection { Default, NetworkId, NetworkDesc }
```
Defines network selection criteria.
#### `ScriptTypes`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum ScriptTypes { Migration, Initialization }
```
Categorizes script execution types.
#### `InitializationTypes`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum InitializationTypes { Aero, Crash, TSRAIR }
```
Defines initialization type categories.
#### `StringReplacementMode`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum StringReplacementMode { All, First, Last }
```
Controls string replacement behavior.
#### `MigrationResult`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum MigrationResult { OK, ExceptionThrown, WarningAllowStreamingModesWasNotMigrated }
```
Indicates the outcome of a migration operation.
#### `SLICE6Properties`
```csharp
public enum SLICE6Properties { SLICE6MulticastAddress, SLICE6MulticastCommandPort, SLICE6MulticastResponsePort }
```
Properties for SLICE6 UDP broadcast autodiscovery.
#### `IsoSupportLevels`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum IsoSupportLevels {
[Description("ISO 13499")] ISO_ONLY,
[Description("User specified channel codes")] TRANSITORY,
[Description("No ISO")] NO_ISO
}
```
Defines ISO 13499 channel code support levels.
#### `ImportFormats`
```csharp
public enum ImportFormats {
NOT_SPECIFIED = 1, DTS_XML = 2, ISF = 3, TSF = 4, DTS_CSV = 5,
TTS_XML = 6, CrashDesigner_XML = 7, E2X = 8, TTS_CSV = 9
}
```
Specifies supported import file formats with explicit integer values.
#### `TabControlOperation` / `RibbonControlOperation`
```csharp
public enum TabControlOperation { AddedItem, RemovedItem }
public enum RibbonControlOperation { AddedItem, RemovedItem }
```
Defines UI control modification operations.
#### `IncludeOverwriteName`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum IncludeOverwriteName { IncludedCheckBox, OverwriteCheckBox, ImportingTestSetupName }
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum ExportChoices { ExportType, UnfilteredEUCheckBox, FilteredEUCheckBox, MVCheckBox, ADCCheckBox }
```
Import/export UI selection options.
#### `UICultures`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum UICultures {
[DescriptionResource("UICultures_de-DE")] de_DE,
[DescriptionResource("UICultures_en-US")] en_US,
[DescriptionResource("UICultures_es-ES")] es_ES,
[DescriptionResource("UICultures_fr-FR")] fr_FR,
[DescriptionResource("UICultures_it-IT")] it_IT,
[DescriptionResource("UICultures_ja-JP")] ja_JP
}
```
Supported UI localization cultures.
#### `T0Mode`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum T0Mode {
[Description("DAS")] DAS = 0,
[Description("Test")] Test = 1
}
```
Defines T0 (time zero) reference mode.
#### `VelocityUnit`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum VelocityUnit {
[Description("EditTestSetupObjectMeta_VelocityUnit_KilometerPerHour")] KilometerPerHour = 0,
[Description("EditTestSetupObjectMeta_VelocityUnit_MeterPerSecond")] MeterPerSecond = 1
}
```
Velocity measurement units.
#### `ImportExtraStatus` / `PossibleStatus`
```csharp
public enum ImportExtraStatus { None, NormalizingIds, ReadingCalibrations, ReadingChannels, ReadingCustomerDetails, ReadingEngineerDetails, ReadingGroups, ReadingHardware, ReadingLabDetails, ReadingSensors, ReadingTestSetups, ReadingUsers, ReadingXML }
public enum PossibleStatus { Waiting, Working, Done, Failed, Reading, Importing }
```
Import operation status indicators.
#### `IsoViewMode`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum IsoViewMode {
[Description("ISOOnly")] ISOOnly,
[Description("ISOAndUserCode")] ISOAndUserCode,
[Description("UserCodeOnly")] UserCodeOnly,
[Description("ChannelNameOnly")] ChannelNameOnly
}
```
Channel display naming convention.
#### `PopupWindowImage`
```csharp
public enum PopupWindowImage { Warning = 0, Error = 1, Question = 2, Information = 3 }
```
Defines popup window icon types.
#### `UIItemStatus`
```csharp
public enum UIItemStatus { None, Success, Failed, Error, Warning }
```
UI item operation status.
#### `DigitalOutputModes`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum DigitalOutputModes {
[Description("Off")] NONE = 0,
[DescriptionResource("DigitalOutputMode_FVLH")] FVLH = 1 << 0,
[DescriptionResource("DigitalOutputMode_FVHL")] FVHL = 1 << 1,
[DescriptionResource("DigitalOutputMode_CCNO")] CCNO = 1 << 2,
[DescriptionResource("DigitalOutputMode_CCNC")] CCNC = 1 << 3
}
```
Digital output configuration modes (bitwise flags).
#### `DigitalInputModes`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum DigitalInputModes {
NONE = 1 << 0,
[DescriptionResource("DigitalInputMode_TLH")] TLH = 1 << 1,
[DescriptionResource("DigitalInputMode_THL")] THL = 1 << 2,
[DescriptionResource("DigitalInputMode_CCNO")] CCNO = 1 << 3,
[DescriptionResource("DigitalInputMode_CCNC")] CCNC = 1 << 4
}
```
Digital input configuration modes (bitwise flags).
#### `DataFlag`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum DataFlag {
[Description("None")] None = 0,
[Description("Normal")] Normal = 1,
[Description("Saturated")] Saturated = 2,
[Description("Zero Crossing Error")] ZeroCrossing = 3,
[Description("Broken Wire")] BrokenWire = 4,
[Description("Other")] Other = -1
}
```
Data quality/status flags for channel data.
#### `SquibMeasurementType` / `SquibFireMode`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum SquibMeasurementType { NONE = 0, CURRENT = 1 << 0, INIT_SIGNAL = 1 << 1, VOLTAGE = 1 << 2 }
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum SquibFireMode {
NONE = 1 << 0,
[DescriptionResource("SquibFireMode_Cap")] CAP = 1 << 1,
[DescriptionResource("SquibFireMode_CC")] CONSTANT = 1 << 2,
AC = 1 << 3
}
```
Squib (explosive initiator) configuration modes.
#### `SupportedExportFormatBitFlags`
```csharp
[Flags]
public enum SupportedExportFormatBitFlags {
none = 0x0, csvunfiltered = 0x1, diademadc = 0x2, isounfiltered = 0x4,
somatunfiltered = 0x8, tdmsadc = 0x10, toyotaunfiltered = 0x20, tsvunfiltered = 0x40,
csvfiltered = 0x80, isofiltered = 0x200, somatfiltered = 0x400, tdasadc = 0x800,
toyotafiltered = 0x1000, tsvfiltered = 0x2000, rdfadc = 0x4000, ChryslerDDAS = 0x8000,
HDFUnfiltered = 0x10000, HDFFiltered = 0x20000, HDFMV = 0x40000, HDFADC = 0x80000,
xlsxfiltered = 0x100000, xlsxunfiltered = 0x200000, CSVADC = 0x400000, CSVMV = 0x800000,
Ch10FilteredEU = 0x1000000, Ch10UnfilteredEU = 0x2000000, FIATASC = 0x4000000
}
```
Bitwise flags for supported export formats.
#### `UartBaudRate`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum UartBaudRate : uint {
_110 = 110, _300 = 300, _600 = 600, _1200 = 1200, _2400 = 2400,
_4800 = 4800, _9600 = 9600, _14400 = 14400, _19200 = 19200, _38400 = 38400,
_57600 = 57600, _115200 = 115200, _230400 = 230400, _460800 = 460800, _921600 = 921600
}
```
Standard UART baud rates; enum name prefixed with underscore, value equals actual baud rate.
#### `UDPStreamProfile`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum UDPStreamProfile : byte {
RTCStreaming = 0, DTS_UDP = 1, CH10_MANUAL_CONFIG = 2, CH10_PCM128_MM = 3,
CH10_ANALOG = 4, CH10_PCM_STANDARD = 5, CH10_PCM_SUPERCOM = 6,
CH10_PCM_128BIT_2HDR = 7, CH10_ANALOG_2HDR = 8, CH10_PCM_STANDARD_2HDR = 9,
CH10_PCM_SUPERCOM_2HDR = 10, TMNS_PCM_STANDARD = 11, TMNS_PCM_SUPERCOM = 12,
IENA_PTYPE_STREAM = 13, UART_STREAM = 14
}
```
UDP streaming profiles for data transmission (Chapter 10, TmNS, IENA formats).
#### `ExcitationVoltageOptions.ExcitationVoltageOption`
```csharp
public enum ExcitationVoltageOption {
[VoltageMagnitude(0.0)][Description("Undefined")] Undefined = 1,
[VoltageMagnitude(2.0)][Description("2.0")] Volt2 = 2,
[VoltageMagnitude(2.5)][Description("2.5")] Volt2_5 = 4,
[VoltageMagnitude(3.0)][Description("3.0")] Volt3 = 8,
[VoltageMagnitude(5.0)][Description("5.0")] Volt5 = 16,
[VoltageMagnitude(10.0)][Description("10.0")] Volt10 = 32,
[VoltageMagnitude(1.0)][Description("1.0")] Volt1 = 64
}
```
Sensor excitation voltage options with custom `VoltageMagnitudeAttribute` for extracting numerical values.
#### `RecordingModes`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum RecordingModes {
CircularBuffer, Recorder, HybridRecorder, S6A_DeviceStreamingOnly,
CircularBufferPlusUART, RecorderPlusUART, MultipleEventCircularBuffer,
MultipleEventRecorder, ContinuousRecorder, RecorderAndStreamSubSample,
CircularBufferAndStreamSubSample, Active, MultipleEventActive,
MultipleEventHybridRecorder, Streaming, Scheduled, Interval,
MultipleEventCircularBufferPlusUART, MultipleEventRecorderPlusUART,
ContinuousRecorderPlusUART, RAMActive, MultipleEventRAMActive,
RecordOnBoot, RecordOnBootPlusUART, MultipleEventHybridAndStream,
HybridAndStream, MultipleEventCircularBufferAndStream,
MultipleEventRecorderAndStream
}
```
DAS recording mode configurations.
#### `ApplicationStatusTypes`
```csharp
public enum ApplicationStatusTypes {
IDLE, SettingConfiguration, ClearingFlash, Arm, AutoArmPrepare,
WaitingForStart, WaitingForTrigger, WaitingForStartWithEvent,
WaitingForTriggerCheck, WaitingForAutoArm, WaitingForStreaming,
Passed, FailedStart, FailedTrigger, Done, FailedArm, FailedDisarm,
// ... (70+ total status values)
}
```
Comprehensive application state machine status values.
#### `FtssHeaderLine` / `XLSXExportHeaderLine`
```csharp
public enum FtssHeaderLine {
[Description("Headers")] Headers = 0,
[Description("Test Date")] TestDate,
// ... (30+ header line types)
}
```
Defines header line content for CSV and XLSX file exports.
#### `StreamDigitalFilterTypes`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum StreamDigitalFilterTypes {
NO_DSP_FILTER = 0,
CH10_IIR_6TH_OPTION_80X = 5,
CH10_FIR_45T65T_OPTION_80X = 6,
ALL_RT_IIR_6TH_OPTION_80X = 13,
ALL_RT_FIR_45T65T_OPTION_80X = 14
}
```
DSP IIR/FIR filter profiles for streaming data.
#### `CFCFilter`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum CFCFilter {
[Description("None")] None = 0,
[Description("Unfiltered")] Unfiltered = -2,
[Description("CFC 10")] Class10 = 17,
[Description("CFC 60")] Class60 = 100,
[Description("CFC 180")] Class180 = 300,
[Description("CFC 600")] Class600 = 1000,
[Description("CFC 1000")] Class1000 = 1650
}
```
SAE CFC (Channel Frequency Class) filter definitions per ISO 6487.
#### `ClockSyncProfile` / `InputClockSource` / `OutputClockSource`
```csharp
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum ClockSyncProfile : byte { None = 0, Manual, Slave_E2E, Master_E2E, Auto_E2E, /* 30+ profiles */ }
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum InputClockSource : byte { None = 0, PTP = 1 << 0, IRIG = 1 << 1, GPS = 1 << 2, OnePPS = 1 << 3, /* combinations */ }
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum OutputClockSource : byte { None = 0, PTP =

View File

@@ -0,0 +1,153 @@
---
source_files:
- Common/DTS.CommonCore/Events/LoginUserEvent.cs
- Common/DTS.CommonCore/Events/TextPastedEvent.cs
- Common/DTS.CommonCore/Events/BusyIndicatorChangeNotification.cs
- Common/DTS.CommonCore/Events/ComActiveEvent.cs
- Common/DTS.CommonCore/Events/CloseApplicationRequested.cs
- Common/DTS.CommonCore/Events/TabControlSelectionChanged.cs
- Common/DTS.CommonCore/Events/RaiseNotification.cs
- Common/DTS.CommonCore/Events/PageSetActiveEvent.cs
- Common/DTS.CommonCore/Events/GroupTemplateChangeNotification.cs
- Common/DTS.CommonCore/Events/DatabaseVersionChangedEvent.cs
- Common/DTS.CommonCore/Events/SetSaveButton.cs
- Common/DTS.CommonCore/Events/DBConnectionEvent.cs
- Common/DTS.CommonCore/Events/AutomaticModeStatusEvent.cs
- Common/DTS.CommonCore/Events/SetPageVisibilityEvent.cs
- Common/DTS.CommonCore/Events/LogoutUserEvent.cs
- Common/DTS.CommonCore/Events/PageNameEvent.cs
- Common/DTS.CommonCore/Events/TestEvent.cs
- Common/DTS.CommonCore/Events/PageSelectionChanged.cs
- Common/DTS.CommonCore/Events/UserEvent.cs
- Common/DTS.CommonCore/Events/ListViewStatusEvent.cs
- Common/DTS.CommonCore/Events/HelpTextEvent.cs
- Common/DTS.CommonCore/Events/PageModifiedEvent.cs
- Common/DTS.CommonCore/Events/FeedbackEvent.cs
- Common/DTS.CommonCore/Events/AssemblyListNotification.cs
- Common/DTS.CommonCore/Events/CancelProcess.cs
- Common/DTS.CommonCore/Events/TabControlSelectionEventArgs.cs
- Common/DTS.CommonCore/Events/SLICE6MulticastPropertyEvent.cs
- Common/DTS.CommonCore/Events/AppStatusEvent.cs
- Common/DTS.CommonCore/Events/PageErrorEvent.cs
- Common/DTS.CommonCore/Events/PageNavigationRequestEvent.cs
- Common/DTS.CommonCore/Events/ProgressBarEvent.cs
- Common/DTS.CommonCore/Events/NotificationContentEventArgs.cs
- Common/DTS.CommonCore/Events/ShowStatus.cs
generated_at: "2026-04-16T12:07:09.645358+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9cee3f5e2ea58fa5"
---
# Documentation: DTS.Common.Events
## 1. Purpose
This module defines the application-wide event aggregation contract for the DTS system using the Microsoft Prism Library (`Microsoft.Practices.Prism.Events`). It provides a centralized catalog of event types (`CompositePresentationEvent`) and their associated payload classes (EventArgs) to facilitate loosely-coupled communication between components. The events cover a broad range of concerns including user authentication, database connectivity, UI state management (busy indicators, tabs, notifications), hardware communication (COM status, SLICE6), and page lifecycle management.
## 2. Public Interface
### Event Classes
All event classes inherit from `CompositePresentationEvent` and are designed to be used with an `IEventAggregator`.
| Event Class | Payload Type | Description |
| :--- | :--- | :--- |
| **`AppStatusEvent`** | `AppStatusArg` (enum) | Notifies the application to mark itself as busy, available, or handle shutdown/close/logout states. |
| **`AppStatusExEvent`** | `AppStatusExArg` | Extended app status notification including the name of the process notifying the status. |
| **`AssemblyListNotification`** | `AssemblyListInfo` | Used to display notification content regarding assembly lists. |
| **`AssemblyListNotificationViewer`** | `AssemblyListInfo` | Viewer-specific event for assembly list notifications. |
| **`AutomaticModeStatusEvent`** | `AutomaticModeStatusEventArgs` | Informs the app that Automatic Mode status has changed. |
| **`BusyIndicatorChangeNotification`** | `bool` | Notifies changes to the busy indicator state. |
| **`CancelProcessEvent`** | `CancelProcess` | Used by services to display status or cancel the current process. |
| **`CloseApplicationRequested`** | `object` | Notifies subscribers that the application is requested to be closed. |
| **`CommActiveEvent`** | `ComStatusArg` (enum) | Informs the app that COM status has changed (CommandStart/ResponseStart). |
| **`DatabaseVersionChangedEvent`** | `DatabaseVersionChangedEventArgs` | Informs the app that the database version has changed. |
| **`DBConnectionEvent`** | `DBConnectionArg` | Informs the app about database connection status (Connected/DBName/Server). |
| **`FeedbackEvent`** | `FeedbackArg` | Informs the feedback page to update with severity and message. |
| **`GroupTemplateChangeNotification`** | `IBaseModel` | Notifies that the selected Group Template has changed. |
| **`HelpTextEvent`** | `HelpTextEventArg` | Handles tooltip events for help text. |
| **`ListViewStatusEvent`** | `ListViewStatusArg` | Notifies ListView status changes (Unloaded/ScrollToBottom). |
| **`LoginUserEvent`** | `LoginUserArg` | Event related to user login. |
| **`LogoutUserEvent`** | `LogoutUserArg` | Event related to user logout, includes reason (e.g., DatabaseSwitch). |
| **`PageErrorEvent`** | `PageErrorArg` | Surfaces page errors to the application. |
| **`PageModifiedEvent`** | `PageModifiedArg` | Notifies that a page has been modified, cleared, or saved. |
| **`PageNameEvent`** | `PageNameEventArg` | Informs the app that a page name has been updated. |
| **`PageNavigationRequestEvent`** | `PageNavigationRequest` | Requests navigation to a specific destination (Sensor/TestSetups). |
| **`PageSelectionChanged`** | `PageSelectionChangedArg` | Notifies that page selection has changed. |
| **`PageSetActiveEvent`** | `PageSetActiveEventArg` | Informs that a page has been set active. |
| **`ProgressBarEvent`** | `ProgressBarEventArg` | Notification event for progress bars (color, percentage, text, visibility). |
| **`RaiseNotification`** | `NotificationContentEventArgs` | Displays notification content (message, details, icon, title). |
| **`SetPageHeaderVisibilityEvent`** | `SetPageHeaderVisibilityEventArgs` | Sets the visibility of the page header. |
| **`SetSaveButton`** | `SaveButtonUsability` | Enables or disables the Save button. |
| **`ShowStatus`** | `StatusInfo` | Used by services to display current process status (Idle/Busy/Done). |
| **`SLICE6MulticastPropertyEventChanged`** | `SLICE6MulticastPropertyEventArgs` | Notifies changes to SLICE6 multicast properties. |
| **`TabControlSelectionChanged`** | `TabControlSelectionEventArgs` | Indicates that a TabControl's tab has been changed (Added/Removed). |
| **`TestEvent`** | `TestEventArg` | Informs the app that a test status has changed (Started/Ended). |
| **`TextPastedEvent`** | `ITextPastedEventArgs` | Handles text paste operations. |
| **`UserEvent`** | `UserEventArg` | Notifies user-related events (e.g., ViewingUserChanged). |
### Key Payload Classes & Arguments
* **`AppStatusArg` (enum)**: `Busy`, `Available`, `Shutdown`, `Close`, `UserLogout`.
* **`AppStatusExArg`**:
* `Status` (`AppStatusArg`): The status being notified.
* `Name` (`string`): Name of the process notifying.
* **`AutomaticModeStatusEventArgs`**:
* `TextSet` (`bool`): Default `false`.
* `Text` (`string`): Default `string.Empty`.
* **`CancelProcess`**:
* `IsBusy` (`bool`): Indicates if the process is busy.
* `ProcessId` (`int`): ID of the process.
* **`ComStatusArg` (enum)**: `CommandStart`, `ResponseStart`.
* **`DatabaseVersionChangedEventArgs`**:
* `Version` (`string`): The new version string.
* **`DBConnectionArg`**:
* `Connected` (`bool`).
* `DBName` (`string`).
* `Server` (`string`).
* **`FeedbackArg`**:
* `Severity` (`Severity` enum): `Information`, `Warning`, `Error`, `ResponseStarting`, `CommandStarting`.
* `Message` (`string`).
* **`ListViewStatusArg`**:
* `Status` (`ListViewStatus` enum): `Unloaded`, `ScrollToBottom`.
* `Id` (`string`).
* **`LogoutUserArg`**:
* `Reason` (`Reasons` enum): Currently only supports `DatabaseSwitch`.
* **`NotificationContentEventArgs`**:
* `Message` (`string`).
* `MessageDetails` (`string`).
* `Image` (`PopupWindowImage` enum): Default is `Error`.
* `Title` (`string`).
* **`PageErrorArg`**:
* `Errors` (`string[]`).
* `Page` (`object`).
* `Handled` (`bool`).
* **`PageModifiedArg`**:
* `PageStatus` (`Status` enum): `Clear`, `Modified`, `Saved`.
* `Page` (`object`).
* `Handled` (`bool`).
* **`PageNavigationRequest`**:
* `Destination` (`Destinations` enum): `Sensor`, `TestSetups`.
* `DestinationArg` (`object`).
* `Caller` (`object`).
* **`ProgressBarEventArg`**:
* `ProgressBarName` (`string`): Default constructor sets to "Footer".
* `ProgressBarColor` (`Color`).
* `ProgressBarPercentage` (`double`).
* `ProgressBarText` (`string`).
* `ProgressBarVisibility` (`Visibility`).
* Boolean flags: `SetPercentage`, `SetText`, `SetVisibility`.
* **`StatusInfo`**:
* `CurrentState` (`StatusState` enum): `Idle`, `Busy`, `DoneNoError`, `DoneFailed`.
* `IsBusy` (`bool`): Calculated property (true if `Busy`).
* `IsOk` (`bool`).
* `Percentage` (`decimal`).
* `Text` (`string`).
* `ProcessId` (`int`).
* Method: `Unsubscribe(ShowStatus showStatus)` (Resets Text and State).
* **`TabControlSelectionEventArgs`**:
* `Operation` (`TabControlOperation`).
* `Item` (`object`).
### Special Methods
* **`PageErrorEvent.SurfaceApplicationError(string msg)`**
* A `static` helper method that resolves `IEventAg

View File

@@ -0,0 +1,44 @@
---
source_files:
- Common/DTS.CommonCore/Exceptions/OutOfDataException.cs
generated_at: "2026-04-16T12:01:09.381744+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "fdc72f1eddeb3763"
---
# Documentation: OutOfDataException
## 1. Purpose
This module defines a custom exception class, `OutOfDataException`, within the `DTS.Common.Exceptions` namespace. It is designed to signal that a read operation has attempted to access data beyond the available bounds of a stream or buffer. It extends the standard `System.Exception` class by capturing the specific location (`Index`) where the failure occurred, facilitating easier debugging of data parsing or deserialization errors.
## 2. Public Interface
### Class: `OutOfDataException`
Inherits from: `System.Exception`
**Constructor**
```csharp
public OutOfDataException(string ex, long index)
```
Initializes a new instance of the `OutOfDataException` class.
* `string ex`: The message that describes the error (passed to the base `Exception` class).
* `long index`: The position in the data stream or buffer where the out-of-bounds access occurred.
**Properties**
```csharp
public long Index { get; private set; }
```
Gets the numerical index where the data exhaustion was detected. This property is read-only from outside the class.
## 3. Invariants
* **Immutability of Index:** Once an instance of `OutOfDataException` is created, the `Index` property cannot be modified externally (the setter is `private`).
* **Base Type Guarantee:** The type always behaves as a standard CLR exception regarding stack traces and HResult, as it inherits directly from `System.Exception`.
## 4. Dependencies
* **Dependencies:** This module depends on `System` (specifically `System.Exception`).
* **Dependents:** Unknown from the source file alone, but intended for use by data readers, parsers, or stream processors within the `DTS` codebase.
## 5. Gotchas
* **Misleading Parameter Name:** The constructor argument `string ex` uses a naming convention typically reserved for an inner exception object (e.g., `Exception ex`). However, in this signature, it represents the exception message string. Developers might mistakenly expect a constructor signature of `(string message, Exception innerException)`.
* **Serialization Support:** The class does not explicitly implement the `ISerializable` pattern (a serialization constructor is missing). If this exception needs to be serialized (e.g., crossing AppDomain boundaries), the `Index` property may be lost depending on the serialization mechanism used.

View File

@@ -0,0 +1,360 @@
---
source_files:
- Common/DTS.CommonCore/Interface/ITabView.cs
- Common/DTS.CommonCore/Interface/IMainView.cs
- Common/DTS.CommonCore/Interface/IMenuView.cs
- Common/DTS.CommonCore/Interface/IShellView.cs
- Common/DTS.CommonCore/Interface/INavigationView.cs
- Common/DTS.CommonCore/Interface/IViewerShellView.cs
- Common/DTS.CommonCore/Interface/ITabViewModel.cs
- Common/DTS.CommonCore/Interface/IMenuViewModel.cs
- Common/DTS.CommonCore/Interface/INavigationViewModel.cs
- Common/DTS.CommonCore/Interface/IPluginComponent.cs
- Common/DTS.CommonCore/Interface/IShellViewModel.cs
- Common/DTS.CommonCore/Interface/IViewerShellViewModel.cs
- Common/DTS.CommonCore/Interface/IMainViewModel.cs
- Common/DTS.CommonCore/Interface/IAssemblyInfo.cs
- Common/DTS.CommonCore/Interface/IDataPROPage.cs
generated_at: "2026-04-16T11:57:51.242968+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c067eaab6be3056e"
---
# Documentation: DTS.Common.Interface Namespace
## 1. Purpose
This module defines the core abstraction layer for the DTS application's WPF-based UI framework, establishing the view and view-model contracts that implement the Model-View-ViewModel (MVVM) pattern. It provides interfaces for shell containers, navigation components, tab views, menu systems, plugin integration, and DataPRO page definitions. These interfaces enable loose coupling between UI components and their consumers, supporting a modular, plugin-friendly architecture.
---
## 2. Public Interface
### View Interfaces
#### `ITabView`
```csharp
public interface ITabView : IBaseView { }
```
Marker interface for tab view components. Inherits from `IBaseView`.
#### `IMainView`
```csharp
public interface IMainView : IBaseView { }
```
Marker interface for main view components. Inherits from `IBaseView`.
#### `IMenuView`
```csharp
public interface IMenuView : IBaseView { }
```
Marker interface for menu view components. Inherits from `IBaseView`.
#### `IShellView`
```csharp
public interface IShellView : IBaseWindow { }
```
Marker interface for shell window views. **Note:** Inherits from `IBaseWindow`, not `IBaseView`.
#### `INavigationView`
```csharp
public interface INavigationView : IBaseView { }
```
Marker interface for navigation view components. Inherits from `IBaseView`.
#### `IViewerShellView`
```csharp
public interface IViewerShellView : IBaseView { }
```
Marker interface for viewer shell view components. Inherits from `IBaseView`.
---
### ViewModel Interfaces
#### `ITabViewModel`
```csharp
public interface ITabViewModel : IBaseViewModel
{
ITabView View { get; }
}
```
Contract for tab view models. Provides access to the associated `ITabView` instance.
#### `IMenuViewModel`
```csharp
public interface IMenuViewModel : IBaseViewModel
{
IMenuView View { get; }
}
```
Contract for menu view models. Provides access to the associated `IMenuView` instance.
#### `INavigationViewModel`
```csharp
public interface INavigationViewModel : IBaseViewModel
{
INavigationView NavigationView { get; }
}
```
Contract for navigation view models. Provides access to the associated `INavigationView` instance via `NavigationView` property.
#### `IShellViewModel`
```csharp
public interface IShellViewModel : IBaseWindowModel
{
IShellView View { get; }
List<FrameworkElement> GetRegions();
object ContextMainRegion { get; set; }
}
```
Contract for shell view models. Inherits from `IBaseWindowModel`. Provides:
- `View`: The associated `IShellView` instance
- `GetRegions()`: Returns a list of `FrameworkElement` regions
- `ContextMainRegion`: Gets/sets the main region context object
#### `IViewerShellViewModel`
```csharp
public interface IViewerShellViewModel : IBaseViewModel
{
IViewerShellView View { get; }
List<FrameworkElement> GetRegions();
Object ContextMainRegion { get; set; }
}
```
Contract for viewer shell view models. Inherits from `IBaseViewModel`. Provides:
- `View`: The associated `IViewerShellView` instance
- `GetRegions()`: Returns a list of `FrameworkElement` regions
- `ContextMainRegion`: Gets/sets the main region context object
#### `IMainViewModel`
```csharp
public interface IMainViewModel : IBaseViewModel
{
IBaseView View { get; }
object ContextNavigationRegion { get; set; }
object ContextGraphRegion { get; set; }
object ContextTestsRegion { get; set; }
object ContextGraphsRegion { get; set; }
object ContextLegendRegion { get; set; }
object ContextDiagRegion { get; set; }
object ContextStatsRegion { get; set; }
object ContextCursorRegion { get; set; }
object ContextPropertyRegion { get; set; }
List<FrameworkElement> GetRegions();
}
```
Contract for main view models with multiple named regions. Provides context properties for: Navigation, Graph, Tests, Graphs, Legend, Diag, Stats, Cursor, and Property regions.
---
### Plugin Interface
#### `IPluginComponent`
```csharp
public interface IPluginComponent
{
string ProgId { get; }
}
```
Contract for plugin modules. The `ProgId` property provides a program identifier used to instantiate the plugin object.
---
### Assembly Metadata Interfaces and Attributes
#### `IAssemblyImageAttribute`
```csharp
public interface IAssemblyImageAttribute
{
string AssemblyName { get; }
BitmapImage AssemblyImage { get; }
eAssemblyRegion AssemblyRegion { get; }
Type GetType();
BitmapImage GetAssemblyImage();
string GetAssemblyName();
eAssemblyRegion GetAssemblyRegion();
}
```
#### `ImageAttribute` (Abstract)
```csharp
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public abstract class ImageAttribute : Attribute, IAssemblyImageAttribute
{
public abstract string AssemblyName { get; }
public abstract string AssemblyGroup { get; }
public abstract eAssemblyRegion AssemblyRegion { get; }
public abstract BitmapImage AssemblyImage { get; }
public abstract Type GetAttributeType();
public abstract BitmapImage GetAssemblyImage();
public abstract string GetAssemblyName();
public abstract string GetAssemblyGroup();
public abstract eAssemblyRegion GetAssemblyRegion();
}
```
Abstract attribute for assembly-level image metadata. Restricted to single instance per assembly.
#### `IAssemblyNameAttribute`
```csharp
public interface IAssemblyNameAttribute
{
String AssemblyName { get; }
Type GetType();
string GetAssemblyName();
}
```
#### `TextAttribute` (Abstract)
```csharp
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public abstract class TextAttribute : Attribute, IAssemblyNameAttribute
{
public abstract string AssemblyName { get; }
public abstract Type GetAttributeType();
public abstract string GetAssemblyName();
}
```
Abstract attribute for assembly-level name metadata. Restricted to single instance per assembly.
---
### DataPRO Page Interface
#### `IDataPROPage`
```csharp
public interface IDataPROPage : INotifyPropertyChanged
```
Comprehensive interface for DataPRO UI pages. Key members include:
**Properties:**
| Property | Type |
|----------|------|
| `TestSetupChangeButtonVisible` | `Visibility` |
| `AutomaticModeStatusVisible` | `Visibility` |
| `PageName` | `string` |
| `PageImage` | `ImageSource` |
| `IsAdd` | `bool` |
| `UsesModifyEnhancements` | `bool` |
| `EditIDString` | `string` |
| `AddIDString` | `string` |
| `ModifiedObjectName` | `string` |
| `AutomaticProgression` | `bool` |
| `RecoveryDownloadMode` | `bool` |
| `UniqueId` | `string` (read-only) |
| `TileColor` | `Color` (read-only) |
| `CurrentSearchTerm` | `string` |
| `UsesNAVControl` | `bool` |
| `UsesSearchControl` | `bool` |
| `UsesSelectControl` | `bool` |
| `HasBackButton` | `bool` |
| `HasRefreshButton` | `bool` |
| `HasCancelButton` | `bool` |
| `HasSaveButton` | `bool` |
| `HasNextButton` | `bool` |
| `ContentBackgroundColor` | `Color` |
| `MainContent` | `object` |
| `ControlInOnSetActive` | `bool` |
**Methods:**
- `string GetName()`
- `long GetID()`
- `void SetID(long id)`
- `void SetTileColor(Color c)`
- `void SavePage(object obj)`
- `void ClearSearchTerm()`
- `void SetEnabled(bool bEnable)`
- `void VerifyProgress(object o)`
- `void SaveAndExit()`
- `void RefreshButtonPressed()`
- `void SetDoneButtonIsEnabled(bool bEnabled)`
- `void SetBackButtonIsEnabled(bool bEnabled)`
- `void DoneButtonPress()`
- `void SetCancelEnabled(bool bEnabled)`
- `ContentControl GetMainContentControl()`
- `void SetReturning()`
- `bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow)`
- `bool OKToProceed()`
- `void FormClosing(Action OnComplete = null)`
- `void OnSetActive()`
- `void UnSet()`
- `void SetCurrentItem(object o)`
- `void SetupPageAvailable()`
#### `DataProPageProperties` (Enum)
```csharp
public enum DataProPageProperties
{
UsesModifyEnhancements,
TestSetupChangeButtonVisible,
AutomaticModeStatusVisible,
PageName,
PageImage,
IsAdd,
EditIDString,
AddIDString,
ModifiedObjectName,
AutomaticProgression,
RecoveryDownloadMode,
UsesNAVControl,
UsesSearchControl,
UsesSelectControl,
HasBackButton,
HasRefreshButton,
HasCancelButton,
HasSaveButton,
HasNextButton,
ContentBackgroundColor,
MainContent,
GenerateReportsVisible
}
```
Enumeration of mutable `IDataPROPage` properties that may require external observation or reaction.
---
## 3. Invariants
- **View Hierarchy**: All view interfaces (`ITabView`, `IMainView`, `IMenuView`, `INavigationView`, `IViewerShellView`) inherit from `IBaseView`, except `IShellView` which inherits from `IBaseWindow`.
- **ViewModel Hierarchy**: All view-model interfaces inherit from `IBaseViewModel`, except `IShellViewModel` which inherits from `IBaseWindowModel`.
- **Attribute Restrictions**: `ImageAttribute` and `TextAttribute` are decorated with `[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]`, meaning they can only be applied to assemblies and only one instance of each is permitted per assembly.
- **Abstract Attributes**: Both `ImageAttribute` and `TextAttribute` are abstract classes; concrete implementations must override all abstract members.
- **IDataPROPage Identity**: `UniqueId` and `TileColor` are read-only properties; values must be set via `SetID(long)` and `SetTileColor(Color)` methods respectively.
- **IDataPROPage Validation**: The `Validate` method accepts errors and warnings by reference, suggesting callers must initialize these lists before invocation.
---
## 4. Dependencies
### External Dependencies (Inferred from imports)
- **`DTS.Common.Base`** - Provides base interfaces: `IBaseView`, `IBaseWindow`, `IBaseViewModel`, `IBaseWindowModel`
- **`System.Windows`** - For `FrameworkElement`, `Visibility`, `ContentControl`, `DependencyObject`, `UIElement`
- **`System.Windows.Media`** - For `ImageSource`, `Color`
- **`System.Windows.Media.Imaging`** - For `BitmapImage`
- **`System.ComponentModel`** - For `INotifyPropertyChanged`
- **`System.Collections.Generic`** - For `List<T>`
- **`System`** - For `Type`, `Object`, `String`, `Action`, `Attribute`
### Consumers
- Unknown from source alone. These interfaces are likely consumed by:
- Concrete view and view-model implementations
- Plugin modules implementing `IPluginComponent`
- Assembly metadata classes deriving from `ImageAttribute` or `TextAttribute`
- Page implementations conforming to `IDataPROPage`
---
## 5. Gotchas
1. **IShellView Base Interface Difference**: `IShellView` inherits from `IBaseWindow` while all other view interfaces inherit from `IBaseView`. This suggests shell views represent top-level windows rather than embedded controls.
2. **INavigationViewModel Property Naming Inconsistency**: `INavigationViewModel` exposes `NavigationView` property, while `ITabViewModel`, `IMenuViewModel`, `IViewerShellViewModel`, and `IShellViewModel` expose `View` property. This naming inconsistency may cause confusion.
3. **IDataPROPage Interface Size**: The `IDataPROPage` interface is exceptionally large (30+ members), violating the Interface Segregation Principle. Implementers must provide all members even if some are unused.
4. **Mixed Property/Method Patterns in IDataPROPage**: Some state is accessed via properties (e.g., `TileColor` is read-only property) while similar state requires methods (e.g., `SetTileColor(Color)`). The `UniqueId` property has no corresponding setter method visible, but `SetID(long)` exists for a numeric ID.
5. **eAssemblyRegion Type Undefined**: The `eAssemblyRegion` enum type is referenced in `IAssemblyImageAttribute` and `ImageAttribute` but is not defined in the provided source files. Its definition must exist elsewhere in `DTS.Common.Base` or another namespace.
6. **IDataPROPage.Validate Ref Parameters**: The `Validate` method uses `ref` parameters for error/warning lists, requiring callers to initialize collections before calling. Failure to do so would result in compiler error or runtime issues.

View File

@@ -0,0 +1,126 @@
---
source_files:
- Common/DTS.CommonCore/Interface/BuildTestSetup/IBuildTestSetup.cs
generated_at: "2026-04-16T12:17:19.769596+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5d29553a439a7fc1"
---
# Documentation: IBuildTestSetup
## 1. Purpose
The `IBuildTestSetup` interface defines a data contract for configuring a "Build Test Setup" within the DTS system. It appears to model the configuration state for a Data Acquisition System (DAS) test execution, encapsulating settings for hardware checks (voltage, squib resistance, sensors), data acquisition parameters (sampling rates, triggers), data export formats (CSV, HDF, ISO, etc.), and user interface behaviors. By inheriting from `INotifyPropertyChanged`, it is designed to support data-binding scenarios, likely for a configuration UI or view model where property changes must notify observers.
## 2. Public Interface
The interface contains the following members. All properties are read/write.
**Identification & Metadata**
* `string DASSerialNumber { get; set; }`: Serial number of the DAS unit.
* `string SetupName { get; set; }`: Name of the test setup configuration.
* `string SetupDescription { get; set; }`: Description of the test setup.
* `string LastModified { get; set; }`: Timestamp of the last modification.
* `string LastModifiedBy { get; set; }`: User who last modified the setup.
**Execution Modes & Timing**
* `string AutomaticMode { get; set; }`: Setting for automatic operation mode.
* `string AutomaticModeDelay { get; set; }`: Delay duration for automatic mode.
* `string RecordingMode { get; set; }`: Defines how recording is handled.
* `string SamplesPerSecond { get; set; }`: Sampling rate configuration.
* `string PreTriggerSeconds { get; set; }`: Duration of pre-trigger data capture.
* `string PostTriggerSeconds { get; set; }`: Duration of post-trigger data capture.
* `string NumberOfEvents { get; set; }`: Number of events to capture.
* `string WakeUpMotionTimeout { get; set; }`: Timeout setting for wake-up motion.
* `string Streaming { get; set; }`: Streaming configuration.
**User Interface & Behavior**
* `string ViewRealtime { get; set; }`: Flag/setting to view data in realtime.
* `string WarnOnBatteryFail { get; set; }`: Flag to warn if battery fails.
* `string StrictDiagnostics { get; set; }`: Enables strict diagnostic checks.
* `string RequireConfirmationOnErrors { get; set; }`: UI behavior for error handling.
* `string QuitTestWithoutWarning { get; set; }`: Flag to suppress quit warnings.
* `string CommonStatusLine { get; set; }`: Status line text.
* `string RealtimeCharts { get; set; }`: Configuration for realtime charts.
**Hardware Checks & Diagnostics**
* `string PerformArmChecklist { get; set; }`: Flag to perform arming checklist.
* `string CheckInputVoltage { get; set; }`: Enables input voltage check.
* `string CheckBatteryVoltage { get; set; }`: Enables battery voltage check.
* `string CheckSquibResistance { get; set; }`: Enables squib resistance check.
* `string MeasureSquibResistances { get; set; }`: Enables squib resistance measurement.
* `string CheckSensorIds { get; set; }`: Enables sensor ID verification.
* `string CheckStartEventLines { get; set; }`: Enables start event line checks.
* `string CheckTiltSensor { get; set; }`: Enables tilt sensor check.
* `string CheckTemperature { get; set; }`: Enables temperature check.
* `string RequireAllUnitsPassArmCheckList { get; set; }`: Validation rule for arming.
* `string PostTestDiagnostics { get; set; }`: Post-test diagnostic settings.
* `string CalibrationBehavior { get; set; }`: Defines calibration actions.
* `string TriggerCheckStep { get; set; }`: Trigger check configuration.
**Data Management (Download/ROI/Upload)**
* `string ROIDownload { get; set; }`: Region of Interest download setting.
* `string ViewROIDownload { get; set; }`: UI setting for viewing ROI downloads.
* `string DownloadAll { get; set; }`: Flag to download all data.
* `string ViewDownloadAll { get; set; }`: UI setting for viewing full downloads.
* `string ROIStart { get; set; }`: Start time/point for Region of Interest.
* `string ROIEnd { get; set; }`: End time/point for Region of Interest.
* `string DownloadFolder { get; set; }`: Target directory for downloads.
* `string UploadData { get; set; }`: Flag to enable data upload.
* `string UploadDataFolder { get; set; }`: Source directory for uploads.
**Export Configuration**
* `string Export { get; set; }`: General export setting.
* `string ExportFolder { get; set; }`: Destination directory for exports.
* `string ExportCh10FilteredEUDesired { get; set; }`: Export flag for filtered Ch10 EU data.
* `string ExportChryslerDDASDesired { get; set; }`: Export flag for Chrysler DDAS format.
* `string ExportCSVADCDesired { get; set; }`: Export flag for CSV ADC format.
* `string ExportCSVFilteredDesired { get; set; }`: Export flag for filtered CSV.
* `string ExportCSVMVDesired { get; set; }`: Export flag for CSV MV format.
* `string ExportCSVUnfilteredDesired { get; set; }`: Export flag for unfiltered CSV.
* `string ExportDiademADCDesired { get; set; }`: Export flag for Diadem ADC format.
* `string ExportHDFADCDesired { get; set; }`: Export flag for HDF ADC format.
* `string ExportHDFMVDesired { get; set; }`: Export flag for HDF MV format.
* `string ExportHDFUnfilteredDesired { get; set; }`: Export flag for unfiltered HDF.
* `string ExportISOFilteredDesired { get; set; }`: Export flag for filtered ISO format.
* `string ExportISOUnfilteredDesired { get; set; }`: Export flag for unfiltered ISO format.
* `string ExportRDFADCDesired { get; set; }`: Export flag for RDF ADC format.
* `string ExportTDASADCDesired { get; set; }`: Export flag for TDAS ADC format.
* `string ExportTDMSADCDesired { get; set; }`: Export flag for TDMS ADC format.
* `string ExportToyotaUnfilteredDesired { get; set; }`: Export flag for unfiltered Toyota format.
* `string ExportTSVFilteredDesired { get; set; }`: Export flag for filtered TSV.
* `string ExportTSVUnfilteredDesired { get; set; }`: Export flag for unfiltered TSV.
* `string ExportXLSXFilteredDesired { get; set; }`: Export flag for filtered XLSX.
* `string ExportXLSXUnfilteredDesired { get; set; }`: Export flag for unfiltered XLSX.
* `string ExportASCDesired { get; set; }`: Export flag for ASC format.
**Miscellaneous Configuration**
* `string AllowSensorIdToBlankChannel { get; set; }`: Permission setting for sensor IDs.
* `string ExcitationWarmupTimeMS { get; set; }`: Warmup time in milliseconds.
* `string UseLabDetails { get; set; }`: Flag to use lab details.
* `string UseCustomerDetails { get; set; }`: Flag to use customer details.
* `string UseTestEngineerDetails { get; set; }`: Flag to use test engineer details.
* `string AllowMissingSensors { get; set; }`: Permission to proceed with missing sensors.
* `string SuppressMissingSensorsWarning { get; set; }`: UI warning suppression.
* `string NotAllChannelsRealTime { get; set; }`: Setting regarding realtime channel limits.
* `string NotAllChannelsViewer { get; set; }`: Setting regarding viewer channel limits.
* `string UserTags { get; set; }`: User-defined tags for the setup.
* `string AutoArm { get; set; }`: Auto-arm feature setting.
**Complex Types**
* `List<GroupXMLClass> Groups { get; set; }`: A list of groups, presumably defining channel groups or sensor groupings, utilizing the `DTS.Common.XMLUtils.GroupXMLClass` type.
## 3. Invariants
* **INotifyPropertyChanged Contract:** Any class implementing `IBuildTestSetup` must implement the `PropertyChanged` event (from `System.ComponentModel`). Consumers expect this event to be raised when any of the string properties or the `Groups` list is modified.
* **String-based Values:** Despite many properties representing numeric values (e.g., `SamplesPerSecond`), boolean flags (e.g., `CheckInputVoltage`), or enumerations, the interface defines them strictly as `string`. Implementations may require parsing/validation logic to convert these to appropriate types for internal use.
## 4. Dependencies
* **System.ComponentModel:** Required for the `INotifyPropertyChanged` interface.
* **System.Collections.Generic:** Required for the `List` generic collection used by the `Groups` property.
* **DTS.Common.XMLUtils:** Required for the `GroupXMLClass` type used in the `Groups` property.
* **Consumers:** Unknown from the source alone, but likely includes ViewModels, Serializers (XML/JSON), and Test Configuration managers within the DTS ecosystem.
## 5. Gotchas
* **"Stringly-Typed" Configuration:** The interface uses `string` for almost all properties, including those that logically represent numbers (`ExcitationWarmupTimeMS`, `SamplesPerSecond`) or boolean flags (`AutoArm`, `CheckBatteryVoltage`). This suggests a lack of strong typing which could lead to runtime parsing errors or invalid state representation (e.g., setting `SamplesPerSecond` to "abc").
* **Commented-Out Properties:** The source contains several commented-out properties (e.g., `ExportFormat`, `ExportCh10UnfilteredEUDesired`, `ExportSomatFilteredDesired`). This indicates legacy features or deprecated export formats that were removed from the interface contract but not cleaned up, which may cause confusion regarding supported features.
* **Naming Inconsistencies:** Some export properties end in `Desired` (e.g., `ExportCSVADCDesired`), implying a request or preference, whereas others (like `Export`) do not. The semantic difference between `Export` and the specific `Export[Format]Desired` properties is not defined in the interface.

View File

@@ -0,0 +1,279 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Channels/IChannelSettingRecord.cs
- Common/DTS.CommonCore/Interface/Channels/IGroupChannelSettingRecord.cs
- Common/DTS.CommonCore/Interface/Channels/IChannelCode.cs
- Common/DTS.CommonCore/Interface/Channels/IChannelSetting.cs
- Common/DTS.CommonCore/Interface/Channels/IChannelDbRecord.cs
- Common/DTS.CommonCore/Interface/Channels/IGroupChannel.cs
generated_at: "2026-04-16T12:23:05.212303+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "cbc4fb29d29bc466"
---
# Channel Interfaces Documentation
## 1. Purpose
This module defines the core abstraction layer for channel management in the DTS (Data Test System) application. It provides interfaces for channel configuration, settings persistence, and group channel operations. These interfaces serve as the contract between the database layer, business logic, and UI components for managing physical measurement channels, sensor assignments, hardware configurations, and various channel types (analog, digital, squib, UART, stream, etc.) within test setups.
---
## 2. Public Interface
### IChannelSettingRecord
Simple data contract for a channel setting type definition.
| Member | Type | Description |
|--------|------|-------------|
| `Id` | `int` | Unique identifier for the setting record. |
| `SettingName` | `string` | Name of the setting. |
| `DefaultValue` | `string` | Default value for the setting. |
---
### IGroupChannelSettingRecord
Associates a setting value with a specific channel.
| Member | Type | Description |
|--------|------|-------------|
| `ChannelId` | `long` | ID of the channel this setting applies to. |
| `SettingId` | `int` | ID of the setting type. |
| `SettingValue` | `string` | The value assigned to this setting. |
---
### IChannelCode
Represents a channel code with its metadata.
| Member | Type | Description |
|--------|------|-------------|
| `Id` | `int` | Unique identifier (read-only). |
| `Code` | `string` | The code string (read-only). |
| `Name` | `string` | Display name (read-only). |
| `CodeType` | `ChannelEnumsAndConstants.ChannelCodeType` | Type classification of the code (read-only). |
---
### IChannelSetting
Represents a configurable setting on a channel with typed value access.
| Member | Type | Description |
|--------|------|-------------|
| `ChannelId` | `long` | ID of the associated channel. |
| `SettingTypeId` | `int` | Type identifier for this setting (read-only). |
| `SettingName` | `string` | Name of the setting (read-only). |
| `DefaultValue` | `string` | Default value (read-only). |
| `Value` | `string` | Current string value. |
| `IntValue` | `int` | Integer representation of the value. |
| `DoubleValue` | `double` | Double representation of the value. |
| `BoolValue` | `bool` | Boolean representation of the value. |
| `Clone()` | `IChannelSetting` | Creates a copy of this setting. |
---
### IChannelDbRecord
Interface describing a Channel record as stored in the database. Includes Entity Framework data annotations.
| Member | Type | Description |
|--------|------|-------------|
| `Id` | `long` | Primary key, mapped to column "Id". |
| `GroupId` | `int` | ID of the group this channel belongs to. |
| `IsoCode` | `string` | ISO standard code for the channel. |
| `IsoChannelName` | `string` | ISO standard channel name. |
| `UserCode` | `string` | User-defined code. |
| `UserChannelName` | `string` | User-defined channel name. |
| `DASId` | `int` | Data Acquisition System ID. |
| `DASChannelIndex` | `int` | Physical channel index on the DAS. |
| `GroupChannelOrder` | `int` | Ordering within the group. |
| `TestSetupOrder` | `int` | Ordering within the test setup. |
| `SensorId` | `int` | ID of the assigned sensor. |
| `Disabled` | `bool` | Whether the channel is disabled. |
| `LastModified` | `DateTime` | Timestamp of last modification. |
| `LastModifiedBy` | `string` | User who last modified the record. |
---
### IGroupChannel
Primary interface for channel operations, extending `IChannelDbRecord` and `IComparable<IGroupChannel>`. Contains extensive properties and methods for channel configuration.
#### Key Properties
| Member | Type | Description |
|--------|------|-------------|
| `RangeLowG` | `SensorConstants.AvailableRangesLowG` | Low-G range setting. |
| `VoltageInsertionSensor` | `bool` | Indicates if channel has a calibration-less voltage measurement channel (read-only). |
| `RangeModifiableSensorLowG` | `bool` | Whether channel has an embedded range modifiable low-g sensor (read-only). |
| `RangeModifiableSensorARS` | `bool` | Whether channel has an embedded range modifiable ARS sensor (read-only). |
| `AvailableInitialOffsets` | `InitialOffset[]` | Available initial offsets (requires sensor with calibration). |
| `IEPESupport` | `string` | IEPE support status (read-only). |
| `Group` | `IGroup` | The group this channel belongs to. |
| `GroupName` | `string` | Display name of the group. |
| `GroupNameValid` | `bool` | Whether the group name is valid. |
| `IsoCodeValid` | `bool` | Whether ISO code is set. |
| `IsoChannelNameValid` | `bool` | Whether ISO channel name is set. |
| `UserCodeValid` | `bool` | Whether user code is set. |
| `UserChannelNameValid` | `bool` | Whether user channel name is set. |
| `HardwareValid` | `bool` | Whether hardware has been assigned (read-only). |
| `HardwareId` | `string` | Legacy hardware identifier in format `[das serial]:[channel index]`. |
| `TestSampleRate` | `double` | Sample rate of the associated DAS. |
| `SensorValid` | `bool` | Whether a sensor has been assigned (read-only). |
| `IsDisabled` | `bool` | Whether channel should be used for data collection. |
| `CanMoveUp` / `CanMoveDown` | `bool` | UI state for ordering controls. |
| `DeleteShouldBeEnabled` | `bool` | UI state for delete button. |
| `RemoveSensorVisibility` | `System.Windows.Visibility` | UI visibility state. |
| `PasteCommand` | `ICommand` | Command for paste operations. |
| `ChannelSettings` | `IChannelSetting[]` | Array of channel settings (range, polarity, etc.). |
| `Hardware` | `string` | UI display string for hardware. |
| `Sensor` | `string` | UI display string for sensor (read-only). |
| `SensorData` | `ISensorData` | Sensor data object (read-only). |
| `HardwareChannel` | `IHardwareChannel` | Assigned hardware channel (read-only). |
| `DragAndDropItem` | `IDragAndDropItem` | Drag-and-drop item (read-only). |
| `SensorCalibration` | `ISensorCalibration` | Sensor calibration data (read-only). |
| `HasEID` | `bool` | Whether channel has EID (read-only). |
| `Range` | `double` | Range setting value. |
| `Capacity` | `double` | Capacity of the sensor (read-only). |
| `FilterClass` | `IFilterClass` | Filter class setting (FB 13120). |
| `Polarity` | `string` | Polarity setting. |
| `Units` | `string` | Units (read-only). |
| `ZeroMethod` | `ZeroMethodType` | Zero method type. |
| `ZeroMethodStart` / `ZeroMethodEnd` | `double` | Zero method time range. |
| `Sensitivity` | `string` | Sensitivity (read-only). |
| `InitialOffset` | `InitialOffset` | Initial offset setting. |
#### Squib/Digital Output Properties
| Member | Type | Description |
|--------|------|-------------|
| `SquibLimitDuration` | `bool` | Whether squib duration is limited. |
| `SquibDuration` | `double` | Squib duration value. |
| `SquibDelay` | `double?` | Squib delay (nullable for UI purposes - FB 14623). |
| `SquibCurrent` | `double` | Squib current value. |
| `SquibFireMode` | `SquibFireMode` | Fire mode setting. |
| `DigitalOutLimitDuration` | `bool` | Whether digital out duration is limited. |
| `DigitalOutDuration` | `double` | Digital out duration. |
| `DigitalOutDurationMax` | `double` | Maximum allowed digital out duration (FB 28107). |
| `DigitalOutDelay` | `double` | Digital out delay. |
| `DigitalOutputMode` | `DigitalOutputModes` | Output mode setting. |
| `DigitalInputMode` | `DigitalInputModes` | Input mode setting. |
| `ActiveValue` | `string` | Active value setting. |
| `DefaultValue` | `string` | Default value setting. |
#### UART Properties
| Member | Type | Description |
|--------|------|-------------|
| `UartBaudRate` | `uint` | Baud rate. |
| `UartDataBits` | `uint` | Data bits. |
| `UartStopBits` | `StopBits` | Stop bits configuration. |
| `UartParity` | `Parity` | Parity configuration. |
| `UartFlowControl` | `Handshake` | Flow control (read-only, always NONE per FB 30486). |
| `UartDataFormat` | `UartDataFormat` | Data format. |
#### Stream Properties
| Member | Type | Description |
|--------|------|-------------|
| `StreamInUDPAddress` | `string` | UDP address for stream input. |
| `StreamOutUDPProfile` | `UDPStreamProfile` | UDP profile for stream output. |
| `StreamOutUDPAddress` | `string` | UDP address for stream output. |
| `StreamOutUDPTimeChannelId` | `ushort` | Time channel ID for UDP streaming. |
| `StreamOutUDPDataChannelId` | `ushort` | Data channel ID for UDP streaming. |
| `StreamOutUDPTmNSConfig` | `string` | TMNS configuration. |
| `StreamOutIRIGTimeDataPacketIntervalMs` | `ushort` | IRIG data packet interval in ms. |
| `StreamOutTMATSIntervalMs` | `ushort` | TMATS interval while streaming (FB 29987). |
#### Channel Type Detection Properties (all read-only)
| Member | Returns `true` when |
|--------|---------------------|
| `IsAnalog` | Channel has analog sensor assigned (or non-blank without sensor). |
| `IsSquib` | Channel has squib sensor assigned (or non-blank without sensor). |
| `IsDigitalIn` | Channel has digital input sensor assigned (or non-blank without sensor). |
| `IsDigitalOut` | Channel has digital output sensor assigned (or non-blank without sensor). |
| `IsClock` | Channel is from an RTC module. |
| `IsUart` | Channel is from a UART module. |
| `IsStreamIn` | Channel is from a stream-in module. |
| `IsStreamOut` | Channel is from a stream-out module. |
#### Difference Tracking Properties
| Member | Type | Purpose |
|--------|------|---------|
| `IsRangeDifferent` | `bool` | Tracks range differences. |
| `IsFilterClassDifferent` | `bool` | Tracks filter class differences. |
| `IsPolarityDifferent` | `bool` | Tracks polarity differences. |
| `IsZeroMethodDifferent` | `bool` | Tracks zero method differences. |
| `IsZeroMethodStartDifferent` | `bool` | Tracks zero method start differences. |
| `IsZeroMethodEndDifferent` | `bool` | Tracks zero method end differences. |
| `IsInitialOffsetDifferent` | `bool` | Tracks initial offset differences. |
| `IsSquibFireModeDifferent` | `bool` | Tracks squib fire mode differences. |
| `IsSquibDelayDifferent` | `bool` | Tracks squib delay differences. |
| `IsSquibLimitDurationDifferent` | `bool` | Tracks squib limit duration differences. |
| `IsSquibDurationDifferent` | `bool` | Tracks squib duration differences. |
| `IsSquibCurrentDifferent` | `bool` | Tracks squib current differences. |
| `IsDigitalOutputModeDifferent` | `bool` | Tracks digital output mode differences. |
| `IsDigitalOutDelayDifferent` | `bool` | Tracks digital out delay differences. |
| `IsDigitalOutLimitDurationDifferent` | `bool` | Tracks digital out limit duration differences. |
| `IsDigitalOutDurationDifferent` | `bool` | Tracks digital out duration differences. |
| `IsDigitalInputModeDifferent` | `bool` | Tracks digital input mode differences. |
| `IsDefaultValueDifferent` | `bool` | Tracks default value differences. |
| `IsActiveValueDifferent` | `bool` | Tracks active value differences. |
| `BorderShouldShowOutOfDate` | `bool` | UI state for out-of-date indicator. |
#### Methods
| Signature | Description |
|-----------|-------------|
| `void SetHardwareChannel(IHardwareChannel hardwareChannel)` | Assigns a hardware channel to this channel. |
| `void SetSensor(IDragAndDropItem sensor, IChannelSetting[] channelDefaults, bool applySensorDataToBlankChannels)` | Assigns a sensor with optional defaults application. |
| `bool CompareValue(string property)` | Compares a property value. |
| `bool SetDifferent(string property)` | Marks a property as different. |
| `void SetNotDifferent()` | Clears all difference flags. |
| `void SetRange(CACOption option)` | Sets the range based on an option. |
| `bool IsBlank()` | Returns `true` if channel is a new, non-edited channel. |
| `void Clear()` | Clears hardware and sensor assignments. |
| `bool Filter(string term)` | Returns `true` if channel contains the search term. |
| `string GetChannelName(IsoViewMode isoViewMode)` | Returns channel name based on view mode. |
| `string GetChannelCode(IsoViewMode isoViewMode)` | Returns channel code based on view mode. |
| `void Copy(IGroupChannel groupChannel)` | Creates a memory copy from another channel. |
| `void SetSensorCalibration(ISensorCalibration calibration)` | Sets the sensor calibration. |
| `void SetSensorData(ISensorData sensorData, IDragAndDropItem dragAndDropItem, bool decideSettings = false)` | Sets sensor data with optional settings decision. |
| `IFilterClass GetFilterClassFromISOCode(ISoftwareFilter[] filters, string isoCode)` | Gets filter class from ISO code (FB 15574, FB 13120). |
| `void SetSettingsFromSensor(ISensorData sd)` | Sets channel settings from sensor settings. |
| `string GetChangeList(ISensorData sensor)` | Returns list of parameter differences vs sensor. |
#### Other Members
| Member | Type | Description |
|--------|------|-------------|
| `CoerceISOCodeFunc` | `CoerceISOCodeDelegate` | Function for ISO code coercion. |
| `ChannelStatus` | `UIItemStatus` | Status considering completeness and sensor calibration. |
---
## 3. Invariants
1. **Comparability**: `IGroupChannel` implements `IComparable<IGroupChannel>`, implying ordering semantics must be defined (likely by `GroupChannelOrder` or `TestSetupOrder`).
2. **IEPE Support Logic**: `IEPESupport` follows a priority chain:
- If sensor assigned → depends on sensor bridge
- If no sensor but hardware assigned → depends on hardware channel support
- If neither assigned → IEPE is available
3. **Channel Type Detection Fallback**: Properties `IsAnalog`, `IsSquib`, `IsDigitalIn`, `IsDigitalOut` return `true` for non-blank channels even without a sensor assigned. They return `false` only for blank channels.
4. **Initial Offsets Dependency**: `AvailableInitialOffsets` requires a sensor with calibration to be assigned.
5. **Database Mapping**: `IChannelDbRecord` properties are explicitly mapped to database columns via `[Column("...")]` attributes.
6. **Primary Key**: `IChannelDbRecord.Id` is marked with `[Key]` attribute.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Enums.Channels` - Channel-related enumerations
- `DTS.Common.Enums

View File

@@ -0,0 +1,69 @@
---
source_files:
- Common/DTS.CommonCore/Interface/CheckChannels/ICheckChannelsView.cs
- Common/DTS.CommonCore/Interface/CheckChannels/ICheckChannelsViewModel.cs
- Common/DTS.CommonCore/Interface/CheckChannels/ICheckChannelsMenuView.cs
- Common/DTS.CommonCore/Interface/CheckChannels/ICheckChannelsMenuViewModel.cs
generated_at: "2026-04-16T12:13:50.837632+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "3a5d65945568970d"
---
# Documentation: CheckChannels Interfaces
## 1. Purpose
This module defines four interfaces for the "CheckChannels" feature within the DTS system, following the Model-View-ViewModel (MVVM) architectural pattern. These interfaces establish contracts for the main CheckChannels view and its associated ribbon menu view, enabling loose coupling between UI components and facilitating dependency injection. The interfaces serve as type markers that extend base view and viewmodel abstractions, allowing the CheckChannels feature to integrate consistently with the broader application framework.
## 2. Public Interface
### ICheckChannelsView
```csharp
namespace DTS.Common.Interface
public interface ICheckChannelsView : IBaseView { }
```
A marker interface for the main CheckChannels view. Inherits from `IBaseView` (defined in `DTS.Common.Base`). No additional members are defined.
### ICheckChannelsViewModel
```csharp
namespace DTS.Common.Interface
public interface ICheckChannelsViewModel : IBaseViewModel { }
```
A marker interface for the CheckChannels viewmodel. Inherits from `IBaseViewModel` (defined in `DTS.Common.Base`). No additional members are defined.
### ICheckChannelsMenuView
```csharp
namespace DTS.Common.Interface
public interface ICheckChannelsMenuView : IRibbonView { }
```
A marker interface for the CheckChannels ribbon menu view. Inherits from `IRibbonView` (defined in `DTS.Common.RibbonControl`). No additional members are defined.
### ICheckChannelsMenuViewModel
```csharp
namespace DTS.Common.Interface
public interface ICheckChannelsMenuViewModel : IRibbonViewModel { }
```
A marker interface for the CheckChannels ribbon menu viewmodel. Inherits from `IRibbonViewModel` (defined in `DTS.Common.RibbonControl`). No additional members are defined.
## 3. Invariants
- All four interfaces are empty marker interfaces; they define no members beyond those inherited from their base interfaces.
- Each view interface has a corresponding viewmodel interface following the naming convention `ICheckChannels[Menu]View` / `ICheckChannels[Menu]ViewModel`.
- The main CheckChannels components inherit from base view/viewmodel types (`IBaseView`, `IBaseViewModel`), while the menu components inherit from ribbon-specific types (`IRibbonView`, `IRibbonViewModel`).
- All interfaces reside in the `DTS.Common.Interface` namespace.
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces
- `DTS.Common.RibbonControl` — provides `IRibbonView` and `IRibbonViewModel` base interfaces
### What depends on this module:
- **Unclear from source alone.** Concrete implementations of these interfaces would exist elsewhere in the codebase, likely in view and viewmodel classes within a CheckChannels feature module. The consumers would typically be dependency injection containers and navigation/routing systems.
## 5. Gotchas
- **Empty marker interfaces**: These interfaces define no custom members. All behavior contracts come from the parent interfaces (`IBaseView`, `IBaseViewModel`, `IRibbonView`, `IRibbonViewModel`). Developers implementing these interfaces must consult those base definitions to understand required members.
- **Separate menu hierarchy**: The `ICheckChannelsMenuView` and `ICheckChannelsMenuViewModel` inherit from ribbon-specific base types rather than the general base types used by the main view/viewmodel pair. This suggests the menu components integrate with a specialized ribbon control system.
- **Purpose unclear from source**: The specific functionality of the "CheckChannels" feature cannot be determined from these interface definitions alone. The name suggests channel verification or monitoring, but the actual behavior is not documented here.

View File

@@ -0,0 +1,47 @@
---
source_files:
- Common/DTS.CommonCore/Interface/CheckTrigger/ICheckTriggerView.cs
- Common/DTS.CommonCore/Interface/CheckTrigger/ICheckTriggerViewModel.cs
generated_at: "2026-04-16T12:07:28.882495+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b59a55831fe5a086"
---
# Documentation: ICheckTriggerView and ICheckTriggerViewModel
## 1. Purpose
This module defines two marker interfaces, `ICheckTriggerView` and `ICheckTriggerViewModel`, which serve as contracts for the View and ViewModel components of a "CheckTrigger" feature within an MVVM (Model-View-ViewModel) architecture. These interfaces exist to establish type identity and hierarchy within the system, allowing components to be identified as belonging to the CheckTrigger subsystem while inheriting base behavior from core framework types.
## 2. Public Interface
### `ICheckTriggerView`
- **Namespace:** `DTS.Common.Interface`
- **Signature:** `public interface ICheckTriggerView : IBaseView { }`
- **Description:** An empty marker interface extending `IBaseView`. Declares no members of its own; its purpose is purely typological, allowing implementations to be identified as CheckTrigger-specific views.
### `ICheckTriggerViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Signature:** `public interface ICheckTriggerViewModel : IBaseViewModel { }`
- **Description:** An empty marker interface extending `IBaseViewModel`. Declares no members of its own; its purpose is purely typological, allowing implementations to be identified as CheckTrigger-specific view models.
## 3. Invariants
- Any class implementing `ICheckTriggerView` must also fulfill the contract of `IBaseView` (the specifics of which are not visible in the provided source).
- Any class implementing `ICheckTriggerViewModel` must also fulfill the contract of `IBaseViewModel` (the specifics of which are not visible in the provided source).
- Both interfaces are sealed in the sense that they add no additional members beyond their base interfaces; implementers need only satisfy base interface requirements.
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base types
### What depends on this module:
- **Unknown from source alone.** No consumers of these interfaces are visible in the provided files.
## 5. Gotchas
- **Empty marker interfaces:** Both interfaces declare zero members. This is a common pattern for type discrimination, but developers should be aware that these interfaces provide no behavioral contracts beyond what their base interfaces define.
- **Base interface contracts unknown:** The actual requirements for implementing these interfaces depend entirely on `IBaseView` and `IBaseViewModel`, which are not included in the provided source. Developers will need to consult those base definitions to understand full implementation requirements.
- **Naming convention:** The "CheckTrigger" naming suggests a specific feature domain, but no documentation or comments in the source explain what "CheckTrigger" represents in the business logic.

View File

@@ -0,0 +1,100 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Communication/ICommunicationReport.cs
- Common/DTS.CommonCore/Interface/Communication/IDASConnectedDevice.cs
- Common/DTS.CommonCore/Interface/Communication/ICommunication_DASInfo.cs
generated_at: "2026-04-16T12:19:03.859448+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c40d100ec97fea56"
---
# Documentation: DTS.Common.Interface.Communication
## 1. Purpose
This module defines three interfaces for communication-related data structures within the DTS system. `ICommunicationReport` provides a standard contract for reporting communication operation results, including status, user state, and raw data. `IDASConnectedDevice` describes hardware devices connected to a Data Acquisition System (DAS), capturing physical and logical identification properties. `ICommunication_DASInfo` extends DAS communication capabilities to manage connected device discovery, serial/firmware tracking, first-use date tracking, and streaming support detection. These interfaces support auto-discovery and monitoring of DAS-connected hardware (e.g., S6 devices connected to S6DB).
---
## 2. Public Interface
### ICommunicationReport
**Properties:**
| Name | Type | Access | Description |
|------|------|--------|-------------|
| `UserState` | `object` | get/set | Arbitrary user state associated with the communication report. |
| `Result` | `CommunicationConstantsAndEnums.CommunicationResult` | get/set | The result status of the communication operation. |
| `Data` | `byte[]` | get/set | Raw byte data payload from the communication. |
---
### IDASConnectedDevice
**Properties (all read-only):**
| Name | Type | Description |
|------|------|-------------|
| `DeviceType` | `HardwareTypes` | The hardware type of the connected device. |
| `Port` | `int` | The port on the DAS where the device is connected (0-based index). |
| `SpotOnPort` | `int` | The position in the chain on the given port (0-based index). |
| `PhysicalAddress` | `PhysicalAddress` | The MAC address or physical address of the device. |
| `IPAddress` | `string` | The IP address of the device. |
| `SerialNumber` | `string` | The serial number of the device. |
| `Location` | `string` | The location descriptor of the device. |
| `Version` | `string` | The firmware/hardware version of the device. |
---
### ICommunication_DASInfo
**Properties:**
| Name | Type | Access | Description |
|------|------|--------|-------------|
| `ConnectedDevices` | `IDASConnectedDevice[]` | get only | Array of devices currently connected to the DAS. Currently only used by SLICE6DB. |
| `SerialNumbers` | `string[]` | get/set | Array of serial numbers. |
| `FirmwareVersions` | `string[]` | get/set | Array of firmware versions. |
| `FirstUseDate` | `DateTime?` | get/set | Date of first hardware use; `null` indicates hardware has not been used since calibration. Only valid when `IsFirstUseDateSupported` is `true`. |
| `IsFirstUseDateSupported` | `bool` | get/set | Indicates whether hardware supports first use date tracking. Requires firmware storage for user attributes and calibration by software supporting hardware first use. |
| `IsStreamingSupported` | `bool` | get/set | Indicates whether streaming is supported. TSR AIRs can enable/disable via `DISABLE_STREAMING_FEATURE` system attribute. |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void SetConnectedDevices(IDASConnectedDevice[] devices)` | Sets the `ConnectedDevices` array with devices connected to this DAS. |
| `string StackSerialNumber(int devid)` | Returns the stack serial number for the given device ID. |
---
## 3. Invariants
- **Port and SpotOnPort indexing**: Both `Port` and `SpotOnPort` on `IDASConnectedDevice` are 0-based indices.
- **FirstUseDate validity**: `FirstUseDate` is only meaningful when `IsFirstUseDateSupported` is `true`. A `null` value for `FirstUseDate` indicates the hardware has not been used since calibration.
- **ConnectedDevices mutability**: The `ConnectedDevices` property is read-only; modifications must go through `SetConnectedDevices(IDASConnectedDevice[])`.
- **Streaming support**: `IsStreamingSupported` reflects hardware capability; the actual feature can be controlled via the `DISABLE_STREAMING_FEATURE` system attribute on TSR AIRs.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Enums.Communication` — provides `CommunicationConstantsAndEnums.CommunicationResult`
- `DTS.Common.Enums.Hardware` — provides `HardwareTypes` enum
- `System.Net.NetworkInformation` — provides `PhysicalAddress` class
- `System` — provides `DateTime` type
### What depends on this module:
- Not determinable from the provided source files alone. These are interface definitions likely consumed by DAS communication implementations and device discovery services.
---
## 5. Gotchas
- **FirstUseDate null semantics**: A `null` `FirstUseDate` has specific meaning (hardware not used since calibration), not just "unknown" or "uninitialized". Consumers should check `IsFirstUseDateSupported` before relying on `FirstUseDate`.
- **ConnectedDevices limited usage**: The XML comment indicates `ConnectedDevices` is "currently only used by SLICE6DB" — other DAS types may not populate this array.
- **Streaming feature control**: `IsStreamingSupported` indicates hardware capability, but the actual streaming feature can be disabled via the `DISABLE_STREAMING_FEATURE` system attribute on TSR AIRs. The relationship between this property and the system attribute is not fully specified in the source.
- **StackSerialNumber parameter meaning**: The `devid` parameter in `StackSerialNumber(int devid)` lacks documentation; its interpretation (whether 0-based index, hardware ID, or other identifier) is unclear from source alone.

View File

@@ -0,0 +1,206 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Components/IAssemblyView.cs
- Common/DTS.CommonCore/Interface/Components/IAssemblyListView.cs
- Common/DTS.CommonCore/Interface/Components/ITileView.cs
- Common/DTS.CommonCore/Interface/Components/IGroupView.cs
- Common/DTS.CommonCore/Interface/Components/ITileListView.cs
- Common/DTS.CommonCore/Interface/Components/IGroupListView.cs
- Common/DTS.CommonCore/Interface/Components/IAssemblyViewModel.cs
- Common/DTS.CommonCore/Interface/Components/IAssemblyListViewModel.cs
- Common/DTS.CommonCore/Interface/Components/ITileViewModel.cs
- Common/DTS.CommonCore/Interface/Components/IGroupViewModel.cs
- Common/DTS.CommonCore/Interface/Components/ITileListViewModel.cs
- Common/DTS.CommonCore/Interface/Components/IGroupListViewModel.cs
generated_at: "2026-04-16T12:16:00.246337+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9dfaf004748c958d"
---
# Documentation: View/ViewModel Component Interfaces
## 1. Purpose
This module defines a set of abstraction interfaces for a Model-View-ViewModel (MVVM) architecture, specifically for displaying and managing grouped assembly information in a UI. It provides two parallel interface hierarchies: one in the `DTS.Common.Interface` namespace for assembly-based views, and another in the `DataPro.Common.Interface` namespace for tile/group-based views. These interfaces enable decoupling of UI components from their concrete implementations, supporting view composition patterns where assemblies can be displayed as individual items or grouped lists.
---
## 2. Public Interface
### DTS.Common.Interface Namespace
#### `IAssemblyView`
```csharp
public interface IAssemblyView : IBaseView { }
```
Marker interface extending `IBaseView`. Represents a single assembly view component. No members defined.
#### `IAssemblyListView`
```csharp
public interface IAssemblyListView : IBaseView { }
```
Marker interface extending `IBaseView`. Represents a list container for assembly views. No members defined.
#### `IAssemblyViewModel`
```csharp
public interface IAssemblyViewModel : IBaseViewModel
{
IAssemblyView View { get; set; }
string GroupName { get; set; }
List<AssemblyNameImage> AssemblyList { get; set; }
}
```
ViewModel interface for a single assembly group. Properties:
- `View` - The associated view instance
- `GroupName` - Name identifier for the group
- `AssemblyList` - Collection of `AssemblyNameImage` objects
#### `IAssemblyListViewModel`
```csharp
public interface IAssemblyListViewModel : IBaseViewModel
{
IMainViewModel Parent { get; set; }
IAssemblyListView View { get; set; }
List<IAssemblyView> GroupList { get; set; }
}
```
ViewModel interface for a collection of assembly groups. Properties:
- `Parent` - Reference to the parent `IMainViewModel`
- `View` - The associated list view instance
- `GroupList` - Collection of `IAssemblyView` instances
---
### DataPro.Common.Interface Namespace
#### `ITileView`
```csharp
public interface ITileView : IBaseView { }
```
Marker interface extending `IBaseView`. Represents a tile-based view component. No members defined.
#### `IGroupView`
```csharp
public interface IGroupView : IBaseView { }
```
Marker interface extending `IBaseView`. Represents a group-based view component. No members defined.
#### `ITileListView`
```csharp
public interface ITileListView : IBaseView { }
```
Marker interface extending `IBaseView`. Represents a list container for tile views. No members defined.
#### `IGroupListView`
```csharp
public interface IGroupListView : IBaseView { }
```
Marker interface extending `IBaseView`. Represents a list container for group views. No members defined.
#### `ITileViewModel`
```csharp
public interface ITileViewModel : IBaseViewModel
{
ITileView View { get; set; }
string GroupName { get; set; }
List<AssemblyNameImage> AssemblyList { get; set; }
}
```
ViewModel interface for a tile-based assembly group. Properties:
- `View` - The associated tile view instance
- `GroupName` - Name identifier for the group
- `AssemblyList` - Collection of `AssemblyNameImage` objects
#### `IGroupViewModel`
```csharp
public interface IGroupViewModel : IBaseViewModel
{
IGroupView View { get; set; }
string GroupName { get; set; }
List<AssemblyNameImage> AssemblyList { get; set; }
}
```
ViewModel interface for a group-based assembly display. Properties:
- `View` - The associated group view instance
- `GroupName` - Name identifier for the group
- `AssemblyList` - Collection of `AssemblyNameImage` objects
#### `ITileListViewModel`
```csharp
public interface ITileListViewModel : IBaseViewModel
{
IMainViewModel Parent { get; set; }
ITileListView View { get; set; }
List<ITileView> GroupList { get; set; }
}
```
ViewModel interface for a collection of tile groups. Properties:
- `Parent` - Reference to the parent `IMainViewModel`
- `View` - The associated tile list view instance
- `GroupList` - Collection of `ITileView` instances
#### `IGroupListViewModel`
```csharp
public interface IGroupListViewModel : IBaseViewModel
{
IMainViewModel Parent { get; set; }
IGroupListView View { get; set; }
List<IGroupView> GroupList { get; set; }
}
```
ViewModel interface for a collection of groups. Properties:
- `Parent` - Reference to the parent `IMainViewModel`
- `View` - The associated group list view instance
- `GroupList` - Collection of `IGroupView` instances
---
## 3. Invariants
- All View interfaces (`IAssemblyView`, `IAssemblyListView`, `ITileView`, `IGroupView`, `ITileListView`, `IGroupListView`) must inherit from `IBaseView`.
- All ViewModel interfaces must inherit from `IBaseViewModel`.
- The `View` property on a ViewModel must reference an instance of its corresponding View interface type (e.g., `IAssemblyViewModel.View` must be of type `IAssemblyView`).
- List ViewModels maintain a parent-child relationship: `IAssemblyListViewModel`, `ITileListViewModel`, and `IGroupListViewModel` must have a valid `Parent` reference to `IMainViewModel`.
- The `GroupList` property on list ViewModels must contain elements of the corresponding single-item View interface type.
---
## 4. Dependencies
### External Dependencies (referenced but not defined in source):
- **`DTS.Common.Base.IBaseView`** - Base interface for all views in the DTS namespace
- **`DTS.Common.Base.IBaseViewModel`** - Base interface for all ViewModels in the DTS namespace
- **`DataPro.Common.Base.IBaseView`** - Base interface for all views in the DataPro namespace
- **`DataPro.Common.Base.IBaseViewModel`** - Base interface for all ViewModels in the DataPro namespace
- **`AssemblyNameImage`** - Data structure representing assembly information (type definition not provided)
- **`IMainViewModel`** - Parent ViewModel interface (type definition not provided)
### Namespace Dependencies:
- `System.Collections.Generic` - For `List<T>` usage
- `System.Collections.ObjectModel` - Imported in DataPro ViewModel files but not actively used
- `System.Reflection` - Imported in DataPro ViewModel files but not actively used
---
## 5. Gotchas
### Namespace Inconsistency
The codebase contains two parallel interface hierarchies with inconsistent namespace naming:
- `DTS.Common.Interface` vs `DataPro.Common.Interface`
- `DTS.Common.Base` vs `DataPro.Common.Base`
This suggests either an ongoing refactoring, a legacy migration, or intentional separation between two subsystems. **The relationship between these two namespace families is unclear from source alone.**
### Unused Imports
The following files import namespaces that are never used in the interface definitions:
- `ITileViewModel.cs` - imports `System.Collections.ObjectModel` and `System.Reflection`
- `IGroupViewModel.cs` - imports `System.Collections.ObjectModel` and `System.Reflection`
- `ITileListViewModel.cs` - imports `System.Collections.ObjectModel`, `System.Reflection`, and `System`
- `IGroupListViewModel.cs` - imports `System.Collections.ObjectModel`, `System.Reflection`, and `System`
### Structural Duplication
`ITileViewModel` and `IGroupViewModel` have identical member signatures, differing only in their View property types (`ITileView` vs `IGroupView`). Similarly, `ITileListViewModel` and `IGroupListViewModel` are structurally identical. This may indicate an opportunity for generic abstraction or consolidation.
### Missing Type Definitions
The types `AssemblyNameImage` and `IMainViewModel` are referenced but not defined in the provided source files. Their structure and contracts cannot be documented from the available information.

View File

@@ -0,0 +1,105 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Connection/IConnection.cs
generated_at: "2026-04-16T12:12:24.920785+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a6aead5143a016b8"
---
# Documentation: IConnection Interface
## 1. Purpose
The `IConnection` interface defines a comprehensive abstraction for network socket connections within the DTS system. It provides a unified API for both client and server-side connection management, supporting connection lifecycle operations (create, connect, disconnect, dispose), bidirectional data transfer, and a "soft disconnect" mechanism for temporarily releasing connections with the expectation of reconnecting. The interface implements the Asynchronous Programming Model (APM) pattern for most operations, with one Task-based async method (`SendAsync`), and includes keep-alive monitoring capabilities.
## 2. Public Interface
### Interface Declaration
```csharp
public interface IConnection : IDisposable
```
### Properties
| Property | Signature | Description |
|----------|-----------|-------------|
| `IsSoftDisconnected` | `bool IsSoftDisconnected { get; }` | Returns `true` if the unit is soft disconnected (connected then voluntarily disconnected with expectation of reconnecting). |
| `Flags` | `System.Net.Sockets.SocketFlags Flags { get; set; }` | Gets or sets socket flags for send/receive operations. |
| `ConnectString` | `string ConnectString { get; }` | Returns the connection string associated with this connection. |
| `Connected` | `bool Connected { get; }` | Returns the current connection state. |
### Events
| Event | Signature | Description |
|-------|-----------|-------------|
| `OnDisconnected` | `event EventHandler OnDisconnected` | Raised when the connection is disconnected. |
### Methods - Connection Lifecycle
| Method | Signature | Description |
|--------|-----------|-------------|
| `Create` | `void Create(string connectString)` | Initializes the connection using the specified connection string. |
| `Create` | `void Create(string connectString, string hostIPAddress)` | Initializes the connection using the specified connection string and host IP address. |
| `SoftDisconnect` | `void SoftDisconnect()` | Performs a voluntary disconnect with the intention of reconnecting later. |
| `SoftConnect` | `void SoftConnect()` | Reconnects a soft disconnected unit. |
| `KeepAliveErrorReceived` | `void KeepAliveErrorReceived()` | Indicates that the device has not received a timely response to keep-alive. |
| `GetConnectionData` | `string GetConnectionData()` | Returns connection data as a string. |
### Methods - Server Operations
| Method | Signature | Description |
|--------|-----------|-------------|
| `Bind` | `void Bind(int port)` | Binds the connection to a specific port. |
| `Listen` | `void Listen(int backlog)` | Starts listening for incoming connections with the specified backlog. |
| `BeginAccept` | `IAsyncResult BeginAccept(AsyncCallback callback, object state)` | Begins an asynchronous operation to accept an incoming connection. |
| `EndAccept` | `IConnection EndAccept(IAsyncResult asyncResult)` | Completes the asynchronous accept operation and returns the accepted `IConnection`. |
### Methods - Client Connection Operations
| Method | Signature | Description |
|--------|-----------|-------------|
| `BeginConnect` | `IAsyncResult BeginConnect(AsyncCallback callback, object callbackObject)` | Begins an asynchronous connection attempt. |
| `EndConnect` | `void EndConnect(IAsyncResult ar)` | Completes the asynchronous connect operation. |
| `BeginDisconnect` | `IAsyncResult BeginDisconnect(bool reuseSocket, AsyncCallback callback, object state)` | Begins an asynchronous disconnect operation. |
| `EndDisconnect` | `void EndDisconnect(IAsyncResult asyncResult)` | Completes the asynchronous disconnect operation. |
### Methods - Data Transfer
| Method | Signature | Description |
|--------|-----------|-------------|
| `SendAsync` | `Task<int> SendAsync(byte[] sendBuffer, int bufferStartOffset, int bufferSizeToSend)` | Asynchronously sends data and returns the number of bytes sent. Uses TAP pattern. |
| `BeginSend` | `IAsyncResult BeginSend(byte[] sendBuffer, int bufferStartOffset, int bufferSizeToSend, AsyncCallback callback, object callbackObject)` | Begins an asynchronous send operation. Uses APM pattern. |
| `EndSend` | `int EndSend(IAsyncResult ar)` | Completes the asynchronous send operation and returns the number of bytes sent. |
| `BeginReceive` | `IAsyncResult BeginReceive(byte[] receiveBuffer, int bufferStartOffset, int maxSizeToReceive, AsyncCallback callback, object callbackObject)` | Begins an asynchronous receive operation. |
| `EndReceive` | `int EndReceive(IAsyncResult ar)` | Completes the asynchronous receive operation and returns the number of bytes received. |
## 3. Invariants
- **Disposable Contract**: All implementations must properly implement `IDisposable`, ensuring resources (sockets, buffers, etc.) are released when disposed.
- **APM Pattern Pairing**: Every `Begin*` method must have a corresponding `End*` call to complete the operation and retrieve results. Calling `End*` without a preceding `Begin*`, or calling `End*` multiple times on the same `IAsyncResult`, is undefined behavior.
- **Soft Disconnect State Consistency**: `IsSoftDisconnected` should only return `true` after `SoftDisconnect()` has been called and before `SoftConnect()` is called. The soft disconnect state implies a prior successful connection.
- **Connection State Before Operations**: Data transfer methods (`SendAsync`, `BeginSend`, `BeginReceive`) require an active connection; behavior is undefined if called on a disconnected unit.
- **Create Before Use**: `Create()` must be called before connection operations (`BeginConnect`, `Bind`, etc.).
## 4. Dependencies
### External Dependencies (from imports)
- `System` - Core .NET types (`IAsyncResult`, `AsyncCallback`, `EventHandler`, `IDisposable`)
- `System.Threading.Tasks` - `Task<T>` for `SendAsync`
- `System.Net.Sockets.SocketFlags` - Socket configuration flags
### Dependents
- Unknown from this source file alone. Implementations of this interface and consumers would be defined elsewhere in the codebase.
## 5. Gotchas
1. **Mixed Async Patterns**: The interface uses both APM (`Begin*`/`End*` methods) and TAP (`SendAsync` returning `Task<int>`) patterns. This inconsistency may cause confusion when choosing which method to use. Note that `SendAsync` is the only TAP-style method; all other async operations use APM.
2. **Server and Client Methods in One Interface**: The interface combines server-side methods (`Bind`, `Listen`, `BeginAccept`, `EndAccept`) with client-side methods (`BeginConnect`, `EndConnect`). Implementations may need to handle scenarios where inappropriate methods are called (e.g., calling `Listen` on a client connection).
3. **Commented-Out Rate Methods**: The source contains commented-out methods `GetCurrentUploadRate()` and `GetCurrentDownloadRate()`, suggesting bandwidth monitoring was planned or removed. Do not assume these exist.
4. **Soft Disconnect vs. Regular Disconnect**: The interface provides `SoftDisconnect()`/`SoftConnect()` alongside `BeginDisconnect()`/`EndDisconnect()`. The relationship between these two disconnect mechanisms is not specified—whether `BeginDisconnect` affects `IsSoftDisconnected` state is unclear from the source alone.
5. **KeepAliveErrorReceived is a Method, Not an Event**: Despite the naming convention suggesting an event handler, `KeepAliveErrorReceived()` is a void method. Its intended usage (called by whom, when, and what it should do) is not specified in the source.

View File

@@ -0,0 +1,119 @@
---
source_files:
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsView.cs
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsExportView.cs
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsImportView.cs
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelModel.cs
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsViewModel.cs
generated_at: "2026-04-16T12:10:34.879323+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "d441dada7c96f903"
---
# Custom Channels Interface Module Documentation
## 1. Purpose
This module defines the contract interfaces for a Custom Channels feature, implementing a Model-View-ViewModel (MVVM) architecture. It provides abstractions for managing custom channel configurations, including the ability to import and export channel definitions. The interfaces decouple the presentation layer from business logic, enabling view models to orchestrate import/export operations while views remain passive implementations of `IBaseView` and `IBaseViewModel` contracts.
---
## 2. Public Interface
### `ICustomChannelsView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
A marker interface with no members. Identifies views responsible for displaying custom channels.
---
### `ICustomChannelsExportView`
**Namespace:** `DTS.Common.Interface.CustomChannels`
**Inheritance:** `IBaseView`
A marker interface with no members. Identifies views handling the export workflow for custom channels.
---
### `ICustomChannelsImportView`
**Namespace:** `DTS.Common.Interface.CustomChannels`
**Inheritance:** `IBaseView`
A marker interface with no members. Identifies views handling the import workflow for custom channels.
---
### `ICustomChannelModel`
**Namespace:** `DTS.Common.Interface.CustomChannels`
Represents a single custom channel item with selection state.
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `Name` | `string` | get | The identifier or display name of the custom channel. |
| `Included` | `bool` | get, set | Indicates whether this channel is selected for an operation (e.g., export). |
---
### `ICustomChannelsViewModel`
**Namespace:** `DTS.Common.Interface.CustomChannels`
**Inheritance:** `IBaseViewModel`
Orchestrates custom channel import/export operations.
**Properties:**
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `ImportView` | `ICustomChannelsImportView` | get, set | The view instance for import operations. |
| `ExportView` | `ICustomChannelsExportView` | get, set | The view instance for export operations. |
| `ExportFileName` | `string` | get, set | Target file path for export operations. |
| `ImportFileName` | `string` | get, set | Source file path for import operations. |
| `AllCustomChannels` | `ObservableCollection<ICustomChannelModel>` | get | Collection of all available custom channel models. |
**Methods:**
| Method | Signature | Description |
|--------|-----------|-------------|
| `Unset` | `void Unset()` | Clears or resets the view model state. |
| `OnSetActive` | `void OnSetActive(bool bImport)` | Called when the view becomes active; `bImport` indicates import mode (true) vs export mode (false). |
| `ReadImportFile` | `void ReadImportFile()` | Reads and parses the file specified by `ImportFileName`. |
| `SelectAll` | `void SelectAll()` | Sets `Included` to `true` for all items in `AllCustomChannels`. |
| `ClearSelection` | `void ClearSelection()` | Sets `Included` to `false` for all items in `AllCustomChannels`. |
| `Export` | `void Export()` | Executes the export operation using current selection and `ExportFileName`. |
| `Import` | `void Import()` | Executes the import operation using current selection and `ImportFileName`. |
---
## 3. Invariants
- `ICustomChannelModel.Name` is read-only; once set by the implementation, the name cannot be changed through this interface.
- `AllCustomChannels` is read-only at the interface level; consumers cannot replace the collection, only modify its contents or item properties.
- All view interfaces (`ICustomChannelsView`, `ICustomChannelsExportView`, `ICustomChannelsImportView`) must be assignable to `IBaseView`.
- `ICustomChannelsViewModel` must be assignable to `IBaseViewModel`.
- The `bImport` parameter in `OnSetActive` uses a boolean to distinguish between import (true) and export (false) modes.
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base contracts.
- `System.Collections.ObjectModel` — Provides `ObservableCollection<T>` used for `AllCustomChannels`.
**What depends on this module:**
- Cannot be determined from source alone. Concrete implementations of these interfaces, as well as consumers of `ICustomChannelsViewModel`, would exist elsewhere in the codebase.
---
## 5. Gotchas
1. **Namespace inconsistency:** `ICustomChannelsView` resides in `DTS.Common.Interface`, while all other interfaces in this feature set reside in `DTS.Common.Interface.CustomChannels`. This may cause confusion or require additional using directives.
2. **Marker interfaces:** `ICustomChannelsView`, `ICustomChannelsExportView`, and `ICustomChannelsImportView` define no members. Their utility appears to be type identification for view resolution or dependency injection—verify the actual usage pattern in the consuming codebase.
3. **Import/Export coupling:** The `ICustomChannelsViewModel` manages both import and export workflows. The `OnSetActive(bool bImport)` method toggles behavior based on a boolean flag, which may complicate testing or extension if the two workflows diverge.
4. **File I/O abstraction:** The interfaces expose file names as strings (`ImportFileName`, `ExportFileName`) with no validation hints. It is unclear whether implementations validate file existence, extensions, or permissions before `ReadImportFile()`, `Export()`, or `Import()` are called.

View File

@@ -0,0 +1,69 @@
---
source_files:
- Common/DTS.CommonCore/Interface/CustomerDetails/ICustomerDetailsView.cs
- Common/DTS.CommonCore/Interface/CustomerDetails/ICustomerDetailsViewModel.cs
generated_at: "2026-04-16T12:19:49.445469+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b07af412c78e07b1"
---
# Documentation: Customer Details Interfaces
## 1. Purpose
This module defines two marker interfaces—`ICustomerDetailsView` and `ICustomerDetailsViewModel`—that establish type identity for customer details components within a Model-View-ViewModel (MVVM) architecture. These interfaces exist to provide a contract for customer-specific views and view models, enabling type-safe binding, dependency injection, and navigation patterns while inheriting core behaviors from base interfaces in the `DTS.Common.Base` namespace.
---
## 2. Public Interface
### `ICustomerDetailsView`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseView` (from `DTS.Common.Base`)
- **Signature:**
```csharp
public interface ICustomerDetailsView : IBaseView { }
```
- **Behavior:** Empty marker interface. Any concrete view implementing this interface signals that it represents a customer details screen. All actual behavior and members are inherited from `IBaseView`.
### `ICustomerDetailsViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseViewModel` (from `DTS.Common.Base`)
- **Signature:**
```csharp
public interface ICustomerDetailsViewModel : IBaseViewModel { }
```
- **Behavior:** Empty marker interface. Any concrete view model implementing this interface signals that it provides the presentation logic for a customer details view. All actual behavior and members are inherited from `IBaseViewModel`.
---
## 3. Invariants
- **Type identity guarantee:** Any class implementing `ICustomerDetailsView` or `ICustomerDetailsViewModel` must also satisfy the contracts of `IBaseView` or `IBaseViewModel` respectively.
- **No additional members:** Neither interface defines its own properties, methods, or events; they rely entirely on their base interfaces for functionality.
- **Naming convention:** The interfaces follow a naming pattern suggesting a 1:1 correspondence between `ICustomerDetailsView` and `ICustomerDetailsViewModel`.
**Note:** Specific invariants regarding `IBaseView` and `IBaseViewModel` cannot be determined from the provided source files.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
### What depends on this module:
- Cannot be determined from the provided source files alone. Likely consumers include:
- Concrete view implementations (e.g., WinForms, WPF, or web views displaying customer details)
- Concrete view model implementations for customer details
- Navigation or routing services that resolve views by interface type
- Dependency injection configurations
---
## 5. Gotchas
- **Empty marker interfaces:** Both interfaces define no members of their own. If `IBaseView` and `IBaseViewModel` also lack meaningful members, these interfaces serve purely as type markers. This design is intentional for type discrimination but may confuse developers expecting explicit contracts.
- **Base interface contracts unknown:** The actual capabilities and requirements of these interfaces are entirely determined by `IBaseView` and `IBaseViewModel`. Developers must consult those base definitions to understand what members must be implemented.
- **Potential tight coupling to base types:** Any changes to `IBaseView` or `IBaseViewModel` will ripple to all implementers of these customer details interfaces.

View File

@@ -0,0 +1,429 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DASFactory/IAutoArmed.cs
- Common/DTS.CommonCore/Interface/DASFactory/ITiltSensorCalAware.cs
- Common/DTS.CommonCore/Interface/DASFactory/IRangeBandwidthLimited.cs
- Common/DTS.CommonCore/Interface/DASFactory/IAutoArmStatus.cs
- Common/DTS.CommonCore/Interface/DASFactory/ITimeSynchronization.cs
- Common/DTS.CommonCore/Interface/DASFactory/IConnectedEthernetDevice.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDASConfigurationArg.cs
- Common/DTS.CommonCore/Interface/DASFactory/IRealtime.cs
- Common/DTS.CommonCore/Interface/DASFactory/IUDPQATSEntry.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDASFactory.cs
- Common/DTS.CommonCore/Interface/DASFactory/ICommunication.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDiscoveredDevice.cs
- Common/DTS.CommonCore/Interface/DASFactory/IAnalogInputDASChannel.cs
- Common/DTS.CommonCore/Interface/DASFactory/IDASCommunication.cs
generated_at: "2026-04-16T12:19:30.502497+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5d1420792c49604c"
---
# DASFactory Interfaces Documentation
## 1. Purpose
This module defines the core abstraction layer for the Data Acquisition System (DAS) Factory pattern. It provides interfaces for device discovery, hardware communication, channel configuration, real-time data streaming, and diagnostics across multiple DAS hardware types (SLICE, TDAS, TSR, etc.). The interfaces enable polymorphic treatment of diverse hardware while exposing type-specific capabilities through optional interface implementation. This module serves as the contract layer between high-level application services and low-level hardware drivers.
---
## 2. Public Interface
### IAutoArmed
```csharp
bool AutoArmed { get; set; }
```
Simple marker interface for auto-arming capability.
### ITiltSensorCalAware
```csharp
double[] TiltSensorCals { get; }
```
Exposes tilt sensor calibration values. Returns an array of calibration coefficients.
### IRangeBandwidthLimited
```csharp
bool RangeBandwidthLimited { get; }
```
Read-only flag indicating if the device has range/bandwidth limitations applied.
### IAutoArmStatus
```csharp
DFConstantsAndEnums.CommandStatus AutoArmStatus { get; set; }
```
Tracks the command status of auto-arm operations using `DFConstantsAndEnums.CommandStatus` enum.
### ITimeSynchronization
```csharp
bool SupportsTimeSynchronization { get; }
DateTime SystemBaseTime { get; }
```
Indicates time synchronization support and provides the system base time reference.
### IConnectedEthernetDevice
```csharp
string MACAddress { get; }
int Port { get; }
string SerialNumber { get; set; }
```
Represents an ethernet-connected device with network identification properties.
### IDASConfigurationArg
```csharp
IDASCommunication DAS { get; }
bool BlankConfigurationRead { get; }
bool ConfigurationFailedValidation { get; }
```
Argument interface for configuration events. Used per comment "17872 Use DASConfig XMLs on disk when performing an emergency download with DAS that have blank filestore(s)".
### IRealTime
```csharp
List<int> RealtimeDASChannels { get; set; }
List<double> TiltAxisData { get; set; }
string UDPStreamAddress { get; }
```
Real-time data streaming interface. `TiltAxisData` provides Slice6 Axis 1/2/3 (X/Y/Z) tilt in degrees. `UDPStreamAddress` provides the S6/S6A realtime UDP stream endpoint.
### IUDPQATSEntry
Extensive interface for UDP QATS (Quick Acquisition and Telemetry System) entries:
```csharp
string ResponseHostMac { get; }
string ResponseClientMacAddress { get; }
string SerialNumber { get; }
byte ArmState { get; }
byte ArmMode { get; }
byte Started { get; }
byte Triggered { get; }
byte FaultFlags { get; }
uint SampleRate { get; }
ulong TotalSamples { get; }
ulong CurrentSample { get; }
ushort EventNumber { get; }
ulong FaultSampleNumber { get; }
ushort LegacyFaultFlags { get; }
float InputVoltage { get; }
float BackupVoltage { get; }
float BatterySOC { get; }
ulong EstimateMaxSamples { get; }
short TiltSensorCh1 { get; }
short TiltSensorCh2 { get; }
short TiltSensorCh3 { get; }
float SysTempC { get; }
byte SyncClockEnable { get; }
byte ADCExtClockSyncEnable { get; }
byte SyncClockStatus { get; }
byte ADCExtClockSyncStatus { get; }
ulong EventTriggerSample { get; }
float[] ChannelOffsetMV { get; }
float[] ShuntDeviationPercent { get; }
DateTime Timestamp { get; }
```
### IDASFactory
Primary factory interface for DAS device management:
```csharp
bool PingAll();
string Language { get; set; }
void TakeOwnership();
bool AllowSDBCommandPort { get; set; }
double S6ConnectNewTimeout { get; set; }
string[] SliceDBHostNames { get; set; }
string[] GetConnectedDevices();
string[] TDASHostNames { get; set; }
string[] TDASSerialPortNames { get; set; }
string TDASSerialRackSerialNumber { get; set; }
List<IDASCommunication> GetDASList();
List<IDASCommunication> GetSortedDASList();
List<ICommunication> GetDevList();
void DetachAllDevices(bool detachUSB = false);
void Refresh(ActionCompleteDelegate action);
int MultiCastAutoDiscoveryDefaultTimeoutMS { get; set; }
SortableBindingList<IDiscoveredDevice> AutoDiscoverMulticast(bool discoverParents = true);
```
### ICommunication
Low-level communication interface extending `IComparable<ICommunication>` and `IComparable<string>`:
```csharp
IConnection Transport { get; set; }
void SetupReader();
int ReceiveBufferSize { get; set; }
string SerialNumber { get; set; }
string FirmwareVersion { get; set; }
byte ProtocolVersion { get; set; }
ICommunication_DASInfo DASInfo { get; set; }
Dictionary<DFConstantsAndEnums.ProtocolLimitedCommands, byte> MinimumProtocols { get; set; }
void InitMinProto();
bool IsCommandSupported(DFConstantsAndEnums.ProtocolLimitedCommands command);
byte GetMinProto(DFConstantsAndEnums.ProtocolLimitedCommands command);
event EventHandler OnDisconnected;
string ConnectString { get; }
bool Connected { get; }
void Connect(string ConnectString, CommunicationConstantsAndEnums.CommunicationCallback Callback, object CallbackObject, int CallbackTimeout, string ipAddress);
void Disconnect(bool reuseSocket, CommunicationConstantsAndEnums.CommunicationCallback Callback, object CallbackObject, int CallbackTimeout);
void Close(int Timeout);
void Flush(int Timeout);
bool ExecuteIsBusy { get; set; }
void Execute(byte[] byteData, CommunicationConstantsAndEnums.CommunicationCallback Callback, object CallbackObject, int CallbackTimeout);
void PseudoExecute(byte[] byteData, CommunicationConstantsAndEnums.CommunicationCallback Callback, object CallbackObject, int CallbackTimeout);
byte[] SyncExecute(byte[] byteData, int Timeout);
void Cancel();
void ForceCancel();
bool IsCanceled();
void ClearCancel();
ManualResetEvent CancelEvent { get; }
```
### IDiscoveredDevice
Interface for multicast-discovered devices:
```csharp
string Serial { get; set; }
MultiCastDeviceClasses DevClass { get; set; }
string Mac { get; set; }
IDiscoveredDevice Parent { get; set; }
bool IsParent(IDiscoveredDevice possibleChild);
int GetPort(IDiscoveredDevice device);
int GetSlot(IDiscoveredDevice child, Dictionary<string, IDiscoveredDevice> lookup);
int GetSlotOnPort(IDiscoveredDevice child, Dictionary<string, IDiscoveredDevice> lookup);
bool IsModule { get; set; }
int Port { get; set; }
int PositionOnDistributor { get; set; }
int PositionOnChain { get; set; }
bool Dhcp { get; set; }
string Ip { get; set; }
string Subnet { get; set; }
string Gateway { get; set; }
string Dns { get; set; }
bool Connected { get; set; }
string ConnectedIp { get; set; }
string ConnectedHost { get; set; }
ushort SystemId { get; set; }
string Location { get; set; }
string FirmwareVersion { get; set; } // Format: [Product Name]-[FW/BL]-[REL/DBG]-[Board #]-[FW Ver Name]
string BuildId { get; set; }
IConnectedEthernetDevice[] Connections { get; set; }
```
### IAnalogInputDASChannel
Comprehensive interface for analog input channel configuration (100+ members). Key properties include:
**Bridge Configuration:**
```csharp
SensorConstants.BridgeType TypeOfBridge { get; set; }
SensorConstants.BridgeType[] SupportedBridges { get; set; }
double BridgeResistanceOhms { get; set; }
```
**Sensor Properties:**
```csharp
double SensorCapacityEU { get; set; }
double SensorCapacity { get; set; }
string SensorPolarity { get; set; }
double DesiredRangeWithHeadroomEU { get; set; }
double SensitivityMilliVoltsPerEU { get; set; }
double SensitivityMilliVoltsPerEUNormalized { get; }
bool IsProportionalToExcitation { get; set; }
bool IsInverted { get; set; }
```
**Channel Identification:**
```csharp
string OriginalChannelName { get; set; }
string ChannelName2 { get; set; }
string ChannelId { get; set; }
string ChannelGroupName { get; set; }
string HardwareChannelName { get; set; }
```
**Excitation:**
```csharp
ExcitationVoltageOptions.ExcitationVoltageOption Excitation { get; set; }
ExcitationVoltageOptions.ExcitationVoltageOption[] SupportedExcitation { get; set; }
bool IsSupported(ExcitationVoltageOptions.ExcitationVoltageOption o);
```
**Digital Input:**
```csharp
DigitalInputModes[] SupportedDigitalInputModes { get; set; }
DigitalInputModes DigitalMode { get; set; }
string DIUnits { get; set; }
bool DigitalInputChannel { get; set; }
```
**Zero Configuration:**
```csharp
ZeroMethodType ZeroMethod { get; set; }
double ZeroAverageStartSeconds { get; set; }
double ZeroAverageStopSeconds { get; set; }
double InitialEU { get; set; }
string InitialOffset { get; set; }
```
**Diagnostics:**
```csharp
bool ShuntIsEnabled { get; set; }
int ShuntTargetADC { get; set; }
bool VoltageInsertionCheckEnabled { get; set; }
bool RemoveOffset { get; set; }
bool VerifyOffset { get; set; }
double OffsetToleranceLowMilliVolts { get; set; }
double OffsetToleranceHighMilliVolts { get; set; }
IDiagnosticResult Diagnostics { get; }
IDiagnosticResult DiagnosticInformation { get; }
```
**Level Triggering:**
```csharp
double? TriggerBelowThresholdEu { get; set; }
double? TriggerAboveThresholdEu { get; set; }
bool AlreadyLevelTriggered { get; set; }
double MeasuredEULevelTriggerCheck { get; set; }
```
**XML Serialization:**
```csharp
void WriteElementEnd(XmlWriter writer);
void WriteXml(XmlWriter writer);
void WriteXmlCRC32(XmlWriter writer);
string GetSupportedExcitationSerialized();
string GetSupportedDigitalInputModesSerialized();
string GetSupportedBridgesSerialized();
```
### IDASCommunication
Primary interface for DAS unit interaction. Extends multiple capability interfaces:
- `IConfiguration`, `IDiagnos`, `ITriggerCheck`, `IRealTime`, `IArmStatus`, `IDownload`, `IInformation`
- `IComparable<IDASCommunication>`, `IDisposable`, `IAutoArmStatus`, `IAutoArmed`, `IRangeBandwidthLimited`, `ITimeSynchronization`
**Key Properties:**
```csharp
ExcitationStatus ExcitationStatus { get; set; }
DateTime? FirstUseDate { get; set; }
bool IsFirstUseDateSupported { get; set; }
bool IsStreamingSupported { get; set; }
HardwareTypes GetHardwareType();
int RecordId { get; set; }
string SerialNumber { get; set; }
string FirmwareVersion { get; }
bool DiagnosticsHasBeenRun { get; set; }
bool ConfigureHasBeenRun { get; set; }
string MACAddress { get; set; }
string[] DownstreamMACAddresses { get; set; }
```
**Voltage Thresholds:**
```csharp
float InputLowVoltage { get; set; }
float InputMediumVoltage { get; set; }
float InputHighVoltage { get; set; }
float BatteryLowVoltage { get; set; }
float BatteryMediumVoltage { get; set; }
float BatteryHighVoltage { get; set; }
double MinimumValidInputVoltage { get; set; }
double MaximumValidInputVoltage { get; set; }
double MinimumValidBatteryVoltage { get; set; }
double MaximumValidBatteryVoltage { get; set; }
```
**Channel & Memory:**
```csharp
int NumberOfConfiguredChannels();
int NumberOfChannels();
long MaxMemory();
int MaxModules { get; set; }
```
**Sample Rates:**
```csharp
uint MinSampleRate();
uint MaxSampleRate(int numberOfConfiguredChannels);
uint MaxAAFilterRate();
```
**Capability Queries:**
```csharp
bool SupportsAutoArm();
bool SupportsLevelTrigger();
bool SupportsRealtime();
bool SupportsMultipleEvents();
bool SupportsTriggerInversion();
bool SupportsStartInversion();
bool SupportsHardwareInputCheck();
bool SupportsMultipleSampleRealtime();
bool SupportsIndividualChannelRealtimeStreaming { get; }
bool InvertTrigger { set; }
bool InvertStart { get; set; }
bool IgnoreShortedStart { get; set; }
bool IgnoreShortedTrigger { get; set; }
```
**Hardware Type Checks:**
```csharp
bool IsEthernetDistributor();
bool IsSlice6Distributor();
bool IsBattery();
bool IsTSRAIR();
bool IsSlice6Air();
bool ControlsDAQ();
bool IsStreamingSupported { get; set; }
```
**Operations:**
```csharp
void ReadFirstUseDate();
void SetIsStreamingSupported(bool supported = false);
bool ConnectionCheck();
double[] GetNominalRanges(SensorConstants.BridgeType bridge);
bool CheckAAF(float rate);
bool RequireDiagnosticRateMatchSampleRate();
ulong GetPhaseShiftSamples(uint ModuleIndex, double ActualSampleRate, uint HardwareAAF, ulong originalT0);
bool GetCanCheckArmStatus();
```
---
## 3. Invariants
1. **Channel Configuration**: A channel is considered "configured" if and only if `SerialNumber` field is populated (per `IsConfigured()` contract in `IAnalogInputDASChannel`).
2. **First Use Date**: `FirstUseDate` is only valid when `IsFirstUseDateSupported` is `true`. A `null` value indicates the hardware has not been used since calibration.
3. **Protocol Versioning**: Commands must be checked via `IsCommandSupported()` before execution on `ICommunication` implementations, as protocol support varies by firmware version.
4. **SetupReader Requirement**: `SetupReader()` must be called whenever a socket is connected (per comment in `ICommunication`).
5. **Diagnostics/Configuration State**: `DiagnosticsHasBeenRun` and `ConfigureHasBeenRun` flags indicate whether these operations have been executed and should be checked before relying on diagnostic results.
6. **Phase Shift Calculation**: `GetPhaseShiftSamples()` returns 0 for most DAS types as phase delay is only known for specific hardware.
7. **Position Hierarchy**: For devices on a SLICE6DB, `PositionOnDistributor` and `PositionOnChain` track device location when individual SLICE6 devices are not shown in UI.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Enums` - Core enumerations
- `DTS.Common.Enums.Communication` - Communication-specific enums
- `DTS.Common.Enums.DASFactory` - DAS factory enums including `DFConstantsAndEnums`, `MultiCastDeviceClasses`
- `DTS.Common.Enums.Hardware` - `HardwareTypes`, `ExcitationStatus`
- `DTS.Common.Enums.Sensors` - `SensorConstants.BridgeType`, `SensorConstants.CouplingModes`, `ExcitationVoltageOptions`, `DigitalInputModes`, `ZeroMethodType`
- `DTS.Common.Interface.Communication` - Communication interfaces
- `DTS.Common.Interface.Connection` - `IConnection` interface
- `DTS.Common.Interface.DASFactory.ARM` - ARM-related interfaces
- `DTS.Common.Interface.DASFactory.Config` - Configuration interfaces
- `DTS.Common.Interface.DASFactory.Diagnostics` - `IDiagnosticResult`, `IDiagnos`
- `DTS.Common.Interface.DASFactory.Download` - Download interfaces
- `DTS.Common.Interface.Sensors.SoftwareFilters` - `IFilterClass`
- `DTS.Common.Interface.StatusAndProgressBar` - `ActionCompleteDelegate`
- `DTS.Common.Utilities` - `SortableBindingList<T>`
- `System.Xml` - `XmlWriter` for serialization
### What depends on this module:
Cannot be determined from source alone, but `IDASCommunication` documentation states it is "the most used data structure in the API" with nearly all hardware services taking `List<IDASCommunication>` as a parameter.
---
## 5. Gotchas
1. **SoftwareFilterClass Refactoring** (IAnalog

View File

@@ -0,0 +1,38 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Common.CPU/IcpuEngine.cs
generated_at: "2026-04-16T12:17:51.395302+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "920a09a2c868b9d9"
---
# Documentation: ICPUEngine Interface
## 1. Purpose
This module defines the `ICPUEngine` interface within the `DTS.Common.Interface` namespace. It serves as a specific contract for CPU engine components, deriving from a base system interface `IBaseClass`. Currently, the interface acts as a marker or placeholder, as it defines no custom members of its own, implying that all necessary behavior is currently inherited or that the implementation is pending extension.
## 2. Public Interface
### `ICPUEngine`
**Signature:**
```csharp
public interface ICPUEngine : IBaseClass
```
**Description:**
This is the primary public type defined in this file. It is an empty interface that inherits from `IBaseClass`. It exposes no methods, properties, or events directly; its public interface consists entirely of the members inherited from `IBaseClass`.
## 3. Invariants
* Any class implementing `ICPUEngine` must also implement `IBaseClass` (defined in `DTS.Common.Base`).
* As the interface currently defines no members, it functions strictly as a type definition or marker within the type hierarchy.
## 4. Dependencies
* **Depends on:**
* `DTS.Common.Base` (specifically the `IBaseClass` interface).
* **Dependents:**
* Unknown from this source file alone. Concrete CPU engine implementations would implement this interface.
## 5. Gotchas
* **Empty Interface:** The `ICPUEngine` interface defines no members. Developers should not expect CPU-specific methods (such as execution cycles or instruction handling) to be available on variables typed as `ICPUEngine` unless they are defined on `IBaseClass`.
* **Naming/Location Discrepancy:** The file path suggests a directory named `DTS.Common.CPU` (`.../Interface/DTS.Common.CPU/IcpuEngine.cs`), but the namespace declared in the code is `DTS.Common.Interface`. This may cause confusion when locating the file versus the namespace usage.
* **File Casing:** The filename is `IcpuEngine.cs` (lowercase 'cpu'), while the interface name is `ICPUEngine` (uppercase 'CPU'). This inconsistency in casing could lead to confusion or issues on case-sensitive file systems.

View File

@@ -0,0 +1,269 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDiagView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITestsView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IStatsView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ICursorView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabItemView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IPropertyView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerShellView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IGraphPropertyView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelVerticalView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelHorizontalView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/GroupChannelReadCalcDelegate.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDiagViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IStatsViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ICursorViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITestsViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IPropertyViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerModule.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IPSDReportModule .cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IGraphPropertyViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelVerticalViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IDockPanelHorizontalViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ITabItemViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IViewerShellViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainLiteView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainViewerView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ISelectedDataViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainLiteViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/IMainViewModel.cs
generated_at: "2026-04-16T12:14:43.492195+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "fed47436f7c090f0"
---
# DTS.Common.Interface Viewer Module Documentation
## 1. Purpose
This module defines the contract layer for the DTS Viewer application's presentation components. It establishes a Model-View-ViewModel (MVVM) architecture through a comprehensive set of interfaces for views, view models, and modules. The interfaces enable loose coupling between UI components and their controllers, supporting a modular, plugin-based architecture built on Microsoft Prism. This abstraction layer allows different concrete implementations of views and view models to be swapped without affecting dependent code.
---
## 2. Public Interface
### View Interfaces
All view interfaces inherit from `IBaseView` (defined in `DTS.Common.Base`) and are currently marker interfaces with no additional members:
| Interface | Description |
|-----------|-------------|
| `ITabView` | Marker interface for tab views |
| `IDiagView` | Marker interface for diagnostic views |
| `ITestsView` | Marker interface for test views |
| `IStatsView` | Marker interface for statistics views |
| `ICursorView` | Marker interface for cursor views |
| `IViewerView` | Marker interface for viewer views |
| `ITabItemView` | Marker interface for individual tab item views |
| `IPropertyView` | Marker interface for property views |
| `IViewerShellView` | Marker interface for the main shell view |
| `IGraphPropertyView` | Marker interface for graph property views |
| `IDockPanelVerticalView` | Marker interface for vertical dock panel views |
| `IDockPanelHorizontalView` | Marker interface for horizontal dock panel views |
#### `IMainLiteView`
```csharp
public interface IMainLiteView : IBaseView
{
StackPanel MainShell { get; set; }
ContentControl MainRegion { get; set; }
ContentControl NavigationRegion { get; set; }
ContentControl HorizontalTabRegion { get; set; }
ContentControl VerticalTabRegion { get; set; }
}
```
Exposes WPF region controls for the "Lite" version of the main view.
#### `IMainViewerView`
```csharp
public interface IMainViewerView : IBaseView
{
// All members commented out in source
}
```
Marker interface for the main viewer view. Region properties are commented out in the source.
---
### ViewModel Interfaces
All view model interfaces inherit from `IBaseViewModel` (defined in `DTS.Common.Base`).
#### Standard ViewModel Interfaces
Each provides a `View` property returning its corresponding view interface:
| Interface | View Property Type |
|-----------|-------------------|
| `ITabViewModel` | `ITabView View { get; }` |
| `IDiagViewModel` | `IDiagView View { get; }` |
| `IStatsViewModel` | `IStatsView View { get; }` |
| `ICursorViewModel` | `ICursorView View { get; }` |
| `ITestsViewModel` | `ITestsView View { get; }` |
| `IViewerViewModel` | `IViewerView View { get; }` |
| `IPropertyViewModel` | `IPropertyView View { get; }` |
| `IGraphPropertyViewModel` | `IGraphPropertyView View { get; }` |
| `IDockPanelVerticalViewModel` | `IDockPanelVerticalView View { get; }` |
| `IDockPanelHorizontalViewModel` | `IDockPanelHorizontalView View { get; }` |
#### `ITabItemViewModel`
```csharp
public interface ITabItemViewModel : IBaseViewModel
{
ITabItemView View { get; }
ITabViewModel Parent { get; }
}
```
Represents a tab item with a reference to its parent `ITabViewModel`.
#### `IViewerShellViewModel`
```csharp
public interface IViewerShellViewModel : IBaseViewModel
{
IViewerShellView View { get; }
List<FrameworkElement> GetRegions();
object ContextMainRegion { get; set; }
}
```
The shell view model providing region management and main region context.
#### `IMainLiteViewModel`
```csharp
public interface IMainLiteViewModel : IBaseViewModel
{
IMainView View { get; }
object ContextMainRegion { get; set; }
object ContextNavigationRegion { get; set; }
object ContextHorizontalTabRegion { get; set; }
object ContextVerticalTabRegion { get; set; }
List<FrameworkElement> GetRegions();
}
```
**Note:** Returns `IMainView` (not `IMainLiteView`), which is not defined in the provided source files.
#### `IMainViewerViewModel`
```csharp
public interface IMainViewerViewModel : IBaseViewModel
{
IBaseView View { get; }
object ContextMainRegion { get; set; }
object ContextNavigationRegion { get; set; }
object ContextHorizontalTabRegion { get; set; }
object ContextVerticalTabRegion { get; set; }
List<FrameworkElement> GetRegions();
}
```
Returns `IBaseView` directly rather than a specific view interface.
---
### Module Interfaces
#### `IViewerModule`
```csharp
public interface IViewerModule : IModule
{
void StartSession(bool standalone, string pluginFolder = "");
}
```
Defines a Prism module for the viewer with session initialization capability.
#### `IPSDReportModule`
```csharp
public interface IPSDReportModule : IModule
{
void StartSession(bool standalone, string pluginFolder = "");
}
```
Defines a Prism module for PSD reporting with identical session initialization signature.
---
### Other Types
#### `SetReadCalcProgressValueDelegate`
```csharp
public delegate void SetReadCalcProgressValueDelegate(string message = "", double value = -1D);
```
A delegate type for reporting progress during read/calculation operations. Default parameters allow calling with no arguments.
#### `ISelectedDataViewModel`
```csharp
public interface ISelectedDataViewModel
{
string SelectedDataFolder { get; set; }
string SelectedDataFile { get; set; }
void SelectAndIncludeDataFile(string file);
}
```
**Does NOT inherit from `IBaseViewModel`.** Manages data file selection with a method to both select and include a file as a test. The XML comment references bug "16158 Browse button on View Data tab not functional."
---
## 3. Invariants
- All view interfaces (except `ISelectedDataViewModel`) must inherit from `IBaseView`.
- All view model interfaces (except `ISelectedDataViewModel`) must inherit from `IBaseViewModel`.
- Each standard view model interface must expose a read-only `View` property returning its corresponding view interface type.
- `ITabItemViewModel.Parent` must return a valid `ITabViewModel` instance (parent-child relationship is expected).
- `StartSession` on module interfaces must be called to initialize the module with explicit `standalone` mode specification.
- Region context properties (`ContextMainRegion`, `ContextNavigationRegion`, etc.) are expected to be set by the framework or controlling code before views are rendered.
---
## 4. Dependencies
### External Dependencies
| Dependency | Usage |
|------------|-------|
| `DTS.Common.Base` | Provides `IBaseView` and `IBaseViewModel` base interfaces |
| `Microsoft.Practices.Prism.Modularity` | Provides `IModule` interface for module definitions |
| `System.Windows` | Provides `FrameworkElement` for region management |
| `System.Windows.Controls` | Provides `StackPanel`, `ContentControl` for view composition |
### Downstream Dependencies
**Unclear from source alone.** These interfaces are contract definitions; concrete implementations and consumers are not present in the provided files. The naming convention suggests implementations exist in a `DTS.Viewer` assembly or namespace.
---
## 5. Gotchas
1. **`IMainLiteViewModel.View` returns `IMainView`** — This interface references `IMainView`, which is not defined in any of the provided source files. This may be a typo for `IMainLiteView` or a separate interface.
2. **`IMainViewerView` has all members commented out** — The interface exists but all its region properties are commented out. This may indicate incomplete refactoring or an abandoned change.
3. **`ISelectedDataViewModel` does not follow the pattern** — Unlike all other view model interfaces, this one does not inherit from `IBaseViewModel` and has no `View` property. It appears to be a utility interface rather than a true MVVM view model.
4. **Inconsistent XML comments** — Some interfaces have XML documentation (e.g., `ITabViewModel`, `ITabItemViewModel`), while others do not. Some comments are copy-pasted incorrectly (e.g., `IViewerViewModel` says "Gets the Tests View" but returns `IViewerView`).
5. **`SetReadCalcProgressValueDelegate` naming mismatch** — The filename is `GroupChannelReadCalcDelegate.cs` but the delegate is named `SetReadCalcProgressValueDelegate`.
6. **`IPSDReportModule` filename has trailing space** — The filename is `IPSDReportModule .cs` (note the space before the extension).

View File

@@ -0,0 +1,83 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/CalculatedChannel/IAddCalculatedChannelView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/CalculatedChannel/IAddCalculatedChannelViewModel.cs
generated_at: "2026-04-16T12:23:49.838372+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "720d768a9bb759bc"
---
# Documentation: IAddCalculatedChannelView & IAddCalculatedChannelViewModel
## 1. Purpose
This module defines the view and viewmodel interfaces for the "Add Calculated Channel" feature within a larger MVVM (Model-View-ViewModel) architecture. `IAddCalculatedChannelView` serves as a marker interface for the view component, while `IAddCalculatedChannelViewModel` defines the contract for the viewmodel, exposing commands and properties for managing calculated channel creation, ISO export settings, DTS encoding defaults, and search context regions.
---
## 2. Public Interface
### IAddCalculatedChannelView
**Declaration:**
```csharp
public interface IAddCalculatedChannelView : IBaseView { }
```
A marker interface extending `IBaseView`. Contains no members.
---
### IAddCalculatedChannelViewModel
**Declaration:**
```csharp
public interface IAddCalculatedChannelViewModel : IBaseViewModel
```
**Properties:**
| Name | Type | Access | Description |
|------|------|--------|-------------|
| `View` | `IBaseView` | get/set | The Search View associated with this viewmodel. |
| `Parent` | `IBaseViewModel` | get/set | Reference to the parent viewmodel in the hierarchy. |
| `IncludeGroupNameInISOExport` | `bool` | get/set | Controls whether group names are included in ISO export output. |
| `DefaultDTSEncoding` | `int` | get/set | The default DTS encoding value for calculated channels. |
| `AddCalculatedChannelCommand` | `ICommand` | get | Command to add a calculated channel. |
| `ContextSearchRegion` | `object` | get/set | Context object for the search region. |
**Methods:**
| Name | Return Type | Description |
|------|-------------|-------------|
| `PublishChanges()` | `void` | Publishes or commits pending changes. Behavior specifics not documented in source. |
---
## 3. Invariants
- `IAddCalculatedChannelView` must always be assignable to `IBaseView`.
- `IAddCalculatedChannelViewModel` must always be assignable to `IBaseViewModel`.
- `AddCalculatedChannelCommand` is read-only (getter only); it cannot be replaced after initialization, only executed.
- The presence of `Parent` property implies a hierarchical viewmodel structure that must be maintained.
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
- `System.Windows.Input` — Provides `ICommand` interface for the `AddCalculatedChannelCommand` property.
**Consumers:**
- Unknown from source alone. These interfaces are intended to be implemented by concrete view and viewmodel classes elsewhere in the codebase.
---
## 5. Gotchas
- **Namespace mismatch:** Both files include `// ReSharper disable CheckNamespace`, indicating the declared namespace (`DTS.Common.Interface`) may not match the folder structure (`Common/DTS.CommonCore/Interface/DTS.Viewer/CalculatedChannel/`). This could cause confusion when locating files or during refactoring.
- **Marker interface:** `IAddCalculatedChannelView` has no members and serves only as a type marker. Any view-specific behavior must come from `IBaseView` or be cast to a more specific type.
- **`ContextSearchRegion` type:** The property is typed as `object`, suggesting loose typing. The actual expected type and usage pattern is unclear from source alone.
- **`PublishChanges()` semantics:** The method name suggests an event-publishing or change-commit pattern, but the exact behavior (what changes are published, to whom, and when this should be called) is not documented in the source.

View File

@@ -0,0 +1,172 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/ChartOptions/IChartOptionsView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ChartOptions/IChartOptionsViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ChartOptions/IChartOptionsModel.cs
generated_at: "2026-04-16T12:25:32.635258+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a0d576d041a71e53"
---
# Documentation: Chart Options Interfaces
## 1. Purpose
This module defines the contract for chart configuration and visualization options within the DTS system. It provides three interfaces (`IChartOptionsView`, `IChartOptionsViewModel`, `IChartOptionsModel`) that follow an MVVM (Model-View-ViewModel) pattern to manage chart display settings including axis scaling, cursors, unit types, filtering, and export functionality. These interfaces enable decoupled communication between UI components and business logic for chart rendering.
---
## 2. Public Interface
### IChartOptionsView
**Namespace:** `DTS.Common.Interface`
A marker interface extending `IBaseView` with no additional members.
```csharp
public interface IChartOptionsView : IBaseView { }
```
---
### IChartOptionsViewModel
**Namespace:** `DTS.Common.Interface`
Extends `IBaseViewModel` and coordinates between the view and model for chart options.
| Member | Type | Description |
|--------|------|-------------|
| `View` | `IBaseView` | Gets or sets the Search View. |
| `Parent` | `IBaseViewModel` | Gets or sets the parent view model. |
| `Model` | `IChartOptionsModel` | Gets or sets the associated chart options model. |
| `ContextSearchRegion` | `object` | Gets or sets a context search region object. |
**Methods:**
| Method | Signature | Description |
|--------|-----------|-------------|
| `PublishChanges` | `void PublishChanges()` | Publishes pending changes. |
| `ResetZoomMethod` | `void ResetZoomMethod()` | Resets the chart zoom. |
| `ResetTMethod` | `void ResetTMethod()` | Resets the time axis. |
| `SaveToPDFMethod` | `void SaveToPDFMethod()` | Saves the chart to PDF. |
| `ShowCusor` | `void ShowCusor(bool value)` | Shows or hides the cursor. |
| `ShowMinMaxCursor` | `void ShowMinMaxCursor(bool value)` | Shows or hides the min/max cursor. |
---
### IChartOptionsModel
**Namespace:** `DTS.Common.Interface`
Extends `IBaseModel` and holds all chart configuration state and commands.
**ADC/mV Display Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `SupportsADC` | `bool` | True if all channels support ADC. |
| `SupportsMV` | `bool` | True if all channels support mV. |
| `DisplayingVolts` | `bool` | Indicates if current mV option is for Volts or mV. |
| `MVOrV` | `string` | Returns "mV" or "V" depending on `DisplayingVolts` value. |
**Y-Axis Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `FullScaleValues` | `List<double>` | Available full scale values. |
| `SelectedFullScaleValue` | `double` | Currently selected full scale value. |
| `MinFixedY` | `double` | Minimum fixed Y value. |
| `MaxFixedY` | `double` | Maximum fixed Y value. |
| `LockedY` | `bool` | Indicates if Y-axis is locked. |
| `YRange` | `YRangeScaleEnum` | Y-axis range scale setting. |
| `UnitType` | `ChartUnitTypeEnum` | Chart unit type. |
| `UnitTypeDescription` | `string` | Description of the unit type (getter only). |
**Time Axis Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `MinFixedT` | `double` | Minimum fixed T value. |
| `MaxFixedT` | `double` | Maximum fixed T value. |
| `LockedT` | `bool` | Indicates if T-axis is locked. |
| `TimeUnitType` | `TimeUnitTypeEnum` | Time unit type setting. |
**Cursor Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `ShowCursor` | `bool` | Indicates if cursor is shown. |
| `CurrentCursorValues` | `string` | Current cursor values as string. |
| `IsCursorsAvailable` | `bool` | Indicates if cursors are available. |
**Filter Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `Filter` | `FilterOptionEnum` | Filter option setting. |
| `SelectedFilter` | `IFilterClass` | Selected filter class instance. |
**Other Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `Parent` | `IChartOptionsViewModel` | Parent view model reference. |
| `CanPublishChanges` | `bool` | Indicates if changes can be published. |
| `ReadData` | `bool` | Indicates if data should be read. |
| `IsDigitalChannel` | `bool` | Indicates if channel is digital. |
| `DecimateData` | `bool` | Indicates if data should be decimated. |
| `WidthPoints` | `long` | Width points value. |
**Commands:**
| Property | Type | Description |
|----------|------|-------------|
| `ResetZoomCommand` | `DelegateCommand` | Command to reset zoom. |
| `ResetTCommand` | `DelegateCommand` | Command to reset time axis. |
| `SaveToPDFCommand` | `DelegateCommand` | Command to save to PDF. |
---
## 3. Invariants
1. **Namespace Mismatch:** All three interfaces are declared in `DTS.Common.Interface` namespace, despite the file path suggesting `DTS.Viewer.ChartOptions`. The `// ReSharper disable CheckNamespace` directive indicates this is intentional.
2. **MVVM Hierarchy:**
- `IChartOptionsView` must implement `IBaseView`
- `IChartOptionsViewModel` must implement `IBaseViewModel`
- `IChartOptionsModel` must implement `IBaseModel`
3. **Parent-Child Relationships:**
- `IChartOptionsModel.Parent` must reference the `IChartOptionsViewModel` that owns it
- `IChartOptionsViewModel.Model` must reference the `IChartOptionsModel` it manages
4. **Unit Display Logic:** `MVOrV` property return value is determined by `DisplayingVolts` state.
5. **Command Availability:** The model exposes commands as `DelegateCommand` (Prism), implying they follow the `ICommand` pattern with execute/can-execute semantics.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` - Provides `IBaseView`, `IBaseViewModel`, `IBaseModel`
- `DTS.Common.Enums.Viewer` - Provides `YRangeScaleEnum`, `ChartUnitTypeEnum`, `TimeUnitTypeEnum`, `FilterOptionEnum`
- `DTS.Common.Interface.Sensors.SoftwareFilters` - Provides `IFilterClass`
- `Microsoft.Practices.Prism.Commands` - Provides `DelegateCommand`
- `System.Collections.Generic` - Provides `List<T>`
- `System.Windows.Input` - Provides `ICommand` (indirectly via `DelegateCommand`)
### What depends on this module:
- **Unclear from source alone** - No consumers are shown in these files. Likely implementations exist in a viewer/charting module.
---
## 5. Gotchas
1. **Typo in Method Name:** `ShowCusor(bool value)` is misspelled (should be `ShowCursor`). This typo is part of the public API and must be used as-is.
2. **Namespace/Path Inconsistency:** Files are located in `Common/DTS.CommonCore/Interface/DTS.Viewer/ChartOptions/` but declare namespace `DTS.Common.Interface`. The ReSharper suppression confirms this is deliberate but may cause confusion during navigation.
3. **Command vs Method Duplication:** `IChartOptionsModel` exposes `ResetZoomCommand`, `ResetTCommand`, `SaveToPDFCommand` while `IChartOptionsViewModel` exposes corresponding methods `ResetZoomMethod()`, `ResetTMethod()`, `SaveToPDFMethod()`. The relationship between these is not documented in the source.
4. **Mixed Naming Conventions:** Some methods use `Method` suffix (e.g., `ResetZoomMethod`) while properties use `Command` suffix (e.g., `ResetZoomCommand`). The rationale is unclear from source alone.

View File

@@ -0,0 +1,67 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/Filter/IFilterView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Filter/IFilterViewModel.cs
generated_at: "2026-04-16T12:24:10.338285+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "0d8966c24bd001af"
---
# Documentation: DTS.Common.Interface Filter Components
## 1. Purpose
This module defines the core interfaces for filter components within the DTS viewer system. It establishes a View-ViewModel contract for filter UI elements, following the MVVM (Model-View-ViewModel) pattern. The `IFilterView` and `IFilterViewModel` interfaces provide the abstraction layer that allows filter components to be integrated into the broader application architecture while maintaining separation between presentation and business logic.
---
## 2. Public Interface
### `IFilterView`
**Location:** `DTS.Common.Interface` namespace
**Inheritance:** `IBaseView`
A marker interface with no members. It extends `IBaseView` and serves to identify views that are specifically filter views within the type system.
---
### `IFilterViewModel`
**Location:** `DTS.Common.Interface` namespace
**Inheritance:** `IBaseViewModel`
| Property | Type | Accessor | Description |
|----------|------|----------|-------------|
| `View` | `IBaseView` | `get; set;` | Gets or sets the Search View associated with this filter view model. |
| `Parent` | `IBaseViewModel` | `get; set;` | Gets or sets the parent view model in the hierarchy. |
| `ContextSearchRegion` | `object` | `get; set;` | Gets or sets a context object for the search region. Purpose unclear from source alone. |
---
## 3. Invariants
- **Type Hierarchy:** `IFilterView` must always be assignable to `IBaseView`. `IFilterViewModel` must always be assignable to `IBaseViewModel`.
- **View Association:** The `View` property on `IFilterViewModel` is typed as `IBaseView` (not `IFilterView`), suggesting the view model may be associated with views broader than just filter views.
- **Parent-Child Relationship:** The `Parent` property establishes a hierarchical relationship between view models, though no validation or lifecycle management is defined at this interface level.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces
### What depends on this module:
- **Cannot be determined from source alone.** No imports or usages are visible in the provided files.
---
## 5. Gotchas
1. **Namespace suppression:** The file `IFilterViewModel.cs` contains a `// ReSharper disable CheckNamespace` directive, suggesting the declared namespace (`DTS.Common.Interface`) may not match the project's default namespace structure. This could indicate a historical refactoring or organizational inconsistency.
2. **Weakly-typed context:** The `ContextSearchRegion` property is typed as `object`, providing no compile-time type safety. Consumers must know the expected runtime type through external documentation or convention.
3. **Missing XML documentation:** Only the `View` property has XML documentation (`<summary>` comment). The `Parent` and `ContextSearchRegion` properties lack documentation, leaving their intended usage and semantics unclear.
4. **Marker interface with no contract:** `IFilterView` defines no members beyond inheriting `IBaseView`. Its purpose appears to be purely for type identification, but the specific behaviors or capabilities it signals are not documented in source.

View File

@@ -0,0 +1,224 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphMainView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphChannelView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphPropertyView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphPropertyViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataSeriesView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataSeriesViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphChannelViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/IGraphMainViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Graphs/ITestDataSeries.cs
generated_at: "2026-04-16T12:24:37.475119+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "99208da86b0faad5"
---
# Documentation: DTS.Common.Interface Graph Module
## 1. Purpose
This module defines the interface contracts for a graph visualization subsystem following the Model-View-ViewModel (MVVM) architectural pattern. It provides abstractions for rendering test data series, managing graph channels, editing graph properties, and coordinating channel selection/locking across the application. The interfaces serve as boundaries between UI components and business logic, enabling test-driven development and loose coupling between the graph visualization components and their consumers.
---
## 2. Public Interface
### View Interfaces
#### `IGraphMainView`
- **Signature:** `public interface IGraphMainView : IBaseView`
- **Behavior:** Marker interface for the main graph view container. No members defined; extends `IBaseView`.
#### `IGraphChannelView`
- **Signature:** `public interface IGraphChannelView : IBaseView`
- **Behavior:** Marker interface for the graph channel selection/configuration view. No members defined; extends `IBaseView`.
#### `IGraphPropertyView`
- **Signature:** `public interface IGraphPropertyView : IBaseView`
- **Behavior:** Marker interface for the graph property editing view. No members defined; extends `IBaseView`.
#### `ITestDataView`
- **Signature:** `public interface ITestDataView : IBaseView`
- **Behavior:** Marker interface for the test data view. No members defined; extends `IBaseView`.
#### `ITestDataSeriesView`
- **Signature:** `public interface ITestDataSeriesView : IBaseView`
- **Members:**
- `bool SaveReportToPDF(string directory)` — Exports the report to PDF format to the specified directory.
- `bool SaveReportToCSV(string directory)` — Exports the report to CSV format to the specified directory.
- **Behavior:** Provides export capabilities for test data series reports.
#### `IGraphView`
- **Signature:** `public interface IGraphView : IBaseView`
- **Members:**
- `//void SetGraphs(ObservableCollection<ITestDataSeries> graphs);` (commented out)
- **Behavior:** Marker interface for the graph rendering view. Contains one commented-out method for setting graph collections.
---
### ViewModel Interfaces
#### `IGraphPropertyViewModel`
- **Signature:** `public interface IGraphPropertyViewModel : IBaseViewModel`
- **Members:**
- `IGraphPropertyView View { get; }` — Gets the associated property view.
- **Behavior:** ViewModel contract for managing graph property view state.
#### `IGraphViewModel`
- **Signature:** `public interface IGraphViewModel : IBaseViewModel`
- **Members:**
- `IGraphView View { get; }` — Gets the associated graph view.
- `ITestDataSeriesView DataSeriesView { get; set; }` — Gets or sets the data series view.
- **Behavior:** ViewModel contract for the main graph view coordination.
#### `ITestDataViewModel`
- **Signature:** `public interface ITestDataViewModel : IBaseViewModel`
- **Members:**
- `ITestDataView View { get; set; }` — Gets or sets the associated test data view.
- `ITestDataSeries Model { get; set; }` — Gets or sets the underlying test data series model.
- **Behavior:** ViewModel contract for test data display and editing.
#### `ITestDataSeriesViewModel`
- **Signature:** `public interface ITestDataSeriesViewModel : IBaseViewModel`
- **Members:**
- `ITestDataSeriesView View { get; set; }` — Gets or sets the associated view.
- `ITestDataSeries Model { get; set; }` — Gets or sets the underlying test data series model.
- `void MoveCursor(object sender, KeyEventArgs e)` — Handles cursor movement events.
- `string CurrentCursorValues { get; set; }` — Gets or sets the current cursor position values for display.
- **Behavior:** ViewModel for test data series with interactive cursor functionality.
#### `IGraphChannelViewModel`
- **Signature:** `public interface IGraphChannelViewModel : IBaseViewModel`
- **Members:**
- `IGraphChannelView View { get; }` — Gets the associated channel view.
- `ObservableCollection<ITestChannel> GraphChannelList { get; set; }` — Collection of all available graph channels.
- `ObservableCollection<ITestChannel> SelectedGraphChannelList { get; set; }` — Collection of currently selected graph channels.
- `TestChannel SelectedGraphChannel { get; set; }` — The currently single-selected graph channel.
- **Behavior:** ViewModel for managing graph channel selection and display.
#### `IGraphMainViewModel`
- **Signature:** `public interface IGraphMainViewModel : IBaseViewModel`
- **Members:**
- `IGraphMainView View { get; set; }` — Gets or sets the main graph view.
- `IBaseViewModel Parent { get; set; }` — Gets or sets the parent ViewModel reference.
- `List<ITestChannel> LockedChannelList { get; set; }` — List of locked channels.
- `List<ITestChannel> SelectedChannelList { get; set; }` — List of selected channels.
- `string LockedGroupName { get; set; }` — Name of the locked group.
- `void PublishSelectedChannels()` — Publishes the current channel selection.
- `void AddSelectedChannel(ITestChannel channel)` — Adds a single channel to the selection.
- `void AddSelectedGroupChannels(string groupName, List<ITestChannel> channels)` — Adds multiple channels from a group to the selection.
- `void AddLockedChannel(ITestChannel channel, bool isLocked)` — Adds or updates a channel's locked state.
- `void AddLockedGroupChannels(string testName, string groupName, List<ITestChannel> channels, bool isLocked)` — Adds or updates multiple channels' locked state as a group.
- `void GraphList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)` — Handler for graph list collection changes.
- **Behavior:** Primary ViewModel for graph coordination, managing channel selection and locking state.
---
### Model Interface
#### `ITestDataSeries`
- **Signature:** `public interface ITestDataSeries : IBaseModel`
- **Members (Identification):**
- `string TestGroup { get; set; }`
- `string TestSetupName { get; set; }`
- `string TestId { get; set; }`
- `string ChannelId { get; set; }`
- `string HardwareChannel { get; set; }`
- `string Bridge { get; set; }`
- `string GroupName { get; set; }`
- `string ChannelName { get; set; }`
- `string Description { get; }`
- **Members (Data):**
- `double[] Xvalue { get; set; }` — X-axis data points.
- `double[] Yvalue { get; set; }` — Y-axis data points.
- `Brush GraphColor { get; set; }` — Visual color for the graph line.
- **Members (Configuration):**
- `string SWAAF { get; set; }`
- `string HWAAF { get; set; }`
- `string SampleRate { get; set; }`
- `string ISOCode { get; set; }`
- `string ISOChannelName { get; set; }`
- `string UserCode { get; set; }`
- `string UserChannelName { get; set; }`
- `string EngineeringUnits { get; set; }`
- `string Excitation { get; set; }`
- `string Polarity { get; set; }`
- `string RecordingMode { get; set; }`
- **Members (Sensor):**
- `string SensorSN { get; }`
- `string SensorSNDisplay { get; }`
- **Members (Statistics - read-only):**
- `string MinY { get; }`
- `string MaxY { get; }`
- `string AvgY { get; }`
- `string StdDevY { get; }`
- `string T0EUValue { get; }`
- **Members (FFT Analysis):**
- `bool FFT { get; }` — Indicates if this series is an FFT of signal data.
- `double PeakFrequency { get; }` — Peak frequency by magnitude (only populated when `FFT` is true).
- `double PeakMagnitude { get; }` — Peak magnitude of frequencies (only populated when `FFT` is true).
- `double GRMS { get; set; }` — Root-mean-squared acceleration (calculated in PSD results graphs).
- **Members (HIC - Head Injury Criterion):**
- `bool HIC { get; }` — Indicates if HIC calculation applies.
- `string HICValue { get; }`
- `string T1Time { get; }`
- `string T2Time { get; }`
- **Behavior:** Data model representing a complete test data series with metadata, raw data, and computed statistics. Supports both time-domain and frequency-domain (FFT) data representations.
---
## 3. Invariants
1. **Inheritance Hierarchy:** All view interfaces (`IGraphMainView`, `IGraphChannelView`, `IGraphPropertyView`, `ITestDataView`, `ITestDataSeriesView`, `IGraphView`) must extend `IBaseView`.
2. **Inheritance Hierarchy:** All ViewModel interfaces (`IGraphPropertyViewModel`, `IGraphViewModel`, `ITestDataViewModel`, `ITestDataSeriesViewModel`, `IGraphChannelViewModel`, `IGraphMainViewModel`) must extend `IBaseViewModel`.
3. **Inheritance Hierarchy:** `ITestDataSeries` must extend `IBaseModel`.
4. **FFT Data Population:** `PeakFrequency` and `PeakMagnitude` are only valid when `FFT` is `true`. Consumers must check `FFT` before accessing these properties.
5. **GRMS Context:** `GRMS` is only calculated for PSD (Power Spectral Density) results graphs.
6. **Observable Collections:** `IGraphChannelViewModel` uses `ObservableCollection<ITestChannel>` for both `GraphChannelList` and `SelectedGraphChannelList`, implying UI binding expectations for collection change notifications.
7. **Read-Only Statistics:** Statistical properties (`MinY`, `MaxY`, `AvgY`, `StdDevY`, `T0EUValue`, `PeakFrequency`, `PeakMagnitude`) are read-only and presumably computed from `Xvalue` and `Yvalue` arrays.
---
## 4. Dependencies
### This Module Depends On:
| Dependency | Usage |
|------------|-------|
| `DTS.Common.Base` | `IBaseView`, `IBaseViewModel`, `IBaseModel` base interfaces |
| `DTS.Common.Classes.Viewer.TestMetadata` | `TestChannel`, `ITestChannel` types |
| `DTS.Common.Events` | Referenced in `ITestDataSeriesView.cs` (specific types not visible in source) |
| `System.Windows.Input` | `KeyEventArgs` in `ITestDataSeriesViewModel` |
| `System.Windows.Media` | `Brush` type in `ITestDataSeries` |
| `System.Collections.ObjectModel` | `ObservableCollection<T>` |
| `System.Collections.Specialized` | `NotifyCollectionChangedEventArgs` |
### What Depends On This Module:
**Cannot be determined from source alone.** This module defines only interfaces; consumers would be concrete implementations and other modules that reference these contracts.
---
## 5. Gotchas
1. **Namespace Inconsistency:** Four files (`ITestDataView.cs`, `ITestDataSeriesView.cs`, `IGraphView.cs`, `ITestDataSeriesViewModel.cs`, `IGraphMainViewModel.cs`, `ITestDataSeries.cs`) contain `// ReSharper disable CheckNamespace`, suggesting the declared namespace `DTS.Common.Interface` may not match the file path structure. This could cause confusion when locating types.
2. **Commented-Out Code:** `IGraphView` contains a commented-out method `SetGraphs(ObservableCollection<ITestDataSeries> graphs)`. The reason for its removal and whether it should be restored or permanently deleted is unclear from source.
3. **Malformed XML Comment:** In `ITestDataSeries.cs`, the XML comment for `PeakMagnitude` has a malformed closing tag (`</summary<` instead of `</summary>`), which may break documentation generation tools.
4. **Mixed Collection Types:** `IGraphChannelViewModel` uses `ObservableCollection<ITestChannel>` while `IGraphMainViewModel` uses `List<ITestChannel>`. This inconsistency in collection types across related ViewModels may indicate differing lifecycle or notification requirements, but could also be an oversight.
5. **Type Mismatch in `IGraphChannelViewModel`:** The `SelectedGraphChannel` property is typed as `TestChannel` (concrete class), while the collections use `ITestChannel` (interface). This breaks consistency with the interface-based design pattern used elsewhere.
6. **Setter Accessibility:** Several read-only properties in `ITestDataSeries` (e.g., `Description`, `SensorSN`, `MinY`, `MaxY`, etc.) have only getters, but it's unclear whether these are computed properties or set via constructor/mutable backing field. The implementation strategy is not specified.

View File

@@ -0,0 +1,74 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/Legend/ILegendView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Legend/ILegendViewModel.cs
generated_at: "2026-04-16T12:22:08.946405+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "fa541836d2cec79b"
---
# Documentation: ILegendView / ILegendViewModel
## 1. Purpose
This module defines the core interfaces for a Legend component within a Viewer system, following the MVVM (Model-View-ViewModel) architectural pattern. `ILegendView` represents the view abstraction for legend visualization, while `ILegendViewModel` defines the contract for its corresponding ViewModel, establishing the relationship between the two layers. These interfaces enable decoupled communication between the legend's presentation logic and its UI rendering.
---
## 2. Public Interface
### `ILegendView`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseView`
A marker interface representing a legend view component. No members are defined beyond those inherited from `IBaseView`.
```csharp
public interface ILegendView : IBaseView { }
```
---
### `ILegendViewModel`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseViewModel`
Defines the contract for a legend ViewModel with access to its associated view.
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `View` | `ILegendView` | `get` | Returns the associated `ILegendView` instance for this ViewModel. |
```csharp
public interface ILegendViewModel : IBaseViewModel
{
ILegendView View { get; }
}
```
---
## 3. Invariants
- `ILegendViewModel.View` must return a non-null `ILegendView` instance when accessed (implied by the contract, though nullability annotations are not present in the source).
- Both interfaces must maintain their inheritance from `IBaseView` and `IBaseViewModel` respectively, ensuring consistency with the broader view/viewmodel hierarchy.
- The `View` property on `ILegendViewModel` is read-only (getter only), suggesting the view association is established at construction or through internal mechanisms, not via public setters.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces from which these interfaces inherit.
### What depends on this module:
- **Cannot be determined from source alone.** Consumers would include concrete implementations of `ILegendView` and `ILegendViewModel`, as well as any components that render or interact with legend functionality.
---
## 5. Gotchas
- **Marker Interface:** `ILegendView` defines no members of its own. All functionality comes from `IBaseView`. Developers should consult `IBaseView` to understand available members.
- **Tight Coupling via Property:** The `ILegendViewModel.View` property creates a direct reference from the ViewModel to the View, which is a deviation from pure MVVM where ViewModels are typically view-agnostic. The rationale for this design choice is not documented in the source.
- **Missing Nullability Annotations:** The source lacks C# 8.0+ nullable reference type annotations, making it unclear whether `View` is guaranteed to be non-null.

View File

@@ -0,0 +1,143 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IMainView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IViewerMainView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IViewerMainViewGrid.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IMainViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/MainView/IViewerMainViewModel.cs
generated_at: "2026-04-16T12:24:51.311433+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "95ec9f6198f586ac"
---
# Documentation: DTS.Common.Interface MainView Interfaces
## 1. Purpose
This module defines the core view and ViewModel interfaces for the main window of a DTS Viewer application. It establishes the contract for a modular, region-based UI layout using what appears to be a MVVM (Model-View-ViewModel) architecture. The interfaces support multiple UI regions (navigation, graphs, tests, legends, diagnostics, statistics, cursor, and property panels) and provide keyboard interaction handling, zoom control, and configuration management for a data visualization and analysis tool.
---
## 2. Public Interface
### View Interfaces
#### `IMainView`
```csharp
public interface IMainView : IBaseView { }
```
Marker interface for a main view component. Extends `IBaseView`. No members defined.
#### `IViewerMainView`
```csharp
public interface IViewerMainView : IBaseView { }
```
Marker interface for a viewer main view component. Extends `IBaseView`. No members defined.
#### `IViewerMainViewGrid`
```csharp
public interface IViewerMainViewGrid : IBaseView { }
```
Marker interface for a viewer main view grid component. Extends `IBaseView`. No members defined.
---
### ViewModel Interfaces
#### `IMainViewModel`
```csharp
public interface IMainViewModel : IBaseViewModel
```
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `View` | `IBaseView` | `get` | Gets the Main View instance |
| `ContextNavigationRegion` | `object` | `get; set` | Navigation region context |
| `ContextGraphRegion` | `object` | `get; set` | Graph region context |
| `ContextTestsRegion` | `object` | `get; set` | Tests region context |
| `ContextGraphsRegion` | `object` | `get; set` | Graphs region context |
| `ContextLegendRegion` | `object` | `get; set` | Legend region context |
| `ContextDiagRegion` | `object` | `get; set` | Diagnostics region context |
| `ContextStatsRegion` | `object` | `get; set` | Statistics region context |
| `ContextCursorRegion` | `object` | `get; set` | Cursor region context |
| `ContextPropertyRegion` | `object` | `get; set` | Property region context |
| `GetRegions()` | `List<FrameworkElement>` | method | Returns a list of all region FrameworkElements |
---
#### `IViewerMainViewModel`
```csharp
public interface IViewerMainViewModel : IBaseViewModel, ISelectedDataViewModel
```
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `View` | `IBaseView` | `get; set` | Gets or sets the Main View instance |
| `Standalone` | `bool` | `get; set` | Indicates if viewer is running in standalone mode |
| `ContextNavigationRegion` | `object` | `get; set` | Navigation region context |
| `ContextGraphRegion` | `object` | `get; set` | Graph region context |
| `ContextTestsRegion` | `object` | `get; set` | Tests region context |
| `ContextGraphsRegion` | `object` | `get; set` | Graphs region context |
| `ContextLegendRegion` | `object` | `get; set` | Legend region context |
| `ContextDiagRegion` | `object` | `get; set` | Diagnostics region context |
| `ContextStatsRegion` | `object` | `get; set` | Statistics region context |
| `ContextCursorRegion` | `object` | `get; set` | Cursor region context |
| `ContextPropertyRegion` | `object` | `get; set` | Property region context |
| `GetRegions()` | `List<FrameworkElement>` | method | Returns a list of all region FrameworkElements |
| `ConfigPath` | `string` | `get; set` | Path to configuration file |
| `DoesUserHaveEditPermission` | `bool` | `get; set` | User edit permission flag |
| `ZoomReset()` | `void` | method | Resets zoom to default state |
| `LeftKeyPress()` | `void` | method | Handles left arrow key press notification |
| `RightKeyPress()` | `void` | method | Handles right arrow key press notification |
| `ChannelCodeViewMode` | `Common.Enums.IsoViewMode` | `get; set` | Channel code view mode setting |
| `CalibrationBehaviorSetting` | `Common.Enums.Sensors.CalibrationBehaviors` | `get; set` | Calibration behavior configuration |
| `CalibrationBehaviorSettableInViewer` | `bool` | `get; set` | Whether calibration behavior can be set in viewer |
| `SettingsVisibility` | `Visibility` | `get` | Visibility state of settings UI |
---
## 3. Invariants
1. **Namespace Mismatch**: All interfaces are declared in namespace `DTS.Common.Interface` despite file paths suggesting `DTS.Viewer.MainView` sub-namespaces. The ReSharper disable comments indicate this is intentional.
2. **Region Context Types**: All `Context*Region` properties are typed as `object`, suggesting late binding or multiple possible region types. Implementations must handle assignment of appropriate region types.
3. **View Property Mutability**: `IMainViewModel.View` is read-only (`get`), while `IViewerMainViewModel.View` is read-write (`get; set`). Implementations must respect this difference.
4. **Inheritance Chain**:
- All view interfaces must implement `IBaseView`
- `IMainViewModel` must implement `IBaseViewModel`
- `IViewerMainViewModel` must implement both `IBaseViewModel` and `ISelectedDataViewModel`
5. **GetRegions() Contract**: Must return a non-null `List<FrameworkElement>` containing the UI regions.
---
## 4. Dependencies
### External Dependencies (Imports)
| Namespace | Usage |
|-----------|-------|
| `DTS.Common.Base` | `IBaseView`, `IBaseViewModel`, `ISelectedDataViewModel` base types |
| `System.Collections.Generic` | `List<T>` for `GetRegions()` return type |
| `System.Windows` | `FrameworkElement`, `Visibility` types |
| `Common.Enums` | `IsoViewMode` enum |
| `Common.Enums.Sensors` | `CalibrationBehaviors` enum |
### Downstream Dependencies
**Unclear from source alone** - These are interface definitions; concrete implementations and consumers are not present in the provided files.
---
## 5. Gotchas
1. **Namespace Inconsistency**: The file paths suggest namespaces like `DTS.Viewer.MainView`, but all interfaces are declared in `DTS.Common.Interface`. The `// ReSharper disable CheckNamespace` directives indicate this mismatch is known and suppressed. New developers should be aware that file location does not match declared namespace.
2. **View Property Asymmetry**: `IMainViewModel.View` is read-only while `IViewerMainViewModel.View` is read-write. This inconsistency could cause confusion when implementing or consuming these interfaces.
3. **Magic Object Types**: All region context properties use `object` type rather than specific region interfaces. The actual types expected/returned are unclear from the source alone.
4. **Duplicate Region Definitions**: Both `IMainViewModel` and `IViewerMainViewModel` define identical region properties. This suggests either parallel evolution or a design that could benefit from a shared base interface for region management.
5. **Partial Enum Paths**: The types `Common.Enums.IsoViewMode` and `Common.Enums.Sensors.CalibrationBehaviors` are referenced but their definitions are not provided, making their exact values and usage unclear from this source alone.

View File

@@ -0,0 +1,81 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/Menu/IMenuView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Menu/IMenuViewModel.cs
generated_at: "2026-04-16T12:23:31.714436+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "f8804451d31ebe71"
---
# Documentation: DTS.Common.Interface Menu Module
## 1. Purpose
This module defines the core interfaces for the Menu component within the DTS Viewer application, following the MVVM (Model-View-ViewModel) architectural pattern. It establishes the contract between a menu view and its corresponding view model, enabling loose coupling and testability. The module serves as an abstraction layer that allows concrete implementations of menu UI components to vary independently from their presentation logic.
---
## 2. Public Interface
### `IMenuView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
An empty marker interface that defines the view contract for menu components. It inherits from `IBaseView` (defined in `DTS.Common.Base`), presumably providing common view-related functionality.
```csharp
public interface IMenuView : IBaseView { }
```
---
### `IMenuViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
Defines the contract for a menu view model, providing access to its associated view.
```csharp
public interface IMenuViewModel : IBaseViewModel
{
/// <summary>
/// Gets the Shell View.
/// </summary>
IMenuView View { get; }
}
```
| Member | Type | Accessor | Description |
|--------|------|----------|-------------|
| `View` | `IMenuView` | get-only | Returns the associated menu view instance |
---
## 3. Invariants
1. **Type Compatibility**: `IMenuView` instances must be assignable to `IBaseView`. `IMenuViewModel` instances must be assignable to `IBaseViewModel`.
2. **Non-null View**: The `View` property on any `IMenuViewModel` implementation should reasonably be expected to return a non-null `IMenuView` instance after initialization (inferred from typical MVVM patterns, though not explicitly enforced by the interface).
3. **Read-only View Reference**: The `View` property is get-only; implementations must not expose a public setter through this interface.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** — Provides `IBaseView` and `IBaseViewModel` base interfaces that `IMenuView` and `IMenuViewModel` extend respectively.
### What depends on this module:
- **Unknown from source alone.** Concrete implementations of `IMenuView` and `IMenuViewModel` would exist elsewhere in the codebase, likely in presentation/UI layers.
---
## 5. Gotchas
1. **Misleading XML Documentation**: The XML comment on `IMenuViewModel.View` states "Gets the Shell View," but the return type is `IMenuView`, not a shell view interface. This appears to be a copy-paste error from another component (possibly a shell-related view model). The actual behavior returns a Menu View, not a Shell View.
2. **Marker Interface**: `IMenuView` is an empty interface with no members beyond what it inherits. Its purpose appears to be purely for type identification/categorization within the view hierarchy. The actual view behavior must come from `IBaseView`, whose members are not visible in the provided source.
3. **Tight Coupling via Property**: The `IMenuViewModel` interface exposes `IMenuView` directly as a property rather than through a more abstract mechanism. This creates a compile-time dependency on the view type, which is somewhat atypical for MVVM patterns where view models often avoid direct references to view abstractions.

View File

@@ -0,0 +1,62 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/Navigation/INavigationView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/Navigation/INavigationViewModel.cs
generated_at: "2026-04-16T12:23:10.877701+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "3183c8a5d454e0e2"
---
# Documentation: Navigation Interfaces
## 1. Purpose
This module defines the core navigation interfaces for the DTS viewer system, establishing a contract between navigation views and their associated view models. It follows the MVVM (Model-View-ViewModel) pattern, providing `INavigationView` as a marker interface for navigation view components and `INavigationViewModel` as the interface that exposes access to the navigation view. This abstraction layer allows for decoupled navigation components within the larger DTS.CommonCore framework.
---
## 2. Public Interface
### `INavigationView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
An empty marker interface extending `IBaseView`. It defines no members of its own; its purpose is to provide type identity for navigation view implementations within the view hierarchy.
---
### `INavigationViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `NavigationView` | `INavigationView` | `get` | Returns the associated navigation view instance. |
---
## 3. Invariants
- `INavigationView` must always inherit from `IBaseView`.
- `INavigationViewModel` must always inherit from `IBaseViewModel`.
- The `NavigationView` property on any `INavigationViewModel` implementation must return an object that implements `INavigationView`.
- The inheritance chain implies that any `INavigationView` or `INavigationViewModel` implementation must also satisfy the contracts of their respective base interfaces (`IBaseView`, `IBaseViewModel`).
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces.
### What depends on this module:
- **Cannot be determined from source alone.** No downstream consumers are visible in the provided files.
---
## 5. Gotchas
1. **Documentation mismatch:** The XML summary comment for `INavigationViewModel.NavigationView` states "Gets the Shell View," but the property is named `NavigationView`. It is unclear whether this is a copy-paste error in documentation, a historical naming remnant, or if "Shell View" and "Navigation View" are intended to be synonymous in this context.
2. **Empty interface design:** `INavigationView` defines no members and serves only as a marker interface. Developers implementing this interface must consult `IBaseView` to understand the actual required members, which are not visible in these source files.

View File

@@ -0,0 +1,236 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestMetadata.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestGraphs.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestSetupMetadata.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestSummary.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestRunMetadata.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestModule.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestCalculatedChannel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestDefinition/ITestChannel.cs
generated_at: "2026-04-16T12:25:55.415422+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "2ef74d227b33f018"
---
# Test Definition Interfaces Documentation
## 1. Purpose
This module defines the core data contract interfaces for test definition and metadata within the DTS (Data Test System) viewer application. It provides the abstraction layer for representing test runs, test setups, hardware modules, channels (both physical and calculated), and graph configurations. These interfaces model complex data acquisition scenarios including sensor configurations, calibration parameters, sample data statistics, and test execution metadata, enabling decoupling between data models and their consumers.
---
## 2. Public Interface
### ITestMetadata
Container interface aggregating test run and setup metadata.
| Member | Type | Description |
|--------|------|-------------|
| `TestRun` | `ITestRunMetadata` | Reference to test run metadata |
| `TestSetup` | `ITestSetupMetadata` | Reference to test setup metadata |
---
### ITestGraphs
Represents a graph configuration grouping channels for visualization.
| Member | Type | Description |
|--------|------|-------------|
| `Name` | `string` | Graph name identifier |
| `HardwareChannelName` | `string` | Associated hardware channel name |
| `ChannelIds` | `List<string>` | List of channel IDs belonging to this graph |
| `Channels` | `List<ITestChannel>` | List of resolved test channel objects |
---
### ITestSetupMetadata
Defines metadata for a test setup configuration.
| Member | Type | Description |
|--------|------|-------------|
| `SetupName` | `string` | Name of the test setup |
| `TimeStamp` | `DateTime` | Timestamp when setup was created/modified |
| `TestGraphs` | `List<ITestGraphs>` | Collection of graph configurations |
| `CalibrationBehavior` | `CalibrationBehaviors` | Calibration behavior setting (from `DTS.Common.Enums.Sensors`) |
---
### ITestSummary : IBaseClass
Provides summary information about a test for listing/display purposes.
| Member | Type | Description |
|--------|------|-------------|
| `Id` | `string` | Unique test identifier |
| `Name` | `string` | Test name |
| `Description` | `string` | Test description |
| `ChannelCount` | `int` | Total number of channels |
| `TestDate` | `DateTime` | Date the test was executed |
| `DataType` | `string` | Data type identifier |
| `IsSelected` | `bool` | Selection state for UI |
| `Graphs` | `List<ITestGraphs>` | Collection of graphs |
| `Channels` | `List<ITestChannel>` | Collection of physical channels |
| `CalculatedChannels` | `List<ITestChannel>` | Collection of calculated channels |
| `Parent` | `IBaseViewModel` | Reference to parent view model |
---
### ITestRunMetadata : INotifyPropertyChanged
Defines metadata for a single test run execution.
| Member | Type | Description |
|--------|------|-------------|
| `Name` | `string` | Run name |
| `Id` | `string` | Run identifier |
| `Description` | `string` | Run description |
| `InlineSerializedData` | `bool` | Whether data is serialized inline |
| `TestGuid` | `string` | Globally unique test identifier |
| `FaultFlags` | `int` | Bitmask of fault flags |
| `Software` | `string` | Software name used for acquisition |
| `SoftwareVersion` | `string` | Software version |
| `DataType` | `string` | Data type identifier |
| `FileDate` | `DateTime` | File creation/modification date |
| `FilePath` | `string` | Path to the data file |
| `Modules` | `List<ITestModule>` | Collection of hardware modules |
| `Channels` | `List<ITestChannel>` | Collection of channels |
| `CalculatedChannels` | `List<ITestChannel>` | Collection of calculated channels |
---
### ITestModule : INotifyPropertyChanged
Represents a hardware module used during test acquisition.
| Member | Type | Description |
|--------|------|-------------|
| `SerialNumber` | `string` | Module serial number |
| `BaseSerialNumber` | `string` | Base serial number |
| `AaFilterRateHz` | `int` | Anti-aliasing filter rate in Hz |
| `Number` | `int` | Module number |
| `NumberOfSamples` | `int` | Total samples recorded |
| `UnsubsampledNumberOfSamples` | `int` | Sample count before subsampling |
| `RequestedPostTriggerSeconds` | `double` | Requested post-trigger duration |
| `RequestedPreTriggerSeconds` | `double` | Requested pre-trigger duration |
| `PostTriggerSeconds` | `double` | Actual post-trigger duration |
| `PreTriggerSeconds` | `double` | Actual pre-trigger duration |
| `RecordingMode` | `string` | Recording mode identifier |
| `SampleRateHz` | `int` | Sample rate in Hz |
| `StartRecordSampleNumber` | `int` | Sample number at recording start |
| `NumberOfChannels` | `int` | Number of channels on module |
| `InlineSerializedData` | `bool` | Whether data is inline serialized |
| `StartRecordTimestampSec` | `int` | Recording start timestamp (seconds) |
| `StartRecordTimestampNanoSec` | `int` | Recording start timestamp (nanoseconds) |
| `TriggerTimestampSec` | `int` | Trigger timestamp (seconds) |
| `TriggerTimestampNanoSec` | `int` | Trigger timestamp (nanoseconds) |
| `TriggerSampleNumbers` | `List<ulong>` | List of trigger sample numbers |
| `PTPMasterSync` | `bool` | PTP master sync status |
| `TiltSensorAxisXDegreesPre` | `int` | Pre-test X-axis tilt in degrees |
| `TiltSensorAxisYDegreesPre` | `int` | Pre-test Y-axis tilt in degrees |
| `TiltSensorAxisZDegreesPre` | `int` | Pre-test Z-axis tilt in degrees |
| `TiltSensorAxisXDegreesPost` | `int` | Post-test X-axis tilt in degrees |
| `TiltSensorAxisYDegreesPost` | `int` | Post-test Y-axis tilt in degrees |
| `TiltSensorAxisZDegreesPost` | `int` | Post-test Z-axis tilt in degrees |
| `TemperatureLocation1Pre` through `TemperatureLocation4Pre` | `int` | Pre-test temperatures at 4 locations |
| `TemperatureLocation1Post` through `TemperatureLocation4Post` | `int` | Post-test temperatures at 4 locations |
| `Channels` | `List<ITestChannel>` | Collection of channels |
| `CalculatedChannels` | `List<ITestChannel>` | Collection of calculated channels |
---
### ITestCalculatedChannel : INotifyPropertyChanged
Defines a calculated/virtual channel derived from other channels.
| Member | Type | Description |
|--------|------|-------------|
| `SerialNumber` | `string` | Serial number |
| `ChannelId` | `string` | Channel identifier |
| `Description` | `string` | Channel description |
| `ChannelGroupName` | `string` | Group name for channel |
| `ChannelType` | `string` | Channel type identifier |
| `Number` | `int` | Channel number |
| `DigitalMultiplier` | `string` | Digital multiplier setting |
| `DigitalMode` | `string` | Digital mode setting |
| `Start` | `DateTime` | Start timestamp |
| `Bridge` | `string` | Bridge configuration |
| `BridgeResistanceOhms` | `int` | Bridge resistance in ohms |
| `ZeroPoint` | `double` | Zero point value |
| `ChannelDescriptionString` | `string` | Formatted description string |
| `ChannelName2` | `string` | Secondary channel name |
| `HardwareChannelName` | `string` | Hardware channel name |
| `DesiredRange` | `double` | Desired measurement range |
| `Sensitivity` | `double` | Sensitivity value |
| `SoftwareFilter` | `string` | Software filter configuration |
| `ProportionalToExcitation` | `bool` | Whether proportional to excitation |
| `IsInverted` | `bool` | Whether signal is inverted |
| `LinearizationFormula` | `string` | Linearization formula |
| `IsSubsampled` | `bool` | Whether channel is subsampled |
| `AbsoluteDisplayOrder` | `int` | Display order index |
| `LastCalibrationDate` | `DateTime` | Last calibration date |
| `SensorId` | `string` | Sensor identifier |
| `OffsetToleranceLowMv` | `int` | Low offset tolerance in mV |
| `OffsetToleranceHighMv` | `int` | High offset tolerance in mV |
| `DataFlag` | `int` | Data flag value |
| `ExcitationVoltage` | `int` | Excitation voltage |
| `Eu` | `string` | Engineering units |
| `CalSignalEnabled` | `bool` | Calibration signal enabled |
| `ShuntEnabled` | `bool` | Shunt enabled |
| `VoltageInsertionCheckEnabled` | `bool` | Voltage insertion check enabled |
| `RemoveOffset` | `bool` | Whether to remove offset |
| `ZeroMethod` | `string` | Zero method identifier |
| `ZeroAverageWindowBegin` | `double` | Zero averaging window start |
| `ZeroAverageWindowEnd` | `double` | Zero averaging window end |
| `InitialEu` | `int` | Initial engineering units |
| `InitialOffset` | `string` | Initial offset value |
| `UnsubsampledSampleRateHz` | `int` | Sample rate before subsampling |
| `MeasuredShuntDeflectionMv` | `double` | Measured shunt deflection in mV |
| `TargetShuntDeflectionMv` | `double` | Target shunt deflection in mV |
| `MeasuredExcitationVoltage` | `double` | Measured excitation voltage |
| `FactoryExcitationVoltage` | `double` | Factory excitation voltage |
| `TimeOfFirstSample` | `double` | Timestamp of first sample |
| `Multiplier` | `int` | Multiplier value |
| `UserOffsetEu` | `int` | User-defined offset in EU |
| `UnitConversion` | `int` | Unit conversion flag |
| `AtCapacity` | `bool` | Whether at capacity |
| `CapacityOutputIsBasedOn` | `int` | Capacity output reference |
| `SourceChannelNumber` | `string` | Source channel number |
| `SourceModuleNumber` | `string` | Source module number |
| `SourceModuleSerialNumber` | `string` | Source module serial number |
| `Calculation` | `string` | Calculation formula/expression |
| `SampleRateHz` | `int` | Sample rate in Hz |
| `SensitivityUnits` | `string` | Sensitivity units |
| `SensorCapacity` | `int` | Sensor capacity |
---
### ITestChannel : INotifyPropertyChanged
Represents a physical measurement channel with full configuration and statistics.
**Identity & Hierarchy:**
| Member | Type | Description |
|--------|------|-------------|
| `Group` | `string` | Group identifier |
| `SubGroup` | `string` | Sub-group identifier |
| `TestId` | `string` | Test identifier |
| `TestSetupName` | `string` | Parent test setup name |
| `ModuleSerialNumber` | `string` | Parent module serial number |
| `SerialNumber` | `string` | Channel serial number |
| `ChannelId` | `string` | Channel identifier |
| `ChannelDisplayName` | `string` | Display name |
| `Description` | `string` | Channel description |
| `ChannelGroupName` | `string` | Channel group name |
| `ChannelType` | `string` | Channel type |
| `Number` | `int` | Channel number |
| `ChannelNumber` | `int` | Channel number (alternate) |
| `ParentTestSetup` | `ITestSetupMetadata` | Reference to parent test setup |
| `ParentModule` | `ITestModule` | Reference to parent module |
| `Parent` | `IBaseViewModel` | Reference to parent view model |
**Graph Configuration:**
| Member | Type | Description |
|--------|------|-------------|
| `IsGraphChannel` | `bool` | Whether this is a graph channel |
| `GraphName` | `string` | Associated graph name |
| `ChannelColor` | `Color` | Display color for channel |
| `Xmax` | `double` | Maximum X value |
| `

View File

@@ -0,0 +1,149 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestModification/ITestModificationView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestModification/ITestModificationViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestModification/ITestModificationModel.cs
generated_at: "2026-04-16T12:22:54.326019+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a5f27c5a375dc7b6"
---
# Documentation: Test Modification Module
## 1. Purpose
This module defines the contract for a Test Modification feature following the Model-View-ViewModel (MVVM) pattern. It provides interfaces for modifying test channel parameters—including description, EU multiplier/offset, T0 timing, line fit boundaries, sensitivity, software filters, and data flags—within a DTS data acquisition or sensor testing system. The module tracks modification state for each parameter and supports publishing changes back to the underlying data.
---
## 2. Public Interface
### `ITestModificationView`
**Namespace:** `DTS.Common.Interface`
A marker interface representing the view component for test modification.
```
public interface ITestModificationView : IBaseView { }
```
- Inherits from `IBaseView`
- Defines no additional members
---
### `ITestModificationViewModel`
**Namespace:** `DTS.Common.Interface`
The view model interface coordinating the test modification view and managing ISO code filter mapping behavior.
```
public interface ITestModificationViewModel : IBaseViewModel
```
**Properties:**
| Name | Type | Access | Description |
|------|------|--------|-------------|
| `View` | `ITestModificationView` | get/set | The associated view instance |
| `Parent` | `IBaseViewModel` | get/set | Reference to the parent view model |
| `UseISOCodeFilterMapping` | `bool` | get/set | Controls whether ISO code should be modified when software filter is modified |
| `UseZeroForUnfiltered` | `bool` | get/set | Controls whether '0' or 'P' is used when ISO code is modified due to software filter change |
**Methods:**
| Name | Return Type | Description |
|------|-------------|-------------|
| `PublishChanges()` | `void` | Publishes/commits the modifications |
---
### `ITestModificationModel`
**Namespace:** `DTS.Common.Interface`
The model interface holding test modification state for a selected channel.
```
public interface ITestModificationModel : IBaseModel
```
**Properties:**
| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Parent` | `ITestModificationViewModel` | get/set | Reference to the parent view model |
| `SelectedChannel` | `ITestChannel` | get/set | The channel on which modifications are based |
| `Description` | `string` | get/set | The `ChannelDescriptionString` of the selected channel |
| `EuMultiplier` | `double` | get/set | EU multiplier of the selected channel |
| `EuOffset` | `double` | get/set | EU offset of the selected channel |
| `T0` | `double` | get/set | Current T0 offset in milliseconds |
| `T1` | `double` | get/set | Line fit start time in milliseconds |
| `T2` | `double` | get/set | Line fit end time in milliseconds |
| `Sensitivity` | `double` | get/set | Sensitivity of the selected channel |
| `SelectedFilter` | `IFilterClass` | get/set | Software filter for the selected class |
| `T0Mode` | `T0Mode` | get/set | T0 adjustment mode |
| `SelectedDataFlag` | `DataFlag` | get/set | Data flag for the selected channel |
| `IsModified` | `bool` | get | Indicates whether any values have changed from default |
| `IsModifiedDescription` | `bool` | get | Indicates whether the Description field has been modified |
| `IsModifiedEuMultiplier` | `bool` | get | Indicates whether EuMultiplier has been modified |
| `IsModifiedEuOffset` | `bool` | get | Indicates whether EU offset has been modified |
| `IsModifiedT0` | `bool` | get | Indicates whether T0 has been modified |
| `IsModifiedLineFit` | `bool` | get/set | Indicates whether T1 or T2 has been modified |
| `IsModifiedSensitivity` | `bool` | get | Indicates whether sensitivity has been modified |
| `IsModifiedFilter` | `bool` | get | Indicates whether filter has been modified |
| `IsModifiedDataFlag` | `bool` | get | Indicates whether DataFlag has been modified |
**Methods:**
| Name | Return Type | Description |
|------|-------------|-------------|
| `ValidateT0()` | `bool` | Returns `true` if T0 is valid (within the dataset), `false` otherwise |
---
## 3. Invariants
1. **Parent-Child Hierarchy:** `ITestModificationModel.Parent` must reference an `ITestModificationViewModel`, and `ITestModificationViewModel.Parent` must reference an `IBaseViewModel`, establishing a three-level hierarchy (Model → ViewModel → Parent ViewModel).
2. **Channel Selection Required:** `SelectedChannel` must be set before modification properties (`Description`, `EuMultiplier`, `EuOffset`, `T0`, `T1`, `T2`, `Sensitivity`, `SelectedFilter`, `SelectedDataFlag`) can meaningfully be accessed or modified—they represent values "of the selected channel."
3. **Modification Tracking Consistency:** Each `IsModified*` property should reflect the actual modification state of its corresponding value property. The aggregate `IsModified` property should be `true` if any individual `IsModified*` flag is `true`.
4. **T0 Validation:** `ValidateT0()` must be called to confirm T0 is within the dataset bounds before relying on the T0 value.
5. **Line Fit Ordering:** While not explicitly enforced in the interface, `T1` (line fit start) and `T2` (line fit end) are expected to represent a valid time range—unclear from source whether T1 < T2 is enforced.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** — Provides base interfaces:
- `IBaseView`
- `IBaseViewModel`
- `IBaseModel`
- **`DTS.Common.Interface.Sensors.SoftwareFilters`** — Provides:
- `IFilterClass` (referenced in comment as replacement for `CFCFilter` per FB 13120)
### External types referenced (definitions not in source):
- `ITestChannel` — Type of `SelectedChannel`; location unknown
- `T0Mode` — Enum or type for T0 adjustment mode; location unknown
- `DataFlag` — Enum or type for channel data flags; location unknown
### Dependents:
- Cannot be determined from source alone. Concrete implementations of these interfaces would exist elsewhere in the codebase.
---
## 5. Gotchas
1. **Namespace Discrepancy:** The file path suggests namespace `DTS.Viewer.TestModification`, but the actual namespace declared is `DTS.Common.Interface`. The `// ReSharper disable CheckNamespace` directive indicates this mismatch is intentional/suppressed.
2. **Filter Type Change (FB 13120):** The comment indicates `IFilterClass` replaced `CFCFilter` as the type for `SelectedFilter`. Code referencing the old type may exist elsewhere in the codebase.
3. **ISO Code Filter Mapping Behavior:** The interaction between `UseISOCodeFilterMapping` and `UseZeroForUnfiltered` is not defined in these interfaces. The behavior for when ISO code is modified due to filter changes depends on implementation details not present here.
4. **IsModifiedLineFit is Read/Write:** Unlike other `IsModified*` properties which are read-only, `IsModifiedLineFit` has both getter and setter. The reason for this inconsistency is unclear from source alone.
5. **T0 Validation Not Automatic:** The interface provides `ValidateT0()` as an explicit method rather than automatic validation on set. Callers must remember to invoke it.

View File

@@ -0,0 +1,77 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestModule/ITestModuleView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestModule/ITestModuleViewModel.cs
generated_at: "2026-04-16T12:22:30.959477+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "43e7cc3a0d236351"
---
# Documentation: ITestModuleView & ITestModuleViewModel
## 1. Purpose
This module defines the view and view model interfaces for a Test Module component within an MVVM (Model-View-ViewModel) architecture. It establishes contracts for a test module view (`ITestModuleView`) and its corresponding view model (`ITestModuleViewModel`), with the view model specifically exposing a collection of assemblies for test management purposes. These interfaces enable decoupled communication between the presentation layer and business logic for test module functionality.
---
## 2. Public Interface
### `ITestModuleView`
**Signature:**
```csharp
public interface ITestModuleView : IBaseView { }
```
**Description:** A marker interface extending `IBaseView`. It defines no members of its own, serving purely as a type contract for test module view implementations.
---
### `ITestModuleViewModel`
**Signature:**
```csharp
public interface ITestModuleViewModel : IBaseViewModel
{
List<Assembly> AssemblyList { get; set; }
}
```
**Description:** An interface extending `IBaseViewModel` that defines the contract for a test module view model. Exposes a single property:
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `AssemblyList` | `List<Assembly>` | get; set; | A mutable list of .NET assemblies, presumably for test discovery or execution purposes. |
---
## 3. Invariants
- `ITestModuleView` must always implement `IBaseView`.
- `ITestModuleViewModel` must always implement `IBaseViewModel`.
- The `AssemblyList` property must be a mutable `List<Assembly>` (both getter and setter are required).
- The namespace `DTS.Common.Interface` is declared for both interfaces regardless of file location.
---
## 4. Dependencies
### This module depends on:
| Dependency | Usage |
|------------|-------|
| `DTS.Common.Base` | Provides `IBaseView` and `IBaseViewModel` base interfaces |
| `System.Collections.Generic` | Provides `List<T>` for the `AssemblyList` property |
| `System.Reflection` | Provides the `Assembly` type |
### What depends on this module:
**Cannot be determined from source alone.** Consumers would be concrete implementations of `ITestModuleView` and `ITestModuleViewModel`, as well as any code that depends on these abstractions (e.g., test runners, navigation services, or dependency injection containers).
---
## 5. Gotchas
- **Namespace mismatch with file path:** The declared namespace `DTS.Common.Interface` does not match the folder structure `Common/DTS.CommonCore/Interface/DTS.Viewer/TestModule/`. The `// ReSharper disable CheckNamespace` directive suppresses IDE warnings about this discrepancy, suggesting this may be intentional or a historical artifact.
- **Marker interface with no members:** `ITestModuleView` is an empty interface that only inherits from `IBaseView`. Its purpose beyond type identification is unclear from the source alone.
- **Mutable property on interface:** `AssemblyList` exposes both a getter and setter, implying implementations must support full replacement of the list, not just modification of its contents. The implications of this design choice (e.g., notification requirements, thread safety) are not documented in the source.

View File

@@ -0,0 +1,102 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestSummary/ITestSummaryListView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestSummary/ITestSummaryListViewModel.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestSummary/ITestSummary.cs
generated_at: "2026-04-16T12:23:26.707020+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b60d1a2f75a9d685"
---
# Documentation: Test Summary List View Interfaces
## 1. Purpose
This module defines the core interfaces for a Test Summary List feature within an MVVM (Model-View-ViewModel) architecture. It provides contracts for displaying collections of test summaries, managing user selections, and representing individual test summary data including channels, graphs, and metadata. The module serves as the abstraction layer between the view and view model for test summary presentation.
---
## 2. Public Interface
### `ITestSummaryListView`
**Namespace:** `DTS.Common.Interface`
**Extends:** `IBaseView`
A marker interface representing the view component for the test summary list. No members are defined beyond the inherited `IBaseView`.
---
### `ITestSummaryListViewModel`
**Namespace:** `DTS.Common.Interface`
**Extends:** `IBaseViewModel`
| Member | Type | Description |
|--------|------|-------------|
| `View` | `ITestSummaryListView` (read-only) | Gets the Shell View associated with this view model. |
| `TestSummaryList` | `ObservableCollection<ITestSummary>` | Observable collection of test summaries bound to the view. Supports get/set. |
| `SelectedTestSummaryList` | `List<ITestSummary>` | List of currently selected test summaries. Supports get/set. |
| `PublishSelectedTestSummaryList()` | `void` | Publishes the selected test summary list (destination/consumers not specified in source). |
| `TestSummaryList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)` | `void` | Event handler for collection change notifications on `TestSummaryList`. |
---
### `ITestSummary`
**Namespace:** `DTS.Common.Interface.TestDefinition`
**Extends:** `IBaseClass`
| Property | Type | Access |
|----------|------|--------|
| `Id` | `string` | get/set |
| `SetupName` | `string` | get/set |
| `Description` | `string` | get/set |
| `ChannelCount` | `int` | get/set |
| `FileDate` | `DateTime` | get/set |
| `TimeStamp` | `DateTime` | get/set |
| `DataType` | `string` | get/set |
| `IsSelected` | `bool` | get/set |
| `Graphs` | `List<ITestGraphs>` | get/set |
| `Channels` | `List<ITestChannel>` | get/set |
| `CalculatedChannels` | `List<ITestChannel>` | get/set |
| `Parent` | `IBaseViewModel` | get/set |
| `TestMetadata` | `ITestMetadata` | get/set |
| `CalibrationBehavior` | `CalibrationBehaviors` | get/set |
---
## 3. Invariants
- `ITestSummaryListView` must always be assignable to `IBaseView`.
- `ITestSummaryListViewModel` must always be assignable to `IBaseViewModel`.
- `ITestSummary` must always be assignable to `IBaseClass`.
- `TestSummaryList_CollectionChanged` is designed to handle `NotifyCollectionChangedEventArgs`, implying it expects to be wired to an `ObservableCollection<T>.CollectionChanged` event.
- The `Parent` property on `ITestSummary` suggests a hierarchical relationship where a test summary has a reference back to its containing view model.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** — Provides `IBaseView`, `IBaseViewModel`, and `IBaseClass` base interfaces.
- **`DTS.Common.Enums.Sensors`** — Provides the `CalibrationBehaviors` enum used in `ITestSummary`.
- **`System.Collections.Generic`** — For `List<T>`.
- **`System.Collections.ObjectModel`** — For `ObservableCollection<T>`.
- **`System.Collections.Specialized`** — For `NotifyCollectionChangedEventArgs`.
- **`System`** — For `DateTime`.
### External types referenced but not defined in this module:
- `ITestGraphs` — Referenced in `ITestSummary.Graphs`; definition not provided in source.
- `ITestChannel` — Referenced in `ITestSummary.Channels` and `CalculatedChannels`; definition not provided in source.
- `ITestMetadata` — Referenced in `ITestSummary.TestMetadata`; definition not provided in source.
---
## 5. Gotchas
1. **Namespace/Directory Mismatch:** All three files contain `// ReSharper disable CheckNamespace` directives. The physical file path (`DTS.Viewer/TestSummary/`) does not match the declared namespace (`DTS.Common.Interface` or `DTS.Common.Interface.TestDefinition`). This suggests either a deliberate namespace flattening strategy or a historical refactoring that left files in their original locations.
2. **`TestSummaryList_CollectionChanged` Naming Convention:** The method name follows an event handler naming pattern but is defined as a regular interface method rather than being wired via an event subscription. The caller is responsible for connecting this handler to the `CollectionChanged` event of `TestSummaryList`.
3. **Unknown Publish Behavior:** The `PublishSelectedTestSummaryList()` method's implementation details (event aggregator, message bus, direct callback, etc.) are not specified in these interfaces. Consumers should consult the implementing class for the actual publish mechanism.
4. **Nullable Collections Not Specified:** The interfaces do not indicate whether `Graphs`, `Channels`, `CalculatedChannels`, or `TestMetadata` can be null. Implementers should document their null-handling strategy.

View File

@@ -0,0 +1,82 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DTS.Viewer/ViewerSettings/IViewerSettingsView.cs
- Common/DTS.CommonCore/Interface/DTS.Viewer/ViewerSettings/IViewerSettingsViewModel.cs
generated_at: "2026-04-16T12:22:53.517734+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "aacb0b18894c95e6"
---
# Documentation: IViewerSettingsView & IViewerSettingsViewModel
## 1. Purpose
This module defines the contract for a Viewer Settings UI component following the MVVM (Model-View-ViewModel) pattern. `IViewerSettingsView` represents the view abstraction, while `IViewerSettingsViewModel` defines the presentation logic and state for configuring viewer-related settings, specifically calibration behavior options. These interfaces enable decoupled communication between the UI layer and business logic, allowing for testability and separation of concerns within the DTS viewer settings subsystem.
---
## 2. Public Interface
### IViewerSettingsView
**Namespace:** `DTS.Common.Interface`
```csharp
public interface IViewerSettingsView : IBaseView { }
```
A marker interface extending `IBaseView` with no additional members. Serves as a type contract for viewer settings views.
---
### IViewerSettingsViewModel
**Namespace:** `DTS.Common.Interface`
```csharp
public interface IViewerSettingsViewModel : IBaseViewModel
```
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `View` | `IViewerSettingsView` | get/set | Reference to the associated view instance. |
| `Parent` | `IBaseViewModel` | get/set | Reference to the parent view model in the hierarchy. |
| `PublishChanges()` | `void` | method | Publishes/commits current settings changes. Implementation behavior not specified in source. |
| `CalibrationBehaviorSettingVisibility` | `Visibility` | get/set | Controls visibility of the calibration behavior setting UI element. |
| `OverallSettingsVisibility` | `Visibility` | get | Read-only visibility state for overall settings panel. |
| `AvailableCalibrationBehaviors` | `DisplayedCalibrationBehavior[]` | get | Array of available calibration behavior options for selection. |
| `CalibrationBehaviorSetting` | `DisplayedCalibrationBehavior` | get/set | Currently selected calibration behavior setting. |
---
## 3. Invariants
- `IViewerSettingsView` must always be assignable to `IBaseView` (inheritance constraint).
- `IViewerSettingsViewModel` must always be assignable to `IBaseViewModel` (inheritance constraint).
- `AvailableCalibrationBehaviors` is read-only; consumers cannot replace the array reference, though the source does not specify whether the array contents are mutable.
- `OverallSettingsVisibility` is read-only; its value is determined internally by the implementing class.
**Unclear from source:**
- Whether `View` and `Parent` must be non-null at any point in the lifecycle.
- Whether `PublishChanges()` validates state before publishing or throws on invalid state.
- The relationship between `CalibrationBehaviorSettingVisibility` and `OverallSettingsVisibility`.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — for `IBaseView` and `IBaseViewModel` base interfaces
- `DTS.Common.Classes.Sensors` — for `DisplayedCalibrationBehavior` type
- `System.Windows` — for `Visibility` enumeration (WPF-specific)
### What depends on this module:
**Cannot be determined from source alone.** No consumers are shown in the provided files.
---
## 5. Gotchas
- **WPF Coupling:** The use of `System.Windows.Visibility` ties this interface to WPF. Porting to other UI frameworks would require abstraction changes.
- **Mutable Array Exposure:** `AvailableCalibrationBehaviors` returns an array (`DisplayedCalibrationBehavior[]`), not an immutable collection. If the implementing class does not defensively copy, callers could potentially modify array contents.
- **Setter on View Property:** The `View` property has a public setter, which may indicate the view can be swapped at runtime. Thread-safety implications are unclear from source.
- **PublishChanges Semantics:** The method name suggests a publish/subscribe or event-sourcing pattern, but the actual behavior (synchronous vs. asynchronous, error handling, side effects) is not specified in the interface.

View File

@@ -0,0 +1,208 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DataRecorders/IHardwareChannel.cs
- Common/DTS.CommonCore/Interface/DataRecorders/IDASDBRecord.cs
- Common/DTS.CommonCore/Interface/DataRecorders/IDASHardware.cs
- Common/DTS.CommonCore/Interface/DataRecorders/IDASChannelDBRecord.cs
generated_at: "2026-04-16T12:21:21.272442+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "bca3af738f7131f7"
---
# Documentation: DTS.Common.Interface.DataRecorders
## 1. Purpose
This module defines the core interfaces for Data Acquisition System (DAS) hardware abstraction within the DTS system. It provides contracts for representing hardware channels (`IHardwareChannel`), DAS devices (`IDASHardware`), and their corresponding database persistence records (`IDASDBRecord`, `IDASChannelDBRecord`). These interfaces enable the system to interact with various types of data recording hardware—ranging from individual channels to complete rack systems—in a uniform, decoupled manner, supporting capabilities queries, hardware identification, and configuration persistence.
---
## 2. Public Interface
### IHardwareChannel
Represents an individual hardware channel on a DAS device.
| Member | Signature | Description |
|--------|-----------|-------------|
| `Diagnostics` | `IDiagnosticResult { get; }` | Diagnostic results for this channel; returns `null` if unavailable. |
| `IsSupportedBridgeType` | `bool IsSupportedBridgeType(SensorConstants.BridgeType bridgeType)` | Returns whether the channel supports the specified bridge type. |
| `ChannelNumber` | `int { get; }` | The channel number. |
| `GetId` | `string GetId()` | Returns the channel identifier. |
| `IsAnalog` | `bool { get; }` | Returns `true` if the channel supports analog sensors. |
| `IsSquib` | `bool { get; }` | Returns `true` if the channel supports squibs. |
| `IsDigitalOut` | `bool { get; }` | Returns `true` if the channel supports digital outputs. |
| `IsDigitalIn` | `bool { get; }` | Returns `true` if the channel supports digital inputs. |
| `IsUart` | `bool { get; }` | Returns `true` if the channel supports UART I/O. |
| `IsStreamIn` | `bool { get; }` | Returns `true` if the channel supports stream input. |
| `IsStreamOut` | `bool { get; }` | Returns `true` if the channel supports stream output. |
| `IsClock` | `bool { get; }` | Returns `true` if the channel supports clocks. |
| `IsTSRAIR` | `bool { get; }` | (Undocumented in XML comments.) |
| `IsTSRAIRModule` | `bool { get; }` | (Undocumented in XML comments.) |
| `GetParentDAS` | `IDASHardware GetParentDAS()` | Returns the DAS this channel belongs to. |
| `ModuleSerialNumber` | `string { get; set; }` | The module serial number this channel belongs to. |
| `IsSupportedExcitation` | `bool IsSupportedExcitation(ExcitationVoltageOptions.ExcitationVoltageOption excitation)` | Returns whether a given excitation voltage is supported. |
| `IsG5` | `bool IsG5()` | Returns `true` if the serial number starts with `"5M"`. |
| `ToString` | `string ToString(IDASHardware[] hardwares)` | Returns a string representation given an array of hardware. |
---
### IDASHardware
Represents a DAS hardware device (e.g., a rack, module, or standalone unit).
| Member | Signature | Description |
|--------|-----------|-------------|
| `IsStandIn` | `bool IsStandIn()` | Returns `true` if this is a stand-in for real hardware, not physical hardware itself. |
| `IsFirstUseValid` | `bool { get; }` | Whether hardware supports and is using first use date (ref: 15524). |
| `FirstUseDate` | `DateTime? { get; }` | First date of use after calibration; only valid if `IsFirstUseValid` is `true`. `null` indicates not used since calibration. |
| `IsPseudoRack` | `bool IsPseudoRack()` | (Undocumented in XML comments.) |
| `DASId` | `int { get; }` | The DAS identifier. |
| `SerialNumber` | `string { get; set; }` | Serial number of the hardware. |
| `SerialNumberFamily` | `string { get; set; }` | Serial number family. |
| `EIDFound` | `string { get; set; }` | (Undocumented in XML comments.) |
| `BatteryVoltageStatus` | `string { get; set; }` | Battery voltage status string. |
| `BatteryVoltageColor` | `System.Windows.Media.SolidColorBrush { get; set; }` | Color for battery voltage display. |
| `InputVoltageStatus` | `string { get; set; }` | Input voltage status string. |
| `InputVoltageColor` | `System.Windows.Media.SolidColorBrush { get; set; }` | Color for input voltage display. |
| `ParentDAS` | `string { get; set; }` | Used to display DAS connectivity in Hardware Scan. |
| `Connection` | `string { get; set; }` | Used to determine DAS connectivity for Hardware Scan. |
| `GetIHardwareChannels` | `IHardwareChannel[] GetIHardwareChannels()` | Returns all hardware channels on this DAS. |
| `IsSLICEEthernetController` | `bool { get; }` | Returns whether DAS is a SLICE Ethernet Controller. |
| `IsTDASRack` | `bool IsTDASRack()` | Returns `true` if the DAS is a TDAS rack. |
| `IsG5` | `bool IsG5()` | (Undocumented in XML comments.) |
| `IsTSRAIR` | `bool IsTSRAIR()` | (Undocumented in XML comments.) |
| `IsTSRAIRModule` | `bool IsTSRAIRModule()` | (Undocumented in XML comments.) |
| `GetMinSampleRateDouble` | `double GetMinSampleRateDouble()` | Returns the minimum sample rate allowed on this DAS. |
| `GetMaxSampleRateDouble` | `double GetMaxSampleRateDouble()` | Returns the maximum sample rate allowed on this DAS. |
| `IsModule` | `bool IsModule()` | Returns `true` for modules which should not be displayed in Hardware Scan (SLICE bridges); `false` for modules which should be displayed (TDAS rack modules). |
| `LastModifiedBy` | `string { get; set; }` | User who last modified this record. |
| `LastModified` | `DateTime { get; set; }` | Timestamp of last modification. |
| `DASTypeEnum` | `HardwareTypes { get; set; }` | The hardware type enumeration value. |
---
### IDASDBRecord
Encapsulates a DAS record for database persistence.
| Member | Signature | Description |
|--------|-----------|-------------|
| `DASId` | `int { get; set; }` | Database ID of the DAS record. |
| `SerialNumber` | `string { get; set; }` | Serial number. |
| `DASType` | `int { get; set; }` | DAS type as integer. |
| `MaxModules` | `int { get; set; }` | Maximum number of modules supported. |
| `MaxMemory` | `long { get; set; }` | Maximum memory in bytes. |
| `MaxSampleRate` | `double { get; set; }` | Maximum sample rate. |
| `MinSampleRate` | `double { get; set; }` | Minimum sample rate. |
| `FirmwareVersion` | `string { get; set; }` | Firmware version string. |
| `CalDate` | `DateTime { get; set; }` | Calibration date. |
| `ProtocolVersion` | `int { get; set; }` | Protocol version. |
| `LastModified` | `DateTime { get; set; }` | Last modification timestamp. |
| `LastModifiedBy` | `string { get; set; }` | User who last modified. |
| `Version` | `int { get; set; }` | Record version. |
| `LocalOnly` | `bool { get; set; }` | Whether record is local-only. |
| `LastUsed` | `DateTime { get; set; }` | Last used timestamp. |
| `LastUsedBy` | `string { get; set; }` | User who last used. |
| `Connection` | `string { get; set; }` | Used to determine DAS connectivity for Hardware Scan. |
| `Channels` | `int { get; set; }` | Number of channels. |
| `Position` | `string { get; set; }` | Position identifier. |
| `ChannelTypes` | `int[] { get; set; }` | Array of channel types. |
| `IsProgrammable` | `bool { get; set; }` | Whether hardware is programmable. |
| `IsReconfigurable` | `bool { get; set; }` | Whether hardware is reconfigurable. |
| `IsModule` | `bool { get; set; }` | Whether hardware operates as a rack module (`true`) or standalone (`false`). |
| `PositionOnDistributor` | `int { get; set; }` | Position on distributor. |
| `PositionOnChain` | `int { get; set; }` | Position on chain. |
| `Port` | `int { get; set; }` | Port number. |
| `ParentDAS` | `string { get; set; }` | Parent DAS identifier. |
| `FirstUseDate` | `DateTime? { get; set; }` | First use date after calibration; only valid if `IsFirstUseValid` is `true`. `null` indicates not used since calibration. (Ref: 15524) |
| `TestId` | `int? { get; set; }` | Test ID for stand-in hardware existing in a test only. (Ref: 15727) |
| `GroupId` | `int? { get; set; }` | Group ID for stand-in hardware existing in a group only. |
| `StandIn` | `bool { get; set; }` | Whether this is stand-in/dummy hardware, not physical hardware. |
| `MaxAAFRate` | `double { get; set; }` | Maximum AAF rate. |
| `IsFirstUseValid` | `bool { get; set; }` | Whether hardware supports and is using first use date. (Ref: 15524) |
---
### IDASChannelDBRecord
Describes a DAS channel database record with detailed bitmask configuration.
| Member | Signature | Description |
|--------|-----------|-------------|
| `HardwareId` | `string { get; set; }` | String ID for the hardware (format: `serialnumber_dastype`). |
| `DaschannelId` | `int { get; set; }` | Primary key of the DAS channel record. Annotated with `[Key]` and `[Column("DASChannelId")]`. |
| `Dasid` | `int? { get; set; }` | DAS database ID of the parent hardware. Annotated with `[Column("DASId")]`. |
| `ChannelIdx` | `int { get; set; }` | Physical channel index among channels on the DAS. |
| `SupportedBridges` | `int { get; set; }` | Bitmask for supported bridges (see Invariants for bit meanings). |
| `SupportedExcitations` | `int { get; set; }` | Bitmask for supported excitation options (see Invariants for bit meanings). |
| `DASDisplayOrder` | `int { get; set; }` | Display order among channels; may differ from physical order. Annotated with `[Column("DASDisplayOrder")]`. |
| `LocalOnly` | `bool { get; set; }` | Indicates local-only storage (deprecated per XML comment). |
| `SupportedDigitalInputModes` | `int { get; set; }` | Bitmask for digital input modes (see Invariants for bit meanings). |
| `SupportedSquibFireModes` | `int { get; set; }` | Bitmask for squib fire modes (see Invariants for bit meanings). |
| `SupportedDigitalOutputModes` | `int { get; set; }` | Bitmask for digital output modes (see Invariants for bit meanings). |
| `ModuleSerialNumber` | `string { get; set; }` | Module serial number. |
| `SettingId` | `int { get; set; }` | Setting ID. |
| `ModuleArrayIndex` | `int { get; set; }` | Array index of the module among modules on the DAS. |
---
## 3. Invariants
### First Use Date Validity
- `FirstUseDate` (on both `IDASHardware` and `IDASDBRecord`) is **only valid** when `IsFirstUseValid` is `true`.
- A `null` value for `FirstUseDate` indicates the hardware has not been used since calibration (only meaningful when `IsFirstUseValid` is `true`).
### Hardware ID Format
- `IDASChannelDBRecord.HardwareId` follows the format: `"serialnumber_dastype"`.
### Channel Ordering
- Physical channel order (`ChannelIdx`) and display order (`DASDisplayOrder`) **may not match** for some hardware types.
### SupportedBridges Bitmask (IDASChannelDBRecord)
| Bit | Meaning |
|-----|---------|
| 0 | IEPE |
| 1 | Quarter bridge |
| 2 | Half bridge |
| 3 | Full bridge |
| 4 | Digital input |
| 5 | Squib fire |
| 6 | Digital output |
| 7 | Half bridge signal plus (G5 signal plus) |
| 8 | RealTime Clock |
| 9 | UART |
### SupportedExcitations Bitmask (IDASChannelDBRecord)
| Bit | Meaning |
|-----|---------|
| 0 | Invalid excitation (undefined) |
| 1 | 2V |
| 2 | 2.5V |
| 3 | 3V |
| 4 | 5V |
| 5 | 10V |
| 6 | 1V |
### SupportedDigitalInputModes Bitmask (IDASChannelDBRecord)
| Bit | Meaning |
|-----|---------|
| 0 | Invalid mode |
| 1 | Transition low to high (TLH) |
| 2 | Transition high to low (THL) |
| 3 | Contact closure normally open (CCNO) |
| 4 | Contact closure normally closed (CCNC) |
### SupportedSquibFireModes Bitmask (IDASChannelDBRecord)
| Bit | Meaning |
|-----|---------|
| 0 | Invalid mode (fire mode not set) |
| 1 | Capacitor discharge |
| 2 | Constant current |
| 3 | AC discharge |
### SupportedDigitalOutputModes Bitmask (IDASChannelDBRecord)
| Bit | Meaning |
|-----|---------|
| 0 |

View File

@@ -0,0 +1,181 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Database/IDatabaseCopyView.cs
- Common/DTS.CommonCore/Interface/Database/IDatabaseSwitchView.cs
- Common/DTS.CommonCore/Interface/Database/IDatabaseStatusBarView.cs
- Common/DTS.CommonCore/Interface/Database/IDatabaseSwitchViewModel.cs
- Common/DTS.CommonCore/Interface/Database/IUserDbRecord.cs
- Common/DTS.CommonCore/Interface/Database/IDatabaseCopyViewModel.cs
- Common/DTS.CommonCore/Interface/Database/IDatabaseStatusBarViewModel.cs
generated_at: "2026-04-16T12:08:57.334036+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "142a1b67b74ee9e9"
---
# Documentation: DTS.Common.Interface.Database
## 1. Purpose
This module defines the contract layer for database-related UI operations within the DTS system. It provides interfaces for views and view models that handle database copying from remote to local databases, switching between remote and local database connections, displaying database connection status in a status bar, and representing user records stored in the database. The module follows a Model-View-ViewModel (MVVM) pattern, with all view models extending from `IBaseViewModel` and views extending from `IBaseView`.
---
## 2. Public Interface
### IDatabaseCopyView
```csharp
public interface IDatabaseCopyView : IBaseView { }
```
Marker interface for a view associated with database copy operations. No members defined.
---
### IDatabaseSwitchView
```csharp
public interface IDatabaseSwitchView : IBaseView { }
```
Marker interface for a view associated with database switching operations. No members defined.
---
### IDatabaseStatusBarView
```csharp
public interface IDatabaseStatusBarView : IBaseView { }
```
Marker interface for a view associated with the database status bar. No members defined.
---
### IDatabaseSwitchViewModel
```csharp
public interface IDatabaseSwitchViewModel : IBaseViewModel
```
ViewModel interface for transferring a remote database to a local database. Clears the local database and populates it with the remote database.
**Properties:**
| Signature | Description |
|-----------|-------------|
| `IDatabaseSwitchView View { get; set; }` | The view associated with the model |
| `bool RemoteIsActive { get; }` | Indicates whether remote database is currently active |
| `string DefaultDbName { get; }` | Gets the default database name |
| `string DbHost { get; }` | Gets the database host |
| `bool NTLMAuthentication { get; }` | Gets whether NTLM authentication is enabled |
| `string DbUser { get; }` | Gets the database user |
| `string DbPassword { get; }` | Gets the database password |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void Unset()` | Frees up any memory associated with the viewmodel |
| `void InitializeDbSettings(string defaultDbName, string dbHost, bool ntlmAuthentication, string dbUser, string dbPassword)` | Initializes database connection settings |
| `void SwitchRemote()` | Switches to the remote database |
| `void SwitchLocal()` | Switches to the local database |
---
### IUserDbRecord
```csharp
public interface IUserDbRecord
```
Interface representing a user record in the database.
**Properties:**
| Signature | Description |
|-----------|-------------|
| `int ID { get; set; }` | Database ID of the user |
| `string UserName { get; set; }` | User name of the user. **Must be unique** |
| `string DisplayName { get; set; }` | String to use when displaying user in UI |
| `string Password { get; set; }` | Hashed and salted password value (plain text passwords are not stored) |
| `short Role { get; set; }` | Role of the user |
| `DateTime LastModified { get; set; }` | DateTime the user was last modified |
| `string LastModifiedBy { get; set; }` | User that last modified this user record |
| `bool LocalOnly { get; set; }` | Whether user should be synchronized between local and remote databases. **Deprecated** |
---
### IDatabaseCopyViewModel
```csharp
public interface IDatabaseCopyViewModel : IBaseViewModel
```
ViewModel interface for transferring a remote database to a local database. Clears the local database and populates it with the remote database.
**Properties:**
| Signature | Description |
|-----------|-------------|
| `IDatabaseCopyView View { get; set; }` | The view associated with the model |
| `string DbName { get; }` | Gets the database name |
| `IStatusAndProgressBarView OverallProgressBarView { get; }` | The overall status/progress view |
| `IStatusAndProgressBarView CurrentTaskProgressBarView { get; }` | Current task status/progress view |
| `DbType DatabaseType { get; }` | Gets the database type |
| `bool CopyEnabled { get; }` | Gets whether copy operation is enabled |
| `bool IsCopyVisible { get; set; }` | Gets or sets copy visibility |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void Unset()` | Frees up any memory associated with the viewmodel |
| `void CopyDatabase()` | Copies from remote database to local database (uses `DTS.Common.Storage` to determine local and remote) |
| `void InitializeState(DbType dbType, string dbName)` | Initializes viewmodel state |
---
### IDatabaseStatusBarViewModel
```csharp
public interface IDatabaseStatusBarViewModel : IBaseViewModel
```
ViewModel interface handling the logic for database status in a UI, including current connection and status.
**Properties:**
| Signature | Description |
|-----------|-------------|
| `IDatabaseStatusBarView View { get; set; }` | The associated view for the model |
| `DbType DatabaseType { get; }` | Gets the database type (populated via `InitializeValues`) |
| `bool RemoteConnected { get; }` | Gets whether the remote database is connected (populated via `InitializeValues`) |
| `string ServerName { get; }` | Gets the server name, not database name (populated via `InitializeValues`) |
| `string ActiveDbName { get; }` | Returns the current active database name (either server name or local depending on db type and remote connection status) |
| `Brush BackgroundBrush { get; }` | Returns the background brush for the active database name |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void Unset()` | Frees up any memory associated with the viewmodel |
| `void InitializeValues(DbType dbType, string serverName, bool remoteConnected)` | Sets the initial values for database type, server name, and remote connection status |
---
## 3. Invariants
- **IUserDbRecord.UserName** must be unique across all user records.
- **IUserDbRecord.Password** must be a hashed and salted value; plain text passwords must never be stored in the database.
- **IDatabaseCopyViewModel** and **IDatabaseSwitchViewModel** require that the local database already has the correct tables and stored procedures before copy/switch operations can be performed.
- All ViewModels must have their initialization methods called (`InitializeState`, `InitializeDbSettings`, or `InitializeValues`) before their properties can be meaningfully accessed.
- `Unset()` should be called to clean up resources when a ViewModel is no longer needed.
---
## 4. Dependencies
### This module depends on:
- **DTS.Common.Base** — Provides `IBaseView`, `IBaseViewModel`, and `IStatusAndProgressBarView`
- **DTS.Common.Enums.Database** — Provides `DbType` enumeration
- **DTS.Common.Storage** — Referenced in documentation as the source for determining local and remote database locations (actual dependency not visible in imports)
- **System.Windows.Media** — Provides `Brush` class (used in `IDatabaseStatusBarViewModel`)
- **System** — Provides `DateTime` (used in `IUserDbRecord`)
### What depends on this module:
- Cannot be determined from source alone. Concrete implementations of these interfaces would exist elsewhere in the codebase.
---
## 5. Gotchas
1. **Deprecated Property**: `IUserDbRecord.LocalOnly` is marked as deprecated. New code should not rely on this property for synchronization logic between local and remote databases.
2. **Preconditions for Copy/Switch**: Both `IDatabaseCopyViewModel` and `IDatabaseSwitchViewModel` explicitly require that the local database already has the correct schema (tables and stored procedures) before operations can succeed. This is not validated by the interfaces themselves.
3. **ServerName vs Database Name**: `IDatabaseStatusBarViewModel.ServerName` returns the server name, not the database name. The actual active database name is available via `ActiveDbName`.
4. **Commented-Out Method**: `IDatabaseSwitchViewModel` has a commented-out method signature `//void SetDefaultDbName(string defaultDbName);` suggesting this functionality was removed or never implemented. The reason is unclear from source alone.
5. **WPF Dependency**: The use of `System.Windows.Media.Brush` in `IDatabaseStatusBarViewModel` indicates a WPF-specific dependency, which may limit portability to other UI frameworks.

View File

@@ -0,0 +1,47 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DownloadData/IDownloadDataView.cs
- Common/DTS.CommonCore/Interface/DownloadData/IDownloadDataViewModel.cs
generated_at: "2026-04-16T12:17:08.936258+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "3467185c7a4c208b"
---
# Documentation: Download Data Interfaces
## 1. Purpose
This module defines the contractual interfaces for the View and ViewModel components within a "Download Data" feature, adhering to a Model-View-ViewModel (MVVM) architectural pattern. It establishes a type hierarchy for download-specific UI components by extending base view and viewModel interfaces, allowing for polymorphic handling of download views within the broader `DTS.Common` system.
## 2. Public Interface
### `IDownloadDataView`
* **Namespace:** `DTS.Common.Interface`
* **Inheritance:** `IBaseView`
* **Signature:**
```csharp
public interface IDownloadDataView : IBaseView
```
* **Description:** A marker interface intended to represent the View layer for a data download operation. It inherits from `IBaseView` but defines no additional members.
### `IDownloadDataViewModel`
* **Namespace:** `DTS.Common`
* **Inheritance:** `IBaseViewModel`
* **Signature:**
```csharp
public interface IDownloadDataViewModel : IBaseViewModel
```
* **Description:** A marker interface intended to represent the ViewModel layer for a data download operation. It inherits from `IBaseViewModel` but defines no additional members.
## 3. Invariants
* **Base Type Compliance:** Any class implementing `IDownloadDataView` must also implement `IBaseView`. Similarly, any class implementing `IDownloadDataViewModel` must also implement `IBaseViewModel`.
* **Member Expectations:** As both interfaces currently define no members, they rely entirely on the contracts defined by their parent interfaces (`IBaseView` and `IBaseViewModel`).
## 4. Dependencies
* **External Dependencies:**
* `DTS.Common.Base`: Both interfaces depend on this namespace for `IBaseView` and `IBaseViewModel`.
* **Dependents:** Unknown from source alone. It is expected that concrete View and ViewModel classes within the "Download Data" feature will implement these interfaces.
## 5. Gotchas
* **Empty Interfaces:** Both `IDownloadDataView` and `IDownloadDataViewModel` are currently empty (marker interfaces). They do not define properties such as `DownloadCommand`, `ProgressPercentage`, or `Cancel` methods that one might expect for a download feature. Functionality must be inferred from the base interfaces or implemented in concrete classes without interface enforcement.
* **Namespace Inconsistency:** The View interface (`IDownloadDataView`) resides in `DTS.Common.Interface`, while the ViewModel interface (`IDownloadDataViewModel`) resides in the root `DTS.Common` namespace. This discrepancy may cause confusion regarding file organization or referencing.

View File

@@ -0,0 +1,49 @@
---
source_files:
- Common/DTS.CommonCore/Interface/DownloadEvent/IDownloadEvent.cs
generated_at: "2026-04-16T12:13:29.485943+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "089f2c1bff740fce"
---
# Documentation: IDownloadEvent.cs
## 1. Purpose
This module defines the `IDownloadEvent` interface within the `DTS.Common.Interface.DownloadEvent` namespace. It serves as a data contract for representing a "Multiple download event" (as noted in source comments). The interface is designed for UI data-binding scenarios, indicated by its inheritance from `INotifyPropertyChanged`, and encapsulates properties regarding an event's identification, interactive state (enabled/readonly), duration, and display logic.
## 2. Public Interface
### Interface: `IDownloadEvent`
Inherits from: `INotifyPropertyChanged`
**Properties:**
* `int EventNumber { get; set; }`
* Gets or sets the numeric identifier for the download event.
* `string EventNumberDisplay { get; set; }`
* Gets or sets the string representation of the event number, intended for UI display purposes.
* `bool IsEnabled { get; set; }`
* Gets or sets a value indicating whether the download event is enabled.
* `bool IsReadonly { get; set; }`
* Gets or sets a value indicating whether the download event is read-only.
* `bool IsDefault { get; }`
* Gets a value indicating whether this instance is the default event. This property is read-only (has no setter).
* `TimeSpan EventLength { get; set; }`
* Gets or sets the total length available for the download event.
* `bool ShouldDisplayLength { get; set; }`
* Gets or sets a value indicating whether the event length should be displayed in the UI.
## 3. Invariants
* **INotifyPropertyChanged Contract:** Any class implementing `IDownloadEvent` must implement the `PropertyChanged` event from `INotifyPropertyChanged`. Implementations are expected to raise this event when property values change to support UI binding.
* **Read-Only State:** The `IsDefault` property is strictly read-only. Implementations must calculate or determine this state internally; it cannot be set externally via the interface.
## 4. Dependencies
* **System**: Required for the `TimeSpan` type.
* **System.ComponentModel**: Required for the `INotifyPropertyChanged` interface.
* **Consumers**: Unknown from this source file alone, though the namespace `DTS.Common.Interface.DownloadEvent` suggests it is consumed by UI components or ViewModels handling download logic within the DTS system.
## 5. Gotchas
* **Dual Event Number Properties:** The interface defines both `EventNumber` (int) and `EventNumberDisplay` (string). The source does not define the relationship between them (e.g., if setting one automatically updates the other). Developers should verify the synchronization logic in the concrete implementation.
* **IsDefault Logic:** Because `IsDefault` has no setter, the logic determining what makes an event "default" is encapsulated within the implementation. Developers cannot force an event to be default via this interface.
* **Comment Reference:** The comment `//FB 6399` references a specific issue tracking ID (likely FogBugz), suggesting this interface was created to address a specific requirement or bug regarding "Multiple download events."

View File

@@ -0,0 +1,64 @@
---
source_files:
- Common/DTS.CommonCore/Interface/EngineerDetails/IEngineerDetailsView.cs
- Common/DTS.CommonCore/Interface/EngineerDetails/IEngineerDetailsViewModel.cs
generated_at: "2026-04-16T12:11:30.697854+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "feca2337b3dd2d0e"
---
# Documentation: Engineer Details Interfaces
## 1. Purpose
This module defines two empty marker interfaces, `IEngineerDetailsView` and `IEngineerDetailsViewModel`, which establish the View and ViewModel contracts for an "Engineer Details" feature within the DTS application. These interfaces follow the MVVM (Model-View-ViewModel) architectural pattern and exist primarily to provide type-specific identification and dependency injection registration points by extending base view and view model interfaces.
---
## 2. Public Interface
### `IEngineerDetailsView`
- **Namespace:** `DTS.Common.Interface`
- **Inherits from:** `IBaseView` (from `DTS.Common.Base`)
- **Signature:**
```csharp
public interface IEngineerDetailsView : IBaseView { }
```
- **Behavior:** Empty marker interface. No members defined. Relies entirely on the contract defined by `IBaseView`.
---
### `IEngineerDetailsViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Inherits from:** `IBaseViewModel` (from `DTS.Common.Base`)
- **Signature:**
```csharp
public interface IEngineerDetailsViewModel : IBaseViewModel { }
```
- **Behavior:** Empty marker interface. No members defined. Relies entirely on the contract defined by `IBaseViewModel`.
---
## 3. Invariants
- Both interfaces are empty and define no additional members beyond their base interfaces.
- Any invariants are inherited from `IBaseView` and `IBaseViewModel` respectively; the specific constraints of those base interfaces are not visible in the provided source.
- Implementations of these interfaces must fulfill the contracts of their respective base types.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces.
### What depends on this module:
- **Cannot be determined from source alone.** Consumers would typically include concrete View and ViewModel implementations, dependency injection registration modules, or navigation/routing components within the DTS system.
---
## 5. Gotchas
- **Marker interfaces with no members:** Both interfaces are empty and serve only as type identifiers. They do not define any Engineer Details-specific properties, methods, or events. All functionality must come from the base interfaces or be added via extension methods elsewhere.
- **Base interface contracts unknown:** The actual capabilities and requirements of these interfaces depend entirely on `IBaseView` and `IBaseViewModel`, which are not included in the provided source. Developers should consult those base definitions to understand the full contract.

View File

@@ -0,0 +1,74 @@
---
source_files:
- Common/DTS.CommonCore/Interface/ExportData/IExportDataView.cs
- Common/DTS.CommonCore/Interface/ExportData/IExportDataViewModel.cs
- Common/DTS.CommonCore/Interface/ExportData/IExportHeader.cs
generated_at: "2026-04-16T12:19:27.871731+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ccb8183959611900"
---
# Documentation: DTS.Common.Interface.ExportData
## 1. Purpose
This module defines core interfaces for the data export subsystem within the DTS application. It establishes contracts for the view/viewmodel pair in an MVVM architecture and provides a data structure interface for representing export column headers with selection state. The interfaces serve as integration points between the export functionality and the broader application framework.
---
## 2. Public Interface
### `IExportDataView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
A marker interface for export data views. Defines no members; exists to provide type identity for views that participate in data export operations.
---
### `IExportDataViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
A marker interface for export data view models. Defines no members; exists to provide type identity for view models that support data export operations.
---
### `IExportHeader`
**Namespace:** `DTS.Common.Interface.ExportData`
**Inheritance:** `INotifyPropertyChanged`
Defines a selectable header item for export column configuration.
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `HeaderName` | `string` | get/set | The display name of the export header/column |
| `IsSelected` | `bool` | get/set | Indicates whether this header/column is selected for export |
---
## 3. Invariants
- **Namespace inconsistency:** `IExportHeader` resides in `DTS.Common.Interface.ExportData`, while `IExportDataView` and `IExportDataViewModel` reside in `DTS.Common.Interface`. Consumers must reference the correct namespace for each type.
- **Property change notification:** Implementations of `IExportHeader` must raise `PropertyChanged` events when `HeaderName` or `IsSelected` changes, as required by `INotifyPropertyChanged` inheritance.
- **Base contract compliance:** All three interfaces inherit from framework base types (`IBaseView`, `IBaseViewModel`, `INotifyPropertyChanged`), implying implementations must satisfy those base contracts as well.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces
- `System.ComponentModel` — provides `INotifyPropertyChanged` interface
### What depends on this module:
- **Cannot be determined from source alone.** Consumers would typically be concrete view/viewmodel implementations and export-related services.
---
## 5. Gotchas
- **Marker interfaces with no members:** `IExportDataView` and `IExportDataViewModel` define no members beyond their base interfaces. Their utility appears limited to type identification/constraint purposes. It is unclear from source alone whether this is intentional design or incomplete implementation.
- **Inconsistent namespace depth:** `IExportHeader` is placed in a more specific namespace (`ExportData` sub-namespace) while the view/viewmodel interfaces are not. The rationale for this inconsistency is not evident from the source.
- **No validation contracts:** `IExportHeader.HeaderName` has no nullability annotation or validation requirements defined in the interface. Implementations may handle null/empty strings differently.

View File

@@ -0,0 +1,89 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Graphs/IGraph.cs
- Common/DTS.CommonCore/Interface/Graphs/IGraphRecord.cs
generated_at: "2026-04-16T12:18:31.651015+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a5e5bc31a5802f38"
---
# Documentation: DTS.Common.Interface.Graphs
## 1. Purpose
This module defines the data contract for graph configuration within the DTS system. It provides two interfaces—`IGraphRecord` and `IGraph`—that model graph definitions persisted to a database, including axis bounds, channel assignments, and threshold markers. `IGraphRecord` represents the pure data shape of a database record, while `IGraph` extends it with runtime behaviors for channel management, XML serialization, and string synchronization. These interfaces serve as the abstraction layer between graph persistence and graph rendering/management components.
---
## 2. Public Interface
### IGraphRecord
Base interface describing a database record for a graph configuration.
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `GraphId` | `int` | get/set | Database primary key for the graph. |
| `TestSetupId` | `int` | get/set | Foreign key linking the graph to a test setup. |
| `GraphName` | `string` | get/set | Display name of the graph. Constrained to 50 characters via `[MaxLength(50)]`. |
| `GraphDescription` | `string` | get/set | Description text for the graph. Constrained to 50 characters via `[MaxLength(50)]`. |
| `ChannelsString` | `string` | get/set | Serialized representation of all channels in the graph. Constrained to 2048 characters via `[MaxLength(2048)]`. |
| `UseDomainMin` | `bool` | get/set | Flag indicating whether the domain (X) axis has a minimum bound. |
| `DomainMin` | `double` | get/set | Minimum value for the domain axis. Only meaningful when `UseDomainMin` is `true`. |
| `UseDomainMax` | `bool` | get/set | Flag indicating whether the domain (X) axis has a maximum bound. |
| `DomainMax` | `double` | get/set | Maximum value for the domain axis. Only meaningful when `UseDomainMax` is `true`. |
| `UseRangeMin` | `bool` | get/set | Flag indicating whether the range (Y) axis has a minimum bound. |
| `RangeMin` | `double` | get/set | Minimum value for the range axis. Only meaningful when `UseRangeMin` is `true`. |
| `UseRangeMax` | `bool` | get/set | Flag indicating whether the range (Y) axis has a maximum bound. |
| `RangeMax` | `double` | get/set | Maximum value for the range axis. Only meaningful when `UseRangeMax` is `true`. |
| `ThresholdsString` | `string` | get/set | Serialized representation of threshold lines to display on the graph. Constrained to 2048 characters via `[MaxLength(2048)]`. |
| `LocalOnly` | `bool` | get/set | Flag indicating whether to synchronize the record with a central database. **Marked as deprecated in XML documentation.** |
---
### IGraph
Extends `IGraphRecord` with runtime operations for channel management and serialization.
| Method | Signature | Description |
|--------|-----------|-------------|
| `AddChannel` | `void AddChannel(IGroupChannel groupChannel)` | Adds a group channel to the graph. |
| `RemoveChannel` | `void RemoveChannel(IGroupChannel groupChannel)` | Removes a group channel from the graph. |
| `ReadXML` | `void ReadXML(System.Xml.XmlElement root, IReadOnlyDictionary<long, IGroupChannel> channelLookup)` | Deserializes graph configuration from an XML element. Uses the provided `channelLookup` dictionary to resolve channel references by their `long` key. |
| `WriteXML` | `void WriteXML(ref System.Xml.XmlWriter writer)` | Serializes the graph configuration to XML using the provided `XmlWriter`. The writer is passed by reference. |
| `UpdateChannelAndThresholdStrings` | `void UpdateChannelAndThresholdStrings()` | Synchronizes the `ChannelsString` and `ThresholdsString` properties from the in-memory `GroupChannels` and `Thresholds` collections. |
---
## 3. Invariants
- **String Length Constraints**: `GraphName` and `GraphDescription` must not exceed 50 characters. `ChannelsString` and `ThresholdsString` must not exceed 2048 characters. These are enforced via `MaxLengthAttribute` annotations.
- **Conditional Axis Bounds**: `DomainMin`, `DomainMax`, `RangeMin`, and `RangeMax` values are only semantically valid when their corresponding `Use*` flags are `true`. The interface does not enforce this at compile time.
- **Channel Lookup Key Type**: The `ReadXML` method expects channel lookups to use `long` keys.
- **Inheritance Relationship**: All implementations of `IGraph` must also implement `IGraphRecord`.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Interface.Channels` — for `IGroupChannel` type used in channel management methods
- `System.Collections.Generic` — for `IReadOnlyDictionary<long, IGroupChannel>` parameter
- `System.ComponentModel.DataAnnotations` — for `MaxLengthAttribute` on `IGraphRecord` properties
- `System.Xml` — for `XmlElement` and `XmlWriter` types in serialization methods
### What depends on this module:
- **Cannot be determined from source alone** — no consumers are shown in these files.
---
## 5. Gotchas
- **Deprecated Property**: `LocalOnly` is explicitly marked as deprecated in the XML documentation. Its purpose (controlling synchronization with a central database) suggests historical functionality that may no longer be in use or is planned for removal.
- **Asymmetric XML API**: `ReadXML` accepts an `XmlElement` (a node-oriented approach), while `WriteXML` accepts a `ref XmlWriter` (a streaming writer approach). This asymmetry may complicate round-trip serialization logic.
- **Hidden Properties Referenced**: The `UpdateChannelAndThresholdStrings` method documentation references `GroupChannels` and `Thresholds` properties that are **not defined in either interface**. These are presumably defined on concrete implementations or another partial interface not shown here. The relationship between these collections and the string properties is managed by this method.
- **String Serialization Format**: The format of `ChannelsString` and `ThresholdsString` is not specified in these interfaces. Implementations must define and document their own serialization scheme (e.g., comma-separated IDs, JSON, custom format).

View File

@@ -0,0 +1,276 @@
---
source_files:
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateListView.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateExportView.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateImportView.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/ITemplateChannelListView.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateInfoControlView.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateViewModel.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateInfoControlViewModel.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplate.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateListViewModel.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/ITemplateChannelListViewModel.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/IGroupTemplateChannel.cs
- Common/DTS.CommonCore/Interface/GroupTemplate/ITestObjectTemplate.cs
generated_at: "2026-04-16T12:16:13.665831+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "7ad50e5b491c81bf"
---
# GroupTemplate Interface Module Documentation
## 1. Purpose
This module defines the contract layer for the Group Template subsystem within the DTS application. It provides interfaces for Views, ViewModels, and data models that manage group templates—entities that associate channels with groups and support import/export functionality. The module follows a Model-View-ViewModel (MVVM) architecture, separating presentation concerns from business logic. These interfaces enable testability and decoupling between concrete implementations and their consumers.
---
## 2. Public Interface
### View Interfaces (Marker Interfaces)
| Interface | Namespace | Base | Description |
|-----------|-----------|------|-------------|
| `IGroupTemplateListView` | `DTS.Common.Interface.GroupTemplate` | `IBaseView` | Marker interface for list view |
| `IGroupTemplateExportView` | `DTS.Common.Interface.GroupTemplate` | `IBaseView` | Marker interface for export view |
| `IGroupTemplateImportView` | `DTS.Common.Interface.GroupTemplate` | `IBaseView` | Marker interface for import view |
| `ITemplateChannelListView` | `DTS.Common.Interface.GroupTemplate` | `IBaseView` | Marker interface for channel list view |
| `IGroupTemplateInfoControlView` | `DataPro.Common.Interface` | `IBaseView` | Marker interface for info control view |
---
### `IGroupTemplateViewModel`
**Namespace:** `DTS.Common.Interface.GroupTemplate`
**Base:** `IBaseViewModel`
```csharp
IGroupTemplateImportView ImportView { get; set; }
IGroupTemplateExportView ExportView { get; set; }
void Unset();
```
- **ImportView/ExportView**: Properties for accessing import/export view implementations.
- **Unset()**: Clears or resets the view model state. Behavior implementation-specific.
---
### `IGroupTemplateInfoControlViewModel`
**Namespace:** `DataPro.Common.Interface`
**Base:** `IBaseViewModel`
```csharp
IGroupTemplateInfoView View { get; }
IGroupTemplateModel SelectedGroupTemplate { get; set; }
```
- **View**: Read-only property returning the associated Shell View.
- **SelectedGroupTemplate**: Gets or sets the currently selected group template model.
---
### `IGroupTemplate`
**Namespace:** `DTS.Common.Interface.GroupTemplate`
```csharp
bool Disabled { get; set; }
string Name { get; set; }
string Description { get; set; }
string Channels { get; set; }
string AssociatedGroups { get; set; }
string LastModifiedBy { get; set; }
DateTime LastModified { get; set; }
string SerialNumber { get; set; }
bool Filter(string term);
```
- **Disabled**: Flag indicating whether the template is disabled.
- **Name/Description**: Template identification and documentation.
- **Channels/AssociatedGroups**: String representations of related entities (format unclear from interface).
- **LastModifiedBy/LastModified**: Audit tracking fields.
- **SerialNumber**: Unique identifier for the template.
- **Filter(string term)**: Returns `true` if the template matches the search term; matching criteria implementation-specific.
---
### `IGroupTemplateListViewModel`
**Namespace:** `DTS.Common.Interface.GroupTemplate`
**Base:** `IBaseViewModel`, `IFilterableListView`
```csharp
IGroupTemplateListView View { get; set; }
void GetAllTemplates(bool bIncludeEmbedded, bool bISOMode);
void Unset();
void Sort(object o, bool columnClick);
IGroupTemplate[] Templates { get; set; }
void Filter(string term);
void MouseDoubleClick(int index);
```
- **View**: Associated list view instance.
- **GetAllTemplates(bool bIncludeEmbedded, bool bISOMode)**: Loads templates; `bIncludeEmbedded` controls whether embedded templates are included, `bISOMode` behavior unclear from interface.
- **Unset()**: Clears view model state.
- **Sort(object o, bool columnClick)**: Sorts the template list; `o` represents the sort criteria, `columnClick` indicates sort direction toggle behavior.
- **Templates**: Array of loaded templates.
- **Filter(string term)**: Filters the template list by search term.
- **MouseDoubleClick(int index)**: Handles double-click interaction on the template at the specified index.
---
### `ITemplateChannelListViewModel`
**Namespace:** `DTS.Common.Interface.GroupTemplate`
**Base:** `IBaseViewModel`
```csharp
ITemplateChannelListView View { get; set; }
void Unset();
void Sort(object o, bool columnClick);
void Filter(string term);
void SetAllChannels(IGroupTemplateChannel[] channels);
IGroupTemplateChannel[] GetAllChannels();
void MoveDown(IGroupTemplateChannel channel);
void MoveUp(IGroupTemplateChannel channel);
void SetParent(object o);
```
- **View**: Associated channel list view instance.
- **Unset()**: Clears view model state.
- **Sort(object o, bool columnClick)**: Sorts channels; parameters same as list view model.
- **Filter(string term)**: Filters channels by search term.
- **SetAllChannels(IGroupTemplateChannel[] channels)**: Replaces the channel collection.
- **GetAllChannels()**: Returns the current channel array.
- **MoveDown/MoveUp(IGroupTemplateChannel channel)**: Adjusts `DisplayOrder` of the specified channel relative to siblings.
- **SetParent(object o)**: Associates the channel list with a parent object; type of `o` unclear from interface.
---
### `IGroupTemplateChannel`
**Namespace:** `DTS.Common.Interface.GroupTemplate`
```csharp
bool Custom { get; }
int DisplayOrder { get; set; }
string NameOfTheChannel { get; set; }
string Name { get; }
bool Required { get; set; }
string ISOCode { get; }
bool Filter(string term);
```
- **Custom**: Read-only flag indicating whether the channel is user-defined.
- **DisplayOrder**: Sortable position index.
- **NameOfTheChannel**: Mutable channel name.
- **Name**: Read-only name property (relationship to `NameOfTheChannel` unclear).
- **Required**: Flag indicating whether the channel is mandatory.
- **ISOCode**: Read-only ISO code identifier.
- **Filter(string term)**: Returns `true` if the channel matches the search term.
---
### `GroupTemplateChannelComparer`
**Namespace:** `DTS.Common.Interface.GroupTemplate`
**Base:** `IComparer<IGroupTemplateChannel>`
```csharp
GroupTemplateChannelFields SortField { get; set; }
bool Ascending { get; set; }
int Compare(IGroupTemplateChannel x, IGroupTemplateChannel y);
```
- **SortField**: Enum value from `GroupTemplateChannelFields` determining sort criteria.
- **Ascending**: Direction flag; `true` for ascending, `false` for descending.
- **Compare(IGroupTemplateChannel x, IGroupTemplateChannel y)**: Compares two channels based on `SortField`. Handles nulls (null < non-null). Throws `ArgumentOutOfRangeException` for unrecognized `SortField` values.
---
### `ITestObjectTemplate`
**Namespace:** `DTS.Common.Interface.GroupTemplate`
```csharp
string TemplateName { get; set; }
string TemplateNameOrOriginalTemplateName { get; }
string Icon { get; set; }
string Description { get; set; }
bool LocalOnly { get; set; }
int Version { get; set; }
string LastModifiedBy { get; set; }
DateTime LastModified { get; set; }
int CRC32 { get; set; }
string TestObject { get; set; }
string TestObjectType { get; set; }
string TemplateParent { get; set; }
bool SysBuilt { get; set; }
string OriginalTemplateName { get; set; }
bool Embedded { get; set; }
bool IsISOMode();
```
- **TemplateName**: Identifier; may be a GUID for embedded templates.
- **TemplateNameOrOriginalTemplateName**: Read-only human-readable name.
- **Icon/Description**: UI display properties.
- **LocalOnly**: Restricts template to local use.
- **Version**: Version number (comment notes "not currently used").
- **CRC32**: Checksum value (comment notes "not currently used").
- **TestObject/TestObjectType**: ISO meta fields.
- **TemplateParent**: Parent template reference (usage unclear per comments).
- **SysBuilt**: System-generated flag.
- **OriginalTemplateName**: Preserved name when embedded (GUID assigned as new `TemplateName`).
- **Embedded**: Indicates whether template is embedded in a test setup.
- **IsISOMode()**: Returns ISO mode status; implementation-specific.
---
## 3. Invariants
1. **Null Handling in Comparer**: `GroupTemplateChannelComparer.Compare` treats `null` as less than any non-null value. Two nulls are equal (returns 0).
2. **DisplayOrder Consistency**: `MoveUp` and `MoveDown` operations on `ITemplateChannelListViewModel` must maintain consistent `DisplayOrder` values across the channel collection.
3. **Embedded Template Naming**: When `ITestObjectTemplate.Embedded` is `true`, `TemplateName` is expected to be a GUID, while `OriginalTemplateName` preserves the human-readable name.
4. **SortField Enum Coverage**: `GroupTemplateChannelComparer.Compare` supports `Required`, `Name`, `ISOCode`, `Custom`, and `DisplayOrder` fields only. Any other value throws `ArgumentOutOfRangeException`.
---
## 4. Dependencies
### This Module Depends On:
| Dependency | Usage |
|------------|-------|
| `DTS.Common.Base` | `IBaseView`, `IBaseViewModel` base interfaces |
| `DataPro.Common.Base` | Alternative namespace for `IBaseView`, `IBaseViewModel` |
| `DTS.Common.Interface.Pagination` | `IFilterableListView` for list filtering |
| `DTS.Common.Enums.GroupTemplates` | `GroupTemplateChannelFields` enum for sorting |
| `System` | `DateTime`, `IComparer<T>`, `StringComparison` |
### Consumers (Inferred):
Concrete implementations of Views, ViewModels, and Models in higher-level modules will implement these interfaces. Specific consumers cannot be determined from the provided source files.
---
## 5. Gotchas
1. **Mixed Namespaces**: The codebase uses both `DTS.Common.*` and `DataPro.Common.*` namespaces inconsistently. `IGroupTemplateInfoControlView` and `IGroupTemplateInfoControlViewModel` use `DataPro.Common` while all other interfaces use `DTS.Common`. This may indicate a refactoring in progress or historical naming inconsistency.
2. **Unused Properties**: `ITestObjectTemplate.Version` and `ITestObjectTemplate.CRC32` are explicitly documented as "not currently used" in the source comments. Implementers should be aware these may have no functional effect.
3. **Ambiguous Name Properties**: `IGroupTemplateChannel` has both `NameOfTheChannel` (read/write) and `Name` (read-only). The relationship between these is not documented in the interface.
4. **Parameter Naming Convention**: Methods like `GetAllTemplates(bool bIncludeEmbedded, bool bISOMode)` use Hungarian notation (`b` prefix for booleans), which is inconsistent with modern C# conventions.
5. **Unknown Types**: Several interfaces reference types not defined in the provided sources:
- `IGroupTemplateModel` (referenced in `IGroupTemplateInfoControlViewModel`)
- `IGroupTemplateInfoView` (referenced in `IGroupTemplateInfoControlViewModel`)
- `GroupTemplateChannelFields` enum (referenced in `GroupTemplateChannelComparer`)
6. **Channels/AssociatedGroups Format**: `IGroupTemplate.Channels` and `IGroupTemplate.AssociatedGroups` are typed as `string`, but the expected format (CSV, JSON, delimited) is unclear from the interface alone.

View File

@@ -0,0 +1,233 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Groups/IGroupImportImportView.cs
- Common/DTS.CommonCore/Interface/Groups/IGroupHardwareDbRecord.cs
- Common/DTS.CommonCore/Interface/Groups/IGroupImportOptionsView.cs
- Common/DTS.CommonCore/Interface/Groups/IGroupImportPreviewView.cs
- Common/DTS.CommonCore/Interface/Groups/ITestSetupGroupRecord.cs
- Common/DTS.CommonCore/Interface/Groups/IGroupChannel.cs
- Common/DTS.CommonCore/Interface/Groups/ITestObject.cs
- Common/DTS.CommonCore/Interface/Groups/IGroupDbRecord.cs
- Common/DTS.CommonCore/Interface/Groups/IGroupImportViewModel.cs
generated_at: "2026-04-16T12:14:34.783297+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "0073692ccbf88d7d"
---
# Documentation: DTS.Common.Interface.Groups
## 1. Purpose
This module defines the core interfaces for the Groups subsystem within DTS, providing abstractions for group import workflows, database record structures, and channel/test object management. It serves as a contract layer between the group import UI views, view models, and the application core, enabling the parsing of `.GRP` files, validation of group configurations, and persistence of group and hardware records to the database. The module supports both legacy (pre-2.0) test object channels and ISO 13499-compliant metadata fields.
---
## 2. Public Interface
### Interfaces
#### `IGroupImportImportView`
Marker interface for views responsible for presenting progress feedback during group creation and commit operations.
- **Inherits:** `IBaseView`
- **Members:** None (marker interface)
---
#### `IGroupHardwareDbRecord`
Interface describing a GroupHardware record in the database.
| Property | Type | Attributes | Description |
|----------|------|------------|-------------|
| `Id` | `int` | `[Key]`, `[Column("Id")]` | Primary key of the GroupHardware record |
| `GroupId` | `int` | `[Column("GroupId")]` | Foreign key to the associated group |
| `DASId` | `int` | `[Column("DASId")]` | Data Acquisition System identifier |
| `SerialNumber` | `string` | `[Column("SerialNumber")]` | Serial number of the hardware |
---
#### `IGroupImportOptionsView`
Interface for views controlling file selection and validation.
- **Inherits:** `IBaseView`
| Method | Signature | Description |
|--------|-----------|-------------|
| `Validate` | `bool Validate(out List<string> errors, out List<string> warnings)` | Returns `true` if files have been selected; populates `errors` and `warnings` collections with validation issues |
---
#### `IGroupImportPreviewView`
Interface for views handling channel parsing from `.GRP` files, result display, and group selection/renaming.
- **Inherits:** `IBaseView`
| Method | Signature | Description |
|--------|-----------|-------------|
| `Validate` | `bool Validate(bool userIsAdmin, out List<string> errors, out List<string> warnings)` | Validates currently selected groups including channels and group names. Returns `true` if all selected groups are valid. Errors are fatal; warnings are non-blocking. |
---
#### `ITestSetupGroupRecord`
Interface describing a test setup group database record.
| Property | Type | Description |
|----------|------|-------------|
| `GroupId` | `int` | Database ID of the group |
| `DisplayOrder` | `int` | Display order of the group |
| `Position` | `string` | Position field (ISO 13499), if available; groups can have mixed position fields |
| `TestObjectType` | `string` | Test Object field (ISO 13499), if available; groups can have mixed test object fields |
| `TestSetupId` | `int` | Database ID of the test setup the group belongs to |
---
#### `IGroupChannel`
Interface representing a logical channel in a group, associated with physical hardware and/or sensors.
- **Inherits:** `IGroupTemplateChannel`, `IComparable<IGroupChannel>`
- **Note:** Marked as "FOR THE OLD (PRE 2.0) TESTOBJECT CHANNELS"
| Property | Type | Description |
|----------|------|-------------|
| `Disabled` | `bool` | Controls whether channel is used during data collection; disabled channels are excluded from run test |
| `ChannelIdx` | `int` | Channel index |
| `SensorSerialNumber` | `string` | Serial number of the associated sensor (if any) |
| `HardwareId` | `string` | Hardware channel identifier associated with this channel |
---
#### `ITestObject`
Interface representing a test object with channel management and metadata.
| Property | Type | Description |
|----------|------|-------------|
| `DisplaySerialNumber` | `string` | Read-only display-formatted serial number |
| `SerialNumberConverted` | `string` | Converted serial number |
| `SerialNumber` | `string` | Serial number |
| `SerialNumberOrOriginalSerialNumber` | `string` | Read-only fallback to original serial number |
| `TestObjectType` | `string` | Type of test object |
| `ParentObject` | `string` | Parent object reference |
| `SysBuilt` | `bool` | System-built flag |
| `TextL1` | `string` | Text line 1 |
| `HardwareIds` | `string[]` | Array of hardware IDs |
| `Template` | `string` | Template name |
| `LocalOnly` | `bool` | Local-only flag |
| `LastModifiedBy` | `string` | User who last modified the object |
| `LastModified` | `DateTime` | Timestamp of last modification |
| `Embedded` | `bool` | Embedded flag |
| `OriginalSerialNumber` | `string` | Original serial number before conversion |
| `OriginalTemplate` | `string` | Original template (before embedding in test setup) |
| Method | Signature | Description |
|--------|-----------|-------------|
| `SortChannels` | `void SortChannels()` | Sorts channels within the test object |
| `SetTemplateOnly` | `void SetTemplateOnly(string value)` | Sets template without triggering additional side effects |
---
#### `IGroupDbRecord`
Interface describing a Group record in the database.
| Property | Type | Attributes | Description |
|----------|------|------------|-------------|
| `Id` | `int` | `[Key]`, `[Column("Id")]` | Primary key |
| `SerialNumber` | `string` | `[Column("SerialNumber")]` | Serial number of the group |
| `Picture` | `string` | `[Column("Picture")]` | Picture path/identifier |
| `DisplayName` | `string` | `[Column("DisplayName")]` | Display name |
| `Description` | `string` | `[Column("Description")]` | Description text |
| `Embedded` | `bool` | `[Column("Embedded")]` | Whether the group is embedded |
| `LastModified` | `DateTime` | `[Column("LastModified")]` | Last modification timestamp |
| `LastModifiedBy` | `string` | `[Column("LastModifiedBy")]` | User who last modified |
| `StaticGroupId` | `int?` | `[Column("StaticGroupId")]` | Optional static group ID |
| `ExtraProperties` | `string` | `[Column("ExtraProperties")]` | Extra properties (serialized) |
---
#### `IGroupImportViewModel`
Interface for the group import view model, coordinating views, application logic, and intermediate data.
- **Inherits:** `IBaseViewModel`
| Property | Type | Description |
|----------|------|-------------|
| `ImportOptionsView` | `IGroupImportOptionsView` | View for file selection |
| `ImportPreviewView` | `IGroupImportPreviewView` | View for group selection and channel viewing |
| `ImportView` | `IGroupImportImportView` | View for commit progress display |
| `Logger` | `FileUtils.LogDelegate` | Logging facility |
| `SwitchNavSteps` | `SwitchNavStepsDelegate` | Callback to change navigation steps |
| `CheckGroupExists` | `CheckGroupExistsDelegate` | Callback to check if a group exists |
| `CheckSensorExists` | `CheckSensorExistsDelegate` | Callback to check if a sensor exists |
| `CreateGroup` | `CreateGroupDelegate` | Callback to create a group |
| `AddChannel` | `AddChannelToGroupDelegate` | Callback to add a channel to a group |
| `CommitGroups` | `CommitGroupsDelegate` | Callback to commit groups to database |
| `DisableUI` | `Disable_UIDelegate` | Callback to disable the UI |
| `EnableUI` | `Enable_UIDelegate` | Callback to enable the UI |
| `BrowseOk` | `bool` | Flag indicating browse operation status |
| Method | Signature | Description |
|--------|-----------|-------------|
| `SetStatus` | `void SetStatus(string message, Color color)` | Sets status message with color |
| `ParseSourceFiles` | `void ParseSourceFiles(string userTags)` | Reads source files and parses channels/groups |
| `Import` | `void Import()` | Commits groups and channels to application |
| `Reset` | `void Reset()` | Resets view model to initial values |
---
### Delegates
| Delegate | Signature | Description |
|----------|-----------|-------------|
| `SwitchNavStepsDelegate` | `void (GroupImportEnums.Steps step)` | Switches navigation to specified step |
| `CheckGroupExistsDelegate` | `bool (string name)` | Checks if a group exists by serial number |
| `CheckSensorExistsDelegate` | `bool (string serialNumber)` | Checks if a sensor exists by serial number |
| `CreateGroupDelegate` | `void (string serialNumber, string tags)` | Creates a new group with tags |
| `AddChannelToGroupDelegate` | `void (string groupSerialNumber, string displayName, string sensorSerialNumber, double? capacity, bool? invert, string isoCode, IChannelSetting[] channelDefaults)` | Adds a channel to the end of a group's existing channels; `capacity`/`invert` use sensor defaults when `null` |
| `CommitGroupsDelegate` | `void (string[] serialNumbers)` | Commits specified groups to database |
| `Disable_UIDelegate` | `void ()` | Disables the UI |
| `Enable_UIDelegate` | `void ()` | Enables the UI |
---
## 3. Invariants
1. **Database Column Mapping:** All `IGroupDbRecord` and `IGroupHardwareDbRecord` properties are explicitly mapped to database columns via `[Column]` attributes; implementations must preserve these mappings.
2. **Primary Keys:** `Id` properties on `IGroupDbRecord` and `IGroupHardwareDbRecord` are marked with `[Key]` attribute and must be unique.
3. **Validation Pattern:** Both `IGroupImportOptionsView.Validate` and `IGroupImportPreviewView.Validate` follow the pattern of returning a boolean success indicator while populating `out` parameters for errors (fatal) and warnings (non-fatal).
4. **Channel Ordering:** `IGroupChannel` implements `IComparable<IGroupChannel>`, implying a defined sort order for channels.
5. **Channel Append Semantics:** Per `AddChannelToGroupDelegate` documentation, channels are appended to the end of a group's existing channels.
6. **Nullable Foreign Keys:** `StaticGroupId` on `IGroupDbRecord` is nullable (`int?`), indicating optional relationships.
---
## 4. Dependencies
### This module depends on:
- **DTS.Common.Base** - `IBaseView`, `IBaseViewModel` base interfaces
- **DTS.Common.Enums.Groups** - `GroupImportEnums.Steps` enumeration
- **DTS.Common.Interface.Channels** - `IChannelSetting` interface
- **DTS.Common.Interface.GroupTemplate** - `IGroupTemplateChannel` interface
- **DTS.Common.Utils** - `FileUtils.LogDelegate` delegate type
- **System.ComponentModel.DataAnnotations** - `[Key]`, `[Column]` attributes
- **System.Windows.Media** - `Color` type for status display
### What depends on this module:
- **Unclear from source alone** - No downstream consumers are visible in these interface definitions. The delegate patterns (`CreateGroupDelegate`, `CommitGroupsDelegate`, etc.) indicate that an application layer provides implementations, but specific consumers cannot be determined from these files.
---
## 5. Gotchas
1. **Legacy Channel Interface:** `IGroupChannel` is explicitly marked as "FOR THE OLD (PRE 2.0) TESTOBJECT CHANNELS" in the source comments. New implementations should investigate whether a newer channel interface exists.
2. **ViewModel Reuse Pattern:** The `Reset()` method documentation states: *"we are currently not creating a new viewmodel in the page, but re-using an existing one so everytime we re-visit the page we must re-initialize the vm"*. This singleton-like reuse pattern requires explicit cleanup via `Reset()` to avoid stale state.
3. **Mixed ISO 13499 Fields:** `ITestSetupGroupRecord.Position` and `TestObjectType` comments note that groups can be composed of mixed position and test object fields, which may complicate validation or display logic.
4. **Template Mutation on Embedding:** `ITestObject.OriginalTemplate` documentation indicates that the template changes when embedded in a test setup, suggesting template mutation side effects that may not be obvious.
5. **Null Parameter Semantics:** In `AddChannelToGroupDelegate`, `capacity` and `invert` parameters use `null` to signal "use sensor defaults" rather than "no value" — implementations must explicitly handle this convention.

View File

@@ -0,0 +1,153 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Groups/GroupChannelList/IGroupChannelListView.cs
- Common/DTS.CommonCore/Interface/Groups/GroupChannelList/IGroupChannelSettingsListView.cs
- Common/DTS.CommonCore/Interface/Groups/GroupChannelList/IGroupChannelListViewModel.cs
generated_at: "2026-04-16T12:21:49.528154+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b48152996c8c8c44"
---
# Documentation: Group Channel List Interfaces
## 1. Purpose
This module defines the contract for the Group Channel List feature using a Model-View-ViewModel (MVVM) pattern. It provides three interfaces—`IGroupChannelListView`, `IGroupChannelSettingsListView`, and `IGroupChannelListViewModel`—that govern the display, filtering, sorting, and manipulation of channel data within groups and test setups. The module serves as the abstraction layer between the UI layer and the business logic for managing sensor channels, their configurations, and their presentation modes.
---
## 2. Public Interface
### IGroupChannelListView
**Inherits from:** `IBaseView`
| Member | Signature | Description |
|--------|-----------|-------------|
| `HandleColumns` | `void HandleColumns(IsoViewMode viewMode)` | Configures which columns are displayed based on the provided ISO view mode. |
---
### IGroupChannelSettingsListView
**Inherits from:** `IBaseView`
| Member | Signature | Description |
|--------|-----------|-------------|
| `SetOrderMode` | `void SetOrderMode(bool bUseTestSetupOrder)` | Sets whether columns should reflect group order or test setup order. |
| `SetDisplayOptions` | `void SetDisplayOptions(bool bShowSensorChannelUserValues)` | Controls visibility of User Value X columns. |
| `HandleColumns` | `void HandleColumns(IsoViewMode viewMode)` | Sets which columns to display based on an ISO view mode. |
| `SetFilterMode` | `void SetFilterMode(PossibleFilters filterMode)` | Sets which columns to display based on a sensor type filter. |
| `ViewDbVersion` | `int ViewDbVersion { get; set; }` | Stores the minimum client database version associated with view data; used to hide or disable properties/features. |
---
### IGroupChannelListViewModel
**Inherits from:** `IBaseViewModel`, `IFilterableListView`
#### Properties
| Property | Type | Description |
|----------|------|-------------|
| `View` | `IGroupChannelListView` | The associated main view. |
| `SettingsView` | `IGroupChannelSettingsListView` | The associated settings view. |
| `CreateVoltageInputChannels` | `bool` | Controls whether voltage insertion channels are created when dragging an analog hardware channel onto a blank channel with no sensor set. |
| `CapacityFormat` | `string` | Format string for double values (typically "N2"). |
| `AllChannels` | `List<Channels.IGroupChannel>` | All available channels prior to filtering/searching/sorting. |
| `ChannelCodesFunc` | `Func<IList<IChannelCode>>` | Function returning available channel codes. |
| `Channels` | `ObservableCollection<Channels.IGroupChannel>` | Channels displayed in the channel list view. |
| `SettingChannels` | `ObservableCollection<Channels.IGroupChannel>` | Channels displayed in settings view; snapshot from `OnSetActive` with blank channels removed. |
| `SettingsViewLoaded` | `bool` | Indicates whether the attached `SettingsView` has loaded. |
| `SettingChannelsLoaded` | `bool` | Indicates whether `SettingChannel` UI elements were created. |
| `Group` | `IGroup` | The group being viewed (when editing a group). |
| `TestSetup` | `ITestSetup` | The test setup being viewed (when editing a test setup). |
| `UseISOCodeFilterMapping` | `bool` | Whether to always match the CFC to the ISO code and vice versa. |
| `ShowISOCodes` | `bool` | Indicates whether to show ISO codes. |
| `ShowUserCodes` | `bool` | Indicates whether to show user codes. |
| `ShowDallasIdColumn` | `bool` | Indicates whether to show Dallas ID column. |
| `ISOViewMode` | `IsoViewMode` | Gets/sets the ISO view mode. |
| `ShowISOStringBuilder` | `bool` | Controls visibility of ISO string builder. |
| `UniqueISOCodesRequired` | `bool` | Gets/sets whether complete and unique ISO codes are required. |
| `ShowChannelCodeLookupHelper` | `bool` | Controls visibility of channel code lookup helper. |
| `UseTestSetupOrder` | `bool` | Indicates whether test setup order is being used. |
| `ShowSensorChannelUserValues` | `bool` | Controls visibility of sensor channel user values. |
| `ApplySensorDataToBlankChannels` | `bool` | Modifies how meta data is handled when sensors are dragged onto channels without sensors. |
| `AllowChannelDeletionByNonAdminUser` | `bool` | Controls whether non-admin users can delete channels. |
| `UserIsAdmin` | `bool` | Indicates whether the current user is an admin. |
| `AllowSensorPushAndPull` | `bool` | Controls sensor push/pull functionality. |
| `ReadOnlyParametersMode` | `bool` | Enables read-only mode for parameters. |
| `ReadOnlyChannelsMode` | `bool` | Enables read-only mode for channels. |
| `UserID` | `int` | The current user ID. |
#### Methods
| Method | Signature | Description |
|--------|-----------|-------------|
| `PopulateChannels` | `IDictionary<IGroup, Channels.IGroupChannel[]> PopulateChannels(object page, IDictionary<int, ISensorData> sensorLookup, IDictionary<int, IDASHardware> hardwareLookup, IChannelSetting[] channelDefaults, bool allowChannelDeletionByNonAdminUser = true, bool userIsAdmin = true, bool allowSensorPushAndPull = false, bool keepExistingChannels = false, bool allowChannelDeletionFromFixedGroup = true)` | Populates channels to be displayed in views. Returns a dictionary mapping groups to their channels. |
| `CompareAndMarkChannelParameters` | `bool CompareAndMarkChannelParameters(Channels.IGroupChannel ch)` | Checks if any modifiable channel parameter values differ from the sensor database values; used for decoration in the Parameters step. |
| `OnSetActive` | `void OnSetActive()` | Called when a view is loaded. |
| `Unset` | `void Unset()` | Called when a view is unloaded. |
| `Filter` | `void Filter(string term)` | Filters content by a string search term. |
| `Filter` | `void Filter(PossibleFilters filter)` | Filters channels by sensor type. |
| `SetFilter` | `void SetFilter(PossibleFilters bridgeFilter)` | Sets which channel types are displayed by sensor type. |
| `MoveDown` | `void MoveDown(Channels.IGroupChannel[] channel)` | Moves the specified channels down in the list. |
| `MoveBottom` | `void MoveBottom(Channels.IGroupChannel[] channel)` | Moves the specified channels to the bottom of the list. |
| `MoveUp` | `void MoveUp(Channels.IGroupChannel[] channel)` | Moves the specified channels up in the list. |
| `MoveTop` | `void MoveTop(Channels.IGroupChannel[] channel)` | Moves the specified channels to the top of the list. |
| `AddChannels` | `void AddChannels(DTS.Common.Interface.Sensors.SensorsList.IDragAndDropItem[] sensors)` | Adds channels from drag-and-drop sensor items. |
| `AddChannels` | `void AddChannels(IHardwareChannel[] hardwareChannels)` | Adds channels from hardware channels. |
| `AddChannels` | `void AddChannels(Channels.IGroupChannel[] groupChannels)` | Adds existing group channels. |
| `Remove` | `void Remove(Channels.IGroupChannel channel, bool notifyChanged = true)` | Removes a channel from the list. |
| `CreateGroupIfNeeded` | `IGroup CreateGroupIfNeeded(ITestSetup testSetup, string groupName)` | Creates a group if one does not already exist. |
| `SetIncludedHardware` | `void SetIncludedHardware(IDASHardware[] hardwares)` | Sets included hardware; used to count channels for the view label. |
| `SetRange` | `void SetRange(CACOption option)` | Sets the range of all analog sensors according to the input option. |
| `Sort` | `void Sort(object columnTag, bool bUserClick)` | Sorts the view by the specified column. |
---
## 3. Invariants
- `IGroupChannelListView` and `IGroupChannelSettingsListView` must always inherit from `IBaseView`.
- `IGroupChannelListViewModel` must always inherit from both `IBaseViewModel` and `IFilterableListView`.
- `Channels` and `SettingChannels` must be of type `ObservableCollection<Channels.IGroupChannel>` to support UI binding.
- `SettingChannels` is a snapshot of `Channels` taken during `OnSetActive` with blank channels removed; it does not automatically update when `Channels` changes.
- `ViewDbVersion` on `IGroupChannelSettingsListView` must be set to the minimum client database version to ensure proper feature availability.
- The `PopulateChannels` method requires valid lookups (`sensorLookup`, `hardwareLookup`) to properly populate channel data.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` (`IBaseView`, `IBaseViewModel`)
- `DTS.Common.Enums` (`IsoViewMode`, `CACOption`)
- `DTS.Common.Enums.Sensors` (`PossibleFilters`)
- `DTS.Common.Enums.Sensors.SensorsList` (used in `IDragAndDropItem`)
- `DTS.Common.Interface.Channels` (`IGroupChannel`, `IHardwareChannel`)
- `DTS.Common.Interface.Channels.ChannelCodes` (`IChannelCode`)
- `DTS.Common.Interface.DataRecorders` (`IDASHardware`)
- `DTS.Common.Interface.Groups.GroupList` (`IGroup`)
- `DTS.Common.Interface.Pagination` (`IFilterableListView`)
- `DTS.Common.Interface.Sensors` (`ISensorData`, `IChannelSetting`)
- `DTS.Common.Interface.Sensors.SensorsList` (`IDragAndDropItem`)
- `DTS.Common.Interface.TestSetups.TestSetupsList` (`ITestSetup`)
- `System.Collections.Generic`
- `System.Collections.ObjectModel`
### What depends on this module:
- Not determinable from the provided source files alone.
---
## 5. Gotchas
1. **Two separate channel collections:** `Channels` and `SettingChannels` are both `ObservableCollection<Channels.IGroupChannel>`, but `SettingChannels` is a snapshot taken during `OnSetActive` with blank channels removed. Changes to one do not automatically reflect in the other.
2. **Multiple `AddChannels` overloads:** There are three overloads of `AddChannels` accepting different types (`IDragAndDropItem[]`, `IHardwareChannel[]`, `IGroupChannel[]`). Ensure the correct overload is called for the source data type.
3. **Two `Filter` overloads with different semantics:** `Filter(string term)` performs text-based filtering, while `Filter(PossibleFilters filter)` performs sensor-type-based filtering. These are distinct operations.
4. **`CreateVoltageInputChannels` behavior:** This property controls automatic creation of voltage insertion channels when dragging an analog hardware channel onto a blank channel. This behavior may be unexpected if not explicitly configured.
5. **`CompareAndMarkChannelParameters` side effects:** This method not only compares values but also "marks" them (presumably for UI decoration). It should be called when channel parameter modifications need to be highlighted.
6. **`Remove` method notification parameter:** The `Remove` method has a `notifyChanged` parameter defaulting to `true`. Setting this to `false` may suppress necessary UI updates.

View File

@@ -0,0 +1,240 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Groups/GroupList/IGroupListView.cs
- Common/DTS.CommonCore/Interface/Groups/GroupList/TestSetupParentHelper.cs
- Common/DTS.CommonCore/Interface/Groups/GroupList/IGroupListViewModel.cs
- Common/DTS.CommonCore/Interface/Groups/GroupList/IGroup.cs
generated_at: "2026-04-16T12:22:13.797964+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a5d3249cf1dc850d"
---
# Documentation: DTS.Common.Interface.Groups.GroupList
## 1. Purpose
This module defines the core interfaces and a helper class for managing Groups within the DTS system. Groups appear to be configurable entities that associate hardware, channels, sensors, and test setups together. The module provides the view-model contract (`IGroupListViewModel`), the view contract (`IGroupListView`), the domain entity interface (`IGroup`), and a helper class (`TestSetupParentHelper`) for tracking test setup associations. This abstraction layer enables separation between the UI layer and business logic for group management operations including creation, deletion, filtering, sorting, and XML serialization.
---
## 2. Public Interface
### `IGroupListView`
**File:** `IGroupListView.cs`
**Namespace:** `DTS.Common.Interface.Groups.GroupTemplateList`
```csharp
public interface IGroupListView : IBaseView { }
```
A marker interface extending `IBaseView`. No members are defined; it serves as a contract identifier for views that display group lists.
---
### `TestSetupParentHelper`
**File:** `TestSetupParentHelper.cs`
**Namespace:** `DTS.Common.Interface.Groups.GroupList`
```csharp
public class TestSetupParentHelper
{
public int Id;
public string Name { get; set; }
public bool Modified { get; set; }
public override string ToString()
}
```
A POCO class used to represent associated test setups within a group.
| Member | Type | Description |
|--------|------|-------------|
| `Id` | `int` (public field) | Identifier for the test setup |
| `Name` | `string` | Display name of the test setup |
| `Modified` | `bool` | Flag indicating whether the test setup has been modified |
| `ToString()` | `string` | Returns the `Name` property |
---
### `IGroupListViewModel`
**File:** `IGroupListViewModel.cs`
**Namespace:** `DTS.Common.Interface.Groups.GroupList`
```csharp
public interface IGroupListViewModel : IBaseViewModel, IFilterableListView
```
Defines the contract for a view model that manages a list of groups.
#### Properties
| Signature | Description |
|-----------|-------------|
| `IGroupListView View { get; set; }` | Gets or sets the associated view |
| `IGroup[] Groups { get; set; }` | Gets or sets the array of groups |
#### Methods
| Signature | Description |
|-----------|-------------|
| `void Unset()` | Purpose unclear from source alone |
| `void Sort(object o, bool columnClick)` | Sorts the group list; parameters' specific meanings unclear from source |
| `void OnSetActive(object page, bool groupTile, object currentUser)` | Called when the view becomes active; parameter purposes unclear from source |
| `void MouseDoubleClick(int index)` | Handles mouse double-click on a group at the specified index |
| `void Filter(string term)` | Filters the group list by the given search term |
| `IGroup GetGroup(int? id, bool updateTags = true)` | Retrieves a group by ID; optionally updates tags |
| `IGroup GetGroup(string displayName)` | Retrieves a group by display name |
| `IGroup[] GetGroups(int[] ids)` | Retrieves multiple groups by an array of IDs |
| `IGroup[] GetAllGroups()` | Retrieves all groups |
| `void DeleteGroups(int[] ids)` | Deletes groups specified by the array of IDs |
| `IGroup CreateGroup()` | Creates a new group with default parameters |
| `IGroup CreateGroup(List<string> includedHardwareStringList)` | Creates a new group with specified hardware string identifiers |
| `IGroup CreateGroup(SqlDataReader reader, List<string> includedHardwareStringList, List<int> dasIdList)` | Creates a group from a database reader |
| `IGroup CreateGroup(IGroupDbRecord groupRecord, List<string> includedHardwareStringList, List<int> dasIdList)` | Creates a group from a database record |
---
### `IGroup`
**File:** `IGroup.cs`
**Namespace:** `DTS.Common.Interface.Groups.GroupList`
```csharp
public interface IGroup : IComparable<IGroup>
```
Defines the contract for a Group entity, supporting comparison, hardware/channel management, XML serialization, and test setup associations.
#### Identity & Metadata Properties
| Signature | Description |
|-----------|-------------|
| `int Id { get; set; }` | Unique identifier for the group |
| `string Name { get; set; }` | Internal name of the group |
| `string DisplayName { get; set; }` | User-facing display name |
| `int? StaticGroupId { get; set; }` | Optional reference to a static group |
| `string Description { get; set; }` | Group description |
| `bool Embedded { get; set; }` | Indicates if the group is embedded |
| `DateTime LastModified { get; set; }` | Timestamp of last modification |
| `string LastModifiedBy { get; set; }` | User who last modified the group |
| `int DisplayOrder { get; set; }` | Order in which the group appears in lists |
#### Hardware Properties
| Signature | Description |
|-----------|-------------|
| `int[] IncludedHardware { get; set; }` | Array of hardware IDs included in the group |
| `string[] IncludedHardwareStringList { get; set; }` | Legacy hardware identifiers using old SerialNumber_type scheme (primarily for import) |
| `int ChannelCount { get; set; }` | Number of channels in the group |
#### Position & Test Object Properties
| Signature | Description |
|-----------|-------------|
| `bool PositionIsMixed { get; set; }` | Indicates if position values are mixed across channels |
| `bool PositionIsTextbox { get; set; }` | Indicates if position is represented as a textbox |
| `bool PositionIsCombobox { get; set; }` | Indicates if position is represented as a combobox |
| `string Position { get; set; }` | Position value |
| `bool TestObjectIsMixed { get; set; }` | Indicates if test object values are mixed across channels |
| `string TestObject { get; set; }` | Test object value |
| `List<string> AvailableTestObjects { get; set; }` | List of available test object options |
| `string SelectedTestObjectItem { get; set; }` | Currently selected test object item |
| `List<string> AvailablePositions { get; set; }` | List of available position options |
| `string SelectedPositionItem { get; set; }` | Currently selected position item |
#### Channel & Sensor Methods
| Signature | Description |
|-----------|-------------|
| `List<IGroupChannel> GroupChannelList { get; set; }` | List of channels associated with the group |
| `bool Save(IGroupChannel[] groupChannels, bool canUserCommitChannelCodes)` | Saves the group with the specified channels |
| `void ClearGroupChannelSettingCache(long groupId)` | Clears cached channel settings for the group |
| `IGroupChannel[] GetAllChannels(bool bEditable, IDictionary<int, ISensorData> sensorLookup, IDictionary<int, IDASHardware> hardwareLookup, IChannelSetting[] channelDefaults, bool allowSensorPushAndPull = false)` | Retrieves all channels with lookups for sensors and hardware |
| `void LoadHardware()` | Loads hardware for the group |
| `void ConvertToEmbedded(IGroupChannel[] groupChannels)` | Converts the group to embedded using the specified channels |
| `void DeterminePositionAndTestObject(IGroupChannel[] channels)` | Determines position and test object from channels |
| `ISensorData GetSensor(IGroupChannel channel, ISensorData sensorData, bool bUseIsoFilter)` | Retrieves sensor data for a channel |
| `void SetSensor(IGroupChannel channel, ISensorData sensorData)` | Sets sensor data for a channel |
#### XML Serialization Methods
| Signature | Description |
|-----------|-------------|
| `void WriteXML(ref XmlWriter writer)` | Writes the group to XML |
| `IGroup ReadXML(XmlElement node, Dictionary<long, IGroupChannel> channelLookup, List<ISensorData> sensors)` | Reads group from XML; returns the group instance |
#### Test Setup & Tag Methods
| Signature | Description |
|-----------|-------------|
| `List<TestSetupParentHelper> AssociatedTestSetups { get; set; }` | List of associated test setups |
| `void SetTestSetupLists()` | Populates the associated test setups list |
| `bool StaticGroupIsEqual()` | Compares group to its static counterpart |
| `bool IsDifferentThanStaticGroup { get; set; }` | Indicates if group differs from its static version |
| `bool TagCompatible(int[] tags)` | Checks if the group is compatible with the given tags |
| `int[] TagIDs { get; set; }` | Array of tag IDs associated with the group |
| `string GetTagsAsCommaSeparatedString(TagsGetDelegate tagsGet)` | Gets tags as a comma-separated string using the provided delegate |
| `string Tags { get; set; }` | Tags as a string |
#### Other Methods
| Signature | Description |
|-----------|-------------|
| `bool Filter(string term)` | Returns true if the group matches the search term |
| `void SetIncludedHardware(int[] hardware)` | Sets included hardware and updates internal loaded state |
| `IGroupDbRecord GetIGroupDbRecord()` | Retrieves the database record representation of the group |
---
## 3. Invariants
1. **Comparability**: All `IGroup` implementations must support comparison via `IComparable<IGroup>` for sorting operations.
2. **Hardware Dual Representation**: Groups maintain hardware references in two forms:
- `IncludedHardware` as `int[]` (current scheme)
- `IncludedHardwareStringList` as `string[]` (legacy SerialNumber_type scheme)
3. **Position/Test Object State Exclusivity**: The properties `PositionIsMixed`, `PositionIsTextbox`, and `PositionIsCombobox` appear to represent mutually exclusive states, though this is not explicitly enforced in the interface.
4. **Static Group Relationship**: When `StaticGroupId` is set, the group has a relationship with a static group that can be compared via `StaticGroupIsEqual()`.
5. **Channel Setting Cache**: Channel settings may be cached and must be explicitly cleared via `ClearGroupChannelSettingCache()` when needed.
---
## 4. Dependencies
### This module depends on:
| Dependency | Usage |
|------------|-------|
| `DTS.Common.Base` | Provides `IBaseView`, `IBaseViewModel` base interfaces |
| `DTS.Common.Interface.Pagination` | Provides `IFilterableListView` for filtering capability |
| `DTS.Common.Interface.Channels` | Provides `IGroupChannel`, `IChannelSetting` for channel management |
| `DTS.Common.Interface.DataRecorders` | Provides `IDASHardware` for hardware lookups |
| `DTS.Common.Interface.Sensors` | Provides `ISensorData` for sensor data operations |
| `DTS.Common.Interface.TestSetups.TestSetupsList` | Referenced in comments; relationship unclear from source |
| `System.Collections.Generic` | For `List<T>`, `IDictionary<TKey, TValue>` |
| `System.Data.SqlClient` | For `SqlDataReader` used in `CreateGroup` |
| `System.Xml` | For `XmlWriter`, `XmlElement` in XML serialization |
| `Classes.Tags.TagsInstance.TagsGetDelegate` | Delegate type for tag retrieval (fully qualified in source) |
### What depends on this module:
Cannot be determined from the provided source files alone.
---
## 5. Gotchas
1. **Namespace Mismatch**: `IGroupListView` is defined in namespace `DTS.Common.Interface.Groups.GroupTemplateList`, while all other types in this module are in `DTS.Common.Interface.Groups.GroupList`. This inconsistency may cause confusion or require additional using directives.
2. **Legacy Hardware Identification**: The `IncludedHardwareStringList` property uses the "old SerialNumber_type id scheme" and is "primarily for import purposes" per the source comment. New code should prefer `IncludedHardware`.
3. **Mixed State Indicators**: The `PositionIsMixed` and `TestObjectIsMixed` properties indicate that values vary across channels within a group. Code consuming these values should handle the "mixed" state appropriately.
4. **Public Field in TestSetupParentHelper**: The `Id` member is a public field rather than a property, unlike `Name` and `Modified`. This inconsistency may affect serialization or data binding scenarios.
5. **XML Writer Passed by Reference**: The `WriteXML` method takes `ref XmlWriter writer`, which is unusual. The reason for passing by reference is unclear from the source alone.
6. **Overloaded CreateGroup with SqlDataReader**: Direct use of `SqlDataReader` in the interface suggests tight coupling to SQL Server data access patterns, which may limit flexibility for alternative data sources.

View File

@@ -0,0 +1,122 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Hardware/IDASMonitorInfo.cs
- Common/DTS.CommonCore/Interface/Hardware/IISOHardware.cs
- Common/DTS.CommonCore/Interface/Hardware/IATDArmStatus.cs
- Common/DTS.CommonCore/Interface/Hardware/IDiagnosticResult.cs
generated_at: "2026-04-16T12:11:59.143193+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "706013fcdffb7c0e"
---
# Hardware Interface Module Documentation
## 1. Purpose
This module defines the core contracts for hardware abstraction within the DTS (Data Acquisition System) ecosystem. It provides interfaces for managing monitor calibration data (`IDASMonitorInfo`), persisting hardware configuration records (`IISOHardware`), tracking the hierarchical connection and arming status of devices (`IATDArmStatus` and related types), and reporting detailed per-channel diagnostic results (`IDiagnosticResult`). These interfaces decouple the system logic from specific hardware implementations, enabling consistent data handling across different device types.
## 2. Public Interface
### `IDASMonitorInfo`
Defines accessors for monitor hardware configuration and calibration data, specifically for tilt sensors and channel offsets.
* **Properties**:
* `string SerialNumber`: The hardware serial number.
* `double[] TiltSensorCals`: Calibration data for tilt sensors.
* `short[] TiltSensorDataPre`: Pre-calibration tilt sensor data.
* `DFConstantsAndEnums.TiltAxes TiltAxes`: The tilt axes configuration.
* `int AxisIgnored`: Identifier for which axis is ignored.
* `double MountOffsetAxisOne` / `MountOffsetAxisTwo`: Mounting offset values.
* **Methods**:
* `string GetChannelName(int index)`: Retrieves the name of a channel by index.
* `double GetOffsetTolerancemVLow(int index)` / `GetOffsetTolerancemVHigh(int index)`: Retrieves voltage offset tolerances.
* `void ReadFromFile(string path)`: Populates the object from a file.
* `void WriteToFile(string path)`: Persists the object state to a file.
### `IISOHardware` (inherits `IDASDBRecord`)
Defines behavior for hardware entities that interact with a database and network configuration.
* **Properties**:
* `HardwareTypes DASTypeEnum`: The specific hardware type enumeration.
* `string IPAddress`: The network IP address of the hardware.
* **Methods**:
* `void GetChannelsString(...)`: Returns counts of various channel types (analog, digital, squib, UART, stream) via out parameters.
* `bool IsPseudoRackModule()`: Indicates if the hardware is capable of being a pseudo-rack module (e.g., SLICE slabs).
* `bool IsTSRAIR()`: Indicates specific hardware capability.
* `bool ValidateSerialNumber(ref List<string> errors)` / `ValidateIPAddress(...)`: Validates configuration, appending errors to the provided list.
* `void Insert()` / `Update()` / `Delete()`: Database CRUD operations.
### `IATDArmStatus` Hierarchy
A set of interfaces and enums defining the status of Arm/Trigger Devices (ATD) in a hierarchy: `IAllATDStatus` -> `IATDStatus` -> `IDistributorArmStatus` -> `IDeviceArmStatus`.
* **`IAllATDStatus`**: Root container for ATD statuses.
* `IATDStatus[] ATDs`: Array of ATD devices.
* `AllATDStatuses OverallStatus`: Aggregate status enum (NotConnected, Connecting, AllConnected, AllArmed, Errors).
* **`IATDStatus`**: Represents a single ATD unit.
* `IPAddress IP`: The IP address of the ATD.
* `IDistributorArmStatus[] Distributors`: Child distributors.
* `void UpdateAggregateStatus()`: Recalculates status based on children.
* **`IDistributorArmStatus`**: Represents a distributor device.
* `DistributorStatuses DistributorStatus`: Enum (NotConnected, Connected, Armed, NotArmed, Errored).
* `IDeviceArmStatus[] Devices`: Child devices.
* `DateTime? LastSeen`, `float? InputVoltage`, `float? BackupVoltage`: Status metrics.
* `void UpdateStatusFromQATS(IUDPQATSEntry qats)`: Updates status from a QATS entry.
* **`IDeviceArmStatus`**: Represents a specific data acquisition device.
* `DASStatuses DASStatus`: Enum (MissingNotBooted, BootedNotArmedYet, ArmedReady, etc.).
* `DiagStatuses DiagStatus`: Flags enum (Passed, NoResults, FailedShunt, FailedOffset, etc.).
* `IDASHardware Hardware`: Reference to the hardware interface.
* `string ShuntResults`, `OffsetResults`: Diagnostic result strings.
* `double? TiltX`, `TiltY`, `TiltZ`: Tilt sensor readings.
* `bool Triggered`: Indicates if the device triggered.
### `IDiagnosticResult`
Defines a data contract for the results of a channel diagnostic or calibration run.
* **Identification**:
* `int DASChannelNumber`, `int EventNumber`.
* **Scaling & Excitation**:
* `double ScalefactorMilliVoltsPerADC`: Mandatory factor to convert raw ADC data to voltage.
* `double ExpectedExcitationMilliVolts`, `double? MeasuredExcitationMilliVolts`.
* `bool NegativeExcitation`: Flag for legacy negative excitation handling.
* **Offsets**:
* `double? MeasuredOffsetMilliVolts`, `double? MeasuredInternalOffsetMilliVolts`.
* `short? FinalOffsetADC`: Remaining offset after a removal attempt.
* `short WindowAverageADC`: Average ADC over a window.
* **Shunt & Calibration**:
* `bool ShuntDeflectionFailed`, `bool CalSignalCheckFailed`.
* `double? MeasuredShuntDeflectionMv`, `double? TargetShuntDeflectionMv`.
* `double? BridgeResistance`: Measured sensor resistance.
* **Squib (Explosive/Firing) Data**:
* `bool? SquibFirePassed`, `SquibDurationPassed`, `SquibDelayPassed`.
* `double[] SquibFireCurrentData`, `SquibFireVoltageData`, `SquibFireTimeAxis`.
* **Methods**:
* `short GetExpectedDataZeroLevelADC(ZeroMethodType zeroMethod)`: Calculates expected zero level.
## 3. Invariants
* **`IDiagnosticResult.WindowAverageADC`**: The value `short.MinValue` explicitly indicates an uninitialized or invalid state.
* **`IDiagnosticResult` Nullability**: When reading specific properties (`MeasuredExcitationMilliVolts`, `MeasuredOffsetMilliVolts`, `NoisePercentFullScale`, `MeasuredShuntDeflectionMv`, `TargetShuntDeflectionMv`, `BridgeResistance`) from event attributes, a value of `0.0` may represent `null` (i.e., the value was not measured), rather than a literal zero measurement.
* **`DiagStatuses`**: This is a `[Flags]` enum, meaning multiple failure conditions (e.g., `FailedShunt | FailedOffset`) can be set simultaneously.
* **`IISOHardware.IsPseudoRackModule`**: This method indicates *capability* (e.g., SLICE slabs), not whether the hardware is currently serving that role.
## 4. Dependencies
* **Internal Dependencies**:
* `DTS.Common.Enums.DASFactory` (for `DFConstantsAndEnums.TiltAxes`)
* `DTS.Common.Enums.Hardware` (for `HardwareTypes`)
* `DTS.Common.Enums.Sensors` (for `ZeroMethodType`)
* `DTS.Common.Converters` (for `EnumDescriptionTypeConverter`)
* `DTS.Common.Interface.DataRecorders` (for `IDASDBRecord`)
* `DTS.Common.Interface.DASFactory` (for `IDASHardware`, `IDASCommunication`)
* `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList` (implied by namespace usage)
* **External Dependencies**:
* `System`
* `System.Collections.Generic`
* `System.ComponentModel`
* `System.Net`
## 5. Gotchas
* **Ambiguous Zero Values**: In `IDiagnosticResult`, developers must be aware that `0.0` does not always mean "zero volts"; it often serves as a sentinel for "not measured" when read from event attributes. Logic checking for `> 0` may need to handle this distinction.
* **Legacy Excitation Handling**: The `NegativeExcitation` boolean in `IDiagnosticResult` exists specifically to handle legacy TDC/TDAS hardware behavior regarding broken sensor/wire warnings. This suggests newer implementations should not rely on sign checks alone for error detection without consulting this flag.
* **Pseudo-Rack Definition**: The comment in `IISOHardware` clarifies that "Pseudo racks" are collections of hardware like SLICE slabs. The method `IsPseudoRackModule()` returns true based on hardware type capability, regardless of its current configuration context.

View File

@@ -0,0 +1,131 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Hardware/AddEditHardware/IAddEditHardwareView.cs
- Common/DTS.CommonCore/Interface/Hardware/AddEditHardware/IAddEditHardwareDASModule.cs
- Common/DTS.CommonCore/Interface/Hardware/AddEditHardware/IAddEditHardwareViewModel.cs
- Common/DTS.CommonCore/Interface/Hardware/AddEditHardware/IAddEditHardwareHardware.cs
generated_at: "2026-04-16T12:24:47.346735+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "8c9d2e027679c71f"
---
# Documentation: DTS.Common.Interface.Hardware.AddEditHardware
## 1. Purpose
This module defines the contract layer for the Add/Edit Hardware feature within the DTS system. It provides four interfaces that establish the boundaries between the view layer (`IAddEditHardwareView`), presentation logic (`IAddEditHardwareViewModel`), hardware domain model (`IAddEditHardwareHardware`), and modular hardware components (`IAddEditHardwareDASModule`). These interfaces enable the creation, modification, validation, and persistence of Data Acquisition System (DAS) hardware configurations, including support for modular hardware components like SLICE bridges.
---
## 2. Public Interface
### IAddEditHardwareView
**Inherits from:** `IBaseView`
| Member | Signature | Description |
|--------|-----------|-------------|
| `Activated` | `void Activated()` | Notifies the view that it has been activated and should handle any post-activation work. |
| `ViewDbVersion` | `int ViewDbVersion { get; set; }` | Gets or sets the database version associated with the view. |
---
### IAddEditHardwareDASModule
**Inherits from:** None
| Member | Signature | Description |
|--------|-----------|-------------|
| `ModuleType` | `HardwareTypes ModuleType { get; set; }` | Gets or sets the type of the DAS module. |
| `SerialNumber` | `string SerialNumber { get; set; }` | Gets or sets the serial number for the DAS module. |
| `DASImage` | `ImageSource DASImage { get; }` | Gets an image representing the DAS (read-only). |
| `OwningHardware` | `IAddEditHardwareHardware OwningHardware { get; set; }` | Gets or sets a reference to the parent hardware that owns this module. |
| `SLICEBridgeType` | `SLICEBridgeTypes SLICEBridgeType { get; set; }` | Gets or sets the SLICE bridge type for this module. |
| `GetSerialNumberPrefix` | `string GetSerialNumberPrefix()` | Returns the prefix for any modules of this `ModuleType`. |
---
### IAddEditHardwareHardware
**Inherits from:** None
| Member | Signature | Description |
|--------|-----------|-------------|
| `HardwareType` | `HardwareTypes HardwareType { get; set; }` | Gets or sets the DAS hardware type. |
| `SerialNumber` | `string SerialNumber { get; set; }` | Gets or sets the serial number for the DAS. |
| `FirmwareVersion` | `string FirmwareVersion { get; set; }` | Gets or sets the firmware version of the DAS. |
| `IPAddress` | `string IPAddress { get; set; }` | Gets or sets the IP address of the DAS (if supported). |
| `SupportsIPAddress` | `bool SupportsIPAddress { get; }` | Indicates whether the DAS supports an IP address (read-only). |
| `SupportsRackSize` | `bool SupportsRackSize { get; }` | Indicates whether the DAS supports rack sizes (read-only). |
| `SupportsConfiguration` | `bool SupportsConfiguration { get; }` | Indicates whether the DAS supports configuration (read-only). |
| `SLICEConfiguration` | `SLICEConfigurations SLICEConfiguration { get; set; }` | Gets or sets the SLICE configuration of the DAS. |
| `RackSize` | `RackSizes RackSize { get; set; }` | Gets or sets the size of the rack (if supported). |
| `DASImage` | `ImageSource DASImage { get; }` | Gets an image representing the DAS (read-only). |
| `Modules` | `ObservableCollection<IAddEditHardwareDASModule> Modules { get; set; }` | Gets or sets the collection of DAS modules attached to this hardware. |
| `StandIn` | `bool StandIn { get; set; }` | Indicates whether this is actual physical hardware or stand-in/placeholder hardware. |
| `IsModule` | `bool IsModule { get; set; }` | Indicates whether this hardware is a module. |
| `IsAdd` | `bool IsAdd { get; set; }` | Indicates whether this record already exists in the database (`false`) or is a new entry (`true`). |
| `RemoveModule` | `void RemoveModule(IAddEditHardwareDASModule module)` | Removes the specified module from the hardware. |
| `AddModule` | `void AddModule()` | Adds a new module to the hardware. |
| `ToISOHardware` | `IISOHardware ToISOHardware()` | Returns a new `IISOHardware` representation of the hardware. |
---
### IAddEditHardwareViewModel
**Inherits from:** `IBaseViewModel`
| Member | Signature | Description |
|--------|-----------|-------------|
| `View` | `IAddEditHardwareView View { get; set; }` | Gets or sets the associated view instance. |
| `Hardware` | `IAddEditHardwareHardware Hardware { get; set; }` | Gets or sets the hardware being operated on in the viewmodel. |
| `TestId` | `int? TestId { get; set; }` | Gets or sets an optional test identifier. |
| `NotificationsOn` | `bool NotificationsOn { get; set; }` | Controls whether change notifications are sent. Can be disabled during initialization to avoid spurious notifications. |
| `AllowStandin` | `bool AllowStandin { get; set; }` | Indicates whether stand-in hardware is supported by the current model. |
| `SLICE6TreeView` | `ISLICE6TreeView SLICE6TreeView { get; }` | Provides access to the current SLICE6 tree view (read-only). |
| `Unset` | `void Unset()` | Clears or resets the viewmodel state. |
| `SetHardware` | `void SetHardware(IDASHardware hw, IISOHardware isoHW)` | Initializes the viewmodel with the given hardware. |
| `Validate` | `bool Validate(IISOHardware isoHW, ref List<string> errors, ref List<string> warnings, bool displayWindow, bool IsAdd)` | Validates the hardware. Returns `true` if the hardware can be committed. Populates `errors` and `warnings` lists. |
| `Save` | `void Save()` | Commits any changes present. |
| `GetISOHardware` | `IISOHardware GetISOHardware()` | Returns the `IISOHardware` representation. |
| `SetSLICE6TreeView` | `void SetSLICE6TreeView(ISLICE6TreeView treeView, IHardwareListViewModel treeViewModel)` | Allows access to the SLICE6 treeview module. |
---
## 3. Invariants
1. **Module Ownership:** An `IAddEditHardwareDASModule` must have a valid `OwningHardware` reference to function properly within the module hierarchy.
2. **Support Capability Flags:** The boolean support properties (`SupportsIPAddress`, `SupportsRackSize`, `SupportsConfiguration`) on `IAddEditHardwareHardware` are read-only and their values are determined by the `HardwareType`. Consumers should check these before attempting to set related properties.
3. **Validation Before Save:** The `Validate` method on `IAddEditHardwareViewModel` should be called and return `true` before calling `Save()` to ensure data integrity.
4. **Notifications Control:** `NotificationsOn` should be set to `false` during programmatic initialization to prevent unwanted change notification events, then set back to `true` for normal operation.
5. **IsAdd State:** The `IsAdd` property on `IAddEditHardwareHardware` must accurately reflect whether the hardware record is new (`true`) or existing (`false`) to ensure correct database operations.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces
- `DTS.Common.Enums.Hardware` — Provides `HardwareTypes`, `SLICEBridgeTypes`, `SLICEConfigurations`, `RackSizes` enums
- `DTS.Common.Interface.DASFactory.Diagnostics` — Provides `IDASHardware`
- `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList` — Provides `IHardwareListViewModel`, `ISLICE6TreeView`
- `DTS.Common.Interface.DataRecorders` — Provides `IISOHardware`
- `System.Collections.Generic` — For `List<T>`
- `System.Collections.ObjectModel` — For `ObservableCollection<T>`
- `System.Windows.Media` — For `ImageSource`
### What depends on this module:
- Not determinable from the provided source files alone. Implementations of these interfaces would exist elsewhere in the codebase.
---
## 5. Gotchas
1. **XML Documentation Issue:** In `IAddEditHardwareViewModel`, the `NotificationsOn` property has a malformed XML comment — the closing tag is `<summary>` instead of `</summary>`. This may cause documentation generation warnings or incorrect IntelliSense output.
2. **ref Parameters in Validate:** The `Validate` method uses `ref` parameters for `errors` and `warnings` lists rather than `out`. Callers must initialize these lists before calling the method, or the behavior is undefined.
3. **AddModule Parameterless:** The `AddModule()` method on `IAddEditHardwareHardware` takes no parameters, suggesting the implementation is responsible for constructing and configuring the new module internally. The exact mechanism for how the new module is initialized is unclear from the interface alone.
4. **ViewDbVersion Purpose:** The purpose and usage of `ViewDbVersion` on `IAddEditHardwareView` is not documented in the source; its relationship to database versioning or migration is unclear.

View File

@@ -0,0 +1,230 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/ISLICE6TreeView.cs
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/IHardwareListView.cs
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/IHardwareListSelectView.cs
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/IHardwareListOverdueView.cs
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/IHardwareListReplaceView.cs
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/ISLICE6TreeNode.cs
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/IHardware.cs
- Common/DTS.CommonCore/Interface/Hardware/HardwareList/IHardwareListViewModel.cs
generated_at: "2026-04-16T12:25:52.763260+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "0b794dc751ea2075"
---
# Hardware List Interfaces Documentation
## 1. Purpose
This module defines the contract layer for the Hardware List subsystem within the DTS (Data Acquisition System) diagnostics framework. It provides interfaces for managing hardware inventory, calibration tracking, and SLICE6/SLICE6DB device associations. The module follows the Model-View-ViewModel (MVVM) pattern, separating view concerns (`IHardwareListView`, `ISLICE6TreeView`, etc.) from business logic (`IHardwareListViewModel`) and domain entities (`IHardware`, `ISLICE6TreeNode`).
---
## 2. Public Interface
### View Interfaces (Markers)
All view interfaces extend `IBaseView` and serve as view contracts in the MVVM architecture:
| Interface | Namespace |
|-----------|-----------|
| `IHardwareListView` | `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList` |
| `IHardwareListSelectView` | `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList` |
| `IHardwareListOverdueView` | `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList` |
| `IHardwareListReplaceView` | `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList` |
| `ISLICE6TreeView` | `DTS.Common.Interface.DASFactory.Diagnostics.HardwareList` |
These interfaces define no additional members beyond inheriting `IBaseView`.
---
### `ISLICE6TreeNode`
Represents a node in the SLICE6 device tree hierarchy.
**Properties:**
| Name | Type | Access |
|------|------|--------|
| `DASId` | `int` | get/set |
| `SerialNumber` | `string` | get/set |
| `Port` | `int` | get/set |
| `PortString` | `string` | get only |
| `Number` | `int` | get/set |
| `PositionOnChain` | `int` | get/set |
| `PositionOnChainString` | `string` | get only |
---
### `IHardware`
Represents a hardware device in the inventory system.
**Properties:**
| Name | Type | Access |
|------|------|--------|
| `DASId` | `int` | get/set |
| `Disabled` | `bool` | get/set |
| `Included` | `bool` | get/set |
| `TestSampleRate` | `double` | get/set |
| `SerialNumber` | `string` | get/set |
| `HardwareType` | `string` | get/set |
| `ChannelCount` | `string` | get/set |
| `Firmware` | `string` | get/set |
| `MaxSampleRate` | `double?` | get/set |
| `CalDate` | `DateTime?` | get/set |
| `CalDueDate` | `DateTime?` | get/set |
| `Hardware` | `object` | get/set |
| `ParentDAS` | `string` | get/set |
| `PositionOnChain` | `int` | get/set |
| `PositionOnDistributor` | `int` | get/set |
| `Port` | `int` | get/set |
| `AnalogChannels` | `int` | get/set |
| `SquibChannels` | `int` | get/set |
| `DigitalInChannels` | `int` | get/set |
| `DigitalOutChannels` | `int` | get/set |
| `UartChannels` | `int` | get/set |
| `StreamOutChannels` | `int` | get/set |
| `StreamInChannels` | `int` | get/set |
| `IPAddress` | `string` | get/set |
| `FirstUseDate` | `DateTime?` | get/set |
| `IsFirstUseValid` | `bool` | get/set |
| `IsTSRAIR` | `bool` | get only |
| `PTPDomainID` | `byte` | get/set |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void SetIncluded(bool bIncluded)` | Sets the included state of the hardware |
| `void SetMixedRates(bool mixed)` | Sets mixed rate configuration |
| `bool Filter(string term)` | Filters hardware based on search term; returns match status |
| `void DetermineChannelCount(bool showCompact, IHardware[] allHardware)` | Determines channel count display text; `showCompact` controls whether SLICEPro units connected to ECMs are shown |
---
### `IHardwareListViewModel`
Main view model interface for hardware list management. Extends `IBaseViewModel` and `IFilterableListView`.
**Properties:**
| Name | Type | Access |
|------|------|--------|
| `SelectedSLICE6` | `ISLICE6TreeNode` | get/set |
| `AvailableSLICE6` | `ISLICE6TreeNode[]` | get/set |
| `SelectedSLICE6DB` | `IHardware` | get/set |
| `AvailableSLICE6DB` | `IHardware[]` | get/set |
| `IsEdit` | `bool` | get/set |
| `TDASCalPeriod` | `int` | get/set |
| `G5CalPeriod` | `int` | get/set |
| `SLICE1CalPeriod` | `int` | get/set |
| `SLICE1_5CalPeriod` | `int` | get/set |
| `SLICE2_CalPeriod` | `int` | get/set |
| `SLICE6_CalPeriod` | `int` | get/set |
| `POWERPRO_CalPeriod` | `int` | get/set |
| `SLICE6Air_CalPeriod` | `int` | get/set |
| `SLICE6DB_CalPeriod` | `int` | get/set |
| `TSRAir_CalPeriod` | `int` | get/set |
| `ReplaceView` | `IHardwareListReplaceView` | get/set |
| `View` | `IHardwareListView` | get/set |
| `OverdueView` | `IHardwareListOverdueView` | get/set |
| `SelectView` | `IHardwareListSelectView` | get/set |
| `SLICE6TreeView` | `ISLICE6TreeView` | get/set |
| `Hardware` | `IHardware[]` | get/set |
| `OverdueHardware` | `IHardware[]` | get/set |
| `HardwareInTest` | `IHardware[]` | get/set |
| `HardwareToReplace` | `IHardware` | get/set |
| `AvailableHardware` | `IHardware[]` | get/set |
| `ReplacementHardware` | `IHardware` | get/set |
| `TestAAFRateHzColumnWidth` | `int` | get/set |
| `TestSampleRateColumnWidth` | `int` | get/set |
| `TestClockMasterColumnWidth` | `int` | get/set |
| `PTPDomainColumnWidth` | `int` | get/set |
| `GetAAFForHardwareFunc` | `Func<SerializableAAF.DAS_TYPE, int, float>` | get/set |
| `ShowCompact` | `bool` | get/set |
| `SLICE6TreeNodes` | `ISLICE6TreeNode[]` | get/set |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void InitializeReplace(ITestSetup setup, IsoViewMode viewMode)` | Initializes replacement view for a given test setup |
| `void GetHardware(bool bIncludeModules, bool bIncludeOverdue, bool bIncludeBridges, int? testId, int? groupId)` | Retrieves hardware based on filter criteria |
| `void GetAvailableSampleRates(int[] availableSampleRates)` | Populates available sample rates |
| `void SetTestSampleRates(Dictionary<string, double> testSampleRates)` | Sets test sample rates by serial number |
| `void SetHasIncludedChildren()` | Updates included children state |
| `void UpdateTestSampleRate(string childSerialNumber, double testSampleRate)` | Updates sample rate for specific hardware |
| `void SetTestAAFRates(Dictionary<string, float> testAAFRates)` | Sets anti-alias filter rates |
| `void UpdateTestAAFilterRate(string childSerialNumber, float testAAFilterRate)` | Updates AAF rate for specific hardware |
| `void CheckForMixedDAS(string nonParentSerialNumber, double testSampleRate)` | Checks for mixed DAS configuration |
| `void SetParentMixedRates(string parentDAS, bool mixedRates)` | Sets mixed rate flag on parent DAS |
| `void SetTestClockProfiles(ClockSyncProfile masterProfile, ClockSyncProfile slaveProfile)` | Sets clock synchronization profiles |
| `void SetTestClockMasters(Dictionary<string, bool> testClockMasters)` | Sets clock master assignments |
| `void UpdateTestClockMaster(string childSerialNumber, bool testClockMaster)` | Updates clock master for specific hardware |
| `void SetTestPTPDomainIDs(Dictionary<string, byte> testPTPDomainIDs)` | Sets PTP domain IDs |
| `void UpdateTestPTPDomainID(string childSerialNumber, byte ptpDomainId)` | Updates PTP domain ID for specific hardware |
| `void Unset()` | Clears/resets view model state |
| `void Sort(object o, bool columnClick)` | Sorts hardware list |
| `void SortOverdue(object o, bool columnClick)` | Sorts overdue hardware list |
| `void SetIncluded(string[] serialNumbers, bool included)` | Sets included state for multiple hardware items |
| `void SetIncluded(int[] dasId)` | Sets included state by DAS ID array |
| `void Filter(string term)` | Filters the hardware list |
| `void MouseDoubleClick(int index)` | Handles double-click on hardware item |
| `void SetCache(IISOHardware[] hardware)` | Sets hardware cache |
| `void LoadTreeView(string serialNumber)` | Loads SLICE6 tree for given hardware serial number |
| `void Associate(ISLICE6TreeNode node)` | Associates SLICE6 with SLICE6DB (does not commit) |
| `void Associate(IHardware node)` | Associates units from one SLICE6DB with another (does not commit) |
| `void UnAssociate(ISLICE6TreeNode node)` | Removes SLICE6 association from SLICE6DB (does not commit) |
| `void SaveSLICE6Associations(string serialNumber)` | Commits SLICE6 association changes |
| `IHardware[] GetSelectedItems()` | Returns currently selected hardware items |
| `void Replace()` | Replaces `HardwareToReplace` with `ReplacementHardware` |
| `void SetCalPeriods(int g5CalPeriod, int slice1CalPeriod, int slice1_5CalPeriod, int slice2_CalPeriod, int slice6_CalPeriod, int tdasCalPeriod, int powerpro_CalPeriod, int slice6Air_CalPeriod, int slice6DB_CalPeriod, int tsrAir_CalPeriod, int slice6AirBridge_CalPeriod)` | Sets calibration periods for all hardware types |
---
## 3. Invariants
1. **FirstUseDate Validity**: `IHardware.FirstUseDate` is only meaningful when `IHardware.IsFirstUseValid` is `true`. A `null` `FirstUseDate` when `IsFirstUseValid` is `true` indicates the hardware has not been used since calibration.
2. **Association Operations**: The methods `Associate(ISLICE6TreeNode)`, `Associate(IHardware)`, and `UnAssociate(ISLICE6TreeNode)` perform in-memory modifications only. Changes must be persisted via `SaveSLICE6Associations(string serialNumber)`.
3. **Hardware Replacement**: The `Replace()` method requires both `HardwareToReplace` and `ReplacementHardware` to be set prior to invocation.
4. **View Mode Requirement**: `InitializeReplace` requires both a valid `ITestSetup` and `IsoViewMode` parameter.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` - Provides `IBaseView`, `IBaseViewModel`
- `DTS.Common.Classes.Hardware` - Referenced in imports (specific types not visible in these files)
- `DTS.Common.Enums` - Provides `IsoViewMode` enum
- `DTS.Common.Interface.Pagination` - Provides `IFilterableListView`
- `DTS.Common.Interface.TestSetups.TestSetupsList` - Provides `ITestSetup`
- `System` - Core .NET types (`DateTime`, `Func`, `byte`)
- `System.Collections.Generic` - `Dictionary<>`
- `System.Collections.ObjectModel` - `ObservableCollection<>` (imported but not directly used in visible interfaces)
### Consumers of this module:
Cannot be determined from source alone. These are interface definitions; concrete implementations and consumers exist elsewhere in the codebase.
---
## 5. Gotchas
1. **Association Methods Don't Commit**: The `Associate` and `UnAssociate` methods explicitly state in their XML documentation that they "[do not commit]" changes. Developers must call `SaveSLICE6Associations` to persist changes.
2. **FirstUseDate Conditional Validity**: The `FirstUseDate` property has complex validity semantics tied to `IsFirstUseValid`. Code referencing 15524 DAS "First Use Date" feature should check `IsFirstUseValid` before relying on `FirstUseDate` values.
3. **SerializableAAF.DAS_TYPE Reference**: The `GetAAFForHardwareFunc` property references `SerializableAAF.DAS_TYPE`, which is not defined in these files. The location of this type is unclear from source alone.
4. **ClockSyncProfile Type Location**: The `SetTestClockProfiles` method uses `DTS.Common.ClockSyncProfile`, but the full namespace resolution and type definition are not visible in these files.
5. **IISOHardware vs IHardware**: The `SetCache` method accepts `IISOHardware[]`, which appears to be a different interface than `IHardware`. The relationship between these types is not defined in the provided source.

View File

@@ -0,0 +1,109 @@
---
source_files:
- Common/DTS.CommonCore/Interface/ISO/ExtraProperties/IExtraPropertiesListView.cs
- Common/DTS.CommonCore/Interface/ISO/ExtraProperties/IExtraPropertiesListViewModel.cs
- Common/DTS.CommonCore/Interface/ISO/ExtraProperties/IExtraProperty.cs
generated_at: "2026-04-16T12:25:39.988114+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "785426dcfee2c243"
---
# Documentation: DTS.Common.Interface.ISO.ExtraProperties
## 1. Purpose
This module defines the contract for a Model-View-ViewModel (MVVM) pattern implementation for managing a collection of "extra properties" — key-value pairs with UI status tracking. It provides interfaces for the view (`IExtraPropertiesListView`), view model (`IExtraPropertiesListViewModel`), and the individual property model (`IExtraProperty`). This abstraction layer allows for testable, decoupled management of dynamic property data within the broader DTS system, likely used for ISO-related metadata handling.
---
## 2. Public Interface
### IExtraPropertiesListView
A marker interface extending `IBaseView` with no additional members.
```csharp
public interface IExtraPropertiesListView : IBaseView { }
```
---
### IExtraPropertiesListViewModel
Defines the view model contract for managing a collection of extra properties.
```csharp
public interface IExtraPropertiesListViewModel : IBaseViewModel
```
**Properties:**
| Signature | Description |
|-----------|-------------|
| `IExtraPropertiesListView View { get; set; }` | Gets or sets the associated view instance. |
| `ObservableCollection<IExtraProperty> ExtraProperties { get; set; }` | The bindable collection of extra properties. |
| `bool IsReadOnly { get; set; }` | Controls whether the collection is in read-only mode. |
| `IExtraProperty[] SelectedProperties { get; }` | Returns an array of currently selected property items. |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void SetPage(IDataPROPage page)` | Injects a reference to the hosting page context. |
| `void SetParent(object parent)` | Sets a parent object reference (purpose unclear from source). |
| `void CopySelected()` | Copies the currently selected properties. |
| `void DeleteSelected()` | Deletes the currently selected properties. |
| `void SetExtraProperties(IList<IExtraProperty> properties)` | Replaces the collection with the provided list of properties. |
| `void Filter(object tag, string term)` | Filters the displayed properties based on a tag and search term. |
| `void Sort(object o, bool columnClick)` | Sorts the properties; parameters' specific meanings unclear from source. |
| `bool Validate(ref List<string> errors)` | Validates the collection; returns `true` if valid, populates `errors` with validation messages otherwise. |
---
### IExtraProperty
Defines the contract for an individual key-value property with UI state.
```csharp
public interface IExtraProperty : INotifyPropertyChanged
```
**Properties:**
| Signature | Description |
|-----------|-------------|
| `string Key { get; set; }` | The name/identifier of the property. |
| `string Value { get; set; }` | The value associated with the property. |
| `ICommand PasteCommand { get; set; }` | Command handler for paste operations; supports pasting multi-row data (e.g., CSV) into a single field. |
| `UIItemStatus ItemStatus { get; set; }` | The UI status of the item (e.g., failed, success). |
---
## 3. Invariants
- **INotifyPropertyChanged contract:** `IExtraProperty` extends `INotifyPropertyChanged`, so implementations must raise `PropertyChanged` events when `Key`, `Value`, or `ItemStatus` change.
- **Observable collection binding:** `ExtraProperties` uses `ObservableCollection<IExtraProperty>`, implying UI binding expectations where collection changes (add/remove) must notify observers.
- **Validation contract:** The `Validate` method must populate the `errors` list (passed by reference) with human-readable error messages when returning `false`.
- **Selection state:** `SelectedProperties` returns an array (not a collection), suggesting a snapshot of selection state at call time.
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView`, `IBaseViewModel`, and `IDataPROPage`.
- `DTS.Common.Enums` — Provides `UIItemStatus` enum.
- `System.Collections.ObjectModel` — For `ObservableCollection<T>`.
- `System.ComponentModel` — For `INotifyPropertyChanged`.
- `System.Windows.Input` — For `ICommand`.
**Consumers:**
- Unknown from source alone. Concrete implementations of these interfaces would exist elsewhere in the codebase.
---
## 5. Gotchas
- **`PasteCommand` handles multi-row paste:** The XML comment explicitly states this command is designed to handle pasting multiple rows (e.g., CSV data) into a single field. Implementations must parse and handle this case.
- **`Sort` parameters are ambiguous:** The `Sort(object o, bool columnClick)` method signature does not clearly indicate what `object o` represents or how `columnClick` affects behavior. Purpose unclear from source alone.
- **`Filter` tag parameter is ambiguous:** The `object tag` parameter in `Filter(object tag, string term)` lacks documentation; its purpose is unclear from source alone.
- **`SetParent` purpose is unclear:** The method accepts a generic `object parent` without type constraints or documentation; its usage pattern cannot be determined from source alone.
- **`Validate` uses ref parameter:** The `ref List<string> errors` pattern requires callers to instantiate the list before calling; the method will populate it rather than replace it.

View File

@@ -0,0 +1,101 @@
---
source_files:
- Common/DTS.CommonCore/Interface/LabDetails/ILabDetailsView.cs
- Common/DTS.CommonCore/Interface/LabDetails/ILabDetailsViewModel.cs
- Common/DTS.CommonCore/Interface/LabDetails/ILabDetailsMenuView.cs
- Common/DTS.CommonCore/Interface/LabDetails/ILabDetailsMenuViewModel.cs
generated_at: "2026-04-16T12:09:23.345708+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9b8d7157407e874e"
---
# Documentation: ILabDetails Interfaces
## 1. Purpose
This module defines four marker interfaces for the "Lab Details" feature within the DTS application, following the Model-View-ViewModel (MVVM) architectural pattern. These interfaces establish contracts for views and view models—both for the main lab details display and for an associated ribbon menu—enabling decoupled UI components that can be referenced abstractly throughout the codebase. The interfaces themselves define no members, serving purely as type identifiers that inherit from base view/viewmodel contracts.
---
## 2. Public Interface
### ILabDetailsView
**Signature:**
```csharp
namespace DTS.Common.Interface
{
public interface ILabDetailsView : IBaseView { }
}
```
**Behavior:** A marker interface for lab details views. Inherits from `IBaseView`. Defines no additional members beyond its base interface contract.
---
### ILabDetailsViewModel
**Signature:**
```csharp
namespace DTS.Common.Interface
{
public interface ILabDetailsViewModel : IBaseViewModel { }
}
```
**Behavior:** A marker interface for lab details view models. Inherits from `IBaseViewModel`. Defines no additional members beyond its base interface contract.
---
### ILabDetailsMenuView
**Signature:**
```csharp
namespace DTS.Common.Interface
{
public interface ILabDetailsMenuView : IRibbonView { }
}
```
**Behavior:** A marker interface for lab details ribbon menu views. Inherits from `IRibbonView`. Defines no additional members beyond its base interface contract.
---
### ILabDetailsMenuViewModel
**Signature:**
```csharp
namespace DTS.Common.Interface
{
public interface ILabDetailsMenuViewModel : IRibbonViewModel { }
}
```
**Behavior:** A marker interface for lab details ribbon menu view models. Inherits from `IRibbonViewModel`. Defines no additional members beyond its base interface contract.
---
## 3. Invariants
- All four interfaces are marker interfaces with no members; they rely entirely on their parent interfaces for any contractual requirements.
- `ILabDetailsView` and `ILabDetailsViewModel` form a paired View/ViewModel set.
- `ILabDetailsMenuView` and `ILabDetailsMenuViewModel` form a paired View/ViewModel set for ribbon-specific functionality.
- All interfaces reside in the `DTS.Common.Interface` namespace.
- The View interfaces (`ILabDetailsView`, `ILabDetailsMenuView`) inherit from view-specific base interfaces (`IBaseView`, `IRibbonView` respectively).
- The ViewModel interfaces (`ILabDetailsViewModel`, `ILabDetailsMenuViewModel`) inherit from viewmodel-specific base interfaces (`IBaseViewModel`, `IRibbonViewModel` respectively).
---
## 4. Dependencies
### This module depends on:
| Dependency | Namespace | Source File |
|------------|-----------|-------------|
| `IBaseView` | `DTS.Common.Base` | ILabDetailsView.cs |
| `IBaseViewModel` | `DTS.Common.Base` | ILabDetailsViewModel.cs |
| `IRibbonView` | `DTS.Common.RibbonControl` | ILabDetailsMenuView.cs |
| `IRibbonViewModel` | `DTS.Common.RibbonControl` | ILabDetailsMenuViewModel.cs |
### What depends on this module:
**Cannot be determined from source alone.** The source files contain no references to other modules importing or implementing these interfaces.
---
## 5. Gotchas
- **Empty interfaces:** All four interfaces define no members. Any behavior or properties must come from the base interfaces (`IBaseView`, `IBaseViewModel`, `IRibbonView`, `IRibbonViewModel`). Developers implementing these interfaces should consult those base interfaces for required members.
- **Purpose unclear from source:** The specific domain purpose of "Lab Details" (e.g., what data it represents, what operations it supports) cannot be determined from these interface definitions alone.
- **Ribbon vs. Base distinction:** The menu interfaces inherit from `IRibbonView`/`IRibbonViewModel` rather than `IBaseView`/`IBaseViewModel`, suggesting a different behavioral contract for ribbon-based UI components. The relationship between `IRibbonView` and `IBaseView` (if any) is not visible in these files.

View File

@@ -0,0 +1,73 @@
---
source_files:
- Common/DTS.CommonCore/Interface/ManageUsers/IManageUsersView.cs
- Common/DTS.CommonCore/Interface/ManageUsers/IManageUsersViewModel.cs
generated_at: "2026-04-16T12:21:41.903357+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ca53759ac42ae06f"
---
# Documentation: IManageUsersView and IManageUsersViewModel Interfaces
## 1. Purpose
This module defines two empty marker interfaces, `IManageUsersView` and `IManageUsersViewModel`, which appear to be part of a Model-View-ViewModel (MVVM) architecture for a user management feature. These interfaces serve as type identifiers within the `DTS.Common.Interface` namespace, establishing a contract that ties specific View and ViewModel implementations to the "Manage Users" functionality while inheriting base behavior from core framework types.
---
## 2. Public Interface
### `IManageUsersView`
- **Namespace:** `DTS.Common.Interface`
- **Inherits from:** `IBaseView` (defined in `DTS.Common.Base`)
- **Signature:**
```csharp
public interface IManageUsersView : IBaseView
{
}
```
- **Behavior:** Defines no members of its own. Any behavior or contract is inherited from `IBaseView`. The specific contract of `IBaseView` is not visible in the provided source.
### `IManageUsersViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Inherits from:** `IBaseViewModel` (defined in `DTS.Common.Base`)
- **Signature:**
```csharp
public interface IManageUsersViewModel : IBaseViewModel
{
}
```
- **Behavior:** Defines no members of its own. Any behavior or contract is inherited from `IBaseViewModel`. The specific contract of `IBaseViewModel` is not visible in the provided source.
---
## 3. Invariants
- Any class implementing `IManageUsersView` must also satisfy the contract of `IBaseView`.
- Any class implementing `IManageUsersViewModel` must also satisfy the contract of `IBaseViewModel`.
- The interfaces themselves define no additional invariants beyond their base type requirements.
- **Note:** The specific invariants enforced by `IBaseView` and `IBaseViewModel` cannot be determined from the provided source.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides the base interfaces `IBaseView` and `IBaseViewModel`.
### What depends on this module:
- **Cannot be determined from source alone.** Consumers would be any concrete View or ViewModel classes implementing these interfaces, or any factory/service code that references these types for dependency injection or navigation purposes.
---
## 5. Gotchas
- **Empty interface definitions:** Both `IManageUsersView` and `IManageUsersViewModel` declare no members. This could indicate:
- They are intended as marker interfaces for type discrimination.
- They are placeholder/stub implementations awaiting future expansion.
- All required functionality is expected to come from the base interfaces.
- **Base interface contracts unknown:** Without visibility into `IBaseView` and `IBaseViewModel`, the actual obligations of implementers cannot be fully documented.
- **Naming convention inconsistency:** The file path references `ManageUsers` as a subdirectory (`Interface/ManageUsers/`), but the namespace remains flat (`DTS.Common.Interface`). This may cause confusion when locating types.

View File

@@ -0,0 +1,99 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Networking/INetworkingView.cs
- Common/DTS.CommonCore/Interface/Networking/INetworkAdapterView.cs
- Common/DTS.CommonCore/Interface/Networking/INetworkAdapterViewModel.cs
- Common/DTS.CommonCore/Interface/Networking/INetworkingViewModel.cs
generated_at: "2026-04-16T12:12:55.166080+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9f8faed114584889"
---
# Documentation: Networking Interfaces
## 1. Purpose
This module defines the core interfaces for networking-related Views and ViewModels within the DTS application framework. It establishes the contract for a Model-View-ViewModel (MVVM) architecture concerning network configuration, specifically providing abstractions for network adapter selection and SLICE6 multicast communication settings. These interfaces enable decoupling between UI components and networking logic, allowing for testability and separation of concerns.
---
## 2. Public Interface
### `INetworkingView`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseView`
A marker interface with no additional members. Serves as a type contract for networking-related view components.
---
### `INetworkAdapterView`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseView`
A marker interface with no additional members. Serves as a type contract for network adapter selection view components.
---
### `INetworkAdapterViewModel`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseViewModel`
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `SelectedNetworkInterface` | `NetworkInterface` | get/set | Represents the currently selected network interface from `System.Net.NetworkInformation`. |
---
### `INetworkingViewModel`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseViewModel`
| Member | Type | Access | Description |
|--------|------|--------|-------------|
| `View` | `INetworkingView` | get/set | Reference to the associated view instance. |
| `SLICE6MulticastAddress` | `string` | get/set | The multicast address string for SLICE6 communication. |
| `SLICE6MulticastAddressHasError` | `bool` | get | Indicates whether the multicast address has a validation error. |
| `SLICE6MulticastCommandPort` | `int` | get/set | The port number for SLICE6 multicast commands. |
| `SLICE6MulticastResponsePort` | `int` | get/set | The port number for SLICE6 multicast responses. |
**Methods:**
```csharp
void SetStatus(StatusInfo.StatusState status, string message = "", decimal percentage = -1, int processId = 0)
```
Sets the operational status with an optional message, completion percentage, and process identifier. Default values are provided for `message` (empty string), `percentage` (-1), and `processId` (0).
---
## 3. Invariants
- `INetworkingView` and `INetworkAdapterView` must be assignable to `IBaseView` (inheritance constraint).
- `INetworkAdapterViewModel` and `INetworkingViewModel` must be assignable to `IBaseViewModel` (inheritance constraint).
- `SLICE6MulticastAddressHasError` is a read-only property; its value is determined internally by the implementing class, likely based on the validity of `SLICE6MulticastAddress`.
- The `SetStatus` method has defined default parameters; callers may omit `message`, `percentage`, and `processId` arguments.
- The semantic meaning of `percentage = -1` as a default is unspecified in the source (possibly indicates "no percentage" or "indeterminate").
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
- `DTS.Common.Events` — Provides `StatusInfo` class used in `SetStatus` method signature.
- `System.Net.NetworkInformation` — Provides `NetworkInterface` type used in `INetworkAdapterViewModel`.
- `System.Collections.Generic` — Imported in `INetworkingViewModel.cs` but not directly used in the visible interface definition (may be used by `IBaseViewModel` or reserved for future use).
- `System.Threading.Tasks` — Imported in `INetworkingViewModel.cs` but not directly used in the visible interface definition (may be used by `IBaseViewModel` or reserved for future use).
**What depends on this module:**
- Cannot be determined from the provided source alone. Concrete implementations of these interfaces and consumers of these interfaces are not present in the provided files.
---
## 5. Gotchas
- **Unused imports:** The `INetworkingViewModel.cs` file imports `System.Collections.Generic` and `System.Threading.Tasks`, but neither namespace appears to be used in the interface definition. This may indicate dead code, refactoring remnants, or types used by inherited members from `IBaseViewModel`.
- **SLICE6 naming:** The "SLICE6" prefix on multicast-related properties suggests a specific protocol or device integration. The significance of this naming is not documented in the source.
- **Marker interfaces:** `INetworkingView` and `INetworkAdapterView` are empty marker interfaces. Their purpose beyond type identification is unclear from the source alone.
- **Validation coupling:** The presence of `SLICE6MulticastAddressHasError` implies validation logic tied to `SLICE6MulticastAddress`, but the validation rules (e.g., valid IP multicast format, acceptable range) are not defined in these interfaces.

View File

@@ -0,0 +1,75 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Pagination/IPaginationView.cs
- Common/DTS.CommonCore/Interface/Pagination/IPaginationViewModel.cs
- Common/DTS.CommonCore/Interface/Pagination/IFilterableListView.cs
generated_at: "2026-04-16T12:09:07.697429+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "17272f9179ee1d83"
---
# Documentation: Pagination Interfaces
## 1. Purpose
This module defines core interfaces for pagination and filtering functionality within a view/view-model architecture. It provides marker interfaces for pagination-capable views and view models (`IPaginationView`, `IPaginationViewModel`) that integrate with a base view system, as well as a behavioral interface (`IFilterableListView`) for list views that support dynamic filtering. These interfaces establish contracts for UI components that need to handle paginated data and user-driven filter operations.
---
## 2. Public Interface
### `IPaginationView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
A marker interface for views that support pagination. Defines no members of its own; its contract is purely type identity, indicating that a view participates in pagination workflows.
---
### `IPaginationViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
A marker interface for view models that support pagination. Like `IPaginationView`, it defines no members and serves as a type marker for pagination-capable view models within the system.
---
### `IFilterableListView`
**Namespace:** `DTS.Common.Interface.Pagination`
An interface for views that support filterable list functionality.
| Member | Signature | Description |
|--------|-----------|-------------|
| `Filter` | `void Filter(object tag, string term)` | Applies a filter to the list view using the provided tag and search term. |
| `ClearAllFilters` | `void ClearAllFilters()` | Removes all active filters from the list view. |
| `ListViewId` | `string ListViewId { get; }` | Read-only property returning the identifier for this list view. |
---
## 3. Invariants
- `IPaginationView` and `IPaginationViewModel` must be assignable to `IBaseView` and `IBaseViewModel` respectively (enforced by inheritance).
- `IFilterableListView.ListViewId` must return a valid string identifier; whether null or empty strings are permitted is not specified in the source.
- The `Filter` method's `tag` parameter is of type `object`, implying any reference or value type may be passed; the semantic contract for this parameter is not defined in the source.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces that `IPaginationView` and `IPaginationViewModel` extend.
### What depends on this module:
- Cannot be determined from the provided source files alone. These interfaces are likely consumed by concrete view/view model implementations and any framework code that handles pagination or filtering logic.
---
## 5. Gotchas
1. **Inconsistent namespace structure**: `IPaginationView` and `IPaginationViewModel` reside in `DTS.Common.Interface`, while `IFilterableListView` resides in `DTS.Common.Interface.Pagination`. This may cause confusion when importing or organizing related types.
2. **Marker interfaces with no members**: `IPaginationView` and `IPaginationViewModel` define no members, suggesting they may be used for type checking, dependency injection registration, or convention-based wiring. Their actual utility depends on framework-level code not shown here.
3. **Ambiguous `tag` parameter**: The `Filter(object tag, string term)` method accepts an untyped `object` parameter. Without additional documentation or implementation code, the intended use of this parameter (e.g., column identifier, filter type enum, or other metadata) is unclear.

View File

@@ -0,0 +1,119 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Realtime/IRealtimeChannelSelectView.cs
- Common/DTS.CommonCore/Interface/Realtime/IRealtimeChannelSelectViewModel.cs
- Common/DTS.CommonCore/Interface/Realtime/IRealtimeChannel.cs
generated_at: "2026-04-16T12:15:17.411122+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "1785995e6227da9e"
---
# Documentation: DTS.Common.Interface.Realtime
## 1. Purpose
This module defines the contract for a realtime channel selection feature within a Model-View-ViewModel (MVVM) architecture. It provides three interfaces that together enable the display and selection of realtime data channels: `IRealtimeChannel` models channel metadata (sensor information, hardware identifiers, capacity), `IRealtimeChannelSelectView` represents the view abstraction, and `IRealtimeChannelSelectViewModel` defines the controller logic for managing available channels and user selection. This abstraction layer allows the realtime channel selection UI to be decoupled from concrete implementations.
---
## 2. Public Interface
### `IRealtimeChannelSelectView`
**Namespace:** `DTS.Common.Interface.Realtime`
**Signature:**
```csharp
public interface IRealtimeChannelSelectView : IBaseView { }
```
A marker interface extending `IBaseView`. Defines no members of its own; exists to establish a type hierarchy for view abstraction.
---
### `IRealtimeChannelSelectViewModel`
**Namespace:** `DTS.Common.Interface.Realtime`
**Signature:**
```csharp
public interface IRealtimeChannelSelectViewModel : IBaseViewModel
```
**Properties:**
| Property | Type | Access |
|----------|------|--------|
| `ChannelSelectView` | `IRealtimeChannelSelectView` | get; set; |
**Methods:**
| Method | Signature | Description |
|--------|-----------|-------------|
| `SetAvailableChannels` | `void SetAvailableChannels(IRealtimeChannel[] channels)` | Accepts an array of channels to populate the selection list. |
| `SetSearchText` | `void SetSearchText(string searchText)` | Sets the current search/filter text for channel filtering. |
| `SetRealtimeChannel` | `void SetRealtimeChannel(IRealtimeChannel channel)` | Sets the currently selected channel. |
---
### `IRealtimeChannel`
**Namespace:** `DTS.Common.Interface.Realtime`
**Signature:**
```csharp
public interface IRealtimeChannel
```
**Properties (all read-only):**
| Property | Type | Description |
|----------|------|-------------|
| `Capacity` | `double` | Numeric capacity value for the channel. |
| `DisplayOrder` | `int` | Sort order for UI display. |
| `SensorName` | `string` | Name of the sensor. |
| `ChannelName` | `string` | Name of the channel. |
| `DasNames` | `string[]` | Array of DAS (Data Acquisition System) names. |
| `SensorSerial` | `string` | Serial identifier for the sensor. |
| `Units` | `string` | Unit of measurement. |
| `UserValue1` | `string` | User-defined custom value. |
| `GroupName` | `string` | Group/category name for the channel. |
| `DisplayUnit` | `string` | Unit string for UI display purposes. |
| `HardwareChannelString` | `string` | Hardware identifier string. |
| `ISOCode` | `string` | ISO standard code. |
| `SensorsString` | `string` | String representation of sensor(s). |
| `DasName` | `string` | Single DAS name (singular form). |
| `Name` | `string` | General name identifier. |
| `HasPassedLevelTrigger` | `bool` | Flag indicating if a level trigger threshold has been exceeded. |
**Methods:**
| Method | Signature | Description |
|--------|-----------|-------------|
| `GetId` | `string GetId()` | Returns a unique identifier string for the channel. |
---
## 3. Invariants
- **View-ViewModel Binding:** `IRealtimeChannelSelectViewModel.ChannelSelectView` must reference a valid `IRealtimeChannelSelectView` instance when the view model is in use.
- **Channel Array Handling:** `SetAvailableChannels` accepts an array; callers should handle null or empty arrays appropriately. The behavior for null arrays is not specified in the interface.
- **Immutable Channel Data:** All properties on `IRealtimeChannel` are read-only (getters only). Implementations must provide values at construction or through other means not defined in this interface.
- **Identifier Consistency:** The relationship between `GetId()` and `Name` is not defined by the interface; they may or may not return the same value depending on implementation.
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces that `IRealtimeChannelSelectView` and `IRealtimeChannelSelectViewModel` extend, respectively.
**What depends on this module:**
- Unknown from source alone. Concrete implementations of these interfaces, as well as consumers of the channel selection feature, would depend on this module.
---
## 5. Gotchas
- **Singular vs. Plural DAS Names:** The interface defines both `DasName` (singular `string`) and `DasNames` (plural `string[]`). The semantic difference between these two properties is not documented in the interface; implementers and consumers should clarify whether they represent the same data in different forms or serve distinct purposes.
- **Marker Interface:** `IRealtimeChannelSelectView` is an empty interface with no members. Its purpose appears to be purely for type identification within the `IBaseView` hierarchy.
- **Method vs. Property for ID:** `GetId()` is defined as a method rather than a property (e.g., `Id`), which is inconsistent with the other identifier-like properties (`Name`, `ChannelName`, `SensorName`). The rationale for this design choice is not evident from the source.
- **Search Text Behavior:** The `SetSearchText` method implies filtering capability, but the interface does not define how search text affects the available channels or whether it triggers immediate UI updates.

View File

@@ -0,0 +1,56 @@
---
source_files:
- Common/DTS.CommonCore/Interface/RegionOfInterest/IRegionOfInterest.cs
generated_at: "2026-04-16T12:08:15.186938+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "59ff4edea9524aba"
---
# Documentation: IRegionOfInterest
## 1. Purpose
This module defines the `IRegionOfInterest` interface within the `DTS.Common.Interface.RegionOfInterest` namespace. It establishes a contract for representing a specific bounded interval (defined by `Start` and `End`) that can be toggled, marked as default, and associated with specific data channels. By inheriting from `INotifyPropertyChanged`, this interface is designed to support data-binding scenarios, typically in UI or reactive environments, allowing consumers to react to changes in the region's state.
## 2. Public Interface
### Interface: `IRegionOfInterest`
**Namespace:** `DTS.Common.Interface.RegionOfInterest`
**Inherits:** `INotifyPropertyChanged`
#### Properties
* **`string Suffix { get; set; }`**
* Gets or sets a string suffix associated with the region.
* **`double Start { get; set; }`**
* Gets or sets the starting boundary of the region.
* **`double End { get; set; }`**
* Gets or sets the ending boundary of the region.
* **`bool IsEnabled { get; set; }`**
* Gets or sets a value indicating whether the region is currently active.
* **`bool IsDefault { get; set; }**
* Gets or sets a value indicating whether this region is the default selection.
* **`string[] ChannelNames { get; set; }`**
* Gets or sets an array of strings representing the names of channels associated with this region.
#### Methods
* **`void SetChannelNamesNoNotify(string[] names)`**
* Sets the `ChannelNames` property without raising the `PropertyChanged` event. This is likely used for bulk updates or initialization where UI notification overhead is unnecessary or undesirable.
* **`void ResetSuffix()`**
* Resets the `Suffix` property to a default value. The specific default value is determined by the implementation and is not defined in the interface.
## 3. Invariants
* **Notification Contract:** Implementations must raise the `PropertyChanged` event (from the inherited `INotifyPropertyChanged` interface) when the value of any property changes, with the specific exception of changes made via the `SetChannelNamesNoNotify` method.
* **Boundary Types:** The `Start` and `End` properties are defined as `double`, implying the region operates over a continuous numeric domain (e.g., time, distance, or index).
## 4. Dependencies
* **External Dependencies:**
* `System.ComponentModel`: Required for the `INotifyPropertyChanged` interface.
* **Downstream Dependencies:**
* Unknown from this source file alone. However, classes implementing this interface and ViewModels consuming these regions will depend on this contract.
## 5. Gotchas
* **Silent Updates via `SetChannelNamesNoNotify`:** Consumers listening to `PropertyChanged` events will not be notified when `SetChannelNamesNoNotify` is invoked. Logic that relies on event propagation to validate or synchronize state must account for this silent update path.
* **Array Mutability:** The `ChannelNames` property exposes a `string[]` array. Depending on the implementation, the array itself may be mutable, meaning modifying the array elements after retrieval might bypass the setter and its potential side effects or notifications.
* **Undefined Reset Logic:** The behavior of `ResetSuffix()` is implementation-specific. Developers must inspect the concrete class to determine what string the suffix is reset to.

View File

@@ -0,0 +1,104 @@
---
source_files:
- Common/DTS.CommonCore/Interface/RegionOfInterest/RegionOfInterestChannels/IRegionOfInterestChannelsView.cs
- Common/DTS.CommonCore/Interface/RegionOfInterest/RegionOfInterestChannels/IRegionOfInterestChannelsViewModel.cs
generated_at: "2026-04-16T12:22:46.294400+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "3255d2bc1a28f8fd"
---
# Documentation: RegionOfInterestChannels Module
## 1. Purpose
This module defines the View and ViewModel interfaces for managing Regions of Interest (ROI) channels within the DTS system. It follows a Model-View-ViewModel (MVVM) pattern, where `IRegionOfInterestChannelsView` represents the view contract and `IRegionOfInterestChannelsViewModel` defines the presentation logic for filtering, sorting, selecting, and validating ROI channel data. This module appears to be part of a larger test setup or data acquisition system where hardware channels are organized into regions of interest for monitoring or analysis.
---
## 2. Public Interface
### IRegionOfInterestChannelsView
**Declaration:**
```csharp
public interface IRegionOfInterestChannelsView : IBaseView { }
```
A marker interface extending `IBaseView`. No members are defined beyond the inherited contract.
---
### IRegionOfInterestChannelsViewModel
**Declaration:**
```csharp
public interface IRegionOfInterestChannelsViewModel : IBaseViewModel
```
**Properties:**
| Name | Type | Description |
|------|------|-------------|
| `View` | `IRegionOfInterestChannelsView` | Gets or sets the associated view instance. |
| `RegionsOfInterest` | `BindingList<IRegionOfInterest>` | Gets or sets the collection of regions of interest being managed. |
| `AllChannelSSNs` | `string[]` | Gets an array of all channel SSNs (presumably Serial Numbers). |
| `ISOViewMode` | `IsoViewMode` | Gets or sets the current ISO view mode. |
**Methods:**
| Signature | Description |
|-----------|-------------|
| `void SetParent(object o)` | Sets a parent object reference (purpose unclear from source alone). |
| `void SetGroups(ITestSetup testSetup, Dictionary<string, IDASHardware> serialNumberToHardware, IsoViewMode viewMode)` | Configures groups using a test setup, hardware lookup dictionary, and view mode. |
| `void SetTest(string path, IsoViewMode viewMode)` | Sets a test context using a file path and view mode. |
| `void Filter(object tag, string term)` | Filters channels based on a tag and search term. |
| `void Filter(string term)` | Filters in (searches for) a term among all channels. |
| `void Sort(object o, bool columnClick)` | Sorts the data; parameters suggest sorting by column interaction. |
| `void SelectAll(int roiIndex, bool selection)` | Selects or deselects all items within a specific region of interest identified by `roiIndex`. |
| `bool Validate(ref List<string> errors)` | Validates the current state; populates the `errors` list with validation messages and returns a boolean success indicator. |
---
## 3. Invariants
1. **MVVM Contract**: `IRegionOfInterestChannelsViewModel` must always have an associated `IRegionOfInterestChannelsView` via the `View` property.
2. **BindingList Usage**: `RegionsOfInterest` uses `BindingList<IRegionOfInterest>`, implying the collection must support change notification for UI binding.
3. **Validation Contract**: The `Validate` method must populate the `errors` list (passed by reference) when returning `false`.
4. **ROI Index Bounds**: The `roiIndex` parameter in `SelectAll` must correspond to a valid index within `RegionsOfInterest` (not enforced at interface level, but implied).
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
- `System.Collections.Generic` — For `List<T>` and `Dictionary<TKey, TValue>`.
- `System.Collections.ObjectModel` — For collection types.
- `System.ComponentModel` — For `BindingList<T>`.
- `DTS.Common.Interface.DataRecorders` — Provides `IDASHardware`.
- `DTS.Common.Interface.TestSetups.TestSetupsList` — Provides `ITestSetup`.
- `DTS.Common.Enums` — Provides `IsoViewMode` enum.
**Referenced but not actively used (commented code):**
- `DTS.Common.Interface.Groups``ITestObject` (in commented `SetGroups` overload).
- `DTS.Common.Interface.GroupTemplate``ITestObjectTemplate` (in commented `SetGroups` overload).
**Dependents:**
- Cannot be determined from these source files alone.
---
## 5. Gotchas
1. **Commented Method Signature**: There is a commented-out overload of `SetGroups`:
```csharp
//void SetGroups(ITestObject[] groups, Dictionary<string, IDASHardware> hardwareLookup, ITestObjectTemplate[] groupTemplates);
```
This suggests a refactoring occurred where the method signature changed to accept `ITestSetup` instead of individual arrays. The active `SetGroups` method has different semantics—callers should not assume the old signature is still supported.
2. **Ambiguous `SetParent` Purpose**: The `SetParent(object o)` method accepts a generic `object` type without documentation. The intended parent type and usage context are unclear from the source alone.
3. **Ambiguous `Sort` Parameters**: The `Sort(object o, bool columnClick)` method uses non-descriptive parameter names. The meaning of `o` and the `columnClick` flag's effect on sorting behavior are unclear from the source alone.
4. **SSN Terminology**: `AllChannelSSNs` uses the abbreviation "SSN" without definition. This likely means "Serial Number" but should be confirmed against system documentation.

View File

@@ -0,0 +1,42 @@
---
source_files:
- Common/DTS.CommonCore/Interface/RunTest/IRunTestView.cs
- Common/DTS.CommonCore/Interface/RunTest/IRunTestViewModel.cs
generated_at: "2026-04-16T12:21:57.874851+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e490e1c23959cb19"
---
# Documentation: DTS.Common.Interface.RunTest
## 1. Purpose
This module defines the abstract contracts for the "Run Test" feature within the system. It provides two marker interfaces, `IRunTestView` and `IRunTestViewModel`, which establish a specific View-ViewModel relationship intended for test execution workflows. These interfaces likely serve as registration points for dependency injection containers or for identifying specific view types within an MVVM (Model-View-ViewModel) architecture.
## 2. Public Interface
### `IRunTestView`
* **Signature:** `public interface IRunTestView : IBaseView`
* **Namespace:** `DTS.Common.Interface`
* **Description:** Defines the contract for the View component in the Run Test feature. It inherits from `IBaseView` but adds no additional members, functioning as a specific type identifier for the View layer.
### `IRunTestViewModel`
* **Signature:** `public interface IRunTestViewModel : IBaseViewModel`
* **Namespace:** `DTS.Common.Interface`
* **Description:** Defines the contract for the ViewModel component in the Run Test feature. It inherits from `IBaseViewModel` but adds no additional members, functioning as a specific type identifier for the ViewModel layer.
## 3. Invariants
* **Hierarchy Enforcement:** Any class implementing `IRunTestView` must also implement `IBaseView`. Any class implementing `IRunTestViewModel` must also implement `IBaseViewModel`.
* **Contract Emptiness:** Neither `IRunTestView` nor `IRunTestViewModel` define any methods, properties, or events of their own. Their behavior is entirely derived from their base interfaces (`IBaseView` and `IBaseViewModel` respectively).
## 4. Dependencies
* **Internal Dependencies:**
* `DTS.Common.Base`: Both source files import this namespace. It is the location of the base interfaces `IBaseView` and `IBaseViewModel`.
* **External Consumers:**
* Concrete View classes (intended to implement `IRunTestView`).
* Concrete ViewModel classes (intended to implement `IRunTestViewModel`).
* Navigation or DI registration logic that resolves views based on these specific interface types.
## 5. Gotchas
* **Marker Interfaces:** Both interfaces are empty (marker interfaces). Developers should not expect specific properties or methods (such as `RunTest()` or `TestResults`) to be defined at this level. The actual logic for "Run Test" functionality is not enforced by these contracts and must be looked for in the concrete implementations or base classes.
* **Base Implementation Unknown:** The specific members provided by `IBaseView` and `IBaseViewModel` are not visible in the provided source code. Understanding the full capabilities of these interfaces requires inspecting `DTS.Common.Base`.

View File

@@ -0,0 +1,58 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SensorDatabase/ISensorDatabaseView.cs
- Common/DTS.CommonCore/Interface/SensorDatabase/ISensorDatabaseViewModel.cs
generated_at: "2026-04-16T12:22:13.865366+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9059966d6baab89c"
---
# Documentation: ISensorDatabaseView and ISensorDatabaseViewModel
## 1. Purpose
This module defines two marker interfaces—`ISensorDatabaseView` and `ISensorDatabaseViewModel`—that establish type identity for components within a sensor database feature area. These interfaces follow the Model-View-ViewModel (MVVM) pattern by inheriting from base view and view model contracts. They exist to provide type discrimination and potential future extension points for sensor database-related UI components without prescribing any specific members or behaviors at this level.
---
## 2. Public Interface
### `ISensorDatabaseView`
- **Namespace:** `DTS.Common.Interface`
- **Declaration:** `public interface ISensorDatabaseView : IBaseView`
- **Members:** None defined.
- **Behavior:** Serves as a marker interface for view components associated with sensor database functionality. Inherits from `IBaseView` but adds no additional contracts.
### `ISensorDatabaseViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Declaration:** `public interface ISensorDatabaseViewModel : IBaseViewModel`
- **Members:** None defined.
- **Behavior:** Serves as a marker interface for view model components associated with sensor database functionality. Inherits from `IBaseViewModel` but adds no additional contracts.
---
## 3. Invariants
- `ISensorDatabaseView` must always inherit from `IBaseView`.
- `ISensorDatabaseViewModel` must always inherit from `IBaseViewModel`.
- Both interfaces currently define no members, so any implementation must satisfy only the contracts of their respective base interfaces (`IBaseView` and `IBaseViewModel`).
**Note:** The specific invariants of `IBaseView` and `IBaseViewModel` are not visible in the provided source and cannot be documented here.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
### What depends on this module:
- **Unknown from source alone.** No consumers of `ISensorDatabaseView` or `ISensorDatabaseViewModel` are present in the provided files.
---
## 5. Gotchas
- **Empty interfaces:** Both `ISensorDatabaseView` and `ISensorDatabaseViewModel` are currently empty marker interfaces. They provide type identity but no behavioral contract. Developers should not expect any sensor-database-specific methods or properties from these interfaces alone; any such members must be defined in derived interfaces or concrete implementations.
- **Base interface contracts unknown:** The actual requirements for implementers are determined by `IBaseView` and `IBaseViewModel`, which are not included in the provided source. Consult those definitions to understand full implementation obligations.

View File

@@ -0,0 +1,54 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SensorTemplates/ISensorTemplatesView.cs
- Common/DTS.CommonCore/Interface/SensorTemplates/ISensorTemplatesViewModel.cs
generated_at: "2026-04-16T12:19:45.208798+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "d4eff855657fe005"
---
# Documentation: ISensorTemplatesView and ISensorTemplatesViewModel
## 1. Purpose
This module defines two marker interfaces for the Sensor Templates feature within an MVVM (Model-View-ViewModel) architecture. `ISensorTemplatesView` and `ISensorTemplatesViewModel` establish the contractual boundaries between the view and view model layers, both inheriting from base interfaces in `DTS.Common.Base`. They appear to serve as extension points or type identifiers for dependency injection and navigation purposes.
## 2. Public Interface
### `ISensorTemplatesView`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseView`
- **Signature:**
```csharp
public interface ISensorTemplatesView : IBaseView
```
- **Behavior:** Empty interface with no members. Inherits from `IBaseView`. Likely used as a marker interface for view registration or type constraints.
### `ISensorTemplatesViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseViewModel`
- **Signature:**
```csharp
public interface ISensorTemplatesViewModel : IBaseViewModel
```
- **Behavior:** Empty interface with no members. Inherits from `IBaseViewModel`. Likely used as a marker interface for view model registration or type constraints.
## 3. Invariants
- Both interfaces must always inherit from their respective base interfaces (`IBaseView` and `IBaseViewModel`).
- The interfaces define no members of their own; any behavior is inherited from the base interfaces or expected to be added by implementers.
- The naming convention implies a 1:1 pairing between `ISensorTemplatesView` and `ISensorTemplatesViewModel` within the Sensor Templates feature area.
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces
### What depends on this module:
- **Cannot be determined from source alone.** Concrete implementations of these interfaces would exist elsewhere in the codebase, likely in view and view model classes related to sensor template management.
## 5. Gotchas
- **Empty marker interfaces:** Both interfaces are empty, which may confuse developers expecting explicit member definitions. The actual contract is inherited from `IBaseView` and `IBaseViewModel`. The purpose of these empty interfaces (type identification, DI registration, future extensibility) is not documented in the source.
- **Base interface contracts unknown:** Without visibility into `IBaseView` and `IBaseViewModel`, the full contract that implementers must satisfy cannot be determined from these files alone.

View File

@@ -0,0 +1,38 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Sensors/IZeroMethods.cs
- Common/DTS.CommonCore/Interface/Sensors/IInitialOffsets.cs
- Common/DTS.CommonCore/Interface/Sensors/ISensorDbRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/IStreamInputSettingDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/ISoftwareFilter.cs
- Common/DTS.CommonCore/Interface/Sensors/IDigitalOutDbRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/IStreamInputRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/IDigitalOutDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/IDigitalInputDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/IDigitalInputScaleMultiplier.cs
- Common/DTS.CommonCore/Interface/Sensors/IUartSettingDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/IAnalogDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/ISensorCalDbRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/ISensorChange.cs
- Common/DTS.CommonCore/Interface/Sensors/IUARTRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/IStreamOutputSettingDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/ISensorCalibration.cs
- Common/DTS.CommonCore/Interface/Sensors/IStreamOutputRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/ICalibrationRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/IIEPESensorDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/ISquibDbRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/ISensorBase.cs
- Common/DTS.CommonCore/Interface/Sensors/ISquibSettingDefaults.cs
- Common/DTS.CommonCore/Interface/Sensors/IDigitalInDbRecord.cs
- Common/DTS.CommonCore/Interface/Sensors/ISensorData.cs
- Common/DTS.CommonCore/Interface/Sensors/IAnalogDbRecord.cs
generated_at: "2026-04-16T12:10:25.976382+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "f478d329c262291c"
---
# Documentation: DTS.Common.Interface.Sensors
## 1. Purpose
This module defines the data contracts (interfaces) for the sensor management subsystem within the DTS application. It provides abstractions for database persistence records (e.g., `IAnalogDbRecord`, `ISquibDbRecord`), runtime configuration (`ISensorData`), calibration data (`ISensorCalibration`), and default settings for various hardware types (Digital I/O, UART, Stream, IEPE).

View File

@@ -0,0 +1,82 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Sensors/SensorSettingsModule/ISensorSettingsView.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorSettingsModule/ICalibrationPolicy.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorSettingsModule/ISensorSettingsViewModel.cs
generated_at: "2026-04-16T12:23:47.884836+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "1a993886a7ce02c0"
---
# Documentation: Sensor Settings Module Interfaces
## 1. Purpose
This module defines the core contracts for the Sensor Settings configuration UI within the DTS application. It establishes a Model-View-ViewModel (MVVM) architecture for managing sensor-related defaults, specifically handling calibration policies, digital I/O, squib settings, and analog/IEPE sensor configurations. The module provides the interface layer for persisting these settings to a database (associated with a specific user) and for importing/exporting calibration data via XML.
## 2. Public Interface
### `ISensorSettingsView`
* **Namespace:** `DTS.Common.Interface.Sensors.SensorSettingsModule`
* **Inheritance:** `DTS.Common.Base.IBaseView`
* **Description:** A marker interface representing the View in the MVVM pattern. It defines no specific members beyond those inherited from `IBaseView`.
### `ICalibrationPolicy`
* **Namespace:** `DTS.Common.Interface.Sensors.SensorSettingsModule`
* **Description:** Defines the contract for managing sensor calibration settings, including policy selection and XML serialization.
* **Properties:**
* `SensorConstants.SensorCalPolicy SelectedCalPolicy { get; set; }`: Gets or sets the currently active calibration policy.
* `SensorConstants.SensorCalPolicy[] AvailableSensorCalPolicies { get; }`: Gets an array of all valid calibration policies available for selection.
* `int WarningPeriod { get; set; }`: Gets or sets the warning period (in days) before calibration is due.
* `bool UseSensorFirstUseDate { get; set; }`: Gets or sets a flag indicating if the calibration interval starts from the first use date rather than the calibration date.
* **Methods:**
* `void ReadXML(System.Xml.XmlElement root)`: Imports calibration settings from an XML element.
* `void WriteXML(ref System.Xml.XmlWriter writer)`: Exports calibration settings using an XML writer.
### `ISensorSettingsViewModel`
* **Namespace:** `DTS.Common.Interface.Sensors.SensorSettingsModule`
* **Inheritance:** `DTS.Common.Base.IBaseViewModel`
* **Description:** Defines the behavior and state management for the Sensor Settings view, acting as the bridge between the UI and the data model.
* **Properties:**
* `string User { get; set; }`: The username context for saving/reading settings.
* `int UserID { get; set; }`: The user ID context for saving/reading settings.
* `ISensorSettingsView View { get; set; }`: The associated View instance.
* `ISquibSettingDefaults SquibSettings { get; set; }`: Accessor for squib setting defaults.
* `IDigitalOutDefaults DigitalOutSettings { get; set; }`: Accessor for digital output defaults.
* `IDigitalInputDefaults DigitalInputDefaults { get; set; }`: Accessor for digital input defaults.
* `IIEPESensorDefaults IEPESensorDefaults { get; set; }`: Accessor for IEPE sensor defaults.
* `ICalibrationPolicy SensorCalibrationDefaults { get; set; }`: Accessor for calibration policy defaults.
* `IAnalogDefaults AnalogDefaults { get; set; }`: Accessor for analog defaults (referenced as FB 13120).
* **Methods:**
* `void RestoreOriginalSettings()`: Reverts all settings to their original state.
* `void Unset()`: Uninitializes the display and frees resources.
* `void OnSetActive()`: Initializes the display when the view becomes active.
* `bool ValidateAndSave()`: Validates current settings and persists them if valid. Returns `true` if successful, `false` otherwise.
## 3. Invariants
* **Validation Guarantees:** The `ValidateAndSave()` method on `ISensorSettingsViewModel` must return `false` if settings are invalid, and it must *not* persist invalid settings.
* **Unit Consistency:** The `WarningPeriod` in `ICalibrationPolicy` is explicitly defined in **days**.
* **Lifecycle:** `OnSetActive()` is intended for initialization, while `Unset()` is intended for cleanup/resource freeing.
* **Context Requirement:** Database operations rely on `User` and `UserID` properties being set correctly within the `ISensorSettingsViewModel`.
## 4. Dependencies
### Internal Dependencies
* **`DTS.Common.Base`**: Required for `IBaseView` and `IBaseViewModel` interfaces.
* **`DTS.Common.Enums.Sensors`**: Required for the `SensorConstants.SensorCalPolicy` enum used in `ICalibrationPolicy`.
### External Dependencies
* **`System.Xml`**: Used for XML serialization features (`XmlElement`, `XmlWriter`) in `ICalibrationPolicy`.
### Referenced Types (Definitions not provided in source)
The following interfaces are referenced as properties in `ISensorSettingsViewModel` but their definitions are not included in the provided source files:
* `ISquibSettingDefaults`
* `IDigitalOutDefaults`
* `IDigitalInputDefaults`
* `IIEPESensorDefaults`
* `IAnalogDefaults`
## 5. Gotchas
* **`ref` keyword in `WriteXML`:** The `WriteXML` method in `ICalibrationPolicy` passes `System.Xml.XmlWriter` by reference (`ref`). This is unusual for a writer object (which is a reference type) and implies the method might replace the writer instance or is adhering to a legacy signature constraint.
* **Empty View Interface:** `ISensorSettingsView` defines no members. Developers should expect all specific view capabilities to be defined by the `IBaseView` parent or the concrete implementation.
* **Mixed Responsibilities in `ValidateAndSave`:** The `ValidateAndSave` method combines validation logic with persistence logic (side effects). Callers should be aware that calling this method triggers a database write operation upon success; it is not a pure validation check.

View File

@@ -0,0 +1,304 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorsListOverdueView.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorTemplatesExportView.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorsTemplatesImportView.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorTemplatesViewModel.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorsListView.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorsListEditGroupView.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/IDragAndDropItem.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISquib.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorsListEditGroupViewModel.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/IStreamInputSetting.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/ISensorsListViewModel.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/IUartIOSetting.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/IDigitalInputSetting.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/IDigitalOutputSetting.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/IStreamOutputSetting.cs
- Common/DTS.CommonCore/Interface/Sensors/SensorsList/IAnalogSensor.cs
generated_at: "2026-04-16T12:25:06.358541+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "843b21a9981849bf"
---
# Documentation: DTS.Common.Interface.Sensors.SensorsList
## 1. Purpose
This module defines the contract layer for the sensor management subsystem within DTS. It provides interfaces for various sensor types (Analog, Squib, Digital I/O, UART, Stream I/O) used in UI presentation, along with View and ViewModel interfaces following an MVP/MVC pattern. The module enables sensor listing, editing, filtering, import/export functionality, and drag-and-drop operations between sensor lists. These abstractions decouple the presentation layer from concrete sensor implementations.
---
## 2. Public Interface
### View Interfaces
#### `ISensorsListView : IBaseView`
- `void HandleColumns(CalibrationBehaviors calibrationBehavior)` — Configures columns based on calibration behavior.
- `void SetIncludedVisible(bool bUsesIncludeColumn)` — Controls visibility of the "Included" column.
#### `ISensorsListEditGroupView : IBaseView`
- `void HandleColumns()` — Handles adding/removing columns before view display. (Reference: Case 13065 - Sensor "First Use" Date)
#### `ISensorsListOverdueView : IBaseView`
- Marker interface with no members.
#### `ISensorTemplatesExportView : IBaseView`
- Marker interface with no members.
#### `ISensorsTemplatesImportView : IBaseView`
- Marker interface with no members.
---
### ViewModel Interfaces
#### `ISensorsListViewModel : IBaseViewModel, IFilterableListView`
- **Properties:**
- `ISensorsListView View { get; set; }`
- `IAnalogSensor[] AnalogSensors { get; set; }`
- `ISquib[] Squibs { get; set; }`
- `IDigitalInputSetting[] DigitalInputSettings { get; set; }`
- `IDigitalOutputSetting[] DigitalOutputSettings { get; set; }`
- `IUartIOSetting[] UartIOSettings { get; set; }`
- `IStreamOutputSetting[] StreamOutputSettings { get; set; }`
- `CalibrationBehaviors CalibrationBehavior { get; set; }`
- `string CapacityFormat { get; set; }`
- `bool ShowOnlyTDCSensors { set; }`
- `bool ShowOnlySlicewareSensors { set; }`
- **Methods:**
- `void GetSensors(int sensorCalWarningPeriodDays, bool included)`
- `void GetSensors(int sensorCalWarningPeriodDays, int[] sensorsAllowed, IReadOnlyDictionary<int, ISensorData> sensors)` — Retrieves sensors matching allowed list.
- `void SetSelectedSerial(string serialNumber)`
- `void Sort(object sortBy, bool bColumnClick)`
- `void SortOverdue(object sortBy, bool bColumnClick)`
- `void Unset()`
- `void Filter(string currentFilter)`
- `void FilterSquib(object columnTag, string searchTerm)`
- `void FilterDigitalIn(object columnTag, string searchTerm)`
- `void FilterDigitalOut(object columnTag, string searchTerm)`
- `void FilterUartIO(object columnTag, string searchTerm)`
- `void FilterStreamIn(object columnTag, string searchTerm)`
- `void FilterStreamOut(object columnTag, string searchTerm)`
- `void SetCachedSensors(ISensorData[] cachedSensors)`
- `void SetCachedCalibrations(ISensorCalibration[] sensorCalibrations)`
- `void UseIncludedColumn(bool bUsesIncludedColumn)`
- `void SetIncludedAll(bool bIncluded)`
- `IDragAndDropItem[] GetIncludedSensors()` — Returns all sensors marked as included.
#### `ISensorsListEditGroupViewModel : IBaseViewModel, IFilterableListView`
- **Properties:**
- `ISensorsListEditGroupView View { get; set; }`
- `IAnalogSensor[] AnalogSensors { get; set; }`
- `ISquib[] Squibs { get; set; }`
- `IDigitalInputSetting[] DigitalInputSettings { get; set; }`
- `IDigitalOutputSetting[] DigitalOutputSettings { get; set; }`
- `IUartIOSetting[] UartSettings { get; set; }`
- `IStreamOutputSetting[] StreamOutputSettings { get; set; }`
- **Methods:**
- `void GetSensors(int sensorCalWarningPeriodDays, bool included)`
- `void SetCapacityFormat(string format)`
- `void Sort(object sortBy, bool bColumnClick)`
- `void Unset()`
- `void Filter(string currentFilter)`
- `void FilterSquib(object columnTag, string searchTerm)`
- `void FilterDigitalIn(object columnTag, string searchTerm)`
- `void FilterDigitalOut(object columnTag, string searchTerm)`
- `void FilterUartIO(object columnTag, string searchTerm)`
- `void FilterStreamOut(object columnTag, string searchTerm)`
- `void FilterStreamIn(object columnTag, string searchTerm)`
- `void SetShowAssigned(bool showAssigned, bool showUnassigned, IReadOnlyDictionary<string, bool> assignedSensors)`
- `void SetShowOnline(bool showOnline)`
- `void SetAssignedSensors(IReadOnlyDictionary<string, bool> serialNumbers)`
- `void SetOnline(Dictionary<string, bool> serialNumbersToOnline)`
- `bool IsSensorOnline(string serialNumber)`
- `void SetCachedSensors(ISensorData[] cachedSensors)`
- `void SetCachedCalibrations(ISensorCalibration[] calibrations)`
- `void SetActiveTab(PossibleFilters filter)` — Sets active tab to sensor type.
#### `ISensorTemplatesViewModel : IBaseViewModel`
- Marker interface with no members.
---
### Sensor Data Interfaces
#### `IAnalogSensor`
Represents analog sensors for UI display.
| Property | Type | Description |
|----------|------|-------------|
| `Bridge` | `SensorConstants.BridgeType` | Bridge mode of sensor |
| `IEPE` | `bool` | Integrated Electronics Piezo-Electric indicator |
| `DatabaseId` | `int` | Database ID (positive values valid) |
| `Included` | `bool` | Checkbox state in lists |
| `SerialNumber` | `string` | Sensor serial number |
| `Description` | `string` | Description/comment |
| `Manufacturer` | `string` | Sensor manufacturer |
| `Model` | `string` | Sensor model |
| `Capacity` | `double` | Maximum capacity or desired range in EU |
| `RangeHigh` | `double` | High range EU value |
| `RangeMedium` | `double` | Medium range EU value |
| `RangeLow` | `double` | Low range EU value |
| `Sensitivity` | `string` | User-friendly sensitivity string |
| `AddedSensitivity` | `string` | Second calibration for dual-sensitivity sensors |
| `Resistance` | `double` | Resistance in ohms |
| `Excitation` | `string` | Supported excitations display string |
| `Units` | `string` | Engineering units from calibration |
| `EID` | `string` | Electronic ID |
| `CalDate` | `DateTime` | Last calibration date |
| `CalDueDate` | `DateTime` | Calibration due date |
| `ModifiedBy` | `string` | Last modifying user |
| `LastModified` | `DateTime` | Last modification date |
| `Assigned` | `bool` | Channel assignment status |
| `Online` | `bool` | Online status |
| `ISOCode` | `string` | Default ISO code for new channel |
| `ISOChannelName` | `string` | Default ISO channel name |
| `UserCode` | `string` | Default user code |
| `UserChannelName` | `string` | Default user channel name |
| `CFC` | `FilterClassType` | Channel filter class |
| `Polarity` | `bool` | Output inversion flag |
| `NonLinearCalculationType` | `string` | Nonlinear calculation type (string) |
| `NonLinearCalculationTypeEnum` | `NonLinearStyles` | Nonlinear calculation type (enum) |
| `ZeroMethod` | `ZeroMethodType` | Software zero method |
| `ZeroMethodStart` | `double` | Zero method start time (if Average over Time) |
| `ZeroMethodEnd` | `double` | Zero method end time (if Average over Time) |
| `UserValue1/2/3` | `string` | User-defined values |
| `SensorCalibrationStatus` | `UIItemStatus` | Calibration status |
| `InitialOffsets` | `InitialOffset[]` | Initial offsets array |
| `FilterClass` | `IFilterClass` | Filter class definition (FB 13120) |
| `FirstUseDate` | `DateTime?` | First use date (nullable, Case 13065) |
| `LatestCalibrationId` | `int?` | Latest calibration ID (nullable) |
| `UsingLatestCalibration` | `bool` | Whether using latest calibration |
- `bool Filter(string term)` — Returns true if sensor matches filter criteria.
#### `ISquib`
Represents squib/pyrotechnic devices.
| Property | Type | Description |
|----------|------|-------------|
| `DatabaseId` | `int` | Database ID (>0 valid) |
| `Included` | `bool` | Checkbox state |
| `SerialNumber` | `string` | Serial/setting name |
| `Description` | `string` | Description |
| `ResistanceLow` | `double` | Low resistance value |
| `ResistanceHigh` | `double` | High resistance value |
| `ID` | `string` | Identifier |
| `SQMode` | `string` | Squib mode string |
| `SQDelay` | `double` | Delay value |
| `SQCurrent` | `double` | Current value |
| `SQDuration` | `double` | Duration value |
| `LimitDuration` | `bool` | Duration limit flag |
| `ModifiedBy` | `string` | Last modifying user |
| `LastModified` | `DateTime` | Last modification date |
| `Assigned` | `bool` | Channel assignment status |
| `Online` | `bool` | Online status |
| `ISOCode` | `string` | ISO code |
| `ISOChannelName` | `string` | ISO channel name |
| `UserCode` | `string` | User code |
| `UserChannelName` | `string` | User channel name |
| `Mode` | `SquibFireMode` | Fire mode enum |
| `Broken` | `bool` | Broken flag (excludes from selectable lists) |
| `DoNotUse` | `bool` | Do-not-use flag (excludes from selectable lists) |
- `bool Filter(string term)` — Returns true if squib matches filter criteria.
#### `IDigitalInputSetting`
Represents digital input configurations.
| Property | Type | Description |
|----------|------|-------------|
| `DatabaseId` | `int` | Database ID (positive valid) |
| `Included` | `bool` | Checkbox state |
| `SerialNumber` | `string` | Serial/setting name |
| `Description` | `string` | Description |
| `DIMode` | `string` | Digital Input Mode string |
| `ModifiedBy` | `string` | Last modifying user |
| `LastModified` | `DateTime` | Last modification date |
| `Assigned` | `bool` | Channel assignment status |
| `Online` | `bool` | Online status |
| `EID` | `string` | Electronic ID |
| `ISOCode` | `string` | ISO code |
| `ISOChannelName` | `string` | ISO channel name |
| `UserCode` | `string` | User code |
| `UserChannelName` | `string` | User channel name |
| `ActiveValue` | `string` | Display value for active state |
| `DefaultValue` | `string` | Display value for default/idle state |
| `Mode` | `DigitalInputModes` | DI mode enum |
| `Broken` | `bool` | Broken flag |
| `DoNotUse` | `bool` | Do-not-use flag |
- `bool Filter(string term)` — Returns true if matches filter criteria.
#### `IDigitalOutputSetting`
Represents digital output configurations.
| Property | Type | Description |
|----------|------|-------------|
| `DatabaseId` | `int` | Database ID (>0 valid) |
| `Included` | `bool` | Checkbox state |
| `SerialNumber` | `string` | Serial/setting name |
| `Description` | `string` | Description |
| `DODelay` | `double` | Delay before output (ms) |
| `DODuration` | `double` | Output duration (ms) |
| `ModifiedBy` | `string` | Last modifying user |
| `LastModified` | `DateTime` | Last modification date |
| `Assigned` | `bool` | Channel assignment status |
| `Online` | `bool` | Online status (note: no real detection method) |
| `ISOCode` | `string` | ISO code (limited usefulness) |
| `ISOChannelName` | `string` | ISO channel name (limited usefulness) |
| `UserCode` | `string` | User code (limited usefulness) |
| `UserChannelName` | `string` | User channel name (limited usefulness) |
| `LimitDuration` | `bool` | Duration limit flag |
| `DOMode` | `DigitalOutputModes` | Output mode enum |
| `Broken` | `bool` | Broken flag |
| `DoNotUse` | `bool` | Do-not-use flag |
- `bool Filter(string term)` — Returns true if matches filter criteria.
#### `IUartIOSetting`
Represents UART I/O configurations.
| Property | Type | Description |
|----------|------|-------------|
| `DatabaseId` | `int` | Database ID (positive valid) |
| `Included` | `bool` | Checkbox state |
| `SerialNumber` | `string` | Serial/setting name |
| `Description` | `string` | Description |
| `LastModifiedBy` | `string` | Last modifying user |
| `LastModified` | `DateTime` | Last modification date |
| `Assigned` | `bool` | Channel assignment status |
| `Online` | `bool` | Online status |
| `ISOCode` | `string` | ISO code |
| `ISOChannelName` | `string` | ISO channel name |
| `UserCode` | `string` | User code |
| `UserChannelName` | `string` | User channel name |
| `Broken` | `bool` | Broken flag |
| `DoNotUse` | `bool` | Do-not-use flag |
| `BaudRate` | `uint` | UART baud rate |
| `DataBits` | `uint` | UART data bits |
| `StopBits` | `StopBits` | UART stop bits |
| `Parity` | `Parity` | UART parity |
| `FlowControl` | `Handshake` | UART flow control (always NONE per FB 30486) |
| `DataFormat` | `UartDataFormat` | Incoming data format |
- `bool Filter(string term)` — Returns true if matches filter criteria.
#### `IStreamInputSetting`
Represents stream input configurations.
| Property | Type | Description |
|----------|------|-------------|
| `DatabaseId` | `int` | Database ID (positive valid) |
| `Included` | `bool` | Checkbox state |
| `SerialNumber` | `string` | Serial/setting name |
| `Description` | `string` | Description |
| `LastModifiedBy` | `string` | Last modifying user |
| `LastModified` | `DateTime` | Last modification date |
| `Assigned` | `bool` | Channel assignment status |
| `Online` | `bool` | Online status |
| `ISOCode` | `string` | ISO code |
| `ISOChannelName` | `string` | ISO channel name |
| `UserCode` | `string` |

View File

@@ -0,0 +1,70 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Sensors/SoftwareFilters/ISoftwareFiltersView.cs
- Common/DTS.CommonCore/Interface/Sensors/SoftwareFilters/ISoftwareFiltersViewModel.cs
generated_at: "2026-04-16T12:23:58.149333+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c132999d4e5c3d51"
---
# Documentation: DTS.Common.Interface.Sensors.SoftwareFilters
## 1. Purpose
This module defines the core interfaces for the Software Filters subsystem within the DTS sensor framework. It establishes the contracts for the View and ViewModel in an MVVM (Model-View-ViewModel) architecture, enabling the management, sorting, and filtering of software filter configurations. Additionally, it defines `IFilterClass`, a contract for individual filter parameters (frequency and type), intended to support UI property grid editing and comparison operations.
## 2. Public Interface
### `ISoftwareFiltersView`
Inherits from: `DTS.Common.Base.IBaseView`
* **Description:** A marker interface defining the view contract for the Software Filters module. It imposes no specific members beyond those in `IBaseView`.
### `IFilterClass`
Inherits from: `System.IComparable`
Attributes: `System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))`
* **Description:** Defines a specific software filter configuration. The `ExpandableObjectConverter` attribute suggests this object is intended to be displayed and edited within a visual property grid.
* **Properties:**
* `string FilterName { get; }`: Gets the name of the filter.
* `DTS.Common.Enums.Sensors.FilterClassType FClass { get; set; }`: Gets or sets the classification type of the filter.
* `double Frequency { get; set; }`: Gets or sets the frequency value of the filter.
* **Methods:**
* `int GetFilterClassNumericValue()`: Returns a numeric representation of the filter class.
### `ISoftwareFiltersViewModel`
Inherits from: `DTS.Common.Base.IBaseViewModel`, `DTS.Common.Interface.Pagination.IFilterableListView`
* **Description:** Defines the behavior and state management for the Software Filters view.
* **Properties:**
* `ISoftwareFiltersView View { get; set; }`: Gets or sets the associated view instance.
* `System.Collections.ObjectModel.ObservableCollection<ISoftwareFilter> SoftwareFilters { get; set; }`: Gets or sets the bindable collection of software filters.
* `string CurrentUser { get; set; }`: Gets or sets the current user context.
* **Methods:**
* `void Sort(object sortBy, bool bColumnClick)`: Sorts the collection of software filters based on the provided criteria.
* `void Unset()`: Resets the state of the view model (specific implementation details not defined in interface).
* `void Filter(string currentFilter)`: Applies a string-based filter to the collection.
* `ISoftwareFilter[] GetSoftwareFilters()`: Retrieves the current software filters as an array.
* `void PopulateView()`: Initiates the loading or refreshing of data into the view.
* `bool ValidateAndSave()`: Validates the current state and persists changes; returns `true` if successful.
## 3. Invariants
* **Comparable Filter Classes:** Any implementation of `IFilterClass` must implement `IComparable`, guaranteeing that filter objects can be sorted or ordered relative to one another.
* **UI Compatibility:** `IFilterClass` implementations must be compatible with `System.ComponentModel.ExpandableObjectConverter`, implying they likely expose complex properties intended for expansion in a UI property browser.
* **Collection Type:** The `SoftwareFilters` property in `ISoftwareFiltersViewModel` must utilize `ObservableCollection<T>`, indicating the collection provides change notification events (likely for UI binding).
## 4. Dependencies
**Internal Dependencies (Referenced in Source):**
* `DTS.Common.Base`: Required for `IBaseView` and `IBaseViewModel`.
* `DTS.Common.Enums.Sensors`: Required for the `FilterClassType` enum used in `IFilterClass`.
* `DTS.Common.Interface.Pagination`: Required for `IFilterableListView` interface inheritance.
* `ISoftwareFilter`: Referenced as the generic type for collections in `ISoftwareFiltersViewModel`. **Note:** The definition for `ISoftwareFilter` is not present in the provided source files.
**External/System Dependencies:**
* `System`: For `IComparable` and basic types.
* `System.ComponentModel`: For `TypeConverter` and `ExpandableObjectConverter` attributes.
* `System.Collections.ObjectModel`: For `ObservableCollection`.
## 5. Gotchas
* **Missing Interface Definition:** The interface `ISoftwareFilter` is referenced as the primary data type within `ISoftwareFiltersViewModel` (in both the `ObservableCollection` and the return array of `GetSoftwareFilters`), but its definition is not included in the provided source files. The behavior of the ViewModel depends entirely on this missing contract.
* **Ambiguous `Unset` Behavior:** The method `Unset()` in `ISoftwareFiltersViewModel` has an unclear name. It is not immediately obvious if this clears the list, resets user selections, or disposes of resources without seeing the implementation.
* **Loosely Typed Sort:** The `Sort` method accepts `object sortBy`. This implies the implementation must perform runtime type checking or casting to determine the sort key, which could lead to runtime errors if an unexpected type is passed.
* **Historical Reference:** The `IFilterClass` interface contains a documentation comment referencing "FB 13120". This appears to be a reference to a bug tracking or feature request ticket (e.g., FogBugz), indicating historical context for the creation of this interface.

View File

@@ -0,0 +1,112 @@
---
source_files:
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressBarView.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressFooterView.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressBarFooterViewModel.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressBarViewModel.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/StatusAndProgressDelegates.cs
generated_at: "2026-04-16T12:18:12.505284+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "329090afc20c7c34"
---
# Documentation: DTS.Common.Interface.StatusAndProgressBar
## 1. Purpose
This module defines the contract layer for status and progress bar UI components within the DTS application. It provides interfaces for views and view models following a Model-View-ViewModel (MVVM) pattern, along with a set of delegate types used for progress reporting, status updates, and error handling callbacks. The module serves as an abstraction layer that decouples UI implementation from business logic, enabling consistent progress tracking and status communication across the application.
---
## 2. Public Interface
### Interfaces
#### `IStatusAndProgressBarView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
An empty marker interface extending `IBaseView`. No members defined.
---
#### `IStatusAndProgressFooterView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
An empty marker interface extending `IBaseView`. No members defined.
---
#### `IStatusAndProgressBarFooterViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
| Property | Type | Accessor | Description |
|----------|------|----------|-------------|
| `View` | `IStatusAndProgressFooterView` | get; set; | Holds reference to the associated footer view |
---
#### `IStatusAndProgressBarViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
| Property | Type | Accessor | Description |
|----------|------|----------|-------------|
| `View` | `IBaseView` | get; set; | Gets the Search View (per XML comment) |
| `Parent` | `IBaseViewModel` | get; set; | Reference to parent view model |
| `ProgressBarName` | `string` | get; set; | Name identifier for the progress bar |
| `ContextSearchRegion` | `object` | get; set; | Context object for search region (purpose unclear from source) |
---
### Delegates
**Namespace:** `DTS.Common.Interface.StatusAndProgressBar`
| Delegate | Signature | Description |
|----------|-----------|-------------|
| `SetProgressValueDelegate` | `void (double value)` | Callback for setting a progress bar value |
| `SetStatusTextDelegate` | `void (string text)` | Callback for setting status text |
| `SetProgressVisibilityDelegate` | `void (bool bVisible)` | Callback for toggling progress bar visibility |
| `SetStatusColorDelegate` | `void (Color color)` | Callback for setting status color |
| `ActionCompleteDelegate` | `void ()` | Callback signaling action completion |
| `StatusIntDelegate` | `void (int status)` | Callback for reporting integer status |
| `StatusExIntDelegate` | `void (int status, params object[] extra)` | Callback for reporting integer status with additional parameters |
| `ErrorCallback` | `DialogResult (string errorString, string unit)` | Callback for error handling that returns a dialog result |
---
## 3. Invariants
- All view interfaces (`IStatusAndProgressBarView`, `IStatusAndProgressFooterView`) must inherit from `IBaseView`.
- All view model interfaces (`IStatusAndProgressBarFooterViewModel`, `IStatusAndProgressBarViewModel`) must inherit from `IBaseViewModel`.
- `IStatusAndProgressBarFooterViewModel.View` must be assignable to `IStatusAndProgressFooterView`, not just `IBaseView`.
- The `SetStatusColorDelegate` uses `System.Windows.Media.Color` (WPF color type), not `System.Drawing.Color`.
- The `ErrorCallback` delegate returns `System.Windows.Forms.DialogResult`, indicating Windows Forms interop.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** - Provides `IBaseView` and `IBaseViewModel` base interfaces
- **`System.Windows.Forms`** - Provides `DialogResult` enum used in `ErrorCallback`
- **`System.Windows.Media`** - Provides `Color` struct used in `SetStatusColorDelegate`
### What depends on this module:
- Cannot be determined from source alone. Implementations of these interfaces would exist elsewhere in the codebase.
---
## 5. Gotchas
1. **Mixed UI Framework References:** The delegates reference both `System.Windows.Media.Color` (WPF) and `System.Windows.Forms.DialogResult` (WinForms). This suggests either hybrid UI usage or legacy interop. Developers should be aware of the correct `Color` type when implementing `SetStatusColorDelegate`.
2. **Misleading XML Comment:** The `View` property in `IStatusAndProgressBarViewModel` has an XML comment stating "Gets the Search View", which appears unrelated to the interface's purpose (status/progress bar). This may be a copy-paste error from another interface.
3. **Empty Marker Interfaces:** Both `IStatusAndProgressBarView` and `IStatusAndProgressFooterView` define no members beyond their base interface. Their purpose as separate types (rather than using `IBaseView` directly) is unclear from source alone—possibly for DI container registration or type discrimination.
4. **Vague `ContextSearchRegion` Property:** The purpose and expected type of `ContextSearchRegion` (typed as `object`) is not documented. Its relationship to "Search" in a progress bar context is unclear from source alone.

View File

@@ -0,0 +1,71 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/ISystemSettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/ISystemSettingsViewModel.cs
generated_at: "2026-04-16T12:13:27.974060+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "409fbccc02533644"
---
# Documentation: System Settings View Interfaces
## 1. Purpose
This module defines the contract for the System Settings feature within an MVVM (Model-View-ViewModel) architecture. It provides two interfaces—`ISystemSettingsView` and `ISystemSettingsViewModel`—that establish the separation between the view layer and its corresponding view model. The `ISystemSettingsViewModel` interface defines region management capabilities for context menus, main content, and navigation areas, suggesting this module supports a modular, region-based UI composition system for system configuration screens.
---
## 2. Public Interface
### `ISystemSettingsView`
**Namespace:** `DTS.Common.Interface`
**Inherits from:** `IBaseView`
A marker interface with no additional members. It serves as a typed contract for System Settings views, enabling type-safe association between views and view models.
---
### `ISystemSettingsViewModel`
**Namespace:** `DTS.Common.Interface`
**Inherits from:** `IBaseViewModel`
| Member | Signature | Description |
|--------|-----------|-------------|
| `View` | `ISystemSettingsView View { get; }` | Read-only property that provides access to the associated Shell View. |
| `GetRegions()` | `List<FrameworkElement> GetRegions()` | Method that returns a collection of `FrameworkElement` objects representing UI regions. |
| `ContextMenuRegion` | `Object ContextMenuRegion { get; set; }` | Read-write property for the context menu region context. |
| `ContextMainRegion` | `Object ContextMainRegion { get; set; }` | Read-write property for the main content region context. |
| `ContextNavigationRegion` | `Object ContextNavigationRegion { get; set; }` | Read-write property for the navigation region context. |
---
## 3. Invariants
- `ISystemSettingsView` must always be assignable to `IBaseView` (inheritance constraint).
- `ISystemSettingsViewModel` must always be assignable to `IBaseViewModel` (inheritance constraint).
- The `View` property on `ISystemSettingsViewModel` must return an instance that implements `ISystemSettingsView`.
- `GetRegions()` must return a `List<FrameworkElement>` (the list may be empty, but the return type is non-nullable in the signature).
- The three region context properties (`ContextMenuRegion`, `ContextMainRegion`, `ContextNavigationRegion`) are typed as `Object`, implying they can accept any reference type; no compile-time type constraints are enforced.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** — Provides `IBaseView` and `IBaseViewModel` base interfaces.
- **`System`** — Core .NET types (`Object`).
- **`System.Collections.Generic`** — Provides `List<T>` used by `GetRegions()`.
- **`System.Windows`** — WPF framework providing `FrameworkElement` for region elements.
### What depends on this module:
- **Cannot be determined from source alone.** Concrete implementations of `ISystemSettingsView` and `ISystemSettingsViewModel` exist elsewhere in the codebase, but their locations are not visible in the provided files.
---
## 5. Gotchas
- **Region properties are untyped:** `ContextMenuRegion`, `ContextMainRegion`, and `ContextNavigationRegion` are all declared as `Object`. The actual expected types and their usage patterns are unclear from the interface alone—consumers must refer to implementations or documentation to understand what types should be assigned.
- **No nullability annotations:** The signatures lack nullability annotations (e.g., nullable reference types). Whether `GetRegions()` can return `null` or if region properties accept/return `null` is unspecified.
- **`ISystemSettingsView` is empty:** This interface adds no members beyond `IBaseView`. Its purpose appears to be purely for type discrimination, but the architectural rationale is not evident from the source.
- **WPF coupling:** The use of `FrameworkElement` in `GetRegions()` ties this interface to WPF, limiting portability to other UI frameworks.

View File

@@ -0,0 +1,88 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/DB/IDBImportView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/DB/IDBExportView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/DB/IDBViewModel.cs
generated_at: "2026-04-16T12:20:53.510446+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "7e29e0cdd222a5b1"
---
# Documentation: DTS.Common.Interface (DB Import/Export Views)
## 1. Purpose
This module defines the contract for database import and export functionality within the system settings domain. It provides three interfaces—`IDBImportView`, `IDBExportView`, and `IDBViewModel`—that establish the structure for view models handling file-based data transfer operations. The module abstracts the import/export workflow, allowing views to be swapped or mocked while maintaining a consistent interface for XML-based data serialization.
---
## 2. Public Interface
### `IDBImportView`
**Signature:** `public interface IDBImportView : IBaseView { }`
A marker interface extending `IBaseView`. Defines no members of its own; exists to identify views responsible for import operations.
---
### `IDBExportView`
**Signature:** `public interface IDBExportView : IBaseView { }`
A marker interface extending `IBaseView`. Defines no members of its own; exists to identify views responsible for export operations.
---
### `IDBViewModel`
**Signature:** `public interface IDBViewModel : IBaseViewModel`
Defines the contract for a view model that orchestrates database import/export operations.
**Properties:**
| Name | Type | Access | Description |
|------|------|--------|-------------|
| `ImportView` | `IDBImportView` | get/set | Reference to the import view instance |
| `ExportView` | `IDBExportView` | get/set | Reference to the export view instance |
| `ImportFileName` | `string` | get/set | File path to import from |
| `ImportStatusText` | `string` | get/set | Status message for import operations |
| `ExportFileName` | `string` | get/set | File path to export to |
| `ExportData` | `string` | get/set | Formatted XML string to write to the export file |
| `ImportData` | `string` | get/set | Formatted XML string read from the import file |
**Methods:**
| Name | Return Type | Description |
|------|-------------|-------------|
| `Export()` | `void` | Exports the contents of `ExportData` to the file specified by `ExportFileName` |
---
## 3. Invariants
- `IDBImportView` and `IDBExportView` must always be assignable to `IBaseView`.
- `IDBViewModel` must always be assignable to `IBaseViewModel`.
- `ExportData` and `ImportData` are expected to contain formatted XML strings (as stated in source comments).
- The `Export()` method is expected to use the current values of `ExportFileName` and `ExportData` at the time of invocation.
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
**What depends on this module:**
- Cannot be determined from the provided source files alone. Consumers would be concrete implementations of these interfaces and any code that references `IDBViewModel`, `IDBImportView`, or `IDBExportView`.
---
## 5. Gotchas
1. **Asymmetric API:** There is an `Export()` method defined, but no corresponding `Import()` method is present in `IDBViewModel`. Import logic must be handled elsewhere or through property binding alone.
2. **Placement uncertainty:** Source comments indicate that `ImportFileName` and `ExportFileName` properties may not belong in the view model long-term: *"we may not need this in the viewmodel if the viewmodel is capable of doing all the operations it needs to do."* This suggests potential refactoring.
3. **XML coupling:** The `ExportData` and `ImportData` properties are explicitly documented as "formatted xml string." Any implementation changing this format would break the documented contract.
4. **No validation hooks:** The interfaces define no validation methods or error handling patterns for file I/O operations. Implementers must define their own error handling strategy.

View File

@@ -0,0 +1,100 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IisoSettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IISOSettingsModel.cs
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IISOSettingsViewModel.cs
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IISOSettingsData.cs
generated_at: "2026-04-16T12:20:35.290001+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "7b8cfe6060429ed5"
---
# ISO Settings Module Documentation
## 1. Purpose
This module defines the contract for ISO (International Organization for Standardization) settings management within the DTS system. It establishes a Model-View-ViewModel (MVVM) architecture through four interfaces that govern how ISO-related configuration data is stored, displayed, and manipulated. The module provides a decoupled interface layer allowing implementations to vary without affecting dependent components.
---
## 2. Public Interface
### `IISOSettingsView`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseView`
A marker interface representing the view component in the MVVM pattern. Contains no members beyond those inherited from `IBaseView`.
---
### `IISOSettingsModel`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseModel`
Defines the data persistence contract for ISO settings.
| Method | Signature | Description |
|--------|-----------|-------------|
| `SaveData` | `void SaveData(IISOSettingsData data)` | Persists the provided ISO settings data. |
| `LoadData` | `IISOSettingsData LoadData()` | Retrieves and returns the stored ISO settings data. |
---
### `IISOSettingsViewModel`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseViewModel`
Defines the coordinator between view and model for ISO settings.
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `View` | `IISOSettingsView` | get/set | Reference to the associated view instance. |
| `ISOData` | `IISOSettingsData` | get/set | The ISO settings data being managed. |
| `Model` | `IISOSettingsModel` | get/set | Reference to the model for data operations. |
---
### `IISOSettingsData`
**Namespace:** `DTS.Common.Interface`
**Inherits:** `IBaseClass`
Defines the data structure for ISO configuration settings.
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `UniqueISOCodesRequired` | `bool` | get/set | Controls whether ISO codes must be unique. |
| `ISOViewMode` | `IsoViewMode` | get/set | Determines the view mode for ISO display. |
| `ShowISOStringBuilder` | `bool` | get/set | Controls visibility of ISO string builder UI. |
| `ShowChannelCodeLookupHelper` | `bool` | get/set | Controls visibility of channel code lookup helper. |
| `UseISOCodeFilterMapping` | `bool` | get/set | Enables/disables ISO code filter mapping. |
| `ShowISOCodes` | `bool` | get only | Indicates whether ISO codes should be displayed. |
| `ShowUserCodes` | `bool` | get only | Indicates whether user codes should be displayed. |
| `ChannelNamesOnly` | `bool` | get only | Indicates whether only channel names are shown. |
---
## 3. Invariants
- **Inheritance Hierarchy:** All interfaces in this module inherit from base interfaces in `DTS.Common.Base` (`IBaseView`, `IBaseModel`, `IBaseViewModel`, `IBaseClass`). Implementations must satisfy these base contracts.
- **Read-only Properties:** The properties `ShowISOCodes`, `ShowUserCodes`, and `ChannelNamesOnly` on `IISOSettingsData` are read-only. Their values must be derived from other state (likely computed from `ISOViewMode` or other properties), but the derivation logic is not specified in these interfaces.
- **ViewModel Composition:** `IISOSettingsViewModel` requires non-null references to `View`, `Model`, and `ISOData` for proper operation (implied by the architecture, though not enforced at interface level).
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** — Provides base interfaces (`IBaseView`, `IBaseModel`, `IBaseViewModel`, `IBaseClass`) that all ISO settings interfaces extend.
- **`DTS.Common.Enums`** — Provides the `IsoViewMode` enum used in `IISOSettingsData.ISOViewMode`.
### What depends on this module:
- **Unclear from source alone.** Concrete implementations of these interfaces and any consumers of `IISOSettingsView`, `IISOSettingsModel`, `IISOSettingsViewModel`, or `IISOSettingsData` are not present in the provided files.
---
## 5. Gotchas
- **Naming Inconsistency:** The file name `IisoSettingsView.cs` uses lowercase "iso" while the interface name is `IISOSettingsView` (uppercase). The file includes a `// ReSharper disable InconsistentNaming` directive in `IISOSettingsViewModel.cs`, suggesting naming conventions around "ISO" have been a point of friction.
- **Read-only Property Derivation:** The three read-only properties on `IISOSettingsData` (`ShowISOCodes`, `ShowUserCodes`, `ChannelNamesOnly`) have no visible implementation. Their relationship to `ISOViewMode` or other writable properties is not documented in these interfaces—implementers must consult concrete implementations or other documentation.
- **Empty View Interface:** `IISOSettingsView` defines no members beyond its base interface. This may indicate either a placeholder for future expansion or that all view behavior is defined in `IBaseView`.

View File

@@ -0,0 +1,67 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/PowerAndBattery/IPowerAndBatteryView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/PowerAndBattery/IPowerAndBatteryViewModel.cs
generated_at: "2026-04-16T12:26:11.956445+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a788360f54c0a8e6"
---
# Documentation: Power and Battery View/ViewModel Interfaces
## 1. Purpose
This module defines two marker interfaces, `IPowerAndBatteryView` and `IPowerAndBatteryViewModel`, which serve as type contracts for the Power and Battery settings feature within the system. These interfaces follow the Model-View-ViewModel (MVVM) architectural pattern, providing type identity and polymorphic compatibility with the base view/viewmodel infrastructure while remaining empty to allow implementation-specific flexibility.
---
## 2. Public Interface
### `IPowerAndBatteryView`
**Signature:**
```csharp
public interface IPowerAndBatteryView : IBaseView { }
```
**Location:** `DTS.Common.Interface` namespace
**Behavior:** An empty marker interface that extends `IBaseView`. It imposes no additional members beyond those inherited from `IBaseView`. Implementations represent the UI layer for power and battery configuration.
---
### `IPowerAndBatteryViewModel`
**Signature:**
```csharp
public interface IPowerAndBatteryViewModel : IBaseViewModel { }
```
**Location:** `DTS.Common.Interface` namespace
**Behavior:** An empty marker interface that extends `IBaseViewModel`. It imposes no additional members beyond those inherited from `IBaseViewModel`. Implementations represent the presentation logic and state for power and battery configuration.
---
## 3. Invariants
- Both interfaces must always inherit from their respective base types (`IBaseView` and `IBaseViewModel`).
- The contracts defined by `IBaseView` and `IBaseViewModel` (not visible in these source files) must be fulfilled by any implementing class.
- The namespace `DTS.Common.Interface` groups these interfaces with other system interfaces.
**Note:** Specific invariants regarding member requirements cannot be determined from these source files alone, as both interfaces are empty marker interfaces delegating all contracts to their parent types.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces
### What depends on this module:
**Cannot be determined from source alone.** Consumers would include concrete View and ViewModel implementations for the Power and Battery settings feature, as well as any registration, navigation, or dependency injection configuration that references these interfaces.
---
## 5. Gotchas
- **Empty marker interfaces:** Both interfaces define no members of their own. All behavior contracts come from `IBaseView` and `IBaseViewModel`. Developers implementing these interfaces must consult the base interface definitions to understand required members.
- **Naming inconsistency:** The folder path (`SystemSettings/PowerAndBattery/`) suggests a hierarchical organization, but the namespace flattens to `DTS.Common.Interface`. This may cause confusion when locating related types.
- **No explicit coupling:** There is no compile-time enforcement linking `IPowerAndBatteryView` to `IPowerAndBatteryViewModel`. The relationship is implied by naming convention only.

View File

@@ -0,0 +1,62 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/QASettings/IQASettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/QASettings/IQASettingsViewModel.cs
generated_at: "2026-04-16T12:19:52.577676+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5199e3039d0bb459"
---
# Documentation: IQASettingsView and IQASettingsViewModel Interfaces
## 1. Purpose
This module defines two empty marker interfaces, `IQASettingsView` and `IQASettingsViewModel`, which represent the View and ViewModel contracts for a QA (Quality Assurance) Settings feature within an MVVM (Model-View-ViewModel) architecture. These interfaces exist to establish type hierarchy and enable polymorphic treatment of QA Settings components alongside other system settings views and view models through their base interface inheritance.
---
## 2. Public Interface
### `IQASettingsView`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseView`
- **Signature:**
```csharp
public interface IQASettingsView : IBaseView { }
```
- **Behavior:** Empty marker interface. Provides no members beyond those inherited from `IBaseView`. Used to identify views that implement QA Settings functionality.
### `IQASettingsViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseViewModel`
- **Signature:**
```csharp
public interface IQASettingsViewModel : IBaseViewModel { }
```
- **Behavior:** Empty marker interface. Provides no members beyond those inherited from `IBaseViewModel`. Used to identify view models that implement QA Settings functionality.
---
## 3. Invariants
- Any class implementing `IQASettingsView` must also satisfy the contract of `IBaseView`.
- Any class implementing `IQASettingsViewModel` must also satisfy the contract of `IBaseViewModel`.
- The specific invariants of `IBaseView` and `IBaseViewModel` are not visible in the provided source; their contracts must be consulted for complete invariant requirements.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
### What depends on this module:
- **Unknown from source alone.** Concrete view and view model classes implementing these interfaces, as well as any navigation or registration systems that reference these types, would be consumers, but they are not present in the provided files.
---
## 5. Gotchas
- **Empty interfaces:** Both interfaces define no members of their own. This is either intentional (marker interfaces for type discrimination, registration, or dependency injection) or indicative of incomplete implementation. The actual behavior and responsibilities of QA Settings views/view models must be inferred from the base interfaces (`IBaseView`, `IBaseViewModel`) or from concrete implementations not shown here.
- **Base interface contracts unknown:** Without visibility into `IBaseView` and `IBaseViewModel`, the full contract requirements for implementers cannot be documented.

View File

@@ -0,0 +1,62 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/RealtimeSettings/IRealtimeSettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/RealtimeSettings/IRealtimeSettingsViewModel.cs
generated_at: "2026-04-16T12:20:24.412229+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "0ef736bfba716a64"
---
# Documentation: IRealtimeSettingsView & IRealtimeSettingsViewModel
## 1. Purpose
This module defines two marker interfaces—`IRealtimeSettingsView` and `IRealtimeSettingsViewModel`—for the RealtimeSettings feature within an MVVM (Model-View-ViewModel) architecture. These interfaces serve as extension points for real-time system settings configuration, allowing concrete implementations to be identified, registered, and resolved through dependency injection or convention-based wiring. The interfaces themselves are empty, indicating they rely entirely on their base contracts for behavior.
---
## 2. Public Interface
### `IRealtimeSettingsView`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseView`
- **Signature:**
```csharp
public interface IRealtimeSettingsView : IBaseView { }
```
- **Behavior:** Marker interface with no members. Any contract behavior is inherited from `IBaseView` (defined in `DTS.Common.Base`).
### `IRealtimeSettingsViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Inheritance:** `IBaseViewModel`
- **Signature:**
```csharp
public interface IRealtimeSettingsViewModel : IBaseViewModel { }
```
- **Behavior:** Marker interface with no members. Any contract behavior is inherited from `IBaseViewModel` (defined in `DTS.Common.Base`).
---
## 3. Invariants
- **Type hierarchy:** `IRealtimeSettingsView` must always be assignable to `IBaseView`. `IRealtimeSettingsViewModel` must always be assignable to `IBaseViewModel`.
- **No additional contracts:** Neither interface defines additional members beyond their base interfaces. Any invariants are inherited from `IBaseView` and `IBaseViewModel`, but **these are not visible in the provided source**.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces.
### What depends on this module:
- **Unknown from source alone.** Concrete View and ViewModel implementations for RealtimeSettings would implement these interfaces, and DI containers or navigation frameworks would consume them, but no such consumers are visible in the provided files.
---
## 5. Gotchas
- **Marker interfaces:** Both interfaces are empty marker interfaces. Developers should not expect any RealtimeSettings-specific members here; all functionality comes from the base interfaces (`IBaseView`, `IBaseViewModel`), which are not included in the provided source.
- **Naming suggests pairing:** The naming convention (`IRealtimeSettingsView` + `IRealtimeSettingsViewModel`) strongly implies an MVVM pairing, but the relationship is not enforced at the type level.
- **Purpose unclear without context:** The specific behavior or data associated with "RealtimeSettings" is not documented in these interfaces. The actual settings, validation rules, or real-time update mechanisms must be defined in implementing classes or related modules not provided here.

View File

@@ -0,0 +1,57 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/TablesSettings/ITablesSettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/TablesSettings/ITablesSettingsModel.cs
generated_at: "2026-04-16T12:19:50.242418+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9b85701d1358796f"
---
# Documentation: Tables Settings Interfaces
## 1. Purpose
This module defines two marker interfaces for the "Tables Settings" feature within the System Settings subsystem. These interfaces establish type contracts for the View and ViewModel components in an MVVM (Model-View-ViewModel) architecture, allowing components to be identified and potentially resolved via dependency injection or reflection without exposing any domain-specific members at this interface level.
---
## 2. Public Interface
### `ITablesSettingsView`
- **Namespace:** `DTS.Common.Interface`
- **Declaration:** `public interface ITablesSettingsView : IBaseView { }`
- **Inheritance:** Extends `IBaseView` (from `DTS.Common.Base`)
- **Members:** None defined (marker interface)
### `ITablesSettingsViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Declaration:** `public interface ITablesSettingsViewModel : IBaseViewModel { }`
- **Inheritance:** Extends `IBaseViewModel` (from `DTS.Common.Base`)
- **Members:** None defined (marker interface)
---
## 3. Invariants
- Any class implementing `ITablesSettingsView` must also satisfy the contract of `IBaseView`.
- Any class implementing `ITablesSettingsViewModel` must also satisfy the contract of `IBaseViewModel`.
- The specific behavioral contracts of `IBaseView` and `IBaseViewModel` are not visible in the provided source; their requirements are inherited but unspecified here.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces.
### Consumers:
- Not determinable from the provided source alone. These interfaces are likely consumed by concrete View/ViewModel implementations and possibly a dependency injection container or navigation system.
---
## 5. Gotchas
- **Filename/Interface name mismatch:** The file `ITablesSettingsModel.cs` contains the interface `ITablesSettingsViewModel`, not `ITablesSettingsModel`. This naming inconsistency may cause confusion when locating types by filename.
- **Empty interfaces:** Both interfaces are marker interfaces with no members. Any functionality must be provided by the base interfaces (`IBaseView`, `IBaseViewModel`) or by casting to concrete types, which is not visible in this source.
- **Purpose unclear from source alone:** The specific behavior or data associated with "Tables Settings" is not defined at this interface level; the interfaces serve only as type identifiers.

View File

@@ -0,0 +1,42 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/TestSettings/ITestSettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/TestSettings/ITestSettingsViewModel.cs
generated_at: "2026-04-16T12:21:08.427147+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5e0dfcfe8f8e6976"
---
# Documentation: Test Settings Interfaces
## 1. Purpose
This module defines the contractual interfaces for the "Test Settings" feature within an MVVM (Model-View-ViewModel) architecture. It provides `ITestSettingsView` and `ITestSettingsViewModel` to decouple the UI layer from the business logic layer. These interfaces serve as markers for dependency injection and view resolution, ensuring that specific Test Settings components can be identified and managed by the system's core infrastructure.
## 2. Public Interface
### `ITestSettingsView`
* **Signature:** `public interface ITestSettingsView : IBaseView`
* **Namespace:** `DTS.Common.Interface`
* **Description:** Represents the View component for Test Settings. It inherits from `IBaseView` but defines no additional members, functioning as a specific marker interface for the system's view resolution mechanism.
### `ITestSettingsViewModel`
* **Signature:** `public interface ITestSettingsViewModel : IBaseViewModel`
* **Namespace:** `DTS.Common.Interface`
* **Description:** Represents the ViewModel component for Test Settings. It inherits from `IBaseViewModel` but defines no additional members, functioning as a specific marker interface for the system's logic layer.
## 3. Invariants
* **Hierarchy:** Any class implementing `ITestSettingsView` must also implement `IBaseView`. Any class implementing `ITestSettingsViewModel` must also implement `IBaseViewModel`.
* **Structure:** These interfaces are currently empty (marker interfaces). Therefore, they do not enforce specific method signatures or properties beyond those inherited from their base types.
## 4. Dependencies
* **External Dependencies:**
* `DTS.Common.Base`: Required for the definitions of `IBaseView` and `IBaseViewModel`.
* **Consumers:**
* Concrete View implementations (e.g., WPF Windows/Pages) needing to register as the Test Settings UI.
* Concrete ViewModel implementations handling the logic for Test Settings.
* Dependency injection containers or navigation services that resolve these specific interfaces.
## 5. Gotchas
* **Marker Interfaces:** Both interfaces are empty. While they likely facilitate type-safe navigation or injection, they expose no specific API surface (e.g., `LoadSettings()` or `SaveCommand`) themselves. Developers must cast to the concrete implementation or a more specific base type to access actual functionality, or rely on members exposed by `IBaseView`/`IBaseViewModel`.
* **Base Behavior Unknown:** The actual capabilities of these interfaces depend entirely on the definitions of `IBaseView` and `IBaseViewModel` found in `DTS.Common.Base`, which are not included in the provided source.

View File

@@ -0,0 +1,56 @@
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/UISettings/IUISettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/UISettings/IUISettingsViewModel.cs
generated_at: "2026-04-16T12:25:58.608548+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "2585d1c5e565105e"
---
# Documentation: IUISettingsView & IUISettingsViewModel
## 1. Purpose
This module defines two marker interfaces, `IUISettingsView` and `IUISettingsViewModel`, which serve as type identifiers for UI settings-related components within a Model-View-ViewModel (MVVM) architecture. These interfaces exist to establish a type hierarchy for UI settings screens, allowing components to be identified, registered, or resolved generically as settings-related views and view models without defining any additional members beyond their base contracts.
---
## 2. Public Interface
### `IUISettingsView`
- **Namespace:** `DTS.Common.Interface`
- **Signature:** `public interface IUISettingsView : IBaseView`
- **Description:** A marker interface for UI settings views. Inherits from `IBaseView` (defined in `DTS.Common.Base`). Declares no additional members.
### `IUISettingsViewModel`
- **Namespace:** `DTS.Common.Interface`
- **Signature:** `public interface IUISettingsViewModel : IBaseViewModel`
- **Description:** A marker interface for UI settings view models. Inherits from `IBaseViewModel` (defined in `DTS.Common.Base`). Declares no additional members.
---
## 3. Invariants
- `IUISettingsView` must always be assignable to `IBaseView`.
- `IUISettingsViewModel` must always be assignable to `IBaseViewModel`.
- The actual contracts (properties, methods, events) for these interfaces are defined entirely by their base interfaces (`IBaseView` and `IBaseViewModel`), not by these interfaces themselves.
- **Unclear from source:** The specific invariants enforced by `IBaseView` and `IBaseViewModel` cannot be determined without access to `DTS.Common.Base`.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — provides `IBaseView` and `IBaseViewModel` base interfaces.
### What depends on this module:
- **Unclear from source alone.** Consumers would be any concrete view or view model classes implementing `IUISettingsView` or `IUISettingsViewModel`, as well as any registration/resolution logic (e.g., dependency injection containers, navigation services) that handles UI settings components by these types.
---
## 5. Gotchas
- **Empty marker interfaces:** Both interfaces define no members. All functionality comes from their respective base interfaces. Developers implementing these should consult `IBaseView` and `IBaseViewModel` to understand required members.
- **Naming collision risk:** The namespace `DTS.Common.Interface` is generic; if other modules use the same namespace, type resolution conflicts could occur.
- **Unclear from source:** The reason for having separate marker interfaces (rather than using the base interfaces directly) is not documented in the source. This may relate to type discrimination for navigation, DI registration, or feature-specific handling, but this cannot be confirmed without additional context.

View File

@@ -0,0 +1,48 @@
---
source_files:
- Common/DTS.CommonCore/Interface/TSRAIRGo/INavigationButtonInfo.cs
generated_at: "2026-04-16T12:08:44.958885+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9b7d291a6a236da0"
---
# Documentation: INavigationButtonInfo
## 1. Purpose
This module defines the `INavigationButtonInfo` interface, which specifies a contract for navigation button configuration objects within the TSRAIRGo subsystem. It provides a standardized abstraction for button metadata—including identity, display text, tooltip, enabled state, and border visibility—allowing consumers to interact with navigation buttons polymorphically without depending on concrete implementations.
## 2. Public Interface
### Interface: `INavigationButtonInfo`
**Namespace:** `DTS.Common.Interface.TSRAIRGo`
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `Id` | `NavigationButtonId` | Read-only | Returns the unique identifier for the navigation button. |
| `Text` | `string` | Read/Write | Gets or sets the display text for the button. |
| `Tooltip` | `string` | Read/Write | Gets or sets the tooltip text shown on hover. |
| `Enabled` | `bool` | Read/Write | Gets or sets whether the button is interactive. |
| `ShowBorder` | `bool` | Read/Write | Gets or sets whether the button border is visible. |
## 3. Invariants
- `Id` is immutable after construction (read-only accessor only).
- No null validation or constraint enforcement is visible in the interface definition; implementations may impose additional constraints.
- The relationship between `Id` and other properties (e.g., whether `Id` determines default `Text`) is not specified in this interface.
## 4. Dependencies
### This module depends on:
- `DTS.Common.Enums.TSRAIRGo.NavigationButtonId` — An enumeration type used to identify navigation buttons. The actual enum values are defined externally.
### What depends on this module:
- **Unknown from source alone.** No consumers or implementations are visible in this file.
## 5. Gotchas
- **No null constraints visible:** The interface does not indicate whether `Text` or `Tooltip` may be null or empty. Implementations may handle these cases differently.
- **Mutable state:** All properties except `Id` are read/write, implying implementations are expected to support runtime modification of button state.
- **Enum dependency:** The `NavigationButtonId` enum is imported but not defined here; its values and structure must be located in `DTS.Common.Enums.TSRAIRGo`.

View File

@@ -0,0 +1,61 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Tags/ITagAssignment.cs
- Common/DTS.CommonCore/Interface/Tags/ITagAware.cs
- Common/DTS.CommonCore/Interface/Tags/ITag.cs
generated_at: "2026-04-16T12:15:17.023700+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "8ded8eec16b04840"
---
# Documentation: DTS.Common.Interface.Tags
## 1. Purpose
This module defines the core contracts for the tagging system within the DTS application. It provides interfaces for defining tag entities (`ITag`), assigning tags to specific domain objects (`ITagAssignment`), and implementing tag-aware behavior on business objects (`ITagAware`). The module supports categorization and filtering for entities such as Users, Groups, Templates, TestSetups, Sensors, and SensorModels.
## 2. Public Interface
### Enum: `TagTypes`
Defines the categories of objects that can be associated with tags.
* `User`
* `Group`
* `Template`
* `TestSetup`
* `Sensors`
* `SensorModels`
### Interface: `ITag`
Represents a tag entity, typically mapping to a database record. Inherits from `System.ICloneable`.
* `int ID { get; set; }`: The database identifier for the tag.
* `string Text { get; set; }`: The display text or label of the tag.
* `bool IsObsolete { get; set; }`: Flag indicating whether the tag is deprecated.
### Interface: `ITagAssignment`
Represents the association between a tag and a specific object.
* `int ObjectID { get; set; }`: The identifier of the object being tagged.
* `int TagID { get; set; }`: The identifier of the tag being assigned.
* `TagTypes ObjectType { get; set; }`: The type of the object being tagged (defined by `TagTypes` enum).
### Interface: `ITagAware`
Defines the contract for classes that manage a collection of tags.
* `void SetTags(string[] tagsText)`: Assigns tags to the object based on an array of text strings.
* `string[] GetTagsArray()`: Retrieves the text representation of all assigned tags.
* `int[] GetTagIDs()`: Retrieves the database IDs of all assigned tags.
* `void RemoveTags(string[] tagsText)`: Removes specific tags from the object based on text strings.
* `bool ContainsAnyTag(int[] tags)`: Checks if the object is associated with any of the provided tag IDs.
## 3. Invariants
* **Cloning:** Any implementation of `ITag` must support cloning via the `ICloneable` interface.
* **Type Consistency:** An `ITagAssignment` instance must map a `TagID` to an `ObjectID` of a specific `ObjectType` defined in the `TagTypes` enum.
* **ID vs. Text Duality:** Implementations of `ITagAware` must maintain consistency between the text representation of tags (accessed via `GetTagsArray`) and the ID representation (accessed via `GetTagIDs`).
## 4. Dependencies
* **System Namespace:** `ITag` depends on `System.ICloneable`.
* **Internal Dependencies:** All interfaces reside within the `DTS.Common.Interface.Tags` namespace. No other internal modules are imported in these files.
* **Consumers:** Unknown from the source alone, but intended consumers include business entities that can be tagged (e.g., User, Sensor models) and data access layers managing tag persistence.
## 5. Gotchas
* **ICloneable Implementation:** The `ITag` interface inherits `ICloneable`, but the source does not define a strongly-typed `Clone` method. Implementers must implement `object Clone()` and handle the casting logic manually.
* **Tag Identification:** The `ITagAware` interface implies a dual mechanism for identifying tags (by text string vs. by integer ID). It is unclear from the interface alone how an implementation resolves a text string to an ID in `SetTags` or `RemoveTags` (e.g., whether it requires a database lookup or an in-memory cache).
* **Obsolescence:** `ITag` includes an `IsObsolete` flag. The interface does not enforce logic regarding whether obsolete tags can be newly assigned or if they are filtered out during retrieval.

View File

@@ -0,0 +1,83 @@
---
source_files:
- Common/DTS.CommonCore/Interface/TestMetaData/ITestEngineerDetailsDbRecord.cs
- Common/DTS.CommonCore/Interface/TestMetaData/ICustomerDetailsDbRecord.cs
- Common/DTS.CommonCore/Interface/TestMetaData/ILabratoryDetailsDbRecord.cs
generated_at: "2026-04-16T12:13:05.880610+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "adb5cdc8cb4cf74e"
---
# Documentation: DTS.Common.Core Test Metadata Interfaces
## 1. Purpose
This module defines three data contract interfaces—`ITestEngineerDetailsDbRecord`, `ICustomerDetailsDbRecord`, and `ILabratoryDetailsDbRecord`—within the `DTS.Common.Interface.TestMetaData` namespace. These interfaces abstract the database schema for test metadata entities, mapping properties to specific database columns using `System.ComponentModel.DataAnnotations` attributes. They serve as the data access layer contracts for Test Engineer, Customer, and Laboratory records, likely supporting an ORM framework such as Entity Framework.
## 2. Public Interface
### `ITestEngineerDetailsDbRecord`
Defines the contract for a record in the `TestEngineerDetails` database table.
**Properties:**
* `int TestEngineerId { get; set; }`: The primary key for the record. Mapped to the column `TestEngineerId`.
* `string Name { get; set; }`: Mapped to the column `Name`.
* `string TestEngineerName { get; set; }`: Mapped to the column `TestEngineerName`.
* `string TestEngineerPhone { get; set; }`: Mapped to the column `TestEngineerPhone`.
* `string TestEngineerFax { get; set; }`: Mapped to the column `TestEngineerFax`.
* `string TestEngineerEmail { get; set; }`: Mapped to the column `TestEngineerEmail`.
* `bool LocalOnly { get; set; }`: Mapped to the column `LocalOnly`.
* `DateTime LastModified { get; set; }`: Mapped to the column `LastModified`.
* `string LastModifiedBy { get; set; }`: Mapped to the column `LastModifiedBy`.
* `int Version { get; set; }`: Mapped to the column `Version`.
### `ICustomerDetailsDbRecord`
Defines the contract for a record in the `CustomerDetails` database table.
**Properties:**
* `int CustomerId { get; set; }`: The primary key for the record. Mapped to the column `CustomerId`.
* `string Name { get; set; }`: Mapped to the column `Name`.
* `string CustomerName { get; set; }`: Mapped to the column `CustomerName`.
* `string CustomerTestRefNumber { get; set; }`: Mapped to the column `CustomerTestRefNumber`.
* `string ProjectRefNumber { get; set; }`: Mapped to the column `ProjectRefNumber`.
* `string CustomerOrderNumber { get; set; }`: Mapped to the column `CustomerOrderNumber`.
* `string CustomerCostUnit { get; set; }`: Mapped to the column `CustomerCostUnit`.
* `bool LocalOnly { get; set; }`: Mapped to the column `LocalOnly`.
* `DateTime LastModified { get; set; }`: Mapped to the column `LastModified`.
* `string LastModifiedBy { get; set; }`: Mapped to the column `LastModifiedBy`.
* `int Version { get; set; }`: Mapped to the column `Version`.
### `ILabratoryDetailsDbRecord`
Defines the contract for a record in the `LabratoryDetails` database table.
**Properties:**
* `int LabratoryId { get; set; }`: The primary key for the record. Mapped to the column `LabratoryId`.
* `string Name { get; set; }`: Mapped to the column `Name`.
* `string LabratoryName { get; set; }`: Mapped to the column `LabratoryName`.
* `string LabratoryContactName { get; set; }`: Mapped to the column `LabratoryContactName`.
* `string LabratoryContactPhone { get; set; }`: Mapped to the column `LabratoryContactPhone`.
* `string LabratoryContactFax { get; set; }`: Mapped to the column `LabratoryContactFax`.
* `string LabratoryContactEmail { get; set; }`: Mapped to the column `LabratoryContactEmail`.
* `string LabratoryTestRefNumber { get; set; }`: Mapped to the column `LabratoryTestRefNumber`.
* `string LabratoryProjectRefNumber { get; set; }`: Mapped to the column `LabratoryProjectRefNumber`.
* `DateTime LastModified { get; set; }`: Mapped to the column `LastModified`.
* `string LastModifiedBy { get; set; }`: Mapped to the column `LastModifiedBy`.
* `bool LocalOnly { get; set; }`: Mapped to the column `LocalOnly`.
* `int Version { get; set; }`: Mapped to the column `Version`.
## 3. Invariants
* **Primary Keys**: Each interface requires an integer-based primary key property (`TestEngineerId`, `CustomerId`, `LabratoryId`) decorated with the `[Key]` attribute.
* **Column Mapping**: All properties are explicitly mapped to database columns using the `[Column("...")]` attribute.
* **Audit Trail**: All three interfaces guarantee the existence of `LastModified` (DateTime), `LastModifiedBy` (string), and `Version` (int) properties.
* **Locality**: All three interfaces guarantee a `LocalOnly` boolean flag.
## 4. Dependencies
* **System.ComponentModel.DataAnnotations**: Used for the `[Key]` attribute.
* **System.ComponentModel.DataAnnotations.Schema**: Used for the `[Column]` attribute.
* **System**: Used for basic types (`String`, `Int32`, `DateTime`, `Boolean`).
* **Consumers**: Unknown from source alone, but these interfaces are likely implemented by concrete entity classes consumed by a database context (e.g., Entity Framework `DbContext`).
## 5. Gotchas
* **Spelling Error**: The interface `ILabratoryDetailsDbRecord` and its associated properties/columns (e.g., `LabratoryId`, `LabratoryName`) misspell "Laboratory" as "Labratory". This typo appears to be embedded in the codebase and likely mirrors a typo in the underlying database schema.
* **Redundant Name Fields**: Both `ITestEngineerDetailsDbRecord` and `ICustomerDetailsDbRecord` define a generic `Name` property alongside a more specific `TestEngineerName` or `CustomerName` property. The semantic difference between these two fields is unclear from the source code alone.
* **Nullable Reference Types**: The source code does not enable nullable reference types (no `#nullable enable` directive or `?` annotations on string properties). Consumers should assume strings are nullable or verify data integrity at runtime.

View File

@@ -0,0 +1,47 @@
---
source_files:
- Common/DTS.CommonCore/Interface/TestModule/ITestModuleView.cs
- Common/DTS.CommonCore/Interface/TestModule/ITestModuleViewModel.cs
generated_at: "2026-04-16T12:09:58.780725+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "20d420d686cdf3c6"
---
# Documentation: DTS.Common.Interface.TestModule
## 1. Purpose
This module defines the core interface contracts for the "Test Module" component within the DTS system. It establishes a View-ViewModel abstraction (likely following an MVVM pattern) where `ITestModuleView` represents the display layer and `ITestModuleViewModel` manages the state, specifically exposing a list of loaded assemblies. This separation allows the test module logic to inspect and interact with application assemblies independent of the specific UI framework implementation.
## 2. Public Interface
### `ITestModuleView`
Defined in `DTS.Common.Interface`. Inherits from `DTS.Common.Base.IBaseView`.
* **Signature:** `public interface ITestModuleView : IBaseView`
* **Behavior:** This is a marker interface that extends `IBaseView`. It defines no additional members of its own. It serves to identify a specific view type intended for the Test Module.
### `ITestModuleViewModel`
Defined in `DTS.Common.Interface`. Inherits from `DTS.Common.Base.IBaseViewModel`.
* **Signature:** `public interface ITestModuleViewModel : IBaseViewModel`
* **Behavior:** Defines the data context and state management for the Test Module view.
* **Members:**
* `List<Assembly> AssemblyList { get; set; }`
* A property used to get or set a list of `System.Reflection.Assembly` objects. This implies the view model is responsible for holding references to specific code assemblies, likely for test discovery or execution purposes.
## 3. Invariants
* **Type Hierarchy:** Any class implementing `ITestModuleView` must also implement `IBaseView`. Any class implementing `ITestModuleViewModel` must also implement `IBaseViewModel`.
* **Nullability:** The source does not enforce null checks. `AssemblyList` may theoretically be `null` or empty depending on the implementation logic (not defined in these interfaces).
* **Mutability:** The `AssemblyList` property is mutable (has both `get` and `set`), implying the entire list reference can be swapped out at runtime.
## 4. Dependencies
* **Internal Dependencies:**
* `DTS.Common.Base`: Both interfaces inherit from base types (`IBaseView`, `IBaseViewModel`) defined in this namespace.
* **External Dependencies:**
* `System.Collections.Generic`: Required for the use of `List`.
* `System.Reflection`: Required for the use of the `Assembly` type.
* **Consumers:** Unknown from the source alone. However, concrete classes implementing these interfaces (likely a View and a ViewModel for the Test Module) and any DI container or navigation service resolving these types would depend on this module.
## 5. Gotchas
* **Empty View Interface:** `ITestModuleView` defines no members. Its utility relies entirely on the members inherited from `IBaseView`. Developers should check the definition of `IBaseView` to understand what functionality is actually available to the view.
* **Mutable Collection Property:** `AssemblyList` exposes a `List` rather than an interface (like `IList` or `IEnumerable`) or a read-only collection. This allows consumers to modify the list contents directly or replace the list reference entirely, which could lead to unexpected side effects if not managed carefully in the concrete implementation.
* **Missing Implementation Details:** The source does not indicate how `AssemblyList` is populated (e.g., via dependency injection, service locator, or manual assignment).

View File

@@ -0,0 +1,233 @@
---
source_files:
- Common/DTS.CommonCore/Interface/TestSetups/ITestSetupsView.cs
- Common/DTS.CommonCore/Interface/TestSetups/ITestSetupsViewModel.cs
- Common/DTS.CommonCore/Interface/TestSetups/ITestDASOrder.cs
- Common/DTS.CommonCore/Interface/TestSetups/IROIPeriodChannelRecord.cs
- Common/DTS.CommonCore/Interface/TestSetups/ITestSetupHardwareRecord.cs
- Common/DTS.CommonCore/Interface/TestSetups/ITestSetupROIRecord.cs
- Common/DTS.CommonCore/Interface/TestSetups/ICalculatedChannelRecord.cs
- Common/DTS.CommonCore/Interface/TestSetups/IISFFile.cs
generated_at: "2026-04-16T12:21:25.334372+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "f7166919537b0724"
---
# Documentation: DTS.Common.Interface.TestSetups
## 1. Purpose
This module defines the interface contracts for the TestSetups domain within the DTS (Data Test System) application. It provides abstractions for test configuration data including hardware setup records, Region of Interest (ROI) definitions, calculated channel configurations, and ISF (Instrument Setup File) file format handling. The module supports the MVVM architectural pattern through view/view model interfaces and establishes data contracts for database records and legacy file format interoperability.
---
## 2. Public Interface
### ITestSetupsView
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
Marker interface for test setups view. No members defined.
---
### ITestSetupsViewModel
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
Marker interface for test setups view model. No members defined.
---
### ITestDASOrder
**Namespace:** `DTS.Common.Interface.TestSetups`
Allows DAS (Data Acquisition System) ordering within a test setup.
| Property | Type | Access |
|----------|------|--------|
| `DASIndex` | `int` | get/set |
---
### IROIPeriodChannelRecord
**Namespace:** `DTS.Common.Interface.TestSetups`
Describes a record in the ROIPeriodChannels table.
| Property | Type | Access |
|----------|------|--------|
| `TestSetupROIId` | `int` | get/set |
| `ChannelName` | `string` | get/set |
---
### ITestSetupHardwareRecord
**Namespace:** `DTS.Common.Interface.TestSetups`
Describes hardware records for test setup configuration.
| Property | Type | Access |
|----------|------|--------|
| `DASId` | `int` | get/set |
| `TestSetupId` | `int` | get/set |
| `AddDAS` | `bool` | get/set |
| `SamplesPerSecond` | `int` | get/set |
| `IsClockMaster` | `bool` | get/set |
| `AntiAliasFilterRate` | `int` | get/set |
| `PTPDomainId` | `byte` | get/set |
---
### ITestSetupROIRecord
**Namespace:** `DTS.Common.Interface.TestSetups`
Describes a record in the TestSetupROIs table.
| Property | Type | Access |
|----------|------|--------|
| `TestSetupROIId` | `int` | get/set |
| `TestSetupId` | `int` | get/set |
| `Suffix` | `string` | get/set |
| `ROIStart` | `double` | get/set |
| `ROIEnd` | `double` | get/set |
| `IsEnabled` | `bool` | get/set |
| `IsDefault` | `bool` | get/set |
---
### Operations (Enum)
**Namespace:** `DTS.Common.Interface.TestSetups`
Defines calculation operations for calculated channels. Uses `EnumDescriptionTypeConverter` for localized descriptions via `DescriptionResource` attributes.
| Member | Value | Description Resource Key |
|--------|-------|--------------------------|
| `SUM` | 1 | "CalculatedChannel_Sum" |
| `AVERAGE` | 2 | "CalculatedChannel_Average" |
| `IRTRACC3D` | 3 | "CalculatedChannel_IRTRACC3D_Thorax" |
| `IRTRACC3D_ABDOMEN` | 4 | "CalculatedChannel_IRTRACC3D_Abdomen" |
| `IRTRACC3D_LOWERTHORAX` | 5 | "CalculatedChannel_IRTRACC3D_LowerThorax" |
| `Resultant` | 6 | "CalculatedChannel_Resultant" |
| `HIC` | 7 | "HIC" |
---
### ICalculatedChannelRecord
**Namespace:** `DTS.Common.Interface.TestSetups`
Describes a calculated channel record in the database.
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `Name` | `string` | get/set | Channel name |
| `TestSetupName` | `string` | get/set | Test setup name |
| `Id` | `int` | get/set | Database record ID |
| `Operation` | `Operations` | get/set | Operation to apply to input channels |
| `CalculatedValueCode` | `string` | get/set | ISO or user code for calculated channel |
| `InputChannelIds` | `string[]` | get/set | Array of channel IDs that are inputs for calculation |
| `CFCForInputChannels` | `string` | get/set | CFC (Channel Filter Class) to apply to inputs prior to calculation |
| `ChannelFilterClassForOutput` | `string` | get/set | CFC to apply to output of calculation |
| `TestSetupId` | `int` | get/set | Database ID for test setup record |
| `ViewInRealtime` | `bool` | get/set | Whether channel can be viewed in realtime |
| `ClipLength` | `int` | get/set | Clip length for calculations (e.g., max over clip) |
---
### IISFFile
**Namespace:** `DTS.Common.Interface.TestSetups`
Defines the ISF (Instrument Setup File) file structure with fixed-width records.
| Property | Type | Access | Position/Length |
|----------|------|--------|-----------------|
| `HeaderLine1` | `char[]` | get/set | 80 bytes (RECORD_LENGTH) |
| `TestSetupName` | `char[]` | get/set | 8 characters, starting at character 7 |
| `NumberOfRecords` | `short` | get | 5 characters, starting at character 15 |
| `TestType` | `char[]` | get/set | 22 characters, starting at character 20 |
| `TestDivision` | `char[]` | get/set | 30 characters, starting at character 42 |
| `TCFile` | `char[]` | get/set | 8 characters, starting at character 72 (without .TCF extension) |
| `HeaderLine2` | `char[]` | get/set | 80 bytes (currently unused) |
| `HeaderLine3` | `char[]` | get/set | 80 bytes (currently unused) |
| `Records` | `IISFSensorRecord[]` | get | Sensor records array |
| Method | Signature | Description |
|--------|-----------|-------------|
| `AddRecord` | `void AddRecord(IISFSensorRecord record)` | Adds a record and updates record count |
| `WriteToFile` | `void WriteToFile(string pathToFile)` | Writes the ISF file to disk |
| `AddSensors` | `void AddSensors(ISensorData[] sensors)` | Adds sensors to the file |
---
### IISFSensorRecord
**Namespace:** `DTS.Common.Interface.TestSetups`
Defines a sensor record within an ISF file (4 records of 80 bytes each).
| Property | Type | Position/Length |
|----------|------|-----------------|
| `Record1` | `char[]` | 80 bytes (RECORD_LENGTH) |
| `Tag` | `char[]` | 2 characters, starting at character 75 |
| `DataChannelNumber` | `char[]` | 5 characters, starting at character 7 |
| `UserIdSensorIDIsNotSpecified` | `bool` | 1 character, starting at character 15 |
| `CapacityCharacters` | `char[]` | 11 characters, starting at character 19 |
| `SerialNumber` | `char[]` | 12 characters, starting at character 30 |
| `Sensitivity` | `char[]` | 11 characters, starting at character 42 (Sensitivity/1000 V, or c0 for polynomial) |
| `BridgeResistance` | `char[]` | 11 characters, starting at character 53 |
| `Record2` | `char[]` | 80 bytes (RECORD_LENGTH) |
| `EngineeringUnits` | `char[]` | 12 characters, starting at character 7 of record 2 |
| `C1` | `char[]` | 11 characters, starting at character 20 of record 2 |
| `EID` | `char[]` | 17 characters, starting at character 31 of record 2 |
| `Unknown1` | `char[]` | 4 characters, starting at character 49 of record 2 |
| `Unknown2` | `char[]` | 2 characters, starting at character 53 of record 2 |
| `FireDelay` | `char[]` | 11 characters, starting at character 55 (TOM only, sensor type TI) |
| `TOMConfigurationName` | `char[]` | 8 characters, starting at character 66 |
| `Record3` | `char[]` | 80 bytes (RECORD_LENGTH) |
| `CommentPart1` | `char[]` | 15 characters, starting at character 14 of record 3 |
| `CommentPart2` | `char[]` | 40 characters, starting at character 33 of record 3 |
| `Record4` | `char[]` | 80 bytes (RECORD_LENGTH) |
| `CommentPart3` | `char[]` | 15 characters, starting at character 12 of record 4 |
| `SensorType` | `char[]` | 20 characters, starting at character 30 of record 4 (checked for N/O or N/C for digital inputs) |
| `C2` | `char[]` | 11 characters, starting at character 50 of record 4 |
| `C3` | `char[]` | 11 characters, starting at character 61 of record 4 |
| Method | Signature |
|--------|-----------|
| `SetDataChannelNumber` | `void SetDataChannelNumber(short value)` |
| `SetCapacity` | `void SetCapacity(double capacity)` |
| `GetCapacity` | `double GetCapacity()` |
| `SetSensitivity` | `void SetSensitivity(double sensitivity)` |
| `GetSensitivity` | `double GetSensitivity()` |
| `SetBridgeResistance` | `void SetBridgeResistance(double resistance)` |
| `SetC1` | `void SetC1(double c1)` |
| `GetC1` | `double GetC1()` |
| `SetSensorComment` | `void SetSensorComment(string s)` |
| `SetC2` | `void SetC2(double c2)` |
| `SetC3` | `void SetC3(double c3)` |
| `Write` | `void Write(System.IO.BinaryWriter writer)` |
| `SetSensor` | `void SetSensor(ISensorData sensor)` |
---
### ConstantsAndEnums (Abstract Class)
**Namespace:** `DTS.Common.Interface.TestSetups`
| Constant | Value | Description |
|----------|-------|-------------|
| `RECORD_LENGTH` | 80 | Fixed record length for ISF files |
**ISFKnownChannelTypes Enum:**
| Member | Notes |
|--------|-------|
| `VS` | - |
| `VU` | - |
| `SB` | - |
| `TI` | Not analog (TOM) |
| `TC` | Not analog (TOM) |
| `CT` | Digital |
| `XP` | - |
| `P4` | - |
| `VF` | - |
| `NB` | - |

View File

@@ -0,0 +1,40 @@
---
source_files:
- Common/DTS.CommonCore/Interface/ViewData/IViewDataView.cs
- Common/DTS.CommonCore/Interface/ViewData/IViewDataViewModel.cs
generated_at: "2026-04-16T12:11:08.439419+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "820bab209e8d1b8f"
---
# Documentation: ViewData Interfaces
## 1. Purpose
This module defines two marker interfaces, `IViewDataView` and `IViewDataViewModel`, within the `DTS.Common.Interface` namespace. It exists to establish a specific contract for "ViewData" components within the system, deriving from base architectural components (`IBaseView` and `IBaseViewModel`). This allows for type discrimination of specific views and view models without enforcing additional members beyond those defined in the base interfaces.
## 2. Public Interface
### `IViewDataView`
* **Signature:** `public interface IViewDataView : IBaseView`
* **Namespace:** `DTS.Common.Interface`
* **Description:** An empty interface that extends `IBaseView`. It acts as a marker for view components associated with ViewData logic. It defines no additional methods or properties of its own.
### `IViewDataViewModel`
* **Signature:** `public interface IViewDataViewModel : IBaseViewModel`
* **Namespace:** `DTS.Common.Interface`
* **Description:** An empty interface that extends `IBaseViewModel`. It acts as a marker for view model components associated with ViewData logic. It defines no additional methods or properties of its own.
## 3. Invariants
* **Inheritance Hierarchy:** Any class implementing `IViewDataView` must also implement `IBaseView` (defined in `DTS.Common.Base`).
* **Inheritance Hierarchy:** Any class implementing `IViewDataViewModel` must also implement `IBaseViewModel` (defined in `DTS.Common.Base`).
* **Member Contract:** Since both interfaces are empty (contain no members), the behavioral contract is entirely defined by the base interfaces they inherit from.
## 4. Dependencies
* **Internal Dependencies:**
* `DTS.Common.Base`: Both source files import this namespace to access `IBaseView` and `IBaseViewModel`.
* **Consumers:** Unknown from source alone. It is expected that concrete View and ViewModel classes within the codebase will implement these interfaces to participate in ViewData-specific workflows.
## 5. Gotchas
* **Marker Interfaces:** Both `IViewDataView` and `IViewDataViewModel` are marker interfaces; they define no members. Developers implementing these interfaces should refer to `IBaseView` and `IBaseViewModel` to satisfy the actual structural requirements.
* **Missing Context:** The specific functionality that distinguishes a "ViewData" view/viewmodel from a standard one is not defined in these files. The distinction is purely nominal/type-based at this level.

View File

@@ -0,0 +1,173 @@
---
source_files:
- Common/DTS.CommonCore/Interface/Viewer/IMainView.cs
- Common/DTS.CommonCore/Interface/Viewer/IMenuView.cs
- Common/DTS.CommonCore/Interface/Viewer/IFilterView.cs
- Common/DTS.CommonCore/Interface/Viewer/INavigationView.cs
- Common/DTS.CommonCore/Interface/Viewer/ITestDefinitionListView.cs
- Common/DTS.CommonCore/Interface/Viewer/IMenuViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/INavigationViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/IFilterViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/ITestDefinitionListViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/IMainViewModel.cs
generated_at: "2026-04-16T12:16:35.672388+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "d625778ef337fcd6"
---
# Documentation: DTS.Common.Interface Viewer Interfaces
## 1. Purpose
This module defines a set of view and view model interfaces for the DTS application's viewer components, implementing a Model-View-ViewModel (MVVM) architecture. These interfaces establish contracts for UI composition using a region-based pattern, where views are injected into named context regions (navigation, graphs, tests, legends, etc.). The module serves as the abstraction layer between concrete view implementations and the presentation logic, enabling loose coupling and testability of the viewer subsystem.
---
## 2. Public Interface
### View Interfaces
All view interfaces inherit from `IBaseView` (defined in `DTS.Common.Base`) and currently declare no additional members.
| Interface | File | Description |
|-----------|------|-------------|
| `IMainView` | `IMainView.cs` | Marker interface for the main view. |
| `IMenuView` | `IMenuView.cs` | Marker interface for menu view components. |
| `IFilterView` | `IFilterView.cs` | Marker interface for filter view components. |
| `INavigationView` | `INavigationView.cs` | Marker interface for navigation view components. |
| `ITestSummaryListView` | `ITestDefinitionListView.cs` | Marker interface for test summary list display. |
### ViewModel Interfaces
#### `IMenuViewModel` (`IMenuViewModel.cs`)
```csharp
public interface IMenuViewModel : IBaseViewModel
{
IMenuView View { get; }
}
```
Provides access to the associated `IMenuView` instance.
---
#### `INavigationViewModel` (`INavigationViewModel.cs`)
```csharp
public interface INavigationViewModel : IBaseViewModel
{
INavigationView NavigationView { get; }
}
```
Provides access to the associated `INavigationView` instance.
---
#### `IFilterViewModel` (`IFilterViewModel.cs`)
```csharp
public interface IFilterViewModel : IBaseViewModel
{
IBaseView View { get; }
IBaseViewModel Parent { get; }
object ContextSearchRegion { get; set; }
}
```
Manages filter/search functionality with:
- `View`: The associated view (typed as `IBaseView`, not `IFilterView`)
- `Parent`: Reference to the parent view model in the hierarchy
- `ContextSearchRegion`: A region context for search-related UI composition
---
#### `ITestSummaryListViewModel` (`ITestDefinitionListViewModel.cs`)
```csharp
public interface ITestSummaryListViewModel : IBaseViewModel
{
ITestSummaryListView TestSummaryListView { get; }
ObservableCollection<ITestSummary> TestSummaryList { get; set; }
List<ITestSummary> SelectedTestSummaryList { get; set; }
void PublishSelectedTestSummaryList();
}
```
Manages a collection of test summaries with:
- `TestSummaryListView`: The associated view
- `TestSummaryList`: Bindable collection of `ITestSummary` objects
- `SelectedTestSummaryList`: Tracks user-selected test summaries
- `PublishSelectedTestSummaryList()`: Notifies subscribers of selection changes
---
#### `IMainViewModel` (`IMainViewModel.cs`)
```csharp
public interface IMainViewModel : IBaseViewModel
{
IBaseView View { get; }
object ContextNavigationRegion { get; set; }
object ContextGraphRegion { get; set; }
object ContextTestsRegion { get; set; }
object ContextGraphsRegion { get; set; }
object ContextLegendRegion { get; set; }
object ContextDiagRegion { get; set; }
object ContextStatsRegion { get; set; }
object ContextCursorRegion { get; set; }
object ContextPropertyRegion { get; set; }
List<FrameworkElement> GetRegions();
}
```
The primary shell view model with:
- `View`: The main view instance
- Nine region context properties for UI composition (all typed as `object`)
- `GetRegions()`: Returns a list of all `FrameworkElement` regions
---
## 3. Invariants
1. **Inheritance Hierarchy**: All view interfaces must inherit from `IBaseView`. All view model interfaces must inherit from `IBaseViewModel`.
2. **Region Context Types**: All region context properties in `IMainViewModel` and `IFilterViewModel` are typed as `object`, suggesting late binding or dynamic region assignment.
3. **Observable Collection Requirement**: `TestSummaryList` uses `ObservableCollection<ITestSummary>`, implying it must support property change notification for UI binding.
4. **WPF Dependency**: `IMainViewModel.GetRegions()` returns `List<FrameworkElement>`, indicating a hard dependency on WPF presentation elements.
---
## 4. Dependencies
### External Dependencies (inferred from imports)
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces
- `DTS.Common.Interface.TestDefinition` — Provides `ITestSummary` interface
- `System.Collections.Generic` — For `List<T>`
- `System.Collections.ObjectModel` — For `ObservableCollection<T>`
- `System.Windows` — For `FrameworkElement` (WPF)
### Consumers
Unknown from source alone. These interfaces are likely consumed by:
- Concrete view implementations (WinForms/WPF user controls)
- Concrete view model classes
- DI container registrations
- Region navigation services
---
## 5. Gotchas
1. **File/Interface Name Mismatch**:
- File `ITestDefinitionListView.cs` contains interface `ITestSummaryListView`
- File `ITestDefinitionListViewModel.cs` contains interface `ITestSummaryListViewModel`
This naming inconsistency may cause confusion when locating types. The terms "TestDefinition" and "TestSummary" appear to be used interchangeably, which may indicate a historical rename or unclear domain terminology.
2. **Inconsistent View Property Types**:
- `IMenuViewModel.View` returns `IMenuView` (specific type)
- `INavigationViewModel.NavigationView` returns `INavigationView` (specific type)
- `IFilterViewModel.View` returns `IBaseView` (base type, not `IFilterView`)
- `IMainViewModel.View` returns `IBaseView` (base type, not `IMainView`)
This inconsistency suggests either incomplete refactoring or intentional abstraction at certain levels.
3. **Suppressed Namespace Check**: `IFilterViewModel.cs` contains `// ReSharper disable CheckNamespace`, indicating possible namespace misalignment that was silenced rather than fixed.
4. **Region Naming Inconsistency**: `IMainViewModel` has both `ContextGraphRegion` (singular) and `ContextGraphsRegion` (plural). The semantic difference between these is unclear from source alone.

View File

@@ -0,0 +1,48 @@
---
source_files:
- Common/DTS.CommonCore/Interface/_GenericModule/IGenericModuleView.cs
- Common/DTS.CommonCore/Interface/_GenericModule/IGenericModuleViewModel.cs
generated_at: "2026-04-16T12:17:41.765515+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "857aa9f92afca967"
---
# Documentation: DTS.Common.Interface (Generic Module)
## 1. Purpose
This module defines the core abstraction layer for "Generic Modules" within the system, adhering to a View/ViewModel separation pattern. It provides two marker interfaces, `IGenericModuleView` and `IGenericModuleViewModel`, which establish a standard contract for module implementations. These interfaces ensure that generic modules derive from the application's foundational base types (`IBaseView` and `IBaseViewModel`), enabling polymorphic handling and consistent architecture across the codebase.
## 2. Public Interface
### `IGenericModuleView`
* **Namespace:** `DTS.Common.Interface`
* **Inheritance:** `IBaseView`
* **Signature:**
```csharp
public interface IGenericModuleView : IBaseView { }
```
* **Description:** A marker interface intended for View components within a Generic Module. It inherits from `IBaseView` but defines no additional members.
### `IGenericModuleViewModel`
* **Namespace:** `DTS.Common.Interface`
* **Inheritance:** `IBaseViewModel`
* **Signature:**
```csharp
public interface IGenericModuleViewModel : IBaseViewModel { }
```
* **Description:** A marker interface intended for ViewModel components within a Generic Module. It inherits from `IBaseViewModel` but defines no additional members.
## 3. Invariants
* **Type Hierarchy:** Any class implementing `IGenericModuleView` must also implement `IBaseView` (defined in `DTS.Common.Base`).
* **Type Hierarchy:** Any class implementing `IGenericModuleViewModel` must also implement `IBaseViewModel` (defined in `DTS.Common.Base`).
* **Behavioral Contract:** Since neither interface defines methods or properties, the behavioral contract is entirely defined by the parent interfaces (`IBaseView` and `IBaseViewModel`).
## 4. Dependencies
* **Internal Dependencies:**
* `DTS.Common.Base`: Both source files import this namespace to access `IBaseView` and `IBaseViewModel`.
* **Consumers:** Unknown from the source alone. These interfaces are likely consumed by classes implementing specific module views and viewmodels, or by navigation/dependency injection infrastructure that resolves generic module types.
## 5. Gotchas
* **Marker Interfaces:** Both `IGenericModuleView` and `IGenericModuleViewModel` are empty "marker" interfaces. They do not expose any specific functionality (properties, methods, or events) themselves. Developers must inspect `IBaseView` and `IBaseViewModel` to understand the actual API surface area required for implementation.
* **Usage Ambiguity:** The source does not specify what constitutes a "Generic Module" versus a standard module. The distinction is likely defined by convention or usage in other parts of the codebase (e.g., specific registration logic or base classes).

View File

@@ -0,0 +1,66 @@
---
source_files:
- Common/DTS.CommonCore/ModuleCatalog/AggregateModuleCatalog.cs
generated_at: "2026-04-16T12:02:00.610314+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "6c5b3cbd6c5102fe"
---
# Documentation: AggregateModuleCatalog
## 1. Purpose
The `AggregateModuleCatalog` class provides a composite implementation of the Prism `IModuleCatalog` interface. It allows the application to combine multiple distinct module catalogs (e.g., a `DirectoryModuleCatalog`, a `ModuleCatalog`, etc.) into a single logical unit. This enables modules to be discovered and loaded from heterogeneous sources simultaneously while presenting a unified interface to the module management system.
## 2. Public Interface
* **`AggregateModuleCatalog()`**
* **Signature:** `public AggregateModuleCatalog()`
* **Behavior:** Initializes a new instance of the class. It pre-populates the internal list of catalogs with a default instance of `ModuleCatalog` (located at index 0).
* **`AddCatalog(IModuleCatalog catalog)`**
* **Signature:** `public void AddCatalog(IModuleCatalog catalog)`
* **Behavior:** Adds a specific `IModuleCatalog` instance to the aggregate collection.
* **Validation:** Throws `ArgumentNullException` if the provided `catalog` is null.
* **`Modules`**
* **Signature:** `public IEnumerable<ModuleInfo> Modules { get; }`
* **Behavior:** Aggregates and returns the `ModuleInfo` objects from all catalogs currently held in the collection.
* **`GetDependentModules(ModuleInfo moduleInfo)`**
* **Signature:** `public IEnumerable<ModuleInfo> GetDependentModules(ModuleInfo moduleInfo)`
* **Behavior:** Locates the specific catalog that contains the provided `moduleInfo` and delegates the call to that catalog's `GetDependentModules` method.
* **`CompleteListWithDependencies(IEnumerable<ModuleInfo> modules)`**
* **Signature:** `public IEnumerable<ModuleInfo> CompleteListWithDependencies(IEnumerable<ModuleInfo> modules)`
* **Behavior:** Groups the provided modules by their owning catalog and calls `CompleteListWithDependencies` on each respective catalog, returning the combined result.
* **`Initialize()`**
* **Signature:** `public void Initialize()`
* **Behavior:** Iterates through all catalogs in the collection and calls their `Initialize()` method.
* **`AddModule(ModuleInfo moduleInfo)`**
* **Signature:** `public void AddModule(ModuleInfo moduleInfo)`
* **Behavior:** Adds the provided `moduleInfo` specifically to the first catalog in the internal list (`_catalogs[0]`), which is the default `ModuleCatalog` created in the constructor.
## 3. Invariants
* **Non-Empty Catalog List:** The internal `_catalogs` list is never empty. It is initialized with a default `ModuleCatalog` in the constructor.
* **Module Ownership:** A `ModuleInfo` instance must exist in exactly one of the aggregated catalogs for dependency resolution to succeed. The methods `GetDependentModules` and `CompleteListWithDependencies` rely on `_catalogs.Single(...)` logic to find the owner; if a module appears in multiple catalogs or no catalogs, the `Single` operation will throw an `InvalidOperationException`.
* **AddModule Target:** The `AddModule` method always targets the first catalog in the collection (index 0).
## 4. Dependencies
* **External Dependencies:**
* `Microsoft.Practices.Prism.Modularity`: The class implements `IModuleCatalog` and utilizes types `ModuleInfo` and `ModuleCatalog`.
* **Standard Libraries:**
* `System`
* `System.Collections.Generic`
* `System.Linq`
## 5. Gotchas
* **Hardcoded AddModule Behavior:** Calling `AddModule` does not add the module to the "aggregate" generally; it specifically adds it to the default `ModuleCatalog` stored at `_catalogs[0]`. If a developer adds a new catalog via `AddCatalog` and expects `AddModule` to interact with that new catalog, they will be mistaken.
* **Strict Uniqueness Constraint:** The dependency resolution methods use `System.Linq.Single` to locate the catalog owning a specific module. If the same `ModuleInfo` instance (or equivalent identity) is added to multiple sub-catalogs, the application will crash during dependency resolution because `Single` expects exactly one match.
* **Commented-Out Validation Logic:** The `AddCatalog` method contains a large block of commented-out code attempting to validate `DirectoryModuleCatalog` paths. This suggests unfinished validation logic or technical debt regarding duplicate directory paths that was abandoned.
* **Exception Message Typo:** In `AddCatalog`, the `ArgumentNullException` is instantiated with a string literal `$"catalog"` using string interpolation unnecessarily. While functional, it deviates from standard practices (usually `nameof(catalog)`).

View File

@@ -0,0 +1,80 @@
---
source_files:
- Common/DTS.CommonCore/Properties/AssemblyInfo.cs
- Common/DTS.CommonCore/Properties/Settings.Designer.cs
- Common/DTS.CommonCore/Properties/Annotations.cs
generated_at: "2026-04-16T12:03:42.508191+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e93e9dbcf99f35a2"
---
# Documentation: DTS.CommonCore Properties
## 1. Purpose
This module provides assembly-level metadata, application configuration management, and static analysis annotations for the `DTS.CommonCore` library. It defines the assembly identity (version 1.0.0.0, title "Common"), exposes a strongly-typed settings accessor for file paths (specifically `TilesLocation`), and embeds a comprehensive suite of JetBrains ReSharper annotations within the `DTS.Common.Annotations` namespace to support nullability checks, method contracts, and MVC/Razor inspections during development.
## 2. Public Interface
### Class: `DTS.Common.Properties.Settings`
Defined in `Settings.Designer.cs`. This is an internal, sealed class inheriting from `System.Configuration.ApplicationSettingsBase`.
* **`static Settings Default { get; }`**
* Returns the singleton instance of the settings class, synchronized for thread safety.
* **`string TilesLocation { get; }`**
* An application-scoped setting representing a directory path.
* Default Value: `"Assets\\Tiles\\"`
### Namespace: `DTS.Common.Annotations`
Defined in `Annotations.cs`. Contains attributes used for static code analysis. Key classes include:
**Nullability & State:**
* `CanBeNullAttribute`: Indicates an element value can be null.
* `NotNullAttribute`: Indicates an element value can never be null.
* `ItemNotNullAttribute`: Indicates collection items/Task results are not null.
* `ItemCanBeNullAttribute`: Indicates collection items/Task results can be null.
* `PureAttribute`: Indicates a method has no observable side effects.
**Contracts & Logic:**
* `ContractAnnotationAttribute`: Describes input/output dependencies (e.g., `"null => null"`).
* `AssertionMethodAttribute`: Marks a method as an assertion that halts flow.
* `AssertionConditionAttribute`: Marks a parameter as the condition for an assertion.
* `TerminatesProgramAttribute`: (Obsolete) Indicates method termination.
**Usage & Visibility:**
* `UsedImplicitlyAttribute`: Suppresses "unused" warnings for symbols accessed via reflection.
* `MeansImplicitUseAttribute`: Applied to attributes to suppress "unused" warnings on targets.
* `PublicAPIAttribute`: Marks API as publicly available and treated as used.
* `InstantHandleAttribute`: Indicates a parameter (delegate/enumerable) is fully handled during the method execution.
**MVC & Razor Specifics:**
* `AspMvcActionAttribute`, `AspMvcControllerAttribute`, `AspMvcViewAttribute`: Hints for MVC routing parameters.
* `RazorSectionAttribute`, `RazorImportNamespaceAttribute`: Hints for Razor syntax.
**Templates:**
* `SourceTemplateAttribute`: Marks an extension method as a source template for code completion.
* `MacroAttribute`: Defines macros for source template parameters.
### Assembly Metadata (`AssemblyInfo.cs`)
* **Title:** "Common"
* **Version:** "1.0.0.0"
* **GUID:** `d16201c7-478c-4b92-ba6e-a0d39fd5f081`
* **ComVisible:** `false`
## 3. Invariants
* **Thread Safety:** The `Settings.Default` property is guaranteed to be thread-safe due to the `Synchronized` wrapper used in its initialization.
* **Scope:** The `Settings` class is defined as `internal sealed`, restricting access to within the `DTS.CommonCore` assembly.
* **Read-Only Settings:** The `TilesLocation` property is application-scoped (`ApplicationScopedSettingAttribute`), meaning it is read-only at runtime and cannot be modified by user code.
* **Analysis Only:** Attributes defined in `Annotations.cs` do not affect runtime behavior; they are strictly for static analysis tools (specifically ReSharper/Rider).
## 4. Dependencies
* **System.Configuration:** Required by `Settings.Designer.cs` for `ApplicationSettingsBase`.
* **System.Reflection:** Required by `AssemblyInfo.cs` for assembly attributes.
* **System.Runtime.CompilerServices:** Required for `CompilerGeneratedAttribute` and `InternalsVisibleTo` logic.
* **System.Runtime.InteropServices:** Required for `ComVisible` and `Guid` attributes.
## 5. Gotchas
* **Namespace Discrepancy:** The assembly title is "Common", the file path suggests "DTS.CommonCore", but the settings reside in the `DTS.Common.Properties` namespace. The annotations reside in `DTS.Common.Annotations`. Developers should verify the correct namespace when referencing these components.
* **Hardcoded Path Separator:** The `TilesLocation` setting uses Windows-style backslashes (`"Assets\\Tiles\\"`). This may cause cross-platform compatibility issues if the application is run on non-Windows systems without path normalization logic elsewhere in the codebase.
* **Auto-Generated Code:** `Settings.Designer.cs` contains a header warning that manual changes will be lost if the code is regenerated. Settings should be managed via the Visual Studio settings designer or the `app.config` file.
* **Company Metadata:** The `AssemblyInfo.cs` lists `AssemblyCompany` as "Microsoft". This appears to be template boilerplate and may not reflect the actual ownership of the proprietary codebase.

View File

@@ -0,0 +1,114 @@
---
source_files:
- Common/DTS.CommonCore/RegionManager/ViewDefinition.cs
- Common/DTS.CommonCore/RegionManager/IDataProRegionManager.cs
- Common/DTS.CommonCore/RegionManager/IDTSRegionManager.cs
- Common/DTS.CommonCore/RegionManager/IDTSViewRegionManager.cs
- Common/DTS.CommonCore/RegionManager/RegionManagerExtensions.cs
- Common/DTS.CommonCore/RegionManager/DTSRegionManager.cs
- Common/DTS.CommonCore/RegionManager/DTSViewRegionManager.cs
- Common/DTS.CommonCore/RegionManager/DataProRegionManager.cs
generated_at: "2026-04-16T12:08:29.432638+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "716052479006d994"
---
# Documentation: DTS.Common.RegionManager
## 1. Purpose
This module provides an abstraction layer over the Prism `IRegionManager` to manage the lifecycle of views in a WPF application. It facilitates the registration, activation, removal, and refreshing of views within specific UI regions, while enforcing a strict Model-View-ViewModel (MVVM) pattern. The module bridges the Unity dependency injection container with Prism's region navigation, ensuring that views and view models are resolved, bound, and initialized consistently.
## 2. Public Interface
### Classes
#### `ViewDefinition`
A definition class used to describe a view to be added to a region.
* **`ViewDefinition(string regionName, Type viewInterfaceType, Type viewModelInterfaceType)`**
* Constructor that initializes the definition.
* `regionName`: The name of the region where the view will be displayed.
* `viewInterfaceType`: The interface type of the View (used for resolution and activation checks).
* `viewModelInterfaceType`: The interface type of the ViewModel (used for resolution).
* **`string RegionName { get; private set; }`**
* Gets the region name.
* **`Type ViewInterfaceType { get; private set; }`**
* Gets the View's interface type.
* **`Type ViewModelInterfaceType { get; private set; }`**
* Gets the ViewModel's interface type.
#### `RegionManagerExtensions`
A static class providing extension methods for `IRegionManager`.
* **`void ClearRegion(this IRegionManager regionManager, string regionName)`**
* Removes all views from the specified region.
* **`IList<object> GetViews(this IRegionManager regionManager, string regionName, Type interfaceForView)`**
* Retrieves a list of views from a region that match a specific interface type.
* **`object GetView(this IRegionManager regionManager, string regionName, Type interfaceForView)`**
* Retrieves a single view from a region matching a specific interface type.
* **`bool ActivateViewIfExists(this IRegionManager regionManager, string regionName, Type viewType)`**
* Activates a view if it exists in the region. Returns `true` if found and activated; otherwise `false`.
* **`void DeactivateViews(this IRegionManager regionManager, string regionName)`**
* Deactivates all currently active views in the specified region.
* **`void RemoveViews(this IRegionManager regionManager, string regionName)`**
* Removes all active views from the specified region.
* **`void ActivateLastView(this IRegionManager regionManager, string regionName)`**
* Activates the last view in the region (prioritizing active views, falling back to all views).
* **`void AddViewToRegion(this IRegionManager regionManager, string regionName, object view)`**
* Adds a view to the region without activating it.
* **`void AddViewToRegionActivate(this IRegionManager regionManager, string regionName, object view)`**
* Adds a view to the region and immediately activates it.
* **`void RemoveView(this IRegionManager regionManager, object view)`**
* Removes a view from *all* regions where it is registered.
* **`void RemoveView(this IRegionManager regionManager, string regionName, object view)`**
* Deactivates and removes a view from a specific region.
### Interfaces & Implementations
The module defines three distinct interfaces (`IDTSRegionManager`, `IDTSViewRegionManager`, `IDataProRegionManager`) with identical public members. They are implemented by `DTSRegionManager`, `DTSViewRegionManager`, and `DataProRegionManager` respectively.
**Common Public Members (inherited from `IRegionManager`):**
* **`void AddView(ViewDefinition viewDefinition, object parameter)`**
* Adds a view to the region. Calls `Initialize(parameter)` on the ViewModel.
* **`void AddView(ViewDefinition viewDefinition, object parameter, bool allowMultipleInstances)`**
* Adds a view to the region.
* **`Task AddViewAsync(ViewDefinition viewDefinition, object parameter)`**
* Asynchronously adds a view.
* **`Task AddViewAsync(ViewDefinition viewDefinition, object parameter, bool allowMultipleInstances)`**
* Asynchronously adds a view. Checks for existing instances unless `allowMultipleInstances` is true.
* **`void RemoveView(IBaseViewModel viewModel)`**
* Removes the view associated with the given ViewModel from all regions. Calls `Cleanup()` on the ViewModel.
* **`void RemoveViewByRegionName(string regionName)`**
* Clears all views from the specified region.
* **`void RefreshView(Type interfaceForView, object parameter)`**
* Finds a view by interface type, calls `Cleanup()` on its ViewModel, and re-initializes it with the parameter.
* **`Task RefreshViewAsync(Type interfaceForView, object parameter)`**
* Asynchronously refreshes the view.
## 3. Invariants
1. **Type Resolution:** All `ViewDefinition` instances must provide interface types (`ViewInterfaceType`, `ViewModelInterfaceType`) that are registered in the `IUnityContainer`. The managers cast resolved objects to `IBaseView` and `IBaseViewModel`.
2. **DataContext Binding:** When a view is added, the `DataContext` of the View is explicitly set to the resolved ViewModel instance.
3. **Region Existence:** The `regionName` provided in `ViewDefinition` must correspond to a region already registered in the Prism `RegionManager`.
4. **Shell Context:** When a view is added to `RegionNames.MainRegion`, the implementation sets `shell.ContextMainRegion` (or `ContextNavigationRegion` in `DataProRegionManager`) to the resolved view instance.
5. **View Lifecycle:** `RemoveView` and `RefreshView` rely on the View implementing `IBaseView` and the ViewModel implementing `IBaseViewModel` to execute lifecycle methods (`Cleanup`, `Initialize`, `Activated`).
## 4. Dependencies
**Internal Dependencies (DTS.Common):**
* `DTS.Common.Base`: Uses `IBaseView`, `IBaseViewModel`.
* `DTS.Common.Events`: Uses `RaiseNotification` event and `NotificationContentEventArgs` for error handling.
* `DTS.Common.Interface`: Uses `IShellViewModel`.
* `DTS.Common.Classes`: Uses `Utility` for error message formatting.
**External Dependencies:**
* `Microsoft.Practices.Prism.Regions`: Core region management (`IRegionManager`, `IRegion`, `IRegionCollection`).
* `Microsoft.Practices.Unity`: Dependency injection (`IUnityContainer`).
* `Microsoft.Practices.Prism.Events`: Event aggregation (`IEventAggregator`).
* `System.Windows`: Implied dependency for UI elements (Views).
## 5. Gotchas
1. **Uninitialized `Regions` Property:** The classes `DTSRegionManager`, `DTSViewRegionManager`, and `DataProRegionManager` implement `IRegionManager`. The source explicitly defines a `

View File

@@ -0,0 +1,76 @@
---
source_files:
- Common/DTS.CommonCore/Resources/ResourceNames.cs
- Common/DTS.CommonCore/Resources/MainTabControlResource.xaml.cs
generated_at: "2026-04-16T11:58:21.847018+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "37911183d8b2e17a"
---
# Documentation: Resources Module
## 1. Purpose
This module provides UI-related resource definitions for the application. It consists of a constants class for animation storyboard naming conventions and a code-behind partial class that centralizes tooltip event handling by bridging WPF UI events to the Prism event aggregation system. The module exists to standardize transition animation names and decouple tooltip handling logic from individual UI components.
---
## 2. Public Interface
### `ResourceNames` (class)
**Namespace:** `Athena.Resources`
**Accessibility:** `internal static`
| Member | Type | Value |
|--------|------|-------|
| `EntryStoryboardName` | `const string` | `"InTransition"` |
| `ExitStoryboardName` | `const string` | `"OutTransition"` |
These constants define the expected names for entry and exit transition storyboards used in UI animations.
---
### `MainTabControlResource` (class)
**Namespace:** `DTS.Common.Resources`
**Accessibility:** `public partial`
#### `ToolTipEventHandler`
```csharp
public void ToolTipEventHandler(object sender, System.Windows.Controls.ToolTipEventArgs e)
```
Handles WPF `ToolTip` events by:
1. Marking the event as handled (`e.Handled = true`)
2. Retrieving an `IEventAggregator` instance via `ServiceLocator.Current.GetInstance<IEventAggregator>()`
3. Publishing a `HelpTextEvent` with a `HelpTextEventArg` payload containing the original `sender` and `ToolTipEventArgs`
---
## 3. Invariants
- **Storyboard naming convention:** All entry transition storyboards must be named `"InTransition"` and exit transition storyboards must be named `"OutTransition"` as defined by `ResourceNames`.
- **Event handling:** `ToolTipEventHandler` always marks the `ToolTipEventArgs` as handled before publishing the event.
- **Service locator availability:** `ToolTipEventHandler` assumes `ServiceLocator.Current` is properly configured and can resolve `IEventAggregator`. A null `ServiceLocator.Current` or failure to resolve `IEventAggregator` will throw an exception.
---
## 4. Dependencies
### This module depends on:
- `System.Windows.Controls` — for `ToolTipEventArgs` and WPF control types
- `DTS.Common.Events` — for `HelpTextEvent` and `HelpTextEventArg`
- `Microsoft.Practices.ServiceLocation` — for `ServiceLocator`
- `Microsoft.Practices.Prism.Events` — for `IEventAggregator`
### Consumers:
- The `ResourceNames` class is `internal`, so only code within the same assembly can reference it.
- `MainTabControlResource` is `public partial`, suggesting it is paired with a XAML resource file (`MainTabControlResource.xaml`) that likely defines styles or control templates referencing `ToolTipEventHandler`.
---
## 5. Gotchas
- **Namespace inconsistency:** `ResourceNames` resides in `Athena.Resources` while `MainTabControlResource` is in `DTS.Common.Resources`. This may indicate the files originated from different projects or a historical renaming effort. The relationship between these namespaces is unclear from source alone.
- **Service Locator anti-pattern:** `ToolTipEventHandler` uses the Service Locator pattern (`ServiceLocator.Current.GetInstance<T>()`), which can make testing and dependency tracking more difficult compared to constructor injection.
- **Silent failure risk:** If `ServiceLocator.Current` is not initialized (e.g., during unit tests or before the container is set up), the handler will throw. There is no defensive null check.
- **Partial class without visible XAML:** The `partial` modifier on `MainTabControlResource` indicates a code-behind file for a XAML resource, but the associated `.xaml` file is not provided, so the full context of how `ToolTipEventHandler` is wired is unknown.

View File

@@ -0,0 +1,131 @@
---
source_files:
- Common/DTS.CommonCore/RibbonControl/RibbonControlSelectionChanged.cs
- Common/DTS.CommonCore/RibbonControl/RibbonControlOperation.cs
- Common/DTS.CommonCore/RibbonControl/RibbonControlSelectionEventArgs.cs
- Common/DTS.CommonCore/RibbonControl/RibbonControlSelectionChangeBehavior.cs
- Common/DTS.CommonCore/RibbonControl/RibbonRegionAdapter.cs
generated_at: "2026-04-16T12:05:40.425898+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c0e1c8bd7f1a18f4"
---
# RibbonControl Module Documentation
## 1. Purpose
This module provides Prism region adapter infrastructure for integrating WPF `Ribbon` controls with the Prism navigation and region system. It enables dynamic addition and removal of `RibbonTab` and `RibbonApplicationMenu` items, synchronizes tab selection between document/workspace views and the Ribbon, and publishes selection change events through the Prism event aggregator for loose coupling between UI components.
---
## 2. Public Interface
### `RibbonControlSelectionChanged`
**Kind:** Event class
**Signature:** `public class RibbonControlSelectionChanged : CompositePresentationEvent<RibbonControlSelectionEventArgs>`
**Behavior:** A Prism event used to broadcast when a Ribbon's selection has changed. Carries `RibbonControlSelectionEventArgs` payload indicating whether an item was added or removed.
---
### `RibbonControlOperation`
**Kind:** Enumeration
**Values:**
- `AddedItem` — Indicates an item was added to the control
- `RemovedItem` — Indicates an item was removed from the control
**Behavior:** Used within `RibbonControlSelectionEventArgs` to describe the type of selection operation.
---
### `RibbonControlSelectionEventArgs`
**Kind:** Event arguments class
**Constructor:** `public RibbonControlSelectionEventArgs(RibbonControlOperation operation, object item)`
**Properties:**
| Property | Type | Access |
|----------|------|--------|
| `Operation` | `RibbonControlOperation` | `get;` (set via constructor) |
| `Item` | `object` | `get;` (set via constructor) |
**Behavior:** Immutable payload carrying the operation type and the affected item for ribbon selection changes.
---
### `RibbonControlSelectionChangeBehavior`
**Kind:** WPF Behavior (`System.Windows.Interactivity.Behavior<Ribbon>`)
**Attached Property:** `public static readonly DependencyProperty TargetRibbonProperty`
**Properties:**
| Property | Type | Access |
|----------|------|--------|
| `TargetRibbonControl` | `Ribbon` | `get; set;` |
**Methods:**
- `protected override void OnAttached()` — Subscribes to `AssociatedObject.SelectionChanged`; resolves `IEventAggregator` via `ServiceLocator.Current`
- `protected override void OnDetaching()` — Unsubscribes from `AssociatedObject.SelectionChanged`
- `void Ribbon_SelectionChanged(object sender, SelectionChangedEventArgs e)` — Publishes `RibbonControlSelectionChanged` events for each added/removed item
**Behavior:** When attached to a `Ribbon`, intercepts selection changes and publishes `RibbonControlSelectionChanged` events. Publishes separate events for added items (first item from `AddedItems`) and removed items (first item from `RemovedItems`).
---
### `RibbonRegionAdapter`
**Kind:** Prism RegionAdapter (`RegionAdapterBase<Ribbon>`, `IDisposable`)
**Constructor:** `public RibbonRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory, IRegionManager regionManager, IEventAggregator eventAggregator)`
**Methods:**
| Method | Visibility | Description |
|--------|------------|-------------|
| `Adapt(IRegion region, Ribbon regionTarget)` | `protected override` | Wires up `ActiveViews.CollectionChanged` to add/remove `RibbonTab` and `RibbonApplicationMenu` items |
| `CreateRegion()` | `protected override` | Returns new `AllActiveRegion` instance |
| `OnTabControlSelectionChanged(TabControlSelectionEventArgs e)` | `private` | Handles `TabControlSelectionChanged` events to sync Ribbon tab selection |
| `Dispose()` | `public` | Unsubscribes from `TabControlSelectionChanged` event |
**Behavior:** Adapts a `Ribbon` control to a Prism region. Handles `RibbonTab` additions (with auto-generated `Uid`, `TabIndex` sorting, and optional default selection via config), `RibbonApplicationMenu` additions, and `RibbonTab` removals. Listens to `TabControlSelectionChanged` events to activate corresponding Ribbon tabs when views implementing `IRibbonTabInfoProvider` are activated.
---
## 3. Invariants
1. **Null Region Target:** `Adapt()` throws `ArgumentNullException` if `regionTarget` is null.
2. **Region Type:** `CreateRegion()` always returns a new `AllActiveRegion` instance.
3. **Uid Generation:** If a `RibbonTab` or `RibbonApplicationMenu` has a null or empty `Uid`, one is auto-generated using `Guid.NewGuid().GetHashCode().ToString(CultureInfo.InvariantCulture)`.
4. **Tab Sorting:** All `RibbonTab` items added to the region are sorted by `TabIndex` in ascending order.
5. **Single Item Publication:** `RibbonControlSelectionChangeBehavior.Ribbon_SelectionChanged` publishes at most one event for added items (index 0) and one for removed items (index 0), regardless of how many items are in the collections.
6. **Event Subscription Lifecycle:** `RibbonRegionAdapter` unsubscribes from `TabControlSelectionChanged` on disposal.
---
## 4. Dependencies
### This module depends on:
- `Microsoft.Practices.Prism.Events``CompositePresentationEvent`, `IEventAggregator`
- `Microsoft.Practices.Prism.Regions``RegionAdapterBase<T>`, `IRegion`, `IRegionBehaviorFactory`, `IRegionManager`, `AllActiveRegion`
- `Microsoft.Practices.ServiceLocation``ServiceLocator`
- `Microsoft.Windows.Controls.Ribbon``Ribbon`, `RibbonTab`, `RibbonApplicationMenu`
- `System.Windows.Interactivity``Behavior<T>`
- `System.Configuration``ConfigurationManager`
- `DTS.Common.Classes``IRibbonTabInfoProvider` (referenced but not in source)
- `DTS.Common.Enums``TabControlOperation` (referenced but not in source)
- `DTS.Common.Events``TabControlSelectionChanged` event class (referenced but not in source)
- `DTS.Common.Base``IBaseView` interface (referenced but not in source)
### What depends on this module:
- Cannot be determined from source alone; consumers would reference `RibbonRegionAdapter` in Prism bootstrapping/configuration and use `RibbonControlSelectionChanged` event for cross-component communication.
---
## 5. Gotchas
1. **Naming Inconsistency:** The XML documentation comment in `RibbonControlSelectionEventArgs.cs` references "TabControlSelectionChanged" while the actual class is `RibbonControlSelectionChanged`. This may cause confusion.
2. **ServiceLocator vs Constructor Injection:** `RibbonControlSelectionChangeBehavior` resolves `IEventAggregator` via `ServiceLocator.Current.GetInstance<IEventAggregator>()` (service locator pattern), while `RibbonRegionAdapter` receives it via constructor injection. This inconsistency may cause issues in testing or if service locator is not configured.
3. **Partial Lock Coverage:** `AddRibbonTabToRegion()` uses a lock object for thread safety when modifying `regionTarget.Items`, but `RemoveRibbonTabFromRibbonRegion()` does not. This could lead to race conditions in multi-threaded scenarios.
4. **Case-Insensitive Comparison via ToLower():** The `DefaultRibbonTab` configuration comparison uses `ToLower()` on both sides rather than using `StringComparison.OrdinalIgnoreCase`, which is the preferred .NET idiom.
5. **Only First Item Published:** The behavior only publishes events for `e.AddedItems[0]` and `e.RemovedItems[0]`. If multiple items are added/removed in a single selection change, subsequent items are silently ignored.
6. **External Interface Dependencies:** `RibbonRegionAdapter.OnTabControlSelectionChanged()` depends on `IRibbonTabInfoProvider`, `IBaseView`, `TabControlSelectionChanged`, and `TabControlOperation` which are not included in the provided source files. Their contracts are inferred but not documented here.

View File

@@ -0,0 +1,119 @@
---
source_files:
- Common/DTS.CommonCore/Strings/Strings.Designer.cs
generated_at: "2026-04-16T11:57:17.552440+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "60d8743ec190cc64"
---
# Documentation: DTS.Common.Strings (Strings.Designer.cs)
## 1. Purpose
This module is an **auto-generated strongly-typed resource class** that provides localized string constants for the DTS CommonCore library. It serves as the central access point for UI strings, error messages, status labels, and configuration descriptions used throughout the DTS system. The class wraps a `.resx` resource file, enabling localization and consistent string management across the application. **This file is machine-generated** by the `StronglyTypedResourceBuilder` tool and should not be manually edited.
---
## 2. Public Interface
### Class: `DTS.Common.Strings.Strings`
All members are `static`. The class cannot be instantiated (internal constructor).
| Member | Signature | Description |
|--------|-----------|-------------|
| `ResourceManager` | `public static global::System.Resources.ResourceManager ResourceManager { get; }` | Returns the cached `ResourceManager` instance for this assembly. Lazily initialized on first access. The resource base name is `"DTS.Common.Strings.Strings"`. |
| `Culture` | `public static global::System.Globalization.CultureInfo Culture { get; set; }` | Gets or sets the current `CultureInfo` for resource lookups. Overrides the thread's `CurrentUICulture` for all lookups via this class. |
### Selected String Properties (partial list — file is truncated)
All string properties follow the pattern: `public static string PropertyName { get; }` and call `ResourceManager.GetString("key", resourceCulture)`.
| Property | Default Value (English) | Context |
|----------|------------------------|---------|
| `ActiveValue` | "Active value" | General status |
| `Analog` | "Bridge" | Hardware type |
| `Armed` | "Armed" | System status |
| `ArmSystem_WaitingForNextInterval` | "Waiting for next interval" | Arming workflow |
| `BAD_NETPATH_ERROR_MSG` | "Could not connect to network path, please check network connections" | Network error |
| `BRIDGETYPE_ACC_DESCRIPTION` | "ACC" | Bridge type |
| `BRIDGETYPE_ARS_DESCRIPTION` | "ARS" | Bridge type |
| `BRIDGETYPE_IEPE_DESCRIPTION` | "IEPE" | Bridge type |
| `CAC_Capacity` | "Capacity" | Calibration |
| `CalculatedChannel_Average` | "Average" | Calculated channel type |
| `CalculatedChannel_IRTRACC3D_Abdomen` | "3D IR-TRACC (abdomen)" | IR-TRACC sensor position |
| `CalculatedChannel_Resultant` | "Resultant" | Calculated channel type |
| `CalibrationBehaviors_LinearIfAvailable` | "Use linear sensitivity, if available" | Calibration behavior |
| `ClockSyncProfile_Auto_E2E` | "PTP (E2E) Automatic" | Clock synchronization profile |
| `ClockSyncProfile_Disabled` | "Disabled" | Clock synchronization profile |
| `ClockSyncProfile_GPS` | "GPS In" | Clock synchronization profile |
| `ClockSyncProfile_IRIG` | "IRIG B In" | Clock synchronization profile |
| `DASStatus_ARMED` | "Armed" | DAS (Data Acquisition System) status |
| `DASStatus_Offline` | "Offline" | DAS status |
| `DASStatus_Online` | "Online" | DAS status |
| `DASStatus_READYFORDL` | "Ready for download" | DAS status |
| `DigitalInputMode_CCNC` | "Contact closure normally closed" | Digital input mode |
| `DigitalInputMode_TLH` | "Transition low to high" | Digital input mode |
| `FilterClassType_CFC1000` | "CFC 1000 (A)" | Filter class (ISO 6487) |
| `FilterClassType_CFC600` | "CFC 600 (B)" | Filter class |
| `FilterClassType_Unfiltered` | "Unfiltered (0)" | Filter class |
| `GeneratingPSD` | "Calculating PSD... ({0})" | PSD calculation progress |
| `GeneratingPSD_CalculatingFFTs` | "Calculating FFTs" | FFT processing status |
| `HIC` | "HIC" | Head Injury Criterion |
| `IEPE` | "IEPE" | Integrated Electronics Piezo-Electric |
| `InputClockSource_GPS` | "GPS" | Clock source |
| `InputClockSource_IRIG` | "IRIG B" | Clock source |
| `InvalidCharacterInSerialNumber` | "Error: Invalid character in serial number," | Validation error |
| `ISO13499Code` | "ISO (13499) code" | ISO-MME standard |
| `LevelTrigger_GreaterThan` | "Greater than" | Trigger condition |
| `LevelTrigger_TriggerInside` | "between {0} and {1} ({2})" | Trigger condition (formatted) |
| `NotApplicable` | "N/A" | General placeholder |
*(The source file is truncated; additional properties exist but are not visible in the provided excerpt.)*
---
## 3. Invariants
1. **Auto-generation marker**: The file is decorated with `GeneratedCodeAttribute` indicating tool generation. Manual edits will be overwritten.
2. **Singleton ResourceManager**: The `ResourceManager` property lazily initializes exactly one instance and caches it in the private `resourceMan` field.
3. **Thread-safety of ResourceManager initialization**: Uses a temporary local variable pattern (`temp`) before assigning to the static field to avoid race conditions.
4. **Immutable property signatures**: All string properties are read-only getters; there are no setters.
5. **Resource base name**: The ResourceManager is initialized with the base name `"DTS.Common.Strings.Strings"` and the executing assembly.
6. **Internal constructor**: The `Strings()` constructor is marked `internal` with a suppression for `CA1811` (AvoidUncalledPrivateCode), preventing external instantiation.
---
## 4. Dependencies
### This module depends on:
- `System.Resources.ResourceManager` — for resource lookup
- `System.Globalization.CultureInfo` — for culture-specific string retrieval
- `System.CodeDom.Compiler` — for `GeneratedCodeAttribute`
- `System.Diagnostics` — for `DebuggerNonUserCodeAttribute`
- `System.Runtime.CompilerServices` — for `CompilerGeneratedAttribute`
- `System.ComponentModel` — for `EditorBrowsableAttribute`
- `System.Diagnostics.CodeAnalysis` — for `SuppressMessageAttribute`
### The underlying `.resx` file:
- A companion file `Strings.resx` (not shown) contains the actual key-value pairs and is the source for this designer file.
### What depends on this module:
- **Unknown from source alone** — any component in the DTS codebase that requires localized strings may reference `DTS.Common.Strings.Strings`.
---
## 5. Gotchas
1. **Do not edit this file directly** — The auto-generated header explicitly warns that changes will be lost if the code is regenerated. To add or modify strings, edit the `.resx` file and regenerate.
2. **File is truncated in the provided source** — The source cuts off mid-property (`OutputClockSource_PTP_OnePPS`). The full file contains additional string properties not documented here.
3. **Culture can be overridden globally** — Setting `Strings.Culture` affects all subsequent resource lookups through this class. Callers should be aware this is a global setting.
4. **Formatted strings require caller handling** — Properties like `LevelTrigger_TriggerInside` contain format placeholders (`{0}`, `{1}`, `{2}`). The caller is responsible for calling `string.Format()` or similar.
5. **Typo in property name**: `DigitialOutput` (should be `DigitalOutput`) — this appears to be a historical naming quirk preserved for backward compatibility.
6. **Some strings contain newlines and formatting** — e.g., `DockingStationNotFound` contains multi-line instructions with bullet points. Callers displaying these should preserve formatting.

View File

@@ -0,0 +1,166 @@
---
source_files:
- Common/DTS.CommonCore/Themes/CommonStyles.xaml.cs
- Common/DTS.CommonCore/Themes/BrushesAndColors.cs
generated_at: "2026-04-16T12:07:03.479792+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "0e615cefd8a8a763"
---
# Documentation: DTS.Common Themes Module
## 1. Purpose
This module provides centralized access to WPF theme resources (brushes and colors) and event handling for UI tooltips within the DTS application. The `BrushesAndColors` class serves as a cached, static accessor for theme-defined visual resources, eliminating repetitive resource lookups and ensuring consistent styling across the application. The `CommonStyles` partial class bridges UI tooltip events to the application's event aggregation system, enabling decoupled handling of help text display. This module exists to centralize theme management and was refactored (per FB 33034) to consolidate duplicate implementations from the DataPro project.
---
## 2. Public Interface
### CommonStyles (partial class)
**`void ToolTipEventHandler(object sender, System.Windows.Controls.ToolTipEventArgs e)`**
- Handles WPF tooltip events by marking the event as handled and publishing a `HelpTextEvent` via the `IEventAggregator`.
- Retrieves the `IEventAggregator` instance via `ServiceLocator.Current.GetInstance<IEventAggregator>()`.
- Publishes a `HelpTextEventArg` containing the original `sender` and `ToolTipEventArgs`.
---
### BrushesAndColors (abstract class)
All members are static. The class cannot be instantiated.
#### Brush Properties (return `SolidColorBrush` or `Brush`)
| Property Name | Return Type | Resource Key Looked Up |
|---------------|-------------|------------------------|
| `Brush_ApplicationTileExport` | `SolidColorBrush` | `Brush_ApplicationTileExport` |
| `Brush__ApplicationTileCollectData` | `SolidColorBrush` | `Brush_ApplicationTileCollectData` |
| `Brush_ApplicationStatus_Failed` | `SolidColorBrush` | `Brush_ApplicationStatus_Failed` |
| `Brush_Dimmed_Text` | `SolidColorBrush` | `Brush_Dimmed_TextForeground` |
| `Brush_Application_Idle` | `SolidColorBrush` | `Brush_ApplicationStatus_Idle` |
| `Brush_ApplicationStatus_Complete` | `SolidColorBrush` | `Brush_ApplicationStatus_Complete` |
| `Brush_ApplicationStatus_Idle` | `SolidColorBrush` | `Brush_ApplicationStatus_Idle` |
| `Brush_ApplicationStatus_Busy` | `SolidColorBrush` | `Brush_ApplicationStatus_Busy` |
| `Brush_Run_SensorIdNotFound` | `SolidColorBrush` | `Brush_Run_SensorIdNotFound` |
| `Brush_Run_SensorIdOutOfPlace` | `SolidColorBrush` | `Brush_Run_SensorIdOutOfPlace` |
| `Brush_Table_AlternatingRowBackground` | `SolidColorBrush` | `Brush_Table_AlternatingRowBackground` |
| `Brush_Table_RowBackground` | `SolidColorBrush` | `Brush_Table_RowBackground` |
| `Brush_FlatControlPressedBackground` | `Brush` | `Brush_FlatControlPressedBackground` |
| `Brush_FlatControlPressedForeground` | `Brush` | `Brush_FlatControlPressedForeground` |
| `Brush_Transparent` | `Brush` | Creates new `SolidColorBrush(Colors.Transparent)` (no resource lookup) |
| `Brush_NoError` | `Brush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_Error` | `SolidColorBrush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_Warning` | `SolidColorBrush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_Attention` | `SolidColorBrush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_FlatControlDisabledForeground` | `Brush` | `Brush_FlatControlDisabledForeground` |
| `Brush_ApplicationContentForeground` | `Brush` | `Brush_ApplicationContentForeground` |
| `Brush_FlatControlDisabledBackground` | `Brush` | `Brush_FlatControlDisabledBackground` |
| `Brush_ApplicationStatus_Waiting` | `SolidColorBrush` | `Brush_ApplicationStatus_Waiting` |
| `Brush_ApplicationStatus_Failed_ActionBackground` | `SolidColorBrush` | `Brush_ApplicationStatus_Failed_ActionBackground` |
| `Brush_ApplicationStatus_Complete_ActionBackground` | `SolidColorBrush` | `Brush_ApplicationStatus_Complete_ActionBackground` |
| `Brush_ApplicationStatus_Failed_SystemProcess` | `SolidColorBrush` | `Brush_ApplicationStauts_Failed_SystemProcess` (note typo in resource key) |
| `Brush_ApplicationFooterBackground` | `SolidColorBrush` | `Brush_ApplicationFooterBackground` |
| `Brush_ApplicationLicensingFooterBackground` | `SolidColorBrush` | `Brush_ApplicationLicensingFooterBackground` |
| `Brush_Realtime_OSC_SELECTED` | `Brush` | `Brush_Realtime_OSC_SELECTED` |
| `Brush_Realtime_OSC_UNSELECTED` | `Brush` | `Brush_Realtime_OSC_UNSELECTED` |
| `Brush_Realtime_METER_SELECTED` | `Brush` | `Brush_Realtime_METER_SELECTED` |
| `Brush_Realtime_METER_UNSELECTED` | `Brush` | `Brush_Realtime_METER_UNSELECTED` |
| `Brush_SensorIdFound` | `SolidColorBrush` | `Brush_SensorIdFound` |
| `Brush_ArmSystemForeground` | `SolidColorBrush` | `Brush_ArmSystemForeground` |
| `Brush_ApplicationTilePrepare` | `SolidColorBrush` | `Brush_ApplicationTilePrepare` |
| `Brush_ApplicationTileSetup` | `SolidColorBrush` | `Brush_ApplicationTileSetup` |
| `BrushApplicationStatusPowerRed` | `SolidColorBrush` | `Brush_ApplicationStatusPowerRed` |
| `BrushApplicationStatusPowerYellow` | `SolidColorBrush` | `Brush_ApplicationStatusPowerYellow` |
| `BrushApplicationStatusPowerGreen` | `SolidColorBrush` | `Brush_ApplicationStatusPowerGreen` |
| `BrushFlatControlDarkForeground` | `SolidColorBrush` | `Brush_FlatControlDarkForeground` |
| `BrushApplicationStatusPowerClear` | `SolidColorBrush` | `Brush_ApplicationStatusPowerClear` |
#### Color Properties (return `Color`)
These properties perform a direct resource lookup on each call (no caching):
| Property Name | Resource Key |
|---------------|--------------|
| `Color_ActionBackground` | `Color_ActionBackground` |
| `Color_ApplicationTileCollectData` | `Color_ApplicationTileCollectData` |
| `Color_ItemBackground` | `Color_ItemBackground` |
| `Color_ActionForeground` | `Color_ActionForeground` |
| `Color_ItemForeground` | `Color_ItemForeground` |
| `Color_ApplicationTileSetup` | `Color_ApplicationTileSetup` |
| `Color_ApplicationTilePrepare` | `Color_ApplicationTilePrepare` |
| `Color_ApplicationTileCalibration` | `Color_ApplicationTileCalibration` |
| `Color_ApplicationTileExport` | `Color_ApplicationTileExport` |
| `Color_ApplicationTileAdmin` | `Color_ApplicationTileAdmin` |
---
## 3. Invariants
1. **Brush Caching**: All brush properties use lazy initialization with null-check guards. Once a brush is retrieved and frozen, the same instance is returned on subsequent calls.
2. **Brush Freezing**: All retrieved brushes are frozen via `.Freeze()` before being returned, making them thread-safe and non-modifiable.
3. **Application Resource Availability**: All brush/color properties (except `Brush_Transparent`, `Brush_NoError`, `Brush_Error`, `Brush_Warning`, `Brush_Attention`) require `Application.Current` to be available and the named resource to exist in the application's resource dictionary.
4. **ServiceLocator Availability**: `CommonStyles.ToolTipEventHandler` requires `ServiceLocator.Current` to be configured and able to resolve `IEventAggregator`.
5. **Event Handling**: `ToolTipEventHandler` always sets `e.Handled = true` before publishing the event.
---
## 4. Dependencies
### This module depends on:
- `System.Windows` - For `Application`, `ResourceDictionary`, `Brush`, `SolidColorBrush`, `Colors`, `Color`
- `System.Windows.Controls` - For `ToolTipEventArgs`
- `Microsoft.Practices.ServiceLocation` - For `ServiceLocator`
- `Microsoft.Practices.Prism.Events` - For `IEventAggregator`
- `DTS.Common.Events` - For `HelpTextEvent` and `HelpTextEventArg`
- External XAML resource files: `/DTS.Common;component/Themes/brushes.xaml`
- Application-level resource dictionary containing all named brush/color resources
### What depends on this module:
- Unclear from source alone. Consumers would be any UI code requiring consistent access to theme brushes/colors, and any XAML that attaches `ToolTipEventHandler` to tooltip events.
---
## 5. Gotchas
### Critical Bugs
1. **`Brush_Warning` is broken**: The property getter assigns to `_brushError` instead of `_brushWarning`:
```csharp
_brushError = (SolidColorBrush)_resourceDictionary["Brush_Warning"];
```
This corrupts `Brush_Error` and `Brush_Warning` will always return `null` (or throw if the readonly field prevents assignment—unclear if this compiles).
2. **`_brushWarning` is declared `readonly` but assigned**: The field is declared as:
```csharp
private static readonly SolidColorBrush _brushWarning = null;
```
This will cause a compile error when the property attempts to assign to it.
### Naming Inconsistencies
3. **Double underscore in property name**: `Brush__ApplicationTileCollectData` has two underscores between "Brush" and "Application"—likely a typo.
4. **Typo in resource key**: `Brush_ApplicationStatus_Failed_SystemProcess` looks up `Brush_ApplicationStauts_Failed_SystemProcess` (misspelled "Stauts").
### Theme Switching Limitation
5. **Stale brushes after theme change**: As documented in the class comment, cached brushes become stale if themes are switched at runtime. The comment states: *"this class is holding static caches of the brushes, so if we switch themes they might be out of date"*. There is no mechanism to clear or refresh the cache.
### Inconsistent Null-Checking Patterns
6. **Mixed null-check styles**: Some properties check `if (null == _field)` while others check `if (null != _field) return _field`. This inconsistency makes the code harder to maintain.
7. **Inconsistent null-safety on Freeze()**: Some properties call `.Freeze()` unconditionally (will throw if resource not found), while others check for null before freezing:
```csharp
if (_brushApplicationStatusPowerRed != null) _brushApplicationStatusPowerRed.Freeze();
```
### Performance Note
8. **Color properties are not cached**: Unlike brush properties, all `Color_*` properties perform a resource lookup on every access via `Application.Current.FindResource()`.

View File

@@ -0,0 +1,157 @@
---
source_files:
- Common/DTS.CommonCore/Utils/XMLUtils.cs
- Common/DTS.CommonCore/Utils/EnumUtils.cs
- Common/DTS.CommonCore/Utils/ImageButton.cs
- Common/DTS.CommonCore/Utils/PNGImageUtil.cs
- Common/DTS.CommonCore/Utils/MouseUtils.cs
- Common/DTS.CommonCore/Utils/StopWatch.cs
- Common/DTS.CommonCore/Utils/SerializableDictionary.cs
- Common/DTS.CommonCore/Utils/TestUtils.cs
- Common/DTS.CommonCore/Utils/SecureQueue.cs
- Common/DTS.CommonCore/Utils/ByteConverter.cs
- Common/DTS.CommonCore/Utils/NetworkUtils.cs
- Common/DTS.CommonCore/Utils/BusyWaitAnimation.cs
generated_at: "2026-04-16T12:01:02.629774+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "0a10ccd507cef203"
---
# DTS.CommonCore.Utils Documentation
## 1. Purpose
This module provides a collection of utility classes and helper methods for the DTS system, including thread-safe data structures (`SecureQueue`), byte manipulation with network byte order conversion (`ByteConvertor`), WPF UI components (`ImageButton`, `BusyWaitAnimation`), network interface utilities (`NetworkUtils`), XML serialization helpers (`SerializableDictionary`), performance profiling (`StopWatchQueue`), and various other utility functions for enums, timestamps, mouse positioning, and image rendering.
---
## 2. Public Interface
### `EnumUtil` (static class)
- `IEnumerable<T> GetValues<T>()` — Returns all values of enum type `T` as an enumerable.
- `ItemCollection GetValuesList<T>()` — Returns an `ItemCollection` populated with enum values and their names, suitable for use with Xceed WPF Toolkit PropertyGrid.
### `ImageButton` (extends `Button`)
- `ImageSource Source` — Gets or sets the image source displayed on the button.
- `string ImageText` — Gets or sets the text displayed below the image.
### `PNGImageUtil` (static class)
- `void SaveImage(FrameworkElement view, string fileName)` — Renders a `FrameworkElement` to a PNG file at the specified path. Uses 96 DPI and `Pbgra32` pixel format.
### `MouseUtilities`
- `static Point GetMousePosition(Visual relativeTo)` — Returns the mouse cursor position relative to the specified `Visual`, using Win32 API calls (`GetCursorPos`, `ScreenToClient`).
### `StopWatchQueue`
- `StopWatchQueue(string name)` — Constructor accepting a name used for output file naming.
- `void Start()` — Starts the internal stopwatch.
- `void Stop()` — Stops the stopwatch, records elapsed ticks to an internal queue, and resets the stopwatch.
- `void DumpData()` — Writes all recorded timing data to a CSV file with statistics (max, min, average, standard deviation in milliseconds).
### `SerializableDictionary<TKey, TValue>` (extends `Dictionary<TKey, TValue>`, implements `IXmlSerializable`)
- `XmlSchema GetSchema()` — Returns `null`.
- `void ReadXml(XmlReader reader)` — Deserializes the dictionary from XML format with `<items>`, `<item>`, `<key>`, and `<value>` elements.
- `void WriteXml(XmlWriter writer)` — Serializes the dictionary to XML format.
### `XmlDictionary`
- `SerializableDictionary<string, object> Dictionary` — A pre-configured serializable dictionary for string-to-object mappings.
### `TestModuleTimeStamp`
- `int TriggerTimestampSec` — Seconds component of timestamp.
- `int TriggerTimestampNanoSec` — Nanoseconds component of timestamp.
### `TestUtils` (static class)
- `Tuple<double, double> MinUnixTime(IEnumerable<TestModuleTimeStamp> basemodules)` — Calculates the minimum Unix timestamp from a collection, using statistical filtering (average minus standard deviation, capped at 10ms). Returns `null` if input is null or empty.
- `string ParseROISuffix(string test)` — Parses a test string to extract an ROI suffix based on event number markers.
### `SecureQueue<T>` (implements `IDisposable`, constrained to `new()`)
- `enum NullPolicy``DenyNull`, `SkipNull`, `AllowNull`.
- `SecureQueue(NullPolicy policy, string name)` — Constructor.
- `void ResetEvent()` — Resets the internal `ManualResetEvent`.
- `void Enqueue(T[] newData)` — Thread-safe enqueue; behavior depends on `NullPolicy`. Clones data before storing.
- `bool WaitForData(int timeoutMillisec)` — Blocks until data arrives or timeout; returns `true` if data available.
- `WaitHandle QueueWaitHandle` — Exposes the internal wait handle.
- `T[] Dequeue(bool resetEvent)` — Thread-safe dequeue; concatenates all queued arrays into a single array if multiple entries exist.
- `void Flush()` — Clears the queue and resets the event.
- `bool IsEmpty()` — Returns `true` if queue is empty.
- `void Dispose()` — Implementation of `IDisposable` (currently empty).
### `ByteConvertor` (static class)
- `void Convert(byte[] input, int offset, out byte/ushort/short/uint/int/ulong/long/float/double/string value)` — Converts bytes at offset to the specified type. Multi-byte integers are interpreted in **big-endian (network) byte order**. Strings are null-terminated.
- `byte[] ToByteArray(byte/ushort/short/uint/int/ulong/float/double/string input)` — Converts the specified type to a byte array. Multi-byte integers are output in **big-endian (network) byte order**. Strings are null-terminated.
### `NetworkUtils` (static class)
- `bool IsNetworkInterfaceUp(IPAddress ip)` — Returns `true` if the network interface for the given IP is up and operational.
- `List<HostInfo> GetAvailableHosts(bool supportMulticastOnly = false)` — Returns a list of available network hosts with IP, MAC, and address range information. Filters out VPN, virtual adapters, loopback, and Npcap interfaces.
- `bool TryParseConnectionString(string connectionString, out string ipAddress)` — Attempts to extract an IP address from a connection string; returns `false` for USB connections.
### `BusyWaitAnimation`
- `Color Color` — Gets or sets the spoke color.
- `Color BgColor` — Gets or sets the background color.
- `int OuterCircleRadius` — Gets or sets the outer circle radius.
- `int InnerCircleRadius` — Gets or sets the inner circle radius.
- `int NumberSpoke` — Gets or sets the number of spokes.
- `bool Active` — Gets or sets whether the animation is running.
- `int SpokeThickness` — Gets or sets the spoke thickness.
- `long RotationSpeed` — Gets or sets the rotation speed (higher = slower).
- `StylePresets StylePreset` — Gets or sets a preset style (`MacOsx`, `Firefox`, `Ie7`, `Custom`).
- `Graphics GDIGraphics` — Gets the internal GDI+ graphics object.
- `int hDC` — Gets or sets the device context handle.
- `void SetDrawArea(Rectangle rect)` — Sets the drawing area and initializes internal bitmaps.
- `void SetCircleAppearance(int numberSpoke, int spokeThickness, int innerCircleRadius, int outerCircleRadius)` — Configures the circle appearance.
### `XMLUtils`
- Empty class — **No public members defined.**
---
## 3. Invariants
- **ByteConvertor**: All multi-byte integer conversions use big-endian (network) byte order. The `Convert` methods assume the input byte array is sufficiently sized for the requested type at the given offset.
- **SecureQueue**: The queue is thread-safe; all operations use locking on `ByteQueueLock`. When `NullPolicy.DenyNull` is set, enqueuing null or empty arrays throws `ArgumentException`.
- **SerializableDictionary**: XML structure must follow `<items><item><key>...</key><value>...</value></item>...</items>` format.
- **StopWatchQueue**: `Stop()` records elapsed ticks since the last `Start()` call and resets the stopwatch; calling `Stop()` without `Start()` will record whatever the stopwatch state is (including zero if never started).
- **PNGImageUtil.SaveImage**: Requires the `FrameworkElement` to have valid `ActualWidth` and `ActualHeight` (must be rendered/measured). Uses `FileMode.CreateNew` — will throw if file already exists.
- **TestUtils.MinUnixTime**: Returns `null` if input collection is null or empty. Standard deviation is capped at `Common.Constants.TEN_MILLIS_IN_SEC`.
- **BusyWaitAnimation**: Requires `SetDrawArea()` and `hDC` to be set before animation can render.
---
## 4. Dependencies
### External Dependencies (from imports)
- **Xceed.Wpf.Toolkit.PropertyGrid.Attributes** — `EnumUtil.GetValuesList<T>()` returns `ItemCollection`.
- **System.Windows.Forms** — Used in `SecureQueue` (though not directly referenced in visible code, imported).
- **System.Drawing** — Used in `BusyWaitAnimation` for GDI+ graphics.
- **System.Windows.Threading** — `BusyWaitAnimation` uses `DispatcherTimer`.
### Internal Dependencies
- `DTS.Common.Utilities.Logging.APILogger` — Used by `SecureQueue` for logging.
- `DTS.Common.Interface` — Imported in `TestUtils` (usage unclear from source alone).
- `DTS.Common.Constants` — Constants `NANOS_PER_SECOND`, `TEN_MILLIS_IN_SEC`, `EventNumber` referenced in `TestUtils`.
- `Enums.DASFactory.DFConstantsAndEnums.ExtraCommunicationLogging` — Used in `SecureQueue.Enqueue`.
### Namespace Inconsistency
- `SerializableDictionary` and `XmlDictionary` are in namespace `DTS.DASLib.Utility`, while all other utilities are in `DTS.Common.Utils`.
---
## 5. Gotchas
1. **ByteConvertor float/double conversions**: Unlike integer types, `Convert` methods for `float` and `double` use `BitConverter.ToSingle/ToDouble`, which respects system endianness — inconsistent with the big-endian behavior of integer conversions.
2. **PNGImageUtil.SaveImage file mode**: Uses `FileMode.CreateNew`, which will throw an exception if the file already exists. Caller must ensure the file does not exist or handle the exception.
3. **SecureQueue.Dequeue event handling**: The method creates a **new** `ManualResetEvent(false)` on every call, which may cause issues if multiple consumers are waiting on the original event handle.
4. **SecureQueue.Dispose**: The `Dispose()` method is empty and does not release the `ManualResetEvent` or other resources.
5. **MouseUtilities.GetMousePosition DPI handling**: The calculation `var factor = 2D - presentationSource.CompositionTarget.TransformToDevice.M22` is non-obvious and may produce incorrect results for certain DPI configurations.
6. **StopWatchQueue finalizer**: The destructor `~StopWatchQueue()` calls `DumpData()`, which writes a file to disk. This could cause unexpected file I/O during garbage collection.
7. **BusyWaitAnimation static field**: Contains `static int _xxx = 0;` that is incremented in the constructor but never used — appears to be debug/legacy code.
8. **XMLUtils**: The class is entirely empty — unclear if this is placeholder or deprecated code.
9. **SerializableDictionary.ReadXml**: Creates new `XmlSerializer` instances for each key and value type on every call, which could cause performance issues and memory leaks (XmlSerializer caching issues).

View File

@@ -0,0 +1,83 @@
---
source_files:
- Common/DTS.CommonCore/XMLUtils/DTSXMLFile.cs
- Common/DTS.CommonCore/XMLUtils/TestMetadataXml.cs
generated_at: "2026-04-16T12:04:29.540782+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "8848a0560473ca7f"
---
# Documentation: DTS.Common.XMLUtils
## 1. Purpose
This module provides XML parsing and metadata extraction utilities for DTS application files. It contains two static classes: `DTSXMLFile` for extracting item count information from XML files, and `TestMetadataXml` for aggregating and parsing multiple DTS test metadata XML files into a unified `XDocument` structure. The module serves as a bridge between raw XML file storage and the application's test management system.
---
## 2. Public Interface
### Class: `DTSXMLFile` (static)
#### `public static double GetItemsToCompleteCount(string fileName)`
- **Returns**: The value of the `TotalItems` attribute from an XML node as a `double`.
- **Behavior**: Retrieves an import XML node via `FileUtils.GetImportXmlNode()`, then extracts and converts the `TotalItems` attribute using `CultureInfo.InvariantCulture`. The `importVersion` parameter is passed as an `out` parameter to the internal call but is not returned to the caller.
---
### Class: `TestMetadataXml` (static)
#### `public static XDocument GetTestMetadataXml(string path, string file = "", string pattern = "")`
- **Returns**: An `XDocument` with a root element named `"Tests"` containing aggregated test metadata.
- **Parameters**:
- `path` - Directory path to search for files.
- `file` - Optional specific file path. If provided, only this file is processed.
- `pattern` - File pattern for search. Defaults to `".dts"` if null or empty.
- **Behavior**:
- Clears and populates the static `FileUtils.FileList` property.
- If `file` is provided, adds it directly to the file list.
- Otherwise, calls `FileUtils.FindFiles(path, pattern)` to discover files.
- Delegates to `SetTestMetadataType()` for XML processing.
---
## 3. Invariants
- **FileUtils.FileList state**: The static property `FileUtils.FileList` is cleared (`new List<string>()`) at the start of every `GetTestMetadataXml()` call. Concurrent calls could result in race conditions.
- **Return value for `GetItemsToCompleteCount`**: Always returns a `double`. The initial `importVersion` is set to `-1` before calling `FileUtils.GetImportXmlNode()`.
- **XML structure assumption**: `SetTestMetadataType()` expects XML fragments to contain either a `"Test"` root element or a `"TestSetup"` root element. Other structures are silently ignored (the element is not added).
- **Error handling**: `SetTestMetadataType()` catches exceptions at both the file level (logs and continues) and the overall level (returns an empty `XDocument`).
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Utils`** (`FileUtils` class)
- `FileUtils.GetImportXmlNode()` - used in `DTSXMLFile`
- `FileUtils.FileList` - static list property used in `TestMetadataXml`
- `FileUtils.FindFiles()` - file discovery method used in `TestMetadataXml`
- **`DTS.Common.Utilities.Logging`** (`APILogger` class)
- `APILogger.Log()` - used for error logging in `TestMetadataXml`
- **`System.Xml.Linq`** - `XDocument`, `XElement` for XML manipulation
- **`System.IO`** - `StreamReader`, `StringReader`, `File` for file I/O
### What depends on this module:
- **Unknown from source alone** - No consumers are shown in the provided files.
---
## 5. Gotchas
1. **Multiple XML documents in a single file**: `SetTestMetadataType()` splits file contents by the string `"<?xml version="`, meaning a single file can contain multiple concatenated XML documents. This is a specific format requirement that is not validated—malformed files will cause silent failures.
2. **Static state mutation**: `FileUtils.FileList` is a static property that is cleared and repopulated on every call to `GetTestMetadataXml()`. This is not thread-safe and could cause issues in concurrent scenarios.
3. **Unused variable warning suppression**: The file includes `// ReSharper disable UnusedVariable`, suggesting there may be dead code or the developer wanted to suppress warnings about variables like `xmlCounter` and `fullstring` that could potentially be unused in certain code paths.
4. **DataType attribute logic**: The `DataType` attribute is set to `"ALL"` if the file path contains the substring `"ALL"` (case-sensitive), otherwise `"ROI"`. This simple string check could produce unexpected results if `"ALL"` appears elsewhere in the path.
5. **Empty XDocument on total failure**: If an exception occurs at the outer `try-catch` in `SetTestMetadataType()`, an empty `XDocument` is returned (no root element), which may cause null reference exceptions in consumers expecting a `"Tests"` root.
6. **importVersion not exposed**: In `GetItemsToCompleteCount()`, the `importVersion` value is retrieved via `out` parameter but never returned or used by the caller. Its purpose is unclear from the source.