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,64 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/AnalogChannels/IAnalogChannelsView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/AnalogChannels/IAnalogChannelsViewModel.cs
generated_at: "2026-04-16T03:12:39.216413+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "434d4c5815e120f6"
---
# AnalogChannels
### 1. Purpose
This module defines the view and view model interfaces for the *Analog Channels* section of the TTS (presumably *Test Terminal System*) import configuration UI. It serves as the MVVM (Model-View-ViewModel) contract for presenting and managing user interactions related to analog channel configuration—such as selecting, editing, or validating analog input/output channel settings—within the broader test setup import workflow. Its role is to decouple UI presentation logic from business logic and infrastructure concerns, enabling test setup tools to support analog channel configuration in a testable and maintainable way.
### 2. Public Interface
#### `IAnalogChannelsView`
- **Namespace**: `DTS.Common.Interface.TestSetups.Imports.TTS`
- **Inherits**: `IBaseView`
- **Definition**:
```csharp
public interface IAnalogChannelsView : IBaseView { }
```
- **Behavior**: A marker interface for the view layer (e.g., a WPF `UserControl`, WinForms `Form`, or similar UI container) responsible for rendering the analog channels UI. It carries no additional members beyond those inherited from `IBaseView`, implying the base view contract likely handles common view concerns (e.g., lifecycle, binding context). Actual UI rendering and event wiring are assumed to be implemented by concrete types.
#### `IAnalogChannelsViewModel`
- **Namespace**: `DTS.Common.Interface.TestSetups.Imports.TTS`
- **Inherits**: `IBaseViewModel`
- **Definition**:
```csharp
public interface IAnalogChannelsViewModel : IBaseViewModel
{
IAnalogChannelsView View { get; set; }
string Validate();
}
```
- **Behavior**:
- `View { get; set; }`: Gets or sets the associated view instance. Enables two-way binding or manual view-viewmodel coordination (e.g., in MVVM frameworks where the view model holds a reference to its view).
- `Validate()`: Performs validation of the current analog channel configuration state. Returns a `string`—presumably an error message if validation fails, or an empty string (`""`) or `null` if valid. *Note: The exact semantics of the return value (e.g., empty vs. `null` for success) are not specified in the interface.*
### 3. Invariants
- `IAnalogChannelsView` must be implemented by a concrete UI component that can be bound to an `IAnalogChannelsViewModel`.
- `IAnalogChannelsViewModel.View` must be set to a valid instance of `IAnalogChannelsView` before the view model is used in a UI context (e.g., before `Validate()` is called or data binding is established).
- `Validate()` is expected to be idempotent and side-effect-free *with respect to state changes*—i.e., it should only inspect current state and return a diagnostic message, not mutate the view model or view. *(This is inferred from naming convention and typical MVVM patterns, but not guaranteed by the interface alone.)*
- The interfaces assume `IBaseView` and `IBaseViewModel` provide foundational contracts (e.g., `DataContext`, `Initialize`, `Close`), but their exact contents are not visible here.
### 4. Dependencies
- **Internal Dependencies**:
- `DTS.Common.Base.IBaseView` and `DTS.Common.Base.IBaseViewModel` (from `DTS.Common.Base` namespace).
- **External Dependencies**:
- This module is part of `DTS.Common.Interface.TestSetups.Imports.TTS`, implying it is consumed by higher-level test setup import components (e.g., a `TTSImportWizard`, `TestSetupEditor`, or `ImportConfigurationService`).
- Concrete implementations of `IAnalogChannelsView` and `IAnalogChannelsViewModel` will depend on UI framework-specific libraries (e.g., WPF, WinForms, MAUI), but those are not declared in the interfaces themselves.
- **Consumers**: Any module responsible for orchestrating TTS import flows (e.g., `TTSImportViewModel`, `TestSetupImportService`) will depend on these interfaces to instantiate and coordinate the analog channels UI.
### 5. Gotchas
- **Ambiguity in `Validate()` return semantics**: The interface does not specify whether `Validate()` returns `null`, `""`, or `"OK"` on success, or how multiple validation errors are aggregated (e.g., newline-separated messages). This could lead to inconsistent error handling in consumers.
- **No explicit error reporting mechanism**: Validation failures are communicated solely via a `string`, with no structured error details (e.g., field-level errors, severity levels, or error codes). Consumers may need to parse the string or assume a custom format.
- **View assignment responsibility**: The `View` property is read-write, but the interface does not clarify *who* is responsible for setting it (e.g., the view itself during initialization, or the view model via DI/container). This could cause null reference issues if mismanaged.
- **No data members exposed**: The interface contains no properties or commands for channel configuration (e.g., `ChannelList`, `SelectedChannel`, `ApplyCommand`). This suggests either:
- The actual configuration data lives in a separate model/view model (e.g., `IAnalogChannelConfigViewModel`), or
- The interfaces are intentionally minimal stubs for future expansion.
*Without concrete implementations, the full scope of analog channel functionality is not evident.*
- **No versioning or extensibility markers**: The interfaces lack attributes (e.g., `[ContractVersion]`) or extensibility hooks (e.g., `INotifyPropertyChanged`), suggesting they may be tightly coupled to a specific UI framework or version.

View File

