98 lines
6.8 KiB
Markdown
98 lines
6.8 KiB
Markdown
|
|
---
|
|||
|
|
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-16T02:32:49.562747+00:00"
|
|||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
|||
|
|
schema_version: 1
|
|||
|
|
sha256: "a5f27c5a375dc7b6"
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# TestModification
|
|||
|
|
|
|||
|
|
## Documentation: Test Modification Module Interfaces
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### 1. Purpose
|
|||
|
|
This module defines the core interfaces for the *Test Modification* feature, which enables users to modify properties of a selected test channel (e.g., description, Eu multiplier/offset, T0/T1/T2 timing, sensitivity, software filter, and data flag). It follows the MVVM pattern, with `ITestModificationView`, `ITestModificationViewModel`, and `ITestModificationModel` forming the view, view model, and model layers respectively. The module exists to encapsulate state and behavior related to channel-specific modifications, supporting features such as ISO code synchronization when software filters change and configurable representation of unfiltered states (e.g., `"0"` vs `"P"`).
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### 2. Public Interface
|
|||
|
|
|
|||
|
|
#### `ITestModificationView`
|
|||
|
|
- **Inherits**: `IBaseView`
|
|||
|
|
- **Description**: Marker interface for the view layer of the test modification UI. No additional members defined beyond base view contract.
|
|||
|
|
|
|||
|
|
#### `ITestModificationViewModel`
|
|||
|
|
- **Inherits**: `IBaseViewModel`
|
|||
|
|
- **Properties**:
|
|||
|
|
- `ITestModificationView View { get; set; }` – Binds to the associated view instance.
|
|||
|
|
- `IBaseViewModel Parent { get; set; }` – Reference to the parent view model (e.g., containing test configuration).
|
|||
|
|
- `bool UseISOCodeFilterMapping { get; set; }` – Controls whether modifying the software filter should trigger automatic ISO code updates.
|
|||
|
|
- `bool UseZeroForUnfiltered { get; set; }` – Controls whether `"0"` or `"P"` is used when the ISO code is auto-updated due to filter change (i.e., for unfiltered state).
|
|||
|
|
- **Methods**:
|
|||
|
|
- `void PublishChanges()` – Commits pending modifications (e.g., to the selected channel or underlying data model). Behavior not specified beyond this; implementation-dependent.
|
|||
|
|
|
|||
|
|
#### `ITestModificationModel`
|
|||
|
|
- **Inherits**: `IBaseModel`
|
|||
|
|
- **Properties**:
|
|||
|
|
- `ITestModificationViewModel Parent { get; set; }` – Back-reference to the associated view model.
|
|||
|
|
- `ITestChannel SelectedChannel { get; set; }` – The channel whose properties are being modified.
|
|||
|
|
- `string Description { get; set; }` – The `ChannelDescriptionString` of `SelectedChannel`.
|
|||
|
|
- `bool IsModifiedDescription { get; }` – `true` if `Description` differs from the channel’s original value.
|
|||
|
|
- `double EuMultiplier { get; set; }` – Eu multiplier of `SelectedChannel`.
|
|||
|
|
- `bool IsModifiedEuMultiplier { get; }` – `true` if `EuMultiplier` differs from original.
|
|||
|
|
- `double EuOffset { get; set; }` – Eu offset of `SelectedChannel`.
|
|||
|
|
- `bool IsModifiedEuOffset { get; }` – `true` if `EuOffset` differs from original.
|
|||
|
|
- `double T0 { get; set; }` – T0 offset in milliseconds.
|
|||
|
|
- `bool IsModifiedT0 { get; }` – `true` if `T0` differs from original.
|
|||
|
|
- `bool IsModifiedLineFit { get; set; }` – `true` if `T1` or `T2` has been modified.
|
|||
|
|
- `double T1 { get; set; }` – Start time (ms) for line fit.
|
|||
|
|
- `double T2 { get; set; }` – End time (ms) for line fit.
|
|||
|
|
- `bool IsModifiedSensitivity { get; }` – `true` if `Sensitivity` differs from original.
|
|||
|
|
- `double Sensitivity { get; set; }` – Sensitivity of `SelectedChannel`.
|
|||
|
|
- `bool IsModifiedFilter { get; }` – `true` if `SelectedFilter` differs from original.
|
|||
|
|
- `IFilterClass SelectedFilter { get; set; }` – Software filter applied to `SelectedChannel`.
|
|||
|
|
- `T0Mode T0Mode { get; set; }` – Adjustment mode for T0 (type `T0Mode` not defined in provided sources).
|
|||
|
|
- `DataFlag SelectedDataFlag { get; set; }` – Data flag for `SelectedChannel`.
|
|||
|
|
- `bool IsModifiedDataFlag { get; }` – `true` if `SelectedDataFlag` differs from original.
|
|||
|
|
- `bool IsModified { get; }` – `true` if *any* channel property has been modified.
|
|||
|
|
- **Methods**:
|
|||
|
|
- `bool ValidateT0()` – Returns `true` if `T0` is within the valid time range of the dataset; `false` otherwise.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### 3. Invariants
|
|||
|
|
- `SelectedChannel` must be non-null for `ITestModificationModel` to function meaningfully (all `IsModified*` properties and value getters depend on it).
|
|||
|
|
- `IsModified*` properties are read-only indicators of whether the corresponding property differs from the *original* value of `SelectedChannel` (not necessarily the current in-memory value).
|
|||
|
|
- `IsModified` is a logical OR of all `IsModified*` properties (inferred from documentation).
|
|||
|
|
- `ValidateT0()` must evaluate `T0` against the dataset’s time bounds (exact bounds unspecified).
|
|||
|
|
- `UseISOCodeFilterMapping` and `UseZeroForUnfiltered` only affect behavior when `SelectedFilter` is modified *and* ISO code synchronization is enabled (implementation detail not specified).
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### 4. Dependencies
|
|||
|
|
|
|||
|
|
#### This Module Depends On:
|
|||
|
|
- `DTS.Common.Base` namespace: Provides `IBaseView`, `IBaseViewModel`, `IBaseModel`.
|
|||
|
|
- `DTS.Common.Interface.Sensors.SoftwareFilters`: Provides `IFilterClass`.
|
|||
|
|
- `DTS.Common.Interface`: Contains `ITestChannel`, `DataFlag`, and `T0Mode` (not shown in source but referenced).
|
|||
|
|
|
|||
|
|
#### This Module Is Used By:
|
|||
|
|
- Likely consumed by higher-level modules (e.g., test configuration UI, channel editor) that instantiate and wire `ITestModificationViewModel` and `ITestModificationModel`.
|
|||
|
|
- `ITestModificationView` implies integration with a UI framework (e.g., WPF) via `IBaseView`.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### 5. Gotchas
|
|||
|
|
- `IsModifiedLineFit` is the only `IsModified*` property defined as `get; set;` (others are `get;` only). This suggests it may be settable externally (e.g., to force marking line fit as modified without changing `T1`/`T2`), which is inconsistent with other flags.
|
|||
|
|
- `SelectedFilter` uses `IFilterClass` (comment notes: *"FB 13120 Use IFilterClass instead of CFCFilter"*), indicating a refactor history. Ensure no legacy code still assumes `CFCFilter`.
|
|||
|
|
- `T0Mode` and `DataFlag` types are referenced but not defined in the provided sources; their semantics and valid values are unknown here.
|
|||
|
|
- `ValidateT0()`’s behavior is underspecified: "within the dataset" is ambiguous (e.g., dataset start/end? sample timestamps? configuration bounds?).
|
|||
|
|
- No explicit event or notification mechanism is defined for change tracking (e.g., `INotifyPropertyChanged`). Assumed to be provided via `IBaseViewModel`/`IBaseModel` or external mechanisms.
|
|||
|
|
- None of the `IsModified*` properties are resettable—once `true`, they remain `true` unless the value is reverted to the original (implementation-dependent).
|
|||
|
|
|
|||
|
|
None identified beyond the above.
|