init
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/Commands/RelayCommand.cs
|
||||
generated_at: "2026-04-16T03:19:06.518329+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "33db5b96b73a6f00"
|
||||
---
|
||||
|
||||
# Commands
|
||||
|
||||
### 1. **Purpose**
|
||||
This module implements a concrete, reusable `ICommand`-based command class (`RelayCommand`) for WPF applications, enabling decoupling of UI actions (e.g., button clicks) from their execution logic. It supports optional conditional execution via a `CanExecute` predicate and integrates with WPF’s `CommandManager` to automatically re-evaluate command availability when UI state changes (e.g., focus or selection changes). Its role is to serve as a lightweight, standard command implementation for MVVM pattern adoption, avoiding boilerplate command classes per action.
|
||||
|
||||
---
|
||||
|
||||
### 2. **Public Interface**
|
||||
- **`RelayCommand(Action<object> execute)`**
|
||||
Constructor. Initializes the command with an execution delegate and no `CanExecute` predicate (i.e., always executable).
|
||||
- Throws `ArgumentNullException` if `execute` is `null`.
|
||||
|
||||
- **`RelayCommand(Action<object> execute, Predicate<object> canExecute)`**
|
||||
Constructor. Initializes the command with both execution and availability predicates.
|
||||
- Throws `ArgumentNullException` if `execute` is `null`.
|
||||
- `canExecute` may be `null`, in which case the command is always executable.
|
||||
|
||||
- **`bool CanExecute(object parameter)`**
|
||||
Implements `ICommand.CanExecute`. Returns `true` if `_canExecute` is `null` or if `_canExecute(parameter)` returns `true`; otherwise `false`.
|
||||
|
||||
- **`event EventHandler CanExecuteChanged`**
|
||||
Implements `ICommand.CanExecuteChanged`. Subscribes/unsubscribes to `CommandManager.RequerySuggested`, triggering WPF to re-query `CanExecute` when system events (e.g., keyboard/mouse input, focus changes) occur.
|
||||
|
||||
- **`void Execute(object parameter)`**
|
||||
Implements `ICommand.Execute`. Invokes `_execute(parameter)`. No validation or exception handling is performed; exceptions propagate to the caller.
|
||||
|
||||
---
|
||||
|
||||
### 3. **Invariants**
|
||||
- `_execute` is **never `null`** after construction (enforced via `ArgumentNullException` in both constructors).
|
||||
- `_canExecute` may be `null`; in this case, `CanExecute` always returns `true`.
|
||||
- `CanExecuteChanged` events are **always** routed to `CommandManager.RequerySuggested`; no custom event storage is used.
|
||||
- `Execute` and `CanExecute` are called with the same `parameter` value provided by the command source (e.g., `Button.CommandParameter`).
|
||||
|
||||
---
|
||||
|
||||
### 4. **Dependencies**
|
||||
- **Dependencies on external modules**:
|
||||
- `System` (for `Action<T>`, `Predicate<T>`, `ArgumentNullException`)
|
||||
- `System.Windows.Input` (for `ICommand`, `CommandManager`)
|
||||
- **Dependencies on other modules in the codebase**: None (no internal `using` statements beyond standard libraries).
|
||||
- **Depended upon by**: Presumably UI components (e.g., `Button`, `MenuItem`) in WPF views that bind commands via MVVM. Not visible in this file, but inferred from `ICommand` usage.
|
||||
|
||||
---
|
||||
|
||||
### 5. **Gotchas**
|
||||
- **No manual `CanExecuteChanged` raising**: Since `CanExecuteChanged` is wired to `CommandManager.RequerySuggested`, the command’s executability is only re-evaluated on `CommandManager`-triggered events (e.g., user input). If the command’s availability depends on non-UI state (e.g., background task completion), `CommandManager.InvalidateRequerySuggested()` must be called externally to force re-evaluation.
|
||||
- **No parameter validation**: `Execute` passes the `parameter` directly to `_execute` without null-checking or type validation. If `_execute` expects a specific type (e.g., `string`), passing an incompatible type will cause a runtime exception.
|
||||
- **Thread affinity**: `Execute` runs on the calling thread (typically the UI thread), but no thread-safety guarantees are provided. If invoked from a background thread, UI updates inside `_execute` will fail.
|
||||
- **Memory leak risk**: If subscribers to `CanExecuteChanged` are not properly disposed, the `CommandManager` may hold references indefinitely (though this is a general WPF pattern risk, not unique to this class).
|
||||
|
||||
None identified beyond the above.
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/Reports/ChannelGRMSSummary.cs
|
||||
generated_at: "2026-04-16T03:19:18.243942+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "8f994977a8bca5be"
|
||||
---
|
||||
|
||||
# Reports
|
||||
|
||||
### **1. Purpose**
|
||||
The `ChannelGRMSSummary` class serves as a data model for representing summary statistics of a single channel in a GRMS (G-RMS, or root-mean-square acceleration) analysis report. It encapsulates the channel’s name, its sampling rate, and the computed GRMS value, while implementing `INotifyPropertyChanged` to support data binding in UI frameworks (e.g., WPF). This class enables consistent, observable reporting of GRMS metrics across the DTS Viewer application.
|
||||
|
||||
---
|
||||
|
||||
### **2. Public Interface**
|
||||
|
||||
- **`ChannelName`** (`string`, read-write property)
|
||||
Gets or sets the human-readable name of the channel (e.g., `"Ch1-Accel"`). Used for identification in reports.
|
||||
|
||||
- **`SampleRate`** (`int`, read-write property)
|
||||
Gets or sets the sample rate (in Hz) used to acquire or process the channel data. Must be a non-negative integer (enforced by caller; not validated internally).
|
||||
|
||||
- **`GRMS`** (`double`, read-write property)
|
||||
Gets or sets the computed root-mean-square acceleration value (typically in *g* units) for the channel over a specified time interval.
|
||||
|
||||
- **`PropertyChanged`** (`event PropertyChangedEventHandler`)
|
||||
Event fired when a property value changes. Raised by `OnPropertyChanged`.
|
||||
|
||||
- **`OnPropertyChanged(string propertyName)`** (`void` method)
|
||||
Invokes the `PropertyChanged` event for the specified property name. Used to notify bound UI elements of updates.
|
||||
**Note:** Does *not* validate that `propertyName` corresponds to an actual property; caller must ensure correctness.
|
||||
|
||||
---
|
||||
|
||||
### **3. Invariants**
|
||||
- **No internal validation**: The class does not enforce constraints on `SampleRate` (e.g., positivity) or `GRMS` (e.g., non-negativity). Invalid values may be assigned silently.
|
||||
- **Property names must match exactly**: `OnPropertyChanged` relies on the caller passing the *exact* property name (e.g., `"GRMS"`, not `"grms"` or `"G rms"`); mismatches will cause silent UI update failures.
|
||||
- **Thread-safety**: The class provides no explicit thread-safety guarantees. `PropertyChanged` invocation is not atomic and may throw if subscribers are removed mid-invocation (though `?.` mitigates null reference exceptions).
|
||||
|
||||
---
|
||||
|
||||
### **4. Dependencies**
|
||||
|
||||
- **Depends on**:
|
||||
- `System.ComponentModel` (for `INotifyPropertyChanged` via `PropertyChangedEventHandler` and `PropertyChangedEventArgs`)
|
||||
- `DTS.Common.Interface` (for the `IChannelGRMSSummary` interface—implementation of which this class satisfies)
|
||||
|
||||
- **Implements**:
|
||||
- `IChannelGRMSSummary` (interface defined in `DTS.Common.Interface`; exact contract not visible in this file but assumed to declare `ChannelName`, `SampleRate`, `GRMS`, and `PropertyChanged`/`OnPropertyChanged` members)
|
||||
|
||||
- **Used by**:
|
||||
- Presumably UI components (e.g., WPF `DataGrid`, `ListView`) bound to GRMS summary reports.
|
||||
- Report generation or data aggregation logic that populates/updates channel summaries (e.g., a class computing GRMS from time-series data).
|
||||
|
||||
---
|
||||
|
||||
### **5. Gotchas**
|
||||
- **No null-check on `propertyName` in `OnPropertyChanged`**: Passing `null` will cause `PropertyChanged?.Invoke(...)` to throw a `NullReferenceException` (since `new PropertyChangedEventArgs(null)` is valid, but the event handler may not expect it).
|
||||
- **No validation on numeric properties**: `SampleRate` could be negative or zero; `GRMS` could be negative or `NaN`. Callers must ensure values are physically meaningful.
|
||||
- **Interface implementation is implicit**: The class does not explicitly declare `IChannelGRMSSummary` in its definition (e.g., `: IChannelGRMSSummary`), but the source comment implies it implements the interface. Verify the interface definition in `DTS.Common.Interface` for exact contract requirements (e.g., read-only vs. read-write properties).
|
||||
- **No documentation of units**: While `GRMS` is assumed to be in *g*, and `SampleRate` in Hz, the source provides no explicit unit annotations—rely on external documentation or conventions.
|
||||
|
||||
*None identified beyond the above.*
|
||||
@@ -0,0 +1,316 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestMetadata.cs
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestGraphs.cs
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestSetupMetadata.cs
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestRunMetadata.cs
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestSummary.cs
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestModule.cs
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestChannel.cs
|
||||
- Common/DTS.Common/Classes/DTS.Viewer/TestMetadata/TestMetadataList.cs
|
||||
generated_at: "2026-04-16T03:19:21.354792+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "2276bf4d72ccc406"
|
||||
---
|
||||
|
||||
# TestMetadata Module Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides data structures and parsing logic for loading, representing, and managing test metadata from XML-based `.dts` files in the DTS Viewer system. It defines core domain models (`TestMetadata`, `TestRunMetadata`, `TestSetupMetadata`, `TestModule`, `TestChannel`, `TestGraphs`, `TestSummary`) that encapsulate test configuration, hardware setup, channel definitions, and summary information. The `TestMetadataList` class is responsible for deserializing `.dts` XML files into these strongly-typed objects and constructing `TestSummary` instances for UI binding. This module serves as the foundational data layer for test data browsing, selection, and visualization components.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `TestMetadataList`
|
||||
|
||||
- **`Task<ObservableCollection<ITestSummary>> GetTestSummaryListAsync(IBaseViewModel parent, string path, string file, string pattern = "")`**
|
||||
Async wrapper for `GetTestSummaryList`. Returns a list of `ITestSummary` objects built from `.dts` files in the specified directory.
|
||||
|
||||
- **`ObservableCollection<ITestSummary> GetTestSummaryList(IBaseViewModel parent, string path, string file = "", string pattern = "")`**
|
||||
Loads `.dts` files (matching `pattern`, default `.dts`) from `path`, parses them into `ITestMetadata`, and returns a collection of `ITestSummary` objects. `parent` is used for command wiring in `TestSummary`.
|
||||
|
||||
- **`ObservableCollection<ITestSummary> GetTestSummaryList(string path, string file = "", string pattern = "")`**
|
||||
Overload of `GetTestSummaryList` without a `parent` parameter (used when `Parent` property in `TestSummary` is not required).
|
||||
|
||||
- **`List<ITestMetadata> GetTestMetadataList(XDocument xDoc, string path, string file)`**
|
||||
Parses an `XDocument` (representing a `.dts` XML file) into a list of `ITestMetadata` instances. Includes error handling, filtering for `TSRAIR_GO_TEST` when `RunTestVariables.IsTSRAIRGo` is true, and channel array pre-allocation.
|
||||
|
||||
### `TestMetadata` (implements `ITestMetadata`)
|
||||
|
||||
- **`ITestRunMetadata TestRun { get; set; }`**
|
||||
Contains test run-level metadata (e.g., test ID, description, modules, channels).
|
||||
|
||||
- **`ITestSetupMetadata TestSetup { get; set; }`**
|
||||
Contains test setup-level metadata (e.g., setup name, timestamp, graphs, calibration behavior).
|
||||
|
||||
### `TestRunMetadata` (implements `ITestRunMetadata`, `INotifyPropertyChanged`)
|
||||
|
||||
- **`string Name { get; set; }`**
|
||||
Logical test name (from XML `Id` attribute).
|
||||
|
||||
- **`string Id { get; set; }`**
|
||||
File name without extension (from XML `FilePath` attribute).
|
||||
|
||||
- **`string Description { get; set; }`**
|
||||
Test description.
|
||||
|
||||
- **`bool InlineSerializedData { get; set; }`**
|
||||
Indicates if raw data is embedded in the XML.
|
||||
|
||||
- **`string TestGuid { get; set; }`**
|
||||
Unique test identifier.
|
||||
|
||||
- **`int FaultFlags { get; set; }`**
|
||||
Bitmask of test fault conditions.
|
||||
|
||||
- **`string Software { get; set; }`**, **`string SoftwareVersion { get; set; }`**
|
||||
Software name and version used for acquisition.
|
||||
|
||||
- **`string DataType { get; set; }`**
|
||||
Type of data (e.g., "Acceleration", "Force").
|
||||
|
||||
- **`DateTime FileDate { get; set; }`**
|
||||
File system modification date.
|
||||
|
||||
- **`string FilePath { get; set; }`**
|
||||
Full path to the test data file.
|
||||
|
||||
- **`List<ITestModule> Modules { get; set; }`**
|
||||
List of acquisition modules used.
|
||||
|
||||
- **`List<ITestChannel> Channels { get; set; }`**
|
||||
List of physical channels.
|
||||
|
||||
- **`List<ITestChannel> CalculatedChannels { get; set; }`**
|
||||
List of derived channels.
|
||||
|
||||
- **`bool IsSelected { get; set; }`**
|
||||
UI selection state (raises `PropertyChanged`).
|
||||
|
||||
- **`event PropertyChangedEventHandler PropertyChanged`**
|
||||
Implements `INotifyPropertyChanged`.
|
||||
|
||||
### `TestSetupMetadata` (implements `ITestSetupMetadata`)
|
||||
|
||||
- **`string SetupName { get; set; }`**
|
||||
Name of the test setup configuration.
|
||||
|
||||
- **`DateTime TimeStamp { get; set; }`**
|
||||
Setup timestamp (fallback if module timestamps are invalid/zero).
|
||||
|
||||
- **`List<ITestGraphs> TestGraphs { get; set; }`**
|
||||
List of graph definitions.
|
||||
|
||||
- **`CalibrationBehaviors CalibrationBehavior { get; set; }`**
|
||||
Calibration strategy (e.g., `NonLinearIfAvailable`).
|
||||
|
||||
### `TestGraphs` (implements `ITestGraphs`)
|
||||
|
||||
- **`string Name { get; set; }`**
|
||||
Graph display name.
|
||||
|
||||
- **`string HardwareChannelName { get; set; }`**
|
||||
Hardware channel name associated with the graph.
|
||||
|
||||
- **`List<string> ChannelIds { get; set; }`**
|
||||
List of channel IDs included in the graph.
|
||||
|
||||
- **`List<ITestChannel> Channels { get; set; }`**
|
||||
*Note: Not populated during XML parsing; likely for runtime use.*
|
||||
|
||||
### `TestModule` (implements `ITestModule`, `INotifyPropertyChanged`)
|
||||
|
||||
- **`string SerialNumber { get; set; }`**, **`string BaseSerialNumber { get; set; }`**
|
||||
Module serial and base serial numbers.
|
||||
|
||||
- **`int Number { get; set; }`**, **`int NumberOfChannels { get; set; }`**
|
||||
Module number and channel count.
|
||||
|
||||
- **`int SampleRateHz { get; set; }`**, **`int UnsubsampledSampleRateHz { get; set; }`**
|
||||
Sample rates (post- and pre-subsampling).
|
||||
|
||||
- **`double RequestedPreTriggerSeconds { get; set; }`**, **`double PreTriggerSeconds { get; set; }`**, **`double RequestedPostTriggerSeconds { get; set; }`**, **`double PostTriggerSeconds { get; set; }`**
|
||||
Trigger timing parameters.
|
||||
|
||||
- **`int StartRecordTimestampSec { get; set; }`**, **`int StartRecordTimestampNanoSec { get; set; }`**, **`int TriggerTimestampSec { get; set; }`**, **`int TriggerTimestampNanoSec { get; set; }`**
|
||||
High-precision timestamps (PTP1588).
|
||||
|
||||
- **`List<ulong> TriggerSampleNumbers { get; set; }`**
|
||||
*Note: Always initialized as empty list; parsing logic returns empty list.*
|
||||
|
||||
- **`bool PTPMasterSync { get; set; }`**
|
||||
Indicates PTP synchronization status.
|
||||
|
||||
- **Tilt Sensor Angles (Pre/Post)**:
|
||||
`TiltSensorAxis{X,Y,Z}Degrees{Pre,Post}` — tilt sensor readings before/after test.
|
||||
|
||||
- **Temperature Readings (Pre/Post)**:
|
||||
`TemperatureLocation{1-4}{Pre,Post}` — temperature sensor readings.
|
||||
|
||||
- **`List<ITestChannel> Channels { get; set; }`**, **`List<ITestChannel> CalculatedChannels { get; set; }`**
|
||||
Channels associated with this module.
|
||||
|
||||
- **`bool IsSelected { get; set; }`**
|
||||
Selection state (raises `PropertyChanged`).
|
||||
|
||||
- **`event PropertyChangedEventHandler PropertyChanged`**
|
||||
Implements `INotifyPropertyChanged`.
|
||||
|
||||
### `TestChannel` (implements `ITestChannel`, `IBasePropertyChanged`, `ISerializable`)
|
||||
|
||||
- **`string Group { get; set; }`**, **`string SubGroup { get; set; }`**
|
||||
Logical grouping.
|
||||
|
||||
- **`bool IsGraphChannel { get; set; }`**, **`string GraphName { get; set; }`**
|
||||
Indicates if channel is used in a graph.
|
||||
|
||||
- **`string TestId { get; set; }`**, **`string TestSetupName { get; set; }`**, **`string ModuleSerialNumber { get; set; }`**
|
||||
Contextual identifiers.
|
||||
|
||||
- **`string SerialNumber { get; set; }`**, **`string ChannelId { get; set; }`**
|
||||
Channel serial and ID.
|
||||
|
||||
- **`string ChannelDisplayName { get; set; }`**, **`string ChannelDescriptionString { get; set; }`**
|
||||
Display name and description string.
|
||||
|
||||
- **`string ChannelName2 { get; set; }`**, **`string HardwareChannelName { get; set; }`**
|
||||
Alternative channel names.
|
||||
|
||||
- **`string ChannelType { get; set; }`**
|
||||
Channel type (e.g., "AnalogInput").
|
||||
|
||||
- **`bool IsCalculatedChannel { get; set; }`**
|
||||
Indicates if channel is derived.
|
||||
|
||||
- **`int Number { get; set; }`**, **`int ChannelNumber { get; set; }`**
|
||||
Channel numbers.
|
||||
|
||||
- **`double Sensitivity { get; set; }`**, **`string SensitivityUnits { get; set; }`**, **`double DesiredRange { get; set; }`**, **`double ActualMaxRangeEu { get; set; }`**, **`double ActualMinRangeEu { get; set; }`**, **`double ActualMaxRangeMv { get; set; }`**, **`double ActualMinRangeMv { get; set; }`**
|
||||
Calibration and range parameters.
|
||||
|
||||
- **`string Bridge { get; set; }`**, **`double BridgeResistanceOhms { get; set; }`**, **`double ZeroPoint { get; set; }`**
|
||||
Bridge configuration.
|
||||
|
||||
- **`DateTime Start { get; set; }`**
|
||||
Channel start time.
|
||||
|
||||
- **`string SoftwareFilter { get; set; }`**, **`bool ProportionalToExcitation { get; set; }`**, **`bool IsInverted { get; set; }`**, **`string LinearizationFormula { get; set; }`**, **`bool IsSubsampled { get; set; }`**
|
||||
Processing flags.
|
||||
|
||||
- **`int AbsoluteDisplayOrder { get; set; }`**
|
||||
Display order index.
|
||||
|
||||
- **`DateTime LastCalibrationDate { get; set; }`**
|
||||
Calibration date.
|
||||
|
||||
- **`string SensorId { get; set; }`**
|
||||
Sensor identifier.
|
||||
|
||||
- **`int OffsetToleranceLowMv { get; set; }`**, **`int OffsetToleranceHighMv { get; set; }`**, **`int DataFlag { get; set; }`**
|
||||
Tolerance and data quality flags.
|
||||
|
||||
- **`string ExcitationVoltage { get; set; }`**, **`string Eu { get; set; }`**, **`bool CalSignalEnabled { get; set; }`**, **`bool ShuntEnabled { get; set; }`**, **`bool VoltageInsertionCheckEnabled { get; set; }`**, **`bool RemoveOffset { get; set; }`**, **`string ZeroMethod { get; set; }`**, **`double ZeroAverageWindowBegin { get; set; }`**, **`double ZeroAverageWindowEnd { get; set; }`**
|
||||
Excitation, units, and zeroing configuration.
|
||||
|
||||
- **`int InitialEu { get; set; }`**, **`string InitialOffset { get; set; }`**
|
||||
Initial calibration values.
|
||||
|
||||
- **`double MeasuredShuntDeflectionMv { get; set; }`**, **`double TargetShuntDeflectionMv { get; set; }`**, **`double MeasuredExcitationVoltage { get; set; }`**, **`double FactoryExcitationVoltage { get; set; }`**
|
||||
Shunt calibration parameters.
|
||||
|
||||
- **`double TimeOfFirstSample { get; set; }`**, **`double Multiplier { get; set; }`**, **`double UserOffsetEu { get; set; }`**, **`int UnitConversion { get; set; }`**
|
||||
Timing, scaling, and unit conversion.
|
||||
|
||||
- **`bool AtCapacity { get; set; }`**, **`int CapacityOutputIsBasedOn { get; set; }`**
|
||||
Capacity-related flags.
|
||||
|
||||
- **`string SourceChannelNumber { get; set; }`**, **`string SourceModuleNumber { get; set; }`**, **`string SourceModuleSerialNumber { get; set; }`**, **`string Calculation { get; set; }`**
|
||||
For calculated channels: source and formula.
|
||||
|
||||
- **`string BinaryFileName { get; set; }`**, **`string BinaryFilePath { get; set; }`**
|
||||
Binary data file info.
|
||||
|
||||
- **`double Xmax { get; set; }`**, **`double Xmin { get; set; }`**
|
||||
X-axis range.
|
||||
|
||||
- **`int SequentialNumbers { get; set; }`**
|
||||
Sequential index.
|
||||
|
||||
- **`ITestSetupMetadata ParentTestSetup { get; set; }`**, **`ITestModule ParentModule { get; set; }`**, **`IBaseViewModel Parent { get; set; }`**
|
||||
Parent references.
|
||||
|
||||
- **`Color ChannelColor { get; set; }`**, **`string ErrorMessage { get; set; }`**, **`bool IsError { get; set; }`**, **`Color? ErrorColor { get; set; }`**
|
||||
UI state properties.
|
||||
|
||||
- **`bool IsLocked { get; set; }`**, **`bool CanLock { get; set; }`**, **`bool CanSelectChannel { get; set; }`**, **`bool IsExpanded { get; set; }`**, **`bool IsSelected { get; set; }`**
|
||||
Selection/locking state with side effects (e.g., updating graph view models).
|
||||
|
||||
- **`double MinADC { get; set; }`**, **`double MaxADC { get; set; }`**, **`double AveADC { get; set; }`**, **`double StdDevADC { get; set; }`**, **`double T0ADC { get; set; }`**
|
||||
ADC statistics.
|
||||
|
||||
- **`double MinMV { get; set; }`**, **`double MaxMV { get; set; }`**, **`double AveMV { get; set; }`**, **`double StdDevMV { get; set; }`**, **`double T0MV { get; set; }`**
|
||||
mV statistics.
|
||||
|
||||
- **`double MinEU { get; set; }`**, **`double MaxEU { get; set; }`**, **`double AveEU { get; set; }`**, **`double StdDevEU { get; set; }`**, **`double T0EU { get; set; }`**
|
||||
Engineering Unit statistics.
|
||||
|
||||
- **`double MinY { get; set; }`**, **`double MaxY { get; set; }`**, **`double AveY { get; set; }`**, **`double StdDevY { get; set; }`**, **`double T0Value { get; set; }`**
|
||||
Current unit statistics.
|
||||
|
||||
- **`string SetupEID { get; set; }`**, **`string DataCollectionEID { get; set; }`**
|
||||
EID (likely Event ID) at setup and collection time.
|
||||
|
||||
- **`void SetChannelDescriptionAndDisplayName(string channelDescription)`**
|
||||
Sets `ChannelDescriptionString` and `ChannelDisplayName`.
|
||||
|
||||
- **`ITestChannel Copy()`**
|
||||
Shallow copy via `MemberwiseClone()`.
|
||||
|
||||
- **`override string ToString()`**
|
||||
Returns `ChannelName2` if embedded test-specific; otherwise `ChannelDescriptionString`.
|
||||
|
||||
### `TestSummary` (implements `ITestSummary`, `INotifyPropertyChanged`)
|
||||
|
||||
- **`const string ROI_SUFFIX = @"_ROI Period"`**
|
||||
Suffix indicating ROI period data.
|
||||
|
||||
- **`string Id { get; set; }`**
|
||||
Unique ID: `TestRun.Id + ParseEventNumber(TestRun.FilePath)`.
|
||||
|
||||
- **`string SetupName { get; set; }`**, **`string Description { get; set; }`**, **`int ChannelCount { get; set; }`**, **`DateTime FileDate { get; set; }`**, **`DateTime TimeStamp { get; set; }`**, **`string DataType { get; set; }`**
|
||||
Summary metadata.
|
||||
|
||||
- **`bool IsSelected { get; set; }`**
|
||||
Selection state with side effects via `SelectionChanged()`.
|
||||
|
||||
- **`List<ITestGraphs> Graphs { get; set; }`**, **`List<ITestChannel> Channels { get; set; }`**, **`List<ITestChannel> CalculatedChannels { get; set; }`**
|
||||
References to metadata.
|
||||
|
||||
- **`IBaseViewModel Parent { get; set; }`**
|
||||
Parent view model (for command binding).
|
||||
|
||||
- **`CalibrationBehaviors CalibrationBehavior { get; set; } = CalibrationBehaviors.NonLinearIfAvailable`**
|
||||
Default calibration behavior.
|
||||
|
||||
- **`ITestMetadata TestMetadata { get; set; }`**
|
||||
Full metadata object.
|
||||
|
||||
- **`DelegateCommand IsSelectedCommand { get; }`**
|
||||
Command bound to `IsSelected` property.
|
||||
|
||||
- **`void SelectionChanged()`**
|
||||
Updates `Parent.SelectedTestSummaryList` and publishes via `IEventAggregator`.
|
||||
|
||||
- **`event PropertyChangedEventHandler PropertyChanged`**
|
||||
Implements `INotifyPropertyChanged`.
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **`TestMetadata`** must always have non-null `TestRun` and `TestSetup` properties after construction (defaults are created on parse failure).
|
||||
- **`TestSummary.Id`** is constructed as `TestRun.Id + ParseEventNumber(TestRun.FilePath)`. `ParseEventNumber` extracts the segment starting with `DTS.Common.Constants.EventNumber` from the file path.
|
||||
- **`TestSummary.TimeStamp`** is determined by `TestMetadataList.GetTimestamp()`:
|
||||
- Uses minimum PTP1588 timestamp from modules (trigger or start record).
|
||||
- Falls back to `TestSetup.TimeStamp` if module timestamps are invalid (e.g., zero, before 1990).
|
||||
- **`TestChannel.ChannelId`** defaults to `GetHashCode().ToString()` if the XML attribute is missing or `-1`.
|
||||
- **`TestChannel.HardwareChannelName`** is set to `Strings.Strings.Table_NA` for calculated channels (per comment `//
|
||||
Reference in New Issue
Block a user