Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common/Interface/TestSetups/Imports/TTS/Summary.md

124 lines
7.0 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/Summary/ISummaryChannel.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/Summary/ISummaryView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/Summary/ISummaryViewModel.cs
generated_at: "2026-04-16T03:13:11.250045+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "e533f1f624433322"
---
# Summary
## Documentation: TTS Summary Module Interfaces
---
### 1. **Purpose**
This module defines core interfaces for the *TTS (Test Time Series)* summary view and view model components within the DTS (Data Test System) framework. It provides a structured abstraction for displaying and managing high-level test metadata—such as test ID, name, sample rate, recording mode, trigger settings, and channel assignments—during test setup import workflows. The interfaces enforce separation of concerns between UI presentation (`ISummaryView`), business logic/state (`ISummaryViewModel`), and channel-specific metadata (`ISummaryChannel`), enabling consistent integration with the broader `IBaseClass`/`IBaseView`/`IBaseViewModel` hierarchy.
---
### 2. **Public Interface**
#### `ISummaryChannel`
- **`string ChannelType { get; set; }`**
Gets or sets the type identifier of the channel (e.g., `"Analog"`, `"Digital"`).
- **`int Assigned { get; set; }`**
Gets or sets the number of channels assigned to the current test setup.
- **`string Unassigned { get; set; }`**
Gets or sets a string representation (likely comma-separated IDs or count) of unassigned channels.
#### `ISummaryView`
- **`void UpdateTestIds(string[] serializedValues)`**
Updates the view with an array of serialized test ID values (e.g., JSON or delimited strings).
- **`string GetTestId()`**
Retrieves the currently displayed test ID from the view.
- **`void SetTestName(string testName)`**
Sets the test name displayed in the view.
#### `ISummaryViewModel`
- **`ISummaryView View { get; set; }`**
Gets or sets the associated view instance for UI updates.
- **`void SetStatus(string status, string error = default(string))`**
Updates the status text (e.g., `"Ready"`, `"Loading..."`) and optionally an error message.
- **`void SetProgress(double progress)`**
Sets the progress indicator (expected range: `0.0` to `1.0`).
- **`bool TestSetupComplete { get; set; }`**
Gets or sets a flag indicating whether the test setup process is complete.
- **`string ImportFileName { get; }`**
Gets the name of the imported file (read-only).
- **`string TestSetupName { get; }`**
Gets the name of the current test setup (read-only).
- **`double SampleRate { get; }`**
Gets the configured sample rate (e.g., in Hz).
- **`RecordingModes RecordingMode { get; }`**
Gets the recording mode (from `DTS.Common.Enums.RecordingModes` enum).
- **`string PreTrigger { get; }`**
Gets the pre-trigger duration setting (e.g., `"100ms"`).
- **`string PostTrigger { get; }`**
Gets the post-trigger duration setting (e.g., `"500ms"`).
- **`void SetChannelList()`**
Triggers population of channel-related UI elements (e.g., populating `ISummaryChannel` data).
- **`void UpdateUI()`**
Forces a refresh of the view (e.g., after data changes).
- **`void SetSerializedTestIdValues(string[] values)`**
Stores serialized test ID values for later retrieval (likely used by `UpdateTestIds`).
- **`void SetAvailableSampleRates(int[] values)`**
Sets the list of available sample rates (e.g., for dropdown population).
- **`string GetTestId()`**
Retrieves the test ID (delegates to `View.GetTestId()` internally).
- **`void SetAAFExceptions(Dictionary<double, List<double>> values)`**
Sets AAF (likely *Analog Acquisition Fault*) exception data, mapping timestamps (double) to lists of exception values (e.g., error magnitudes).
---
### 3. **Invariants**
- **`ISummaryChannel`**
- `ChannelType` must be a non-null, non-empty string when set.
- `Assigned` must be ≥ 0.
- `Unassigned` may be empty or null if no unassigned channels exist.
- **`ISummaryViewModel`**
- `TestSetupComplete` must be set to `true` only after all required setup steps (e.g., file import, channel assignment) have succeeded.
- `SampleRate`, `RecordingMode`, `PreTrigger`, and `PostTrigger` must be initialized before `UpdateUI()` is called (behavior undefined if accessed prematurely).
- `SetChannelList()` must be called before relying on `ISummaryChannel` data in the view.
- `SetStatus()` with a non-null `error` implies an error state; `SetStatus(status, null)` should clear prior errors.
- `SetProgress()` values are expected to be in `[0.0, 1.0]`; out-of-range values may cause undefined behavior.
- **General**
- `View` must be assigned before calling `UpdateUI()`, `SetStatus()`, or any method that interacts with the UI.
- `GetTestId()` returns the value last set via `ISummaryView.SetTestName()` or `SetSerializedTestIdValues()`—no validation guarantees beyond view consistency.
---
### 4. **Dependencies**
- **Internal Dependencies**
- `DTS.Common.Base`: All interfaces inherit from `IBaseClass`, `IBaseView`, or `IBaseViewModel`.
- `DTS.Common.Enums`: `RecordingModes` enum is used in `ISummaryViewModel.RecordingMode`.
- `DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile`: Namespace referenced (likely contains file-parsing logic for TTS imports).
- **External Dependencies**
- Standard .NET collections: `string[]`, `Dictionary<double, List<double>>`, `int[]`.
- No external libraries or third-party dependencies are imported.
- **Consumers**
- Likely consumed by concrete implementations of `ISummaryView` (e.g., WPF/WinForms UI controls) and `ISummaryViewModel` (e.g., `SummaryViewModel` class).
- The `TTS.ReadFile` namespace (implied by import) likely depends on `ISummaryViewModel` to populate summary data after parsing.
---
### 5. **Gotchas**
- **Ambiguous `Unassigned` Format**: The `Unassigned` property in `ISummaryChannel` is a `string` but its format (e.g., `"0"`, `"N/A"`, `"CH1,CH3"`) is not specified. Consumers must infer parsing rules from implementation.
- **`GetTestId()` Duplication**: Both `ISummaryView` and `ISummaryViewModel` expose `GetTestId()`. The view models implementation likely delegates to the view, but callers must ensure `View` is assigned to avoid `NullReferenceException`.
- **`SetAAFExceptions` Semantics**: The purpose of `Dictionary<double, List<double>>` for AAF exceptions is unclear without context—e.g., whether keys are timestamps, indices, or error codes.
- **No Validation on `SetProgress`**: No guardrails prevent progress values outside `[0.0, 1.0]`; UI may misbehave if invalid values are passed.
- **`SetSerializedTestIdValues` vs `UpdateTestIds`**: The distinction between these methods is not documented—`SetSerializedTestIdValues` likely stores raw data, while `UpdateTestIds` triggers UI rendering. Confusing usage may occur if order is reversed.
- **No Error Handling Contract**: `SetStatus(status, error)` does not specify whether `error` is logged, displayed, or both.
*None identified from source alone.*