@@ -0,0 +1,44 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/DIChannels/IDigitalInputChannelsView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/DIChannels/IDigitalInputChannelsViewModel.cs
generated_at: "2026-04-16T03:12:24.545763+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "1d90ef476b6595a5"
---
# DIChannels
## 1. Purpose
This module defines foundational interfaces for the digital input channels view-model/view layer within the TTS (presumably *Test Terminal System*) test setup import functionality. It establishes the contract between the UI presentation layer (`IDigitalInputChannelsView`) and its corresponding data-binding context (`IDigitalInputChannelsViewModel`), enabling separation of concerns and testability in the UI architecture. The interfaces are minimal and serve as extension points in a larger MVVM (Model-View-ViewModel) pattern implementation, specifically for digital input channel configuration or monitoring UI components.
## 2. Public Interface
- **`IDigitalInputChannelsView`**
*Signature:* `public interface IDigitalInputChannelsView : IBaseView`
*Behavior:* Represents the view layer for digital input channels. It inherits from `IBaseView`, implying it participates in a standard view lifecycle (e.g., initialization, binding, disposal). No additional members are defined in this interface; it acts as a marker interface for type-safe view resolution and dependency injection.
- **`IDigitalInputChannelsViewModel`**
*Signature:* `public interface IDigitalInputChannelsViewModel : IBaseViewModel`
*Behavior:* Represents the view-model layer for digital input channels. It inherits from `IBaseViewModel`, implying standard view-model responsibilities (e.g., command handling, state management, INotifyPropertyChanged implementation). It exposes a single property:
- `View`: A get/set property of type `IDigitalInputChannelsView`, used to establish the view-model-to-view link (typical in MVVM for view-first or view-model-first activation patterns).
## 3. Invariants
- `IDigitalInputChannelsView` must implement `IBaseView`.
- `IDigitalInputChannelsViewModel` must implement `IBaseViewModel`.
- The `View` property on `IDigitalInputChannelsViewModel` must be assignable (read-write), allowing the view-model to hold a reference to its associated view instance.
- No additional runtime guarantees (e.g., thread-safety, initialization order) are specified in the source; these are assumed to be handled by the consuming framework or implementation.
## 4. Dependencies
- **Depends on:**
- `DTS.Common.Base` namespace (specifically `IBaseView` and `IBaseViewModel`).
- **Depended on by (inferred):**
- Likely consumed by a DI container or UI framework to resolve/view-attach logic for digital input channel UI modules.
- Implied consumers include concrete implementations of `IDigitalInputChannelsView` (e.g., WPF `UserControl`, WinForms `Panel`) and `IDigitalInputChannelsViewModel` (e.g., a class managing DI channel state).
- No direct usage in the provided source; dependencies are inferred from the MVVM pattern and namespace structure.
## 5. Gotchas
- **No behavior defined:** Both interfaces are empty beyond inheritance and the `View` property. Actual functionality (e.g., channel data, commands, events) must be implemented in concrete classes or extended interfaces—this module only provides structural scaffolding.
- **Ambiguous `View` lifecycle:** The source does not clarify ownership or lifecycle management of the `View` reference (e.g., is it weak/strong? who sets/disposes it?). This is common in MVVM but can lead to memory leaks if not handled carefully.
- **No versioning or extensibility hooks:** The interfaces are sealed by design (no methods/events), limiting future extension without breaking changes.
- **None identified from source alone.**

View File

@@ -0,0 +1,48 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/DOChannels/IDigitalOutputChannelsView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/DOChannels/IDigitalOutputChannelsViewModel.cs
generated_at: "2026-04-16T03:12:50.087875+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "2bd296ca29e39b6f"
---
# DOChannels
## 1. Purpose
This module defines the core view and view model interfaces for the digital output channels (DO channels) section within the TTS (presumably *Test Tool Suite*) import subsystem. It establishes the contract for a MVVM (Model-View-ViewModel) pattern implementation specific to digital output channel configuration or display, enabling separation of UI concerns (`IDigitalOutputChannelsView`) from business/logic state (`IDigitalOutputChannelsViewModel`). The interfaces are minimal and serve as extension points in the larger test setup import infrastructure.
## 2. Public Interface
### `IDigitalOutputChannelsView`
- **Signature**: `public interface IDigitalOutputChannelsView : IBaseView`
- **Behavior**: Represents the UI layer for digital output channels. As a view interface, it is expected to be implemented by concrete UI components (e.g., WPF `UserControl`, WinForms `Panel`, or similar). It inherits `IBaseView`, implying standard view lifecycle or binding contract (e.g., data context assignment, initialization hooks), though specifics are defined in `IBaseView` (not provided here).
### `IDigitalOutputChannelsViewModel`
- **Signature**: `public interface IDigitalOutputChannelsViewModel : IBaseViewModel`
- **Behavior**: Represents the view model for digital output channels. It exposes a single property:
- `View`: A `get`/`set` property of type `IDigitalOutputChannelsView`. This enables the view model to hold a reference to its associated view, supporting scenarios like view-driven updates, event wiring, or view lifecycle coordination (e.g., in a service locator or manual MVVM binding setup). Inheritance from `IBaseViewModel` implies standard view model responsibilities (e.g., `INotifyPropertyChanged` implementation, command handling), though details reside in `IBaseViewModel`.
## 3. Invariants
- `IDigitalOutputChannelsView` must implement `IBaseView`.
- `IDigitalOutputChannelsViewModel` must implement `IBaseViewModel`.
- The `View` property on `IDigitalOutputChannelsViewModel` is read-write (`get`/`set`), implying the view model may be instantiated before the view (e.g., via DI or factory) and the view reference assigned later.
- No additional validation or state constraints are specified in the source (e.g., nullability of `View`, ordering of assignment, or mutual exclusion rules).
## 4. Dependencies
- **Internal dependencies**:
- `DTS.Common.Base` namespace (specifically `IBaseView` and `IBaseViewModel`).
- **External dependencies**:
- This module is part of `DTS.Common.Interface.TestSetups.Imports.TTS.DOChannels`, suggesting it integrates with broader test setup import functionality (e.g., test sequence execution, hardware abstraction).
- Likely consumed by higher-level modules managing test setups (e.g., `ITestSetupImporter`, `ITTSImportService`), though no direct references to such types appear in the provided source.
- **Consumers**: Any component responsible for rendering or orchestrating digital output channel UI (e.g., a view factory, navigation service, or main window controller) would depend on these interfaces.
## 5. Gotchas
- **Ambiguity in `View` property semantics**: The `View` property on `IDigitalOutputChannelsViewModel` is a direct reference to the view interface, which is atypical in strict MVVM (where view models usually avoid direct view references to preserve testability and separation). This suggests a pragmatic or legacy design choice—e.g., to support event-driven view updates or custom binding logic. Caution is advised to avoid tight coupling or view-specific logic in the view model.
- **No data members defined**: Neither interface declares properties for channel data (e.g., channel count, state, configuration). This implies either:
- Data is exposed via `IBaseViewModel`/`IBaseView` (e.g., via a generic `DataContext`),
- Or concrete implementations define additional members (not captured here),
- Or this module is intentionally skeletal and intended for future extension.
- **No documentation on lifecycle or threading**: No guidance is provided on thread affinity (e.g., UI thread requirements) or initialization sequence (e.g., must `View` be set before use?).
- **None identified from source alone** regarding naming, constants, or behavioral quirks beyond the above.

View File

@@ -0,0 +1,81 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/EditFile/IEditFileView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/EditFile/IEditFileViewModel.cs
generated_at: "2026-04-16T03:12:49.984508+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "1175b1a21ab11730"
---
# EditFile
## Documentation: `IEditFileView` and `IEditFileViewModel` Interfaces
---
### 1. **Purpose**
This module defines the view and view model interfaces for the *Edit File* screen within the TTS (likely *Test Time Setup*) import workflow. It supports editing of TTS channel records, including validation of user input and filtering of available sensors. The interfaces follow the MVVM (Model-View-ViewModel) pattern, with `IEditFileView` representing the UI layer contract and `IEditFileViewModel` encapsulating the presentation logic and state. The module exists to decouple UI implementation from business logic, enabling testability and maintainability of the file-editing functionality.
---
### 2. **Public Interface**
#### `IEditFileView`
- **Inherits**: `IBaseView`
- **Description**: A marker interface representing the view layer for the Edit File screen. It carries no additional members beyond its base contract.
#### `IEditFileViewModel`
- **Inherits**: `IBaseViewModel`
- **Properties**:
- `IEditFileView View { get; set; }`
Gets or sets the associated view instance. Enables two-way binding or manual view coordination.
- `bool ChangeValidationIsNeeded { get; set; }`
A flag indicating whether change validation is required (e.g., on user input). Likely used to gate expensive or conditional validation logic.
- **Methods**:
- `bool Validate()`
Performs full validation of the current state (e.g., all fields on the page). Returns `true` if valid, `false` otherwise.
- `bool ValidateChange(ITTSChannelRecord record = null)`
Validates *changes* made on the page. If a non-null `record` is provided, ensures no `RequiredChannels` have duplicate channel codes. Designed to be called incrementally (e.g., during editing), not necessarily for full-page validation.
- `void InitializeView()`
Initializes UI components in the associated `View`. Typically called after view binding or construction.
- `void Search(string text)`
Filters the list of available sensors based on the provided `text`. Behavior implies a search/filter UI (e.g., autocomplete or list filtering).
---
### 3. **Invariants**
- `IEditFileViewModel` must maintain a valid reference to an `IEditFileView` instance via the `View` property when `InitializeView()` or `Search()` are invoked (though null-safety is not specified).
- `ValidateChange` must respect the semantics described in its XML summary:
- When `record` is `null`, validation applies only to the *current page changes*.
- When `record` is non-null, it must additionally check for duplicate `RequiredChannels` by channel code.
- `ChangeValidationIsNeeded` is a mutable flag; its value is expected to be set by external logic (e.g., UI event handlers) to control when validation should run.
- `InitializeView()` is expected to be called *before* any other methods that interact with the `View` (e.g., `Search`, `Validate`)—though not strictly enforced by the interface.
---
### 4. **Dependencies**
- **Internal Dependencies**:
- `DTS.Common.Base` namespace (provides `IBaseView`, `IBaseViewModel`).
- `DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile` namespace (provides `ITTSChannelRecord`, used in `ValidateChange`).
- **External Dependencies**:
- `ITTSChannelRecord` (from `ReadFile`) is assumed to define `RequiredChannels` and channel code properties—though its structure is not included here.
- **Consumers**:
- Likely consumed by concrete implementations of `IEditFileView` (e.g., a WPF or WinForms view class) and `IEditFileViewModel` (e.g., a view model class in the TTS import module).
- May be used by dependency injection containers or MVVM frameworks to wire up view/view model pairs.
---
### 5. **Gotchas**
- **Ambiguity in `Validate()` vs `ValidateChange()`**: The distinction between `Validate()` (full-page validation) and `ValidateChange()` (incremental change validation) is *documented in comments* but not enforced by the interface. Implementers must ensure correct usage to avoid inconsistent validation behavior.
- **`ITTSChannelRecord` contract is external**: The interface relies on `ITTSChannelRecord` (from `ReadFile`) and its `RequiredChannels` property. Without that types definition, the exact validation logic (e.g., how duplicates are detected) cannot be fully inferred.
- **`ChangeValidationIsNeeded` semantics are unspecified**: The interface does not define *when* this flag should be `true` or how it affects validation. Its behavior is implementation-dependent.
- **No error reporting mechanism**: Neither interface exposes error messages or validation result details (e.g., `IErrorProvider` or `ValidationResult`). Error handling is likely handled via side effects (e.g., UI binding errors) or external mechanisms.
- **`Search` behavior is underspecified**: The interface does not define how filtering is applied (e.g., substring match, case sensitivity, or whether it updates the view directly). Implementation details may vary.
None identified beyond the above ambiguities.

View File

@@ -0,0 +1,108 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IHardwareScanView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IChannelSummary.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IDasSummary.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IHardwareSummaryRecord.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/HardwareScan/IHardwareScanViewModel.cs
generated_at: "2026-04-16T03:13:13.284640+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "8526536e9586e406"
---
# HardwareScan
## Documentation: Hardware Scan Module
### 1. Purpose
This module defines the core interfaces for the *Hardware Scan* feature within the DTS (Diagnostic Test System) framework. It provides a contract layer for view-model and view implementations that handle hardware inventory scanning, status reporting, and channel summary aggregation—specifically for TTS (Test Tool Suite) import workflows. The interfaces standardize how hardware components (e.g., DOut, DIn, Squib, Analog, ECM, SPS, SPD, SPT, G5, Rack) are tracked, summarized, and displayed during a scan operation, enabling decoupled UI and business logic for hardware diagnostics.
---
### 2. Public Interface
#### Interfaces
- **`IHardwareScanView : IBaseView`**
Marker interface for the view layer of the hardware scan UI. Extends `IBaseView`, implying it participates in the standard view lifecycle (e.g., binding, lifecycle management). No additional members defined.
- **`IChannelSummary : IBaseClass`**
Represents aggregated statistics for a channel type.
- `string ChannelType { get; set; }` Identifier for the channel category (e.g., "DOUT", "ANALOG").
- `int Requested { get; set; }` Number of channels requested for this type.
- `int Assigned { get; set; }` Number of channels assigned during scan.
- `int Unassigned { get; set; }` Number of channels requested but not assigned.
- **`IDasSummary : IBaseClass`**
Encapsulates DAS (Data Acquisition System) hardware status.
- `string DASSerial { get; set; }` Serial number of the DAS unit.
- `string EIDFound { get; set; }` EID (Equipment ID) detected on the DAS.
- `string BatteryVoltageStatus { get; set; }` Status string for battery voltage (e.g., "OK", "LOW").
- `System.Windows.Media.SolidColorBrush BatteryVoltageColor { get; set; }` UI color brush for battery status.
- `string InputVoltageStatus { get; set; }` Status string for input voltage.
- `System.Windows.Media.SolidColorBrush InputVoltageColor { get; set; }` UI color brush for input voltage status.
- **`IHardwareSummaryRecord`**
Represents a single hardware summary record (e.g., per subsystem or test station).
- `uint DOut { get; set; }` Count of digital output channels.
- `uint DIn { get; set; }` Count of digital input channels.
- `uint Squib { get; set; }` Count of squib (explosive device) channels.
- `uint Analog { get; set; }` Count of analog channels.
- `uint Total { get; }` Read-only total of all channel counts (computed).
- `uint SPS { get; set; }` Count of SPS (Switch Power Supply) units.
- `uint SPD { get; set; }` Count of SPD (Switch Power Distributor) units.
- `uint SPT { get; set; }` Count of SPT (Switch Power Terminal) units.
- `uint ECM { get; set; }` Count of ECM (Engine Control Module) units.
- `uint Rack { get; set; }` Count of rack-mounted units.
- `uint G5 { get; set; }` Count of G5 units.
- `void UpdateTotal()` Recalculates and updates the `Total` property based on current counts.
- `void Update(uint analog, uint squib, uint din, uint dout, uint ecm, uint sps, uint spt, uint spd, uint g5, uint rack)` Updates all channel/unit counts in one call; likely triggers `UpdateTotal()` internally.
- **`IHardwareScanViewModel : IBaseViewModel`**
View-model interface for orchestrating the hardware scan process.
- `IHardwareScanView View { get; set; }` Reference to the associated view.
- `IHardwareSummaryRecord[] HardwareRecords { get; }` Read-only array of hardware summary records.
- `void SetStatus(string status)` Updates the UI status text (e.g., "Scanning...", "Complete").
- `void SetProgress(double progress)` Updates progress indicator (range: 0.01.0).
- `void HardwareScan()` Initiates the hardware scan operation.
- `void SetChannelSummaryList(ITTSChannelRecord[] channelRecords)` Populates channel summary data from raw channel records.
#### Delegates
- **`HardwareScanDelegate`**
Delegate signature for hardware scan operations: `void HardwareScanDelegate()`. Used to decouple scan invocation (e.g., for threading or event handling).
---
### 3. Invariants
- `IHardwareSummaryRecord.Total` is a *computed* property and must reflect the sum of all channel/unit counts (`DOut + DIn + Squib + Analog + ECM + SPS + SPD + SPT + G5 + Rack`).
- `IHardwareSummaryRecord.UpdateTotal()` must be called (explicitly or implicitly via `Update()`) to ensure `Total` remains consistent after any count modification.
- `IChannelSummary.Requested = Assigned + Unassigned` must hold for all records (implied by semantics, though not enforced by interface).
- `IDasSummary` properties (`BatteryVoltageStatus`, `InputVoltageStatus`) and their associated color brushes (`BatteryVoltageColor`, `InputVoltageColor`) must be kept in sync (e.g., "OK" ↔ green, "LOW" ↔ red).
- `IHardwareScanViewModel.HardwareRecords` is read-only; modifications require reassignment or internal mutation via the view-models logic (interface does not expose setters for the array itself).
---
### 4. Dependencies
#### Dependencies *of* this module:
- **`DTS.Common.Base`**: Provides base interfaces `IBaseView`, `IBaseClass`, and `IBaseViewModel`.
- **`System.Windows.Media`**: Used for `SolidColorBrush` in `IDasSummary` (WPF-specific).
- **`DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile`**: References `ITTSChannelRecord[]` in `IHardwareScanViewModel.SetChannelSummaryList()`.
- **`DTS.Common.Utils`**: Imported but no direct usage visible in this module (may be used in implementations).
#### Dependencies *on* this module:
- Any UI layer implementation (e.g., WPF views) must implement `IHardwareScanView`.
- View-model implementations (e.g., for TTS hardware scan workflows) must implement `IHardwareScanViewModel`.
- Components consuming hardware scan results (e.g., reporting, validation) depend on `IHardwareSummaryRecord`, `IChannelSummary`, and `IDasSummary`.
---
### 5. Gotchas
- **`IHardwareSummaryRecord.Total` is read-only**: Its value is *not* automatically updated when individual counts change; callers *must* invoke `UpdateTotal()` or `Update()` to maintain correctness.
- **`IHardwareScanViewModel.HardwareRecords` is an array**: Arrays are mutable in C#, but the interface exposes it as read-only (`get;` only). However, the *contents* of the array (i.e., `IHardwareSummaryRecord` objects) may still be mutable—callers should assume reference semantics and avoid external mutation unless documented otherwise.
- **WPF dependency**: `IDasSummary` uses `System.Windows.Media.SolidColorBrush`, making this module tightly coupled to WPF. It cannot be used in non-UI or cross-platform contexts without abstraction.
- **`SetChannelSummaryList` signature**: Takes `ITTSChannelRecord[]`, but `ITTSChannelRecord` is not defined in the provided files. Its structure and relationship to `IChannelSummary` must be inferred from external sources.
- **No error handling exposed**: `HardwareScan()` and `SetChannelSummaryList()` lack explicit error reporting (e.g., exceptions, return codes, or status callbacks). Error handling is likely implicit (e.g., via `SetStatus()` or exceptions thrown by implementations).
- **`HardwareScanDelegate` is unused in interfaces**: Defined but not referenced in any interface method—likely intended for internal use in concrete implementations (e.g., async/await or threading).
None identified beyond the above.

View File

@@ -0,0 +1,87 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/LevelTrigger/ILevelTriggerView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/LevelTrigger/ILevelTriggerViewModel.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/LevelTrigger/ILevelTrigger.cs
generated_at: "2026-04-16T03:12:36.684994+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "514ecd9d78491b12"
---
# LevelTrigger
## Documentation: Level Trigger Module
---
### 1. Purpose
This module defines the core interfaces for the *Level Trigger* functionality within the TTS (presumably *Test Trigger System*) import subsystem. It establishes the contract for modeling a level-triggering mechanism—likely used to initiate or control test sequences based on signal thresholds—by decoupling data (via `ILevelTrigger`), view-model (via `ILevelTriggerViewModel`), and view (via `ILevelTriggerView`) concerns. The module serves as a foundational abstraction for UI and logic layers to interact with level-trigger configurations, including channel assignment, threshold values (in % and engineering units), and metadata like hardware serial numbers and channel counts.
---
### 2. Public Interface
#### `ILevelTriggerView`
- **Definition**: `public interface ILevelTriggerView : IBaseView { }`
- **Behavior**: A marker interface extending `IBaseView`, representing the view layer for the level trigger UI component. No additional members are defined—its purpose is structural separation within the MVVM pattern.
#### `ILevelTriggerViewModel`
- **Definition**: `public interface ILevelTriggerViewModel : IBaseViewModel`
- `ILevelTriggerView View { get; set; }`
- **Behavior**: Extends `IBaseViewModel` and binds to an `ILevelTriggerView` instance. The `View` property enables two-way binding or manual assignment between the view and view-model layers.
#### `ILevelTrigger`
- **Definition**: `public interface ILevelTrigger`
- **Properties**:
- `string Code { get; }` — Identifier for the level trigger configuration.
- `string JCode { get; }` — Secondary identifier (possibly job- or project-specific).
- `double ValuePercent { get; set; }` — Trigger threshold as a percentage (e.g., 0100).
- `double ValueEU { get; set; }` — Trigger threshold in engineering units (e.g., volts, PSI).
- `string EULabel { get; }` — Human-readable label for the engineering unit (e.g., `"V"`, `"psi"`).
- `string HWSerialNumber { get; }` — Serial number of the associated hardware device.
- `int ChannelNumber { get; }` — Number of channels supported or currently in use.
- `ITTSChannelRecord Channel { get; set; }` — The *currently assigned* channel for triggering.
- `ITTSSetup TestSetup { get; }` — Reference to the parent test setup containing this trigger.
- `ITTSChannelRecord[] AvailableChannels { get; }` — List of channels eligible for assignment.
- `bool IsActive { get; }` — Indicates whether the level trigger is currently active/enabled.
- `bool IsModified { get; set; }` — Flag indicating whether the configuration has unsaved changes.
- **Methods**:
- `void Refresh()` — Updates the `AvailableChannels` collection and potentially reassigns `Channel` (e.g., if current channel becomes unavailable).
- `void Add(ITTSChannelRecord channel)` — Adds a channel to the `AvailableChannels` list.
- `void Remove(ITTSChannelRecord channel)` — Removes a channel from `AvailableChannels`; if `Channel == channel`, it is unassigned.
- `byte[] GetBytes()` — Returns a deterministic byte sequence for hashing (e.g., for change detection or serialization).
---
### 3. Invariants
- `Channel` must be `null` or an element of `AvailableChannels`.
- `ChannelNumber` reflects the count of channels in `AvailableChannels` (though not explicitly enforced—implementation-dependent).
- `ValuePercent` and `ValueEU` represent the *same* threshold in different units; consistency between them is expected but not enforced by the interface.
- `IsActive` and `IsModified` are independent flags; `IsModified` does not imply `IsActive`, and vice versa.
- `Refresh()` must ensure `AvailableChannels` is up-to-date and `Channel` remains valid (or becomes `null` if no valid channel remains).
---
### 4. Dependencies
#### *This module depends on*:
- `DTS.Common.Base` (for `IBaseView`, `IBaseViewModel`)
- `DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile` (for `ITTSChannelRecord`, `ITTSSetup`)
#### *This module is depended on by*:
- UI layers (via `ILevelTriggerView` and `ILevelTriggerViewModel`)
- Logic layers managing test setup configurations (via `ILevelTrigger`)
- Serialization/hashing utilities (via `GetBytes()`)
*Note*: Concrete implementations of `ITTSChannelRecord` and `ITTSSetup` are defined in the referenced namespace (`DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile`), but their details are not included here.
---
### 5. Gotchas
- **Ambiguity in `ChannelNumber`**: The interface does not clarify whether `ChannelNumber` represents the *total capacity* of the hardware or the *current count* of `AvailableChannels`.
- **No validation on `ValuePercent`/`ValueEU`**: The interface allows arbitrary `double` values; implementations must enforce ranges (e.g., 0100 for `%`).
- **`Refresh()` semantics**: The summary states it "updates available channels and Channel", but does not specify whether `Channel` is reset to `null` if no valid channel remains, or if it attempts to preserve the current assignment.
- **`IsModified` lifecycle**: The interface exposes `IsModified` as a settable property, but does not define when it should be set (e.g., by user input, programmatic changes, or explicit save events).
- **No thread-safety guarantees**: All members are non-atomic; concurrent access to `Channel`, `AvailableChannels`, or `IsModified` may require external synchronization.
- **None identified from source alone** for `ILevelTriggerView` and `ILevelTriggerViewModel` beyond structural MVVM assumptions.

View File

@@ -0,0 +1,266 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/ReadFile/IReadFileView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/ReadFile/IReadFileViewModel.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/ReadFile/ITTSSetup.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/ReadFile/ITTSChannelRecord.cs
generated_at: "2026-04-16T03:13:56.877656+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "ac5173b821639ae8"
---
# ReadFile
## Documentation: TTS Import File Reading Module
---
### 1. Purpose
This module defines the interfaces and contracts required to support importing and processing TTS (Time-To-Sample) format test setup files—specifically CSV-based configurations used in data acquisition test setups. It enables decoupled reading of file metadata (e.g., channel definitions, trigger settings, sensor properties) into structured domain objects (`ITTSSetup`, `ITTSChannelRecord`) while supporting view-model/view patterns for UI integration. The module does *not* contain implementation logic for parsing files; rather, it provides the abstraction layer for consumers (e.g., import handlers, UI views) to interact with imported test setup data in a consistent, testable manner.
---
### 2. Public Interface
#### `IReadFileView`
- **Namespace**: `DTS.Common.Interface`
- **Inherits**: `IBaseView`
- **Description**: Marker interface for the view layer in the TTS import flow. No additional members beyond base view contract.
#### `IReadFileViewModel`
- **Namespace**: `DTS.Common.Interface`
- **Inherits**: `IBaseViewModel`
- **Members**:
- `IReadFileView View { get; set; }`
Binds the view instance to the view model.
- `void SetStatus(string status)`
Updates the UI status with a single status message.
- `void SetStatus(string status, string error)`
Updates the UI status with both a status message and an error string (e.g., for warnings or failures).
- `void SetProgress(double progress)`
Reports progress (0.01.0) during file reading.
- `string FileToImport { get; set; }`
Gets or sets the path of the file currently being processed.
- `void ReadFile(string fileName, double defaultSampleRate, RecordingModes defaultMode, double defaultTTSPreTrigger, double defaultTTSPostTrigger, double defaultTTSROIStart, double defaultTTSROIEnd, bool defaultRequireEIDFound, string defaultDigitalInputMode, ISquibSettingDefaults squibDefaults)`
Initiates reading and parsing of the specified file (`fileName`) using provided default configuration values. Populates an `ITTSSetup` instance (implementation detail, not exposed here).
- **Delegate**:
- `ReadFileDelegate(string importFile)`
A delegate type used to invoke file reading asynchronously or via event subscription. Signature matches `ReadFile`s primary parameter.
#### `ITTSSetup`
- **Namespace**: `DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile`
- **Properties**:
- `string Filename { get; set; }`
Path of the imported file.
- `string TestId { get; set; }`
Identifier for the test setup.
- `string Line1` through `Line4 { get; set; }`
First four lines of the CSV file (used for preserving header context in "Edit File" workflows).
- `string[] DummyList { get; set; }`
Placeholder for unused or legacy data (purpose unclear from interface alone).
- `double SampleRate { get; set; }`
Sampling rate (Hz) for the test.
- `RecordingModes Mode { get; set; }`
Recording mode (e.g., Standard, Circular, etc.).
- `double TestLength { get; }`
Duration (seconds) of the test (read-only).
- `double PreTrigger { get; set; }`
Pre-trigger buffer duration (seconds).
- `double PostTrigger { get; set; }`
Post-trigger buffer duration (seconds).
- `double ROIStart { get; set; }`
Start time (seconds) of Region of Interest.
- `double ROIEnd { get; set; }`
End time (seconds) of Region of Interest.
- `ITTSChannelRecord[] Channels { get; set; }`
Array of channel records (sensors, digital I/O, squibs).
- `ILevelTrigger[] LevelTriggers { get; set; }`
Array of level trigger configurations.
- `string OriginalImportFile { get; set; }`
Original file path before any modifications.
- `bool AllowAdvancedRecordingModes { get; set; }`
Global flag allowing hybrid/circular buffer + recorder modes.
- `bool AllowActiveRecordingModes { get; set; }`
Global flag allowing Active RAM and Active RAM Multiple Events modes.
- `bool AllowTSRAIRRecordingModes { get; set; }`
Global flag allowing TSR-AIR modes (purpose unclear from interface alone).
- `bool RequireEIDFound { get; set; }`
If `true`, sensors without a valid EID are excluded.
- `string DefaultDigitalInputMode { get; set; }`
Default digital input mode (e.g., from `DataPRO.config.exe`).
- `double DefaultSquibFireDurationMs { get; set; }`
Default squib fire duration (ms) from configuration.
- `string GetHashCode()`
Returns a hash code string for the setup (likely for change detection).
- `Tuple<string, string>[] PreAssignedSensorIdAndHwId { get; set; }`
Pre-assigned sensor-to-hardware mappings (used during XML import before hardware scan completes).
#### `ITTSChannelRecord`
- **Namespace**: `DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile`
- **Properties**:
- `int ChannelNumber { get; set; }`
Logical channel index.
- `string ChannelCode { get; set; }`
Channel identifier (e.g., "ACC1").
- `string JCodeOrDescription { get; set; }`
J-code or human-readable description.
- `double ChannelRange { get; set; }`
Measurement range (e.g., ±5V).
- `int ChannelFilterHz { get; set; }`
Anti-aliasing filter cutoff (Hz).
- `string SensorEID { get; set; }`
Sensor Electronic ID (unique identifier).
- `string SensorSerialNumber { get; set; }`
Sensor serial number.
- `double SensorSensitivity { get; set; }`
Sensor sensitivity (e.g., mV/unit).
- `double SensorExcitationVolts { get; set; }`
Excitation voltage (V) for the sensor.
- `double SensorCapacity { get; set; }`
Sensor capacitance (pF).
- `string SensorEU { get; set; }`
Sensor engineering units (e.g., "g", "psi").
- `bool SensorPolarity { get; set; }`
Sensor polarity (true = positive).
- `ToyotaBridgeType ChannelType { get; set; }`
Bridge type (e.g., Full, Half, Quarter).
- `string Description { get; set; }`
Channel description.
- `bool ProportionalToExcitation { get; set; }`
Whether sensor output scales with excitation voltage.
- `double BridgeResistance { get; set; }`
Bridge resistance (Ω).
- `double InitialOffsetVoltage { get; set; }`
Initial offset voltage (V).
- `double InitialOffsetVoltageTolerance { get; set; }`
Tolerance for offset voltage (V).
- `bool RemoveOffset { get; set; }`
Whether to subtract offset during processing.
- `ToyotaZeroMethods ZeroMethod { get; set; }`
Zeroing method (e.g., Manual, Auto).
- `double CableMultiplier { get; set; }`
Cable length compensation factor.
- `double InitialEUInMV { get; set; }`
Initial value in engineering units (converted to mV).
- `double InitialEUInEU { get; set; }`
Initial value in engineering units.
- `double IRTraccExponent { get; set; }`
IR Tracc exponent for temperature compensation.
- `double PolynomialConstant { get; set; }`
Polynomial calibration constant term.
- `double PolynomialCoefficientC { get; set; }`
Polynomial coefficient C (quadratic term).
- `double PolynomialCoefficentB { get; set; }`
Polynomial coefficient B (linear term).
- `double PolynomialCoefficientA { get; set; }`
Polynomial coefficient A (quadratic term).
- `double PolynomialCoefficientAlpha { get; set; }`
Polynomial coefficient α (exponential term).
- `string ISOCode { get; set; }`
ISO standard code for the channel.
- `string ISODescription { get; set; }`
ISO description.
- `string ISOPolarity { get; set; }`
ISO polarity specification.
- `bool IsSquib { get; set; }`
Indicates if channel is a squib (pyrotechnic device).
- `bool IsDigitalInput { get; set; }`
Indicates if channel is a digital input.
- `bool IsDigitalOutput { get; set; }`
Indicates if channel is a digital output.
- `bool IsEmptyRecord { get; }`
`true` if `ChannelCode` and `SensorSerialNumber` are both empty.
- `IHardwareChannel HardwareChannel { get; set; }`
Reference to the hardware channel assigned to this record.
- `bool IsChannelCodeValid { get; set; }`
Whether `ChannelCode` passes validation.
- `bool IsJCodeValid { get; set; }`
Whether `JCodeOrDescription` passes validation.
- `bool IsRangeValid { get; set; }`
Whether `ChannelRange` is valid.
- `bool IsFilterValid { get; set; }`
Whether `ChannelFilterHz` is valid.
- `bool Disabled { get; set; }`
If `true`, channel is excluded during test execution.
- `SquibFireMode SquibFireMode { get; set; }`
Fire mode for squib channels (e.g., Normal, Test).
- `double SquibFireDelayMs { get; set; }`
Delay (ms) between trigger and squib fire.
- `bool LimitDuration { get; set; }`
Whether to limit squib fire duration.
- `double SquibFireDurationMs { get; set; }`
Duration (ms) of squib fire (if limited).
- `double SquibFireCurrent { get; set; }`
Current limit (amps) for squib fire.
- `double SquibFireResistanceLowOhm { get; set; }`
Lower bound of squib resistance tolerance (Ω).
- `double SquibFireResistanceHighOhm { get; set; }`
Upper bound of squib resistance tolerance (Ω).
- `DigitalInputModes DigitalInputMode { get; set; }`
Digital input mode (e.g., Edge, Level).
- `DigitalOutputModes DigitalOutputMode { get; set; }`
Digital output mode (e.g., Pulse, Latch).
- `double DigitalOutputDelay { get; set; }`
Delay (ms) between trigger and digital output.
- `double DigitalOutputDuration { get; set; }`
Duration (ms) of digital output pulse.
- `IEditFileViewModel Parent { get; set; }`
Reference to parent view model (for UI binding).
- `ITTSChannelRecord Copy()`
Deep copy of the channel record.
- `Visibility RangeVisible { get; }`
UI visibility state for range input (e.g., `Visible`, `Collapsed`).
- `Visibility FilterVisible { get; }`
UI visibility state for filter input.
- `bool OriginallyRequestedChannel { get; set; }`
Whether the channel was explicitly requested (vs. auto-generated).
- `bool DiagnosticsMode { get; set; }`
Enables diagnostics mode (if supported by hardware/firmware).
- `bool IsModified { get; set; }`
Whether the record has been modified since import.
- `byte[] GetBytes()`
Returns a byte array representation for hashing/CRC (used for integrity checks).
---
### 3. Invariants
- **`ITTSChannelRecord.IsEmptyRecord`**: Must be `true` *if and only if* both `ChannelCode` and `SensorSerialNumber` are `null` or empty strings.
- **`ITTSChannelRecord.IsSquib`, `IsDigitalInput`, `IsDigitalOutput`**: These flags are mutually exclusive—only one may be `true` per record.
- **`ITTSSetup.TestLength`**: Read-only; value is derived from other properties (e.g., `PreTrigger`, `PostTrigger`, `ROIStart`, `ROIEnd`) and must be consistent with them.
- **`IReadFileViewModel.ReadFile`**: Must not throw exceptions during file parsing; errors should be reported via `SetStatus(string, string)`.
- **`ITTSSetup.PreAssignedSensorIdAndHwId`**: Only populated during XML import; cleared once hardware assignment is finalized.
- **`AllowAdvancedRecordingModes`, `AllowActiveRecordingModes`, `AllowTSRAIRRecordingModes`**: Global flags that constrain which `RecordingModes` are permitted in `ITTSSetup.Mode`.
---
### 4. Dependencies
#### Dependencies *of* this module:
- **`DTS.Common.Base`**: Provides `IBaseView`, `IBaseViewModel`, `IBaseClass` base interfaces.
- **`DTS.Common.Enums`**: Supplies `RecordingModes`, `ToyotaBridgeType`, `ToyotaZeroMethods`, `SquibFireMode`, `DigitalInputModes`, `DigitalOutputModes`.
- **`DTS.Common.Interface.Sensors`**: Likely contains `ISquibSettingDefaults` (used in `ReadFile` signature).
- **`DTS.Common.Interface.DataRecorders`**: Supplies `IHardwareChannel` (used in `ITTSChannelRecord.HardwareChannel`).
- **`DTS.Common.Interface.TestSetups.Imports.TTS.LevelTrigger`**: Supplies `ILevelTrigger` (used in `ITTSSetup.LevelTriggers`).
#### Dependencies *on* this module:
- **UI Layer**: `IReadFileView` and `IReadFileViewModel` imply binding to WPF views (via `Visibility`, `IEditFileViewModel`).
- **Import Handlers**: Concrete implementations of `IReadFileViewModel` (e.g., `ReadFileViewModel`) will depend on this interface to parse files.
- **Test Setup Logic**: `ITTSSetup` and `ITTSChannelRecord` are used by downstream components (e.g., test execution, validation, export).
---
### 5. Gotchas
- **`GetHashCode()` in `ITTSSetup`**: This method is declared explicitly in the interface but not inherited from `object`. This is unusual—likely a legacy workaround for hashing. Consumers should verify whether it returns a string representation of a hash (e.g., `"ABC123"`) or a standard hash code.
- **`DummyList`**: Purpose and usage are undocumented; may be obsolete or reserved for future use. Avoid relying on its contents.
- **`IEditFileViewModel.Parent`**: The `Parent` property in `ITTSChannelRecord` creates a circular reference. Ensure implementations handle this carefully to avoid memory leaks or serialization issues.
- **`IsModified`**: No mechanism is defined to reset this flag; consumers must manage state manually (e.g., after saving).
- **`PreAssignedSensorIdAndHwId`**: Only used for XML imports. If non-XML import paths are used, this list should remain empty.
- **`ReadFileDelegate`**: Signature matches only the `fileName` parameter of `ReadFile`. It does *not* include the default configuration parameters—this may cause confusion if used for async invocation.
- **`IsChannelCodeValid`, `IsJCodeValid`, etc.**: These are *settable* properties, not computed read-only properties. Validation logic must be implemented externally (e.g., in view model or service layer).
- **No explicit error handling interface**: Errors during `ReadFile` are communicated via `SetStatus(string, string)`, but there is no structured exception or error code mechanism. Consumers must parse status strings for error details.
None identified beyond the above.

View File

@@ -0,0 +1,124 @@
---
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.*

View File

@@ -0,0 +1,63 @@
---
source_files:
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/TOMChannels/ITOMChannelsView.cs
- Common/DTS.Common/Interface/TestSetups/Imports/TTS/TOMChannels/ITOMChannelsViewModel.cs
generated_at: "2026-04-16T03:12:14.900868+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "3510602433a78ab8"
---
# TOMChannels
### 1. **Purpose**
This module defines the foundational interfaces for a Model-View-Presenter (MVP) or Model-View-ViewModel (MVVM)-style architectural pattern within the TTS (likely *Test Tool Suite* or *Tone Transfer System*) import subsystem. Specifically, `ITOMChannelsView` and `ITOMChannelsViewModel` establish the contract for a view and its associated view model responsible for managing TOM (likely *Test Object Model* or *Tone Output Module*) channel configuration or display. The interfaces serve as minimal abstractions to decouple UI presentation logic from business logic, leveraging existing base interfaces (`IBaseView`, `IBaseViewModel`) for consistency across the codebase.
---
### 2. **Public Interface**
- **`ITOMChannelsView`**
```csharp
public interface ITOMChannelsView : IBaseView { }
```
A marker interface extending `IBaseView`. It represents the *view* layer for TOM channel UI components (e.g., a dialog, control, or panel). No additional members are defined—behavior and data binding are expected to be handled via the associated view model or through inherited `IBaseView` functionality (e.g., initialization, lifecycle hooks).
- **`ITOMChannelsViewModel`**
```csharp
public interface ITOMChannelsViewModel : IBaseViewModel
{
ITOMChannelsView View { get; set; }
}
```
A view model interface extending `IBaseViewModel`. It exposes a bidirectional reference to its associated view via the `View` property (read-write), enabling the view model to interact with the view (e.g., trigger updates, respond to user actions). The property is nullable by default (no explicit nullability annotations), implying the view may be assigned lazily or set to `null` during disposal.
---
### 3. **Invariants**
- `ITOMChannelsView` must be implemented by a concrete UI component (e.g., a `UserControl`, `Form`, or WPF `UserControl`) that adheres to the contract of `IBaseView` (e.g., implements `IBaseView`s required members, such as `Initialize()` or `Close()`—though these are not visible here).
- `ITOMChannelsViewModel` must maintain a valid reference to an instance of `ITOMChannelsView` *after* the view is attached (via `View = ...`), and this reference must remain consistent during the view models active lifetime (unless explicitly reset).
- The `View` property on `ITOMChannelsViewModel` is expected to be set exactly once per view model instance during initialization (though the source does not enforce this, it is a common pattern in MVP/MVVM).
- No validation rules or data constraints are defined in this module alone; they are likely enforced in concrete implementations or downstream logic.
---
### 4. **Dependencies**
- **Depends on**:
- `DTS.Common.Base.IBaseView` (via `ITOMChannelsView`)
- `DTS.Common.Base.IBaseViewModel` (via `ITOMChannelsViewModel`)
*(Note: The definitions of `IBaseView` and `IBaseViewModel` are not provided here, but their existence is required for compilation.)*
- **Depended on by**:
- Concrete implementations of `ITOMChannelsView` (e.g., `TOMChannelsView : ITOMChannelsView`)
- Concrete implementations of `ITOMChannelsViewModel` (e.g., `TOMChannelsViewModel : ITOMChannelsViewModel`)
- Likely consumed by a presenter/controller or DI container to wire up the view/view model pair.
*(No direct usages are visible in the provided source files.)*
---
### 5. **Gotchas**
- **Ambiguous naming**: The acronyms `TOM` and `TTS` are not defined in this module. Their meaning (e.g., *Test Object Model*, *Tone Transfer System*) must be inferred from broader context.
- **Minimal interface definitions**: Both interfaces are effectively empty markers. Critical behavior (e.g., data binding, event handling, validation) is not specified here—developers must inspect concrete implementations or `IBaseView`/`IBaseViewModel` for details.
- **No null-safety guarantees**: The `View` property is read-write with no explicit null-checking semantics. If the view model assumes `View` is non-null, runtime errors may occur if it is accessed before assignment.
- **No versioning or extensibility hints**: The interfaces lack attributes (e.g., `[Obsolete]`, `[EditorBrowsable]`) or documentation on how they should be extended or versioned.
- **None identified from source alone.**