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,21 @@
---
source_files:
- Common/DTS.CommonCore/Classes/ChannelCodes/TextPastedArgs.cs
- Common/DTS.CommonCore/Classes/ChannelCodes/ChannelCode.cs
generated_at: "2026-04-17T16:24:31.004584+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c71458d3400b2fd5"
---
# ChannelCodes
### Purpose
This module provides the core domain model and event handling infrastructure for channel codes used throughout the system. It includes the `ChannelCode` entity class that represents channel code records with support for ISO and User code types, a `TextPastedArgs` event argument class for paste operations, a `PasteCommandClass` for handling clipboard paste logic with multi-field parsing, and a delegate type for ISO code coercion.
### Public Interface
**TextPastedArgs**
- `class TextPastedArgs : ITextPastedEventArgs`
- Constructor: `TextPastedArgs(string text, IChannelCode channelCode, string id, object tag)`
- `string Text { get; }`

View File

@@ -0,0 +1,13 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Connection/NotConnectedException.cs
generated_at: "2026-04-17T16:09:20.276633+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "0dc15237410ea215"
---
# Connection
### 1. Purpose
This module provides a specific exception type for handling connection

View File

@@ -0,0 +1,148 @@
---
source_files:
- Common/DTS.CommonCore/Classes/DASFactory/TemperatureConfig.cs
- Common/DTS.CommonCore/Classes/DASFactory/TMSNConfig.cs
- Common/DTS.CommonCore/Classes/DASFactory/ATDStagger.cs
generated_at: "2026-04-17T15:39:37.663601+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e9a2b8493c76b444"
---
# DASFactory Classes Documentation
## 1. Purpose
This module provides configuration and utility classes for the DAS (Data Acquisition System) Factory subsystem. `TemperatureConfig` manages temperature and humidity logging channel settings with serialization to/from ushort arrays for firmware communication. `TMNSConfig` encapsulates TMNS (Telemetry) configuration as a fixed-length uint array with named property accessors and profile type detection. `ATDStagger` is a commented-out class that was designed to sequence device communications to prevent processing delays.
---
## 2. Public Interface
### TemperatureConfig
**Properties:**
- `ushort LogEnable { get; set; }` - Enable/disable logging flag
- `ushort LogIntervalSec { get; set; }` - Logging interval in seconds
- `ushort Channels { get; set; }` - Bitfield representing enabled channels (backed by internal `BitArray`)
- `bool MCUTemp { get; set; }` - On-board temperature channel enable
- `bool OnBoardHumidity { get; set; }` - On-board humidity channel enable
- `bool EnvironmentalCh1 { get; set; }` - Environmental channel 1 enable
- `bool EnvironmentalCh2 { get; set; }` - Environmental channel 2 enable
- `bool EnvironmentalCh3 { get; set; }` - Environmental channel 3 enable
- `bool EnvironmentalCh4 { get; set; }` - Environmental channel 4 enable
- `const ushort Reserved = 0` - Reserved field constant
**Methods:**
- `ushort[] ToUShortArray()` - Returns a 4-element array: `[LogEnable, LogIntervalSec, Channels, Reserved]`
- `TemperatureConfig()` - Default constructor
- `TemperatureConfig(ushort[] ushortArray)` - Constructs from array; silently ignores null and handles short arrays by defaulting to 0
- `int[] GetChannelsArray()` - Returns indices of all enabled channels
- `S6DBDiagnosticChannelList[] GetMeasurementChannels()` - Maps enabled channels to diagnostic channel list values
- `TempLogChannelBits GetChannelBitForDiagChannel(S6DBDiagnosticChannelList ch)` - Returns the bit mapping for a diagnostic channel; throws `NullReferenceException` if not found
---
### TMNSConfig
**Properties (all backed by internal uint array):**
- `uint TMNS_PCMSubFrameId { get; set; }`
- `uint TMNS_MsgId { get; set; }`
- `uint TMNS_PCMMinorPerMajor { get; set; }`
- `uint TMNS_TMATSPortNumber { get; set; }`
- `uint IENAUDP_PortNumber { get; set; }`
- `uint TMNS5 { get; set; }` - Reserved field 5
- `uint TMNS6 { get; set; }` - Reserved field 6
- `uint TMNS7 { get; set; }` - Reserved field 7
**Nested Enum:**
- `enum Fields` - Values: `TMNS_PCMSubFrameID, TMNS_MsgId, TMNS_PCMMinorPerMajor, TMNS_TMATSPortNumber, IENAUDP_PortNumber, TMNS5, TMNS6, TMNS7`
**Constructors:**
- `TMNSConfig()` - Initializes with zero-filled array
- `TMNSConfig(uint[] parameters)` - Copies values from input array (truncates if longer, fills remaining with zeros if shorter)
- `TMNSConfig(string parameters)` - Parses comma-separated values; strips parentheses; silently skips unparseable tokens
**Methods:**
- `void SetValue(Fields field, uint value)` - Sets value at field index
- `uint GetValue(Fields field)` - Gets value at field index
- `uint[] ToUintArray()` - Returns a copy of the internal array
- `string ToCSVString()` - Returns format `(value0,value1,...,value7)`
- `static bool IsCh10(UDPStreamProfile profile)` - Returns true for CH10 streaming profiles
- `static bool IsIENA(UDPStreamProfile profile)` - Returns true for IENA profile
- `static bool IsTMNS(UDPStreamProfile profile)` - Returns true for TMNS profiles
- `static bool IsUART(UDPStreamProfile profile)` - Returns true for UART profile
---
### ATDStagger
**Status: Entire class is commented out.** No public interface is active.
---
## 3. Invariants
### TemperatureConfig
- `Channels` property always returns a 2-byte value derived from a 16-bit `BitArray`
- `ToUShortArray()` always returns exactly 4 elements
- The `Reserved` constant is always `0` and is included as the 4th element in serialization
- Channel bit indices are defined by `TempLogChannelBits` enum (external dependency)
- `GetChannelBitForDiagChannel` will always throw for unmapped `S6DBDiagnosticChannelList` values
### TMNSConfig
- Internal `_values` array length is always exactly 8 elements (determined by `Fields` enum cardinality)
- Array indices correspond directly to `Fields` enum integer values
- `ToUintArray()` always returns a copy, not the internal array reference
- `ToCSVString()` always returns parenthesized output format
- String constructor silently ignores malformed tokens (no exceptions thrown)
### ATDStagger
- N/A (class is commented out)
---
## 4. Dependencies
### TemperatureConfig
**Depends on:**
- `DTS.Common.Enums.DASFactory.TempLogChannelBits` - Enum defining channel bit positions
- `DTS.Common.Enums.DASFactory.DFConstantsAndEnums.S6DBDiagnosticChannelList` - Enum for diagnostic channels
- `System.Collections.BitArray`
- `System`
**Depended on by:** Not determinable from source alone
### TMNSConfig
**Depends on:**
- `DTS.Common.Enums.UDPStreamProfile` - Enum for streaming profile types
- `System`
- `System.Linq`
- `System.Text`
**Depended on by:** Not determinable from source alone
### ATDStagger
**Depends on (if uncommented):**
- `DTS.Common.Interface.DASFactory.IDASCommunication`
- `DTS.Common.Interface.DASFactory.ICommunication`
- `DTS.Common.Utilities.Logging.APILogger`
- `System.Data.IDbCommand`
- `System.Data.CommandType`
---
## 5. Gotchas
### TemperatureConfig
- **BitArray endianness:** The `Channels` getter uses `BitConverter.ToUInt16` after `BitArray.CopyTo`. The bit-to-byte mapping depends on `BitArray`'s internal ordering, which may not match intuitive expectations.
- **Constructor silently handles null:** `TemperatureConfig(ushort[] ushortArray)` returns early if null is passed, leaving `LogEnable`, `LogIntervalSec`, and `Channels` at their default values (0).
- **GetChannelBitForDiagChannel throws NullReferenceException:** Despite the name, this throws `NullReferenceException` (not `KeyNotFoundException` or `ArgumentException`) when the key is not found. The exception message is `"Not found: {ch}"`.
### TMNSConfig
- **String constructor is permissive:** It strips all `(` and `)` characters anywhere in the string, not just at boundaries. Malformed tokens that fail `uint.TryParse` are silently skipped.
- **Array truncation in constructor:** If the input array is longer than 8 elements, excess elements are ignored without warning.
- **No validation on property setters:** Any `uint` value is accepted; range validation is not performed.
### ATDStagger
- **Entire class is commented out:** This class is non-functional. The comment references ticket "16237" and describes sequencing/staggering for services, but the implementation is entirely disabled. Reason for commenting out is not documented in source.

View File

@@ -0,0 +1,64 @@
---
source_files:
- Common/DTS.CommonCore/Classes/DTS.Viewer/Commands/RelayCommand.cs
generated_at: "2026-04-17T16:38:38.055405+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "9f35643384379d28"
---
# Documentation: RelayCommand
## 1. Purpose
`RelayCommand` is an implementation of `System.Windows.Input.ICommand` that delegates execution logic to callbacks provided at construction time. It enables MVVM (Model-View-ViewModel) data binding in WPF applications by allowing view models to expose commands that can be bound to UI elements (buttons, menu items, etc.) without requiring the view model to implement full command classes for each action. This is a standard pattern for decoupling UI from business logic.
---
## 2. Public Interface
### Constructors
| Signature | Description |
|-----------|-------------|
| `RelayCommand(Action<object> execute)` | Creates a command that always reports as executable. Internally delegates to the two-parameter constructor with `canExecute` set to `null`. |
| `RelayCommand(Action<object> execute, Predicate<object> canExecute)` | Creates a command with both execute and canExecute logic. Throws `ArgumentNullException` if `execute` is `null`. The `canExecute` parameter may be `null`, in which case `CanExecute` will always return `true`. |
### Methods
| Signature | Description |
|-----------|-------------|
| `bool CanExecute(object parameter)` | Returns the result of invoking the `_canExecute` predicate with the provided `parameter`. If `_canExecute` is `null`, returns `true`. |
| `void Execute(object parameter)` | Invokes the `_execute` action delegate with the provided `parameter`. |
### Events
| Event | Description |
|-------|-------------|
| `EventHandler CanExecuteChanged` | Forwards subscriptions to `CommandManager.RequerySuggested`. Adding/removing handlers directly adds/removes them from the WPF `CommandManager`. |
---
## 3. Invariants
- **`_execute` is never null after construction.** The constructor enforces this by throwing `ArgumentNullException` if a null value is passed.
- **`_canExecute` may be null.** When null, `CanExecute` must return `true` for all parameters.
- **`CanExecuteChanged` is always routed through `CommandManager.RequerySuggested`.** There is no manual invocation mechanism for this event within the class itself.
- **The command does not retain or manage the parameter.** The `parameter` argument flows through without validation or storage.
---
## 4. Dependencies
### This module depends on:
- `System` — Provides `Action<T>`, `Predicate<T>`, `ArgumentNullException`, and `EventHandler`.
- `System.Windows.Input` — Provides `ICommand` interface and `CommandManager` static class.
### What depends on this module:
- **Not determinable from source alone.** As a utility class, it is expected to be consumed by ViewModels and other UI-related components throughout the codebase, but specific consumers are not visible in this file.
---
## 5. Gotchas
1. **No manual `RaiseCanExecuteChanged` method.** Unlike some `RelayCommand` implementations, this class provides no way to manually raise `CanExecuteChanged`. Consumers are entirely dependent on `CommandManager

View File

@@ -0,0 +1,61 @@
---
source_files:
- Common/DTS.CommonCore/Classes/DTS.Viewer/Reports/ChannelGRMSSummary.cs
generated_at: "2026-04-17T16:38:38.176911+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "022bbb862d4376ac"
---
# Documentation: ChannelGRMSSummary
## 1. Purpose
`ChannelGRMSSummary` is a data model class representing a summary report entry for a single channel's GRMS (likely "G RMS" - Root Mean Square acceleration measured in G-forces) value. It implements `IChannelGRMSSummary` and supports property change notification via the `INotifyPropertyChanged` pattern, enabling data binding scenarios in viewer/reporting contexts.
## 2. Public Interface
### Class: `ChannelGRMSSummary`
**Namespace:** `DTS.Common.Classes.Viewer.Reports`
**Implements:** `IChannelGRMSSummary`
#### Properties
| Name | Type | Access | Description |
|------|------|--------|-------------|
| `ChannelName` | `string` | get/set | Name identifier for the channel being summarized. |
| `SampleRate` | `int` | get/set | Sample rate value for the channel (units unspecified in source). |
| `GRMS` | `double` | get/set | GRMS (G-force Root Mean Square) value for the channel. |
#### Events
| Name | Type | Description |
|------|------|-------------|
| `PropertyChanged` | `PropertyChangedEventHandler` | Standard property change notification event. |
#### Methods
| Signature | Description |
|-----------|-------------|
| `void OnPropertyChanged(string propertyName)` | Invokes the `PropertyChanged` event with the specified property name, if any handlers are attached. |
## 3. Invariants
- The class uses auto-implemented properties with no validation logic; `ChannelName` may be `null`, and `SampleRate`/`GRMS` will default to `0` if not explicitly set.
- The `PropertyChanged` event will only fire when `OnPropertyChanged` is explicitly called; property setters do not automatically trigger notification.
- The relationship between `SampleRate` and `GRMS` (e.g., whether GRMS is calculated from samples at that rate) is not enforced by this class.
## 4. Dependencies
### This module depends on:
- `DTS.Common.Interface` — provides `IChannelGRMSSummary` interface
- `System.ComponentModel` — provides `PropertyChangedEventHandler` and `PropertyChangedEventArgs`
### What depends on this module:
- **Unknown from source alone.** Consumers of `IChannelGRMSSummary` or this concrete implementation are not visible in this file.
## 5. Gotchas
- **Manual notification required:** The property setters (`ChannelName`, `SampleRate`, `GRMS`) do not automatically call `OnPropertyChanged`. Callers must manually invoke `OnPropertyChanged` after setting properties if UI binding notification is required. This is a common source of bugs in MVVM scenarios.
- **Interface inheritance unclear:** Whether `IChannelGRMSSummary` inherits from `INotifyPropertyChanged` cannot be determined from this source alone. If it does not, consumers expecting standard `INotifyPropertyChanged` behavior may need to cast or check for the interface explicitly.
- **No constructor defined:** The class relies on the default parameterless constructor

View File

@@ -0,0 +1,273 @@
---
source_files:
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestMetadata.cs
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestGraphs.cs
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestSetupMetadata.cs
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestRunMetadata.cs
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestSummary.cs
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestModule.cs
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestChannel.cs
- Common/DTS.CommonCore/Classes/DTS.Viewer/TestMetadata/TestMetadataList.cs
generated_at: "2026-04-17T15:34:59.192943+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "edb878a345b676b6"
---
# Test Metadata Module Documentation
## 1. Purpose
This module provides the data model and parsing infrastructure for test metadata in the DTS (Data Test System) application. It defines POCO classes representing test runs, setups, modules, channels, and graphs, along with XML parsing logic to hydrate these objects from `.dts` files. The module serves as the bridge between persisted test data and the application's runtime representation, supporting both raw data channels and calculated channels with full calibration and statistical metadata.
---
## 2. Public Interface
### TestMetadata
Implements `ITestMetadata`. Root container for test information.
| Property | Type | Description |
|----------|------|-------------|
| `TestRun` | `ITestRunMetadata` | Metadata about the test run execution |
| `TestSetup` | `ITestSetupMetadata` | Metadata about the test setup configuration |
### TestGraphs
Implements `ITestGraphs`. Represents a graph configuration within a test setup.
| Property | Type | Description |
|----------|------|-------------|
| `Name` | `string` | Graph name |
| `HardwareChannelName` | `string` | Associated hardware channel name |
| `ChannelIds` | `List<string>` | List of channel IDs belonging to this graph |
| `Channels` | `List<ITestChannel>` | Resolved channel objects |
### TestSetupMetadata
Implements `ITestSetupMetadata`. Contains test setup configuration.
| Property | Type | Description |
|----------|------|-------------|
| `SetupName` | `string` | Name of the test setup |
| `TimeStamp` | `DateTime` | Timestamp of the setup |
| `TestGraphs` | `List<ITestGraphs>` | Graph configurations |
| `CalibrationBehavior` | `CalibrationBehaviors` | Calibration mode enum value |
### TestRunMetadata
Implements `ITestRunMetadata`. Contains test run execution details. Implements `INotifyPropertyChanged`.
| Property | Type | Description |
|----------|------|-------------|
| `Name` | `string` | Test name (ID from DTS file) |
| `Id` | `string` | File name without extension |
| `Description` | `string` | Test description |
| `InlineSerializedData` | `bool` | Whether data is inline serialized |
| `TestGuid` | `string` | Unique test identifier |
| `FaultFlags` | `int` | Fault flag bitmask |
| `Software` | `string` | Software name |
| `SoftwareVersion` | `string` | Software version |
| `DataType` | `string` | Data type identifier |
| `FileDate` | `DateTime` | File creation date |
| `FilePath` | `string` | Path to the test file |
| `Modules` | `List<ITestModule>` | List of test modules |
| `Channels` | `List<ITestChannel>` | All channels across modules |
| `CalculatedChannels` | `List<ITestChannel>` | Calculated/virtual channels |
| `IsSelected` | `bool` | Selection state |
**Events:**
- `event PropertyChangedEventHandler PropertyChanged`
**Methods:**
- `void OnPropertyChanged([CallerMemberName] string propertyName = null)` - Protected virtual
### TestSummary
Implements `ITestSummary`. Aggregated view of a test for UI display. Implements `INotifyPropertyChanged`.
| Property | Type | Description |
|----------|------|-------------|
| `ROI_SUFFIX` | `const string` | Constant value `@"_ROI Period"` |
| `Id` | `string` | Composite ID (TestRun.Id + event number) |
| `SetupName` | `string` | Test setup name |
| `Description` | `string` | Test description |
| `ChannelCount` | `int` | Number of channels |
| `FileDate` | `DateTime` | File date |
| `TimeStamp` | `DateTime` | Test timestamp |
| `DataType` | `string` | Data type |
| `IsSelected` | `bool` | Selection state with side effects |
| `Graphs` | `List<ITestGraphs>` | Graph configurations |
| `Channels` | `List<ITestChannel>` | Channel list |
| `CalculatedChannels` | `List<ITestChannel>` | Calculated channels |
| `Parent` | `IBaseViewModel` | Parent view model |
| `CalibrationBehavior` | `CalibrationBehaviors` | Calibration mode (defaults to `NonLinearIfAvailable`) |
| `TestMetadata` | `ITestMetadata` | Full metadata reference |
| `IsSelectedCommand` | `DelegateCommand` | Command for selection changes |
**Methods:**
- `void SelectionChanged()` - Updates parent's `SelectedTestSummaryList` and publishes selection event
- `void OnPropertyChanged(string propertyName)`
**Events:**
- `event PropertyChangedEventHandler PropertyChanged`
### TestModule
Implements `ITestModule`. Hardware module metadata. Implements `INotifyPropertyChanged`.
| Property | Type | Description |
|----------|------|-------------|
| `SerialNumber` | `string` | Module serial number |
| `BaseSerialNumber` | `string` | Base serial number |
| `AaFilterRateHz` | `int` | Anti-alias filter rate |
| `Number` | `int` | Module number |
| `NumberOfSamples` | `int` | Total samples recorded |
| `UnsubsampledNumberOfSamples` | `int` | Samples before subsampling |
| `RequestedPostTriggerSeconds` | `double` | Requested post-trigger duration |
| `RequestedPreTriggerSeconds` | `double` | Requested pre-trigger duration |
| `PostTriggerSeconds` | `double` | Actual post-trigger duration |
| `PreTriggerSeconds` | `double` | Actual pre-trigger duration |
| `RecordingMode` | `string` | Recording mode string |
| `SampleRateHz` | `int` | Sample rate in Hz |
| `StartRecordSampleNumber` | `int` | Starting sample number |
| `NumberOfChannels` | `int` | Channel count |
| `InlineSerializedData` | `bool` | Inline serialization flag |
| `StartRecordTimestampSec` | `int` | Start timestamp (seconds) |
| `StartRecordTimestampNanoSec` | `int` | Start timestamp (nanoseconds) |
| `TriggerTimestampSec` | `int` | Trigger timestamp (seconds) |
| `TriggerTimestampNanoSec` | `int` | Trigger timestamp (nanoseconds) |
| `TriggerSampleNumbers` | `List<ulong>` | Trigger sample indices |
| `PTPMasterSync` | `bool` | PTP master sync status |
| `TiltSensorAxisXDegreesPre/Post` | `int` | Tilt sensor readings |
| `TiltSensorAxisYDegreesPre/Post` | `int` | Tilt sensor readings |
| `TiltSensorAxisZDegreesPre/Post` | `int` | Tilt sensor readings |
| `TemperatureLocation1-4Pre/Post` | `int` | Temperature readings |
| `Channels` | `List<ITestChannel>` | Module's channels |
| `CalculatedChannels` | `List<ITestChannel>` | Module's calculated channels |
| `IsSelected` | `bool` | Selection state |
**Events:**
- `event PropertyChangedEventHandler PropertyChanged`
### TestChannel
Implements `ITestChannel`. Comprehensive channel metadata. Extends `BasePropertyChanged`. Marked `[Serializable]`.
**Identity Properties:**
| Property | Type |
|----------|------|
| `Group`, `SubGroup` | `string` |
| `ChannelId` | `string` |
| `ChannelDisplayName` | `string` |
| `ChannelName2` | `string` |
| `HardwareChannelName` | `string` |
| `SerialNumber` | `string` |
| `ModuleSerialNumber` | `string` |
| `Description` | `string` |
| `ChannelDescriptionString` | `string` |
| `ChannelType` | `string` |
| `ChannelGroupName` | `string` |
| `Number`, `ChannelNumber` | `int` |
| `TestId`, `TestSetupName` | `string` |
**Calibration Properties:**
| Property | Type |
|----------|------|
| `Sensitivity` | `double` |
| `SensitivityUnits` | `string` |
| `Bridge` | `string` |
| `BridgeResistanceOhms` | `double` |
| `ZeroPoint` | `double` |
| `DesiredRange` | `double` |
| `ActualMaxRangeEu`, `ActualMinRangeEu` | `double` |
| `ActualMaxRangeAdc` | `double` (returns `short.MaxValue`) |
| `ActualMinRangeAdc` | `double` (returns `short.MinValue`) |
| `ActualMaxRangeMv`, `ActualMinRangeMv` | `double` |
| `ExcitationVoltage` | `string` |
| `MeasuredExcitationVoltage`, `FactoryExcitationVoltage` | `double` |
| `MeasuredShuntDeflectionMv`, `TargetShuntDeflectionMv` | `double` |
| `LinearizationFormula` | `string` |
| `LastCalibrationDate` | `DateTime` |
| `SensorId` | `string` |
| `SensorCapacity` | `int` |
| `SensorPolarity` | `string` |
| `UseEUScaler` | `bool` |
| `ScaleFactorEU` | `double` |
**Statistical Properties (all default to `double.NaN`):**
| Property | Description |
|----------|-------------|
| `MinADC`, `MaxADC`, `AveADC`, `StdDevADC`, `T0ADC` | ADC domain statistics |
| `MinMV`, `MaxMV`, `AveMV`, `StdDevMV`, `T0MV` | Millivolt domain statistics |
| `MinEU`, `MaxEU`, `AveEU`, `StdDevEU`, `T0EU` | Engineering unit statistics |
| `MinY`, `MaxY`, `AveY`, `StdDevY`, `T0Value` | Current unit statistics |
**State Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `IsSelected` | `bool` | Selection state with parent notification |
| `IsLocked` | `bool` | Lock state with parent notification |
| `IsGraphChannel` | `bool` | Whether channel is in a graph |
| `IsCalculatedChannel` | `bool` | Whether this is a calculated channel |
| `CanLock` | `bool` | Whether channel can be locked |
| `CanSelectChannel` | `bool` | Whether channel can be selected |
| `IsExpanded` | `bool` | UI expansion state |
| `IsError` | `bool` | Error state |
| `ErrorMessage` | `string` | Error message text |
| `ChannelColor` | `Color` | Display color |
| `ErrorColor` | `Color?` | Red if error, Black otherwise |
**Methods:**
- `ITestChannel Copy()` - Returns shallow copy via `MemberwiseClone()`
- `void SetChannelDescriptionAndDisplayName(string channelDescription)` - Sets description and updates display name
- `override string ToString()` - Returns "N/A" for test-specific embedded strings, otherwise `ChannelDescriptionString`
### TestMetadataList
Factory/parser class for creating test metadata from XML files.
**Methods:**
| Signature | Description |
|-----------|-------------|
| `Task<ObservableCollection<ITestSummary>> GetTestSummaryListAsync(IBaseViewModel parent, string path, string file, string pattern = "")` | Async wrapper (actually synchronous) |
| `ObservableCollection<ITestSummary> GetTestSummaryList(IBaseViewModel parent, string path, string file = "", string pattern = "")` | Builds test summary list with parent |
| `ObservableCollection<ITestSummary> GetTestSummaryList(string path, string file = "", string pattern = "")` | Builds test summary list without parent |
| `List<ITestMetadata> GetTestMetadataList(XDocument xDoc, string path, string file)` | Parses XDocument into metadata objects |
---
## 3. Invariants
- **TestSummary.CalibrationBehavior** defaults to `CalibrationBehaviors.NonLinearIfAvailable`
- **TestSummary.IsSelected** defaults to `false`
- **TestChannel.ActualMaxRangeAdc** always returns `short.MaxValue` (32767)
- **TestChannel.ActualMinRangeAdc** always returns `short.MinValue` (-32768)
- **TestChannel** statistical properties (`MinADC`, `MaxEU`, etc.) are initialized to `double.NaN`
- **TestChannel.ChannelColor** defaults to `Colors.Transparent`
- **TestChannel.ErrorColor** returns `Colors.Red` when `IsError` is `true`, `Colors.Black` otherwise
- **TestMetadataList.GetTestSummaryList** returns results ordered by `TimeStamp.Ticks` descending
- **TestMetadataList** uses file extension `.dts` as default pattern when none specified
- **TestMetadataList.GetTimestamp** falls back to `TestSetup.TimeStamp` if PTP timestamps are invalid or before 1/1/1990
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Interface` - Core interfaces (`ITestMetadata`, `ITestRunMetadata`, `ITestSetupMetadata`, `ITestGraphs`, `ITestModule`, `ITestChannel`, `ITestSummary`)
- `DTS.Common.Interface.TestDefinition` - Test definition interfaces
- `DTS.Common.Enums.Sensors` - `CalibrationBehaviors` enum
- `DTS.Common.Enums.Viewer` - Viewer-specific enums
- `DTS.Common.Base` - `BasePropertyChanged`, `IBaseViewModel`
- `DTS.Common.Utilities` - Utility classes
- `DTS.Common.Utils` - `PTP1588Timestamps`, `TestUtils`
- `DTS.Common.XMLUtils` - `TestMetadataXml` for XML parsing
- `DTS.Common.Constants` - Constants including `EventNumber`
- `Microsoft.Practices.Prism.Commands` - `DelegateCommand`
- `Microsoft.Practices.Prism.Events` - `IEventAggregator`
- `Microsoft.Practices.ServiceLocation` - `ServiceLocator`
- `System.Windows.Media` - `Color`, `Colors`
- `System.Xml.Linq` - `XDocument`, `XElement`
### What depends on this module:
- Not determinable from source alone; consumers would reference these classes via the `ITestMetadata` family of interfaces.
---
## 5. Gotchas
1. **Async

View File

@@ -0,0 +1,33 @@
---
source_files:
- Common/DTS.CommonCore/Classes/GroupTemplates/Constants.cs
generated_at: "2026-04-17T16:26:10.764880+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "6c2f4aa2a068d759"
---
# GroupTemplates
### Purpose
This module provides constant values used for identifying non-ISO test object types and names within the system. It exists to centralize magic string values that appear to be markers or placeholders for test objects that do not conform to ISO standards, ensuring consistent usage across the codebase.
### Public Interface
- **`Constants` (static class)**
- `public const string NON_ISO_TESTOBJECT_CHANNEL_TYPE = "x_NonISOTestObjectType_x"` - Constant identifying a non-ISO test object channel type.
- `public const string NON_ISO_TESTOBJECT_NAME = "x_NonISOTestObjectName_x"` - Constant identifying a non-ISO test object name.
- `public const string NON_ISO_TESTOBJECT_CHANNEL_TYPE2 = "NONISO_x_"` - Alternative prefix constant for non-ISO test object channel types.
### Invariants
- All members are `const string`, meaning they are compile-time constants and cannot be modified at runtime.
- The values appear to use `x_` prefix/suffix patterns as delimiters, suggesting they are placeholder or marker strings meant to be easily identifiable in data streams or configuration.
### Dependencies
- **Depends on:** None (standalone module with no imports).
- **Depended on by:** Cannot be determined from source alone; likely consumed by test object handling or channel processing components.
### Gotchas
- The naming convention `NON_ISO_TESTOBJECT_CHANNEL_TYPE` vs `NON_ISO_TESTOBJECT_CHANNEL_TYPE2` suggests two different formats may exist in the system. The relationship between these two constants and when to use each is unclear from the source alone.
- The `x_` wrapping pattern appears intentional for parsing/detection purposes but the exact protocol is not documented in source.
---

View File

@@ -0,0 +1,170 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Groups/GroupGRPImportError.cs
- Common/DTS.CommonCore/Classes/Groups/GroupGRPImportGroup.cs
- Common/DTS.CommonCore/Classes/Groups/GroupHardwareDbRecord.cs
- Common/DTS.CommonCore/Classes/Groups/TestSetupGroupRecord.cs
- Common/DTS.CommonCore/Classes/Groups/GroupDbRecord.cs
- Common/DTS.CommonCore/Classes/Groups/GroupGRPImportChannel.cs
- Common/DTS.CommonCore/Classes/Groups/ChannelDbRecord.cs
- Common/DTS.CommonCore/Classes/Groups/GroupHelper.cs
generated_at: "2026-04-17T15:32:21.714066+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b21188904e1c0fcd"
---
# Documentation: DTS.Common.Classes.Groups
## 1. Purpose
This module provides data structures for managing groups and channels within the DTS (Data Test System) application. It handles three primary concerns: (1) importing `.GRP` files containing channel configurations with associated validation error tracking, (2) representing database records for groups, channels, and hardware associations with `INotifyPropertyChanged` support for UI binding, and (3) maintaining static lookup caches via `GroupHelper` for cross-referencing groups, channels, DAS devices, and test setups. The module serves as the data layer between raw file imports, persistent storage, and the application's business logic.
---
## 2. Public Interface
### GroupGRPImportError
Encapsulates errors encountered during `.GRP` file import.
```csharp
public class GroupGRPImportError
{
public enum Errors
{
FileEmpty, InvalidISOCodeInput, InvalidFullScaleInput, InvalidSensorInput,
InvalidInvertInput, SensorNotFound, InvalidInputMode, InvalidDefaultValue,
InvalidActiveValue, InvalidFireMode, InvalidDelay, InvalidLimitDuration,
InvalidDuration, InvalidCurrent
}
public Errors ErrorCode { get; set; }
public string File { get; set; }
public int Line { get; set; }
public string ExtraInfo { get; set; }
public override string ToString() // Returns ExtraInfo
}
```
### GroupGRPImportGroup
Represents an entire group parsed from a `.GRP` file.
```csharp
public class GroupGRPImportGroup : BasePropertyChanged
{
public bool Included { get; set; } = true;
public bool Overwrite { get; set; } = true;
public string GroupName { get; set; }
public string GroupTags { get; set; }
public string ImportingUserTags { get; set; }
public string SourceFile { get; set; }
public GroupGRPImportChannel[] Channels { get; set; } = { };
public GroupGRPImportError[] GroupErrors { get; set; } = null;
public bool GroupNameHasError { get; set; } // Notifies property change
}
```
### GroupGRPImportChannel
Represents a single channel/row from a TDC GRP file.
```csharp
public class GroupGRPImportChannel : BasePropertyChanged
{
// Field position constants for parsing
public const uint SerialNumberField = 0;
public const uint DisplayNameField = 1;
public const uint ISOCodeField = 2;
public const uint InvertField = 3;
public const uint CapacityField = 4;
public const uint InputModeField = 5;
public const uint DefaultValueField = 6;
public const uint ActiveValueField = 7;
public const uint FireModeField = 8;
public const uint DelayField = 9;
public const uint LimitDurationField = 10;
public const uint DurationField = 11;
public const uint CurrentField = 12;
public enum InputModes { na, TLH, THL, CCNO, CCNC }
public enum FireModes { na, CD, CC }
// Default constants
public const InputModes DefaultInputMode = InputModes.CCNO;
public const double DefaultDefaultValue = 0.0;
public const double DefaultActiveValue = 1.0;
public const FireModes DefaultFireMode = FireModes.CD;
public const double DefaultDelay = 0.00;
public const bool DefaultLimitDuration = true;
public const double DefaultDuration = 10.0;
public const double DefaultCurrent = 1.5;
// Properties
public string SensorSerialNumber { get; set; }
public string DisplayName { get; set; }
public string ISOCode { get; set; }
public bool Invert { get; set; }
public double FullScale { get; set; }
public InputModes? InputMode { get; set; } = null;
public double? DefaultValue { get; set; } = null;
public double? ActiveValue { get; set; } = null;
public FireModes? FireMode { get; set; } = null;
public double? Delay { get; set; } = null;
public bool? LimitDuration { get; set; } = null;
public double? Duration { get; set; } = null;
public double? Current { get; set; } = null;
public GroupGRPImportError Error { get; set; } = null;
public GroupGRPImportGroup ParentGroup { get; set; }
public string GroupName { get; } // Returns ParentGroup.GroupName or "---"
public void GroupNameInvalidate(); // Raises PropertyChanged for GroupName
}
```
### GroupDbRecord
Database record for a group, implements `IGroupDbRecord`.
```csharp
public class GroupDbRecord : BasePropertyChanged, IGroupDbRecord
{
[Key] public int Id { get; set; }
public string SerialNumber { get; set; }
public string Picture { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public bool Embedded { get; set; }
public DateTime LastModified { get; set; }
public string LastModifiedBy { get; set; }
public int? StaticGroupId { get; set; }
public string ExtraProperties { get; set; }
public GroupDbRecord();
public GroupDbRecord(IGroupDbRecord copy);
public GroupDbRecord(IGroup copy, List<KeyValuePair<string,string>> extraProperties);
public GroupDbRecord(IDataReader reader);
}
```
### ChannelDbRecord
Database record for a channel, implements `IChannelDbRecord`.
```csharp
public class ChannelDbRecord : BasePropertyChanged, IChannelDbRecord
{
[Key] public long Id { get; set; }
public int GroupId { get; set; }
public string IsoCode { get; set; }
public string IsoChannelName { get; set; }
public string UserCode { get; set; }
public string UserChannelName { get; set; }
public int DASId { get; set; }
public int DASChannelIndex { get; set; }
public int GroupChannelOrder { get; set; }
public int TestSetupOrder { get; set; }
public int SensorId { get; set; }
public bool IsDisabled { get; set; } // Redirects to Disabled, raises PropertyChanged for "IsDisabled"
public bool Disabled { get; set; }
public DateTime LastModified { get; set; }
public string LastModifiedBy { get; set; }
public ChannelDbRecord();
public ChannelDbRecord(IChannelDbRecord copy

View File

@@ -0,0 +1,46 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Groups/ChannelSettings/ChannelSettingRecord.cs
- Common/DTS.CommonCore/Classes/Groups/ChannelSettings/GroupChannelSettingRecord.cs
- Common/DTS.CommonCore/Classes/Groups/ChannelSettings/ChannelSettingBase.cs
generated_at: "2026-04-17T15:39:15.041041+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e5d75cd5b9640621"
---
# Documentation: DTS.Common.Classes.Groups.ChannelSettings
## 1. Purpose
This module provides data structures for managing channel configuration settings within the DTS system. It defines three core classes: `ChannelSettingRecord` for storing setting metadata (ID, name, default value), `GroupChannelSettingRecord` for associating settings with specific channels, and `ChannelSettingBase` which serves as the primary working object for channel settings with typed accessors and a comprehensive set of string constants defining valid setting names across analog, squib, digital I/O, UART, and streaming configurations.
---
## 2. Public Interface
### ChannelSettingRecord
**Implements:** `IChannelSettingRecord`, extends `Common.Base.BasePropertyChanged`
| Member | Signature | Description |
|--------|-----------|-------------|
| `Id` | `int Id { get; set; }` | Numeric identifier for the setting. Raises property change notification via `SetProperty`. |
| `SettingName` | `string SettingName { get; set; }` | Name of the setting. Raises property change notification. |
| `DefaultValue` | `string DefaultValue { get; set; }` | Default value for the setting. Raises property change notification. |
| Constructor | `ChannelSettingRecord()` | Default parameterless constructor. |
| Constructor | `ChannelSettingRecord(IDataReader reader)` | Populates instance from a data reader using `Utility.GetInt` and `Utility.GetString`. Expects columns: "Id", "SettingName", "DefaultValue". |
---
### GroupChannelSettingRecord
**Implements:** `IGroupChannelSettingRecord`, extends `BasePropertyChanged`
| Member | Signature | Description |
|--------|-----------|-------------|
| `ChannelId` | `long ChannelId { get; set; }` | Identifier for the channel. Raises property change notification. |
| `SettingId` | `int SettingId { get; set; }` | Identifier for the setting. Raises property change notification. |
| `SettingValue` | `string SettingValue { get; set; }` | The value assigned to this setting. Raises property change notification. |
| Constructor | `GroupChannelSettingRecord()` | Default parameterless constructor. |
| Constructor | `GroupChannelSettingRecord(IDataReader reader, int storedProcedureVersionUsed)` | Populates instance from data

View File

@@ -0,0 +1,173 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Hardware/ExternalTilt.cs
- Common/DTS.CommonCore/Classes/Hardware/DragAndDropPayload.cs
- Common/DTS.CommonCore/Classes/Hardware/SerializableAAF.cs
- Common/DTS.CommonCore/Classes/Hardware/DASDBRecord.cs
- Common/DTS.CommonCore/Classes/Hardware/DASChannelDBRecord.cs
- Common/DTS.CommonCore/Classes/Hardware/DASMonitorInfo.cs
generated_at: "2026-04-17T15:35:03.536570+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "15f5b1bfa66254ec"
---
# DTS.Common.Classes.Hardware Documentation
## Purpose
This module provides data structures and persistence support for Data Acquisition System (DAS) hardware within the DTS system. It contains entity classes for database records (`DASDBRecord`, `DASChannelDBRecord`), hardware configuration containers (`DASMonitorInfo`, `ExternalTilt`), serialization utilities (`SerializableAAF`), and UI interaction constants (`DragAndDropPayload`). These classes serve as the data layer for hardware inventory, channel configuration, and tilt sensor calibration management.
---
## Public Interface
### ExternalTilt
Simple POCO representing an external tilt sensor device.
**Constructor:**
- `ExternalTilt()` - Default parameterless constructor.
**Properties:**
- `string SerialNumber { get; set; }` - Serial number of the tilt device.
- `byte TiltID { get; set; }` - Numeric identifier for the tilt sensor.
- `string SystemID { get; set; }` - Identifier of the associated system.
- `string SystemLocation { get; set; }` - Physical location within the system.
---
### DragAndDropPayload
Container for drag-and-drop format string constants used in UI operations.
**Constants:**
- `const string FORMAT = "RESOLVECHANNELS_HARDWARETABLE"` - Primary drag-and-drop format.
- `const string ALT_FORMAT = "ALT_RESOLVECHANNELS_HARDWARETABLE"` - Alternate format (Alt-modified drag).
- `const string CTRL_FORMAT = "CTRL_RESOLVECHANNELS_HARDWARETABLE"` - Control-modified drag format.
---
### SerializableAAF
Container for DAS type enumeration. Note: All serialization logic is commented out in the source.
**Nested Enum:**
- `enum DAS_TYPE { TDAS = 0, SLICE = 1 }` - Identifies DAS hardware types.
---
### DASDBRecord
Entity class representing a DAS hardware record for database persistence. Implements `IDASDBRecord`.
**Static Property:**
- `static DateTime INVALID_DATE => new DateTime(1970, 1, 1)` - Sentinel value for unset date fields.
**Constructors:**
- `DASDBRecord()` - Default constructor.
- `DASDBRecord(IDASDBRecord copy)` - Copy constructor; performs deep copy of `ChannelTypes` array.
- `DASDBRecord(IDataReader reader)` - Constructs instance from database reader; parses comma-delimited `ChannelTypes` string.
**Properties (Key Database Fields):**
- `int DASId { get; set; }` - Primary key (`[Key]`).
- `string SerialNumber { get; set; }` - Required, max length 50.
- `int DASType { get; set; }` - DAS type identifier.
- `int MaxModules { get; set; }` - Maximum module count.
- `long MaxMemory { get; set; }` - Maximum memory in bytes.
- `double MaxSampleRate { get; set; }` - Maximum sample rate (`decimal(18,0)`).
- `double MinSampleRate { get; set; }` - Minimum sample rate (`decimal(18,0)`).
- `string FirmwareVersion { get; set; }` - Firmware version string.
- `DateTime CalDate { get; set; }` - Calibration date, defaults to `INVALID_DATE`.
- `int ProtocolVersion { get; set; }` - Protocol version number.
- `DateTime LastModified { get; set; }` - Last modification timestamp.
- `string LastModifiedBy { get; set; }` - User who last modified.
- `int Version { get; set; }` - Record version.
- `bool LocalOnly { get; set; }` - Whether record is local-only.
- `DateTime LastUsed { get; set; }` - Last usage timestamp.
- `string LastUsedBy { get; set; }` - User who last used.
- `string Connection { get; set; }` - Connection string/identifier.
- `int Channels { get; set; }` - Channel count.
- `string Position { get; set; }` - Physical position (required, max 50 chars).
- `int[] ChannelTypes { get; set; }` - Array of channel type identifiers.
- `bool IsProgrammable { get; set; }` - Reprogrammability flag.
- `bool IsReconfigurable { get; set; }` - Reconfigurability flag.
- `bool IsModule { get; set; }` - Whether this is a module.
- `int PositionOnDistributor { get; set; }` - Position on distributor.
- `int PositionOnChain { get; set; }` - Position on chain.
- `int Port { get; set; }` - Port number.
- `string ParentDAS { get; set; }` - Parent DAS serial number.
- `DateTime? FirstUseDate { get; set; }` - Nullable first use date.
- `int? TestId { get; set; }` - Nullable test ID.
- `int? GroupId { get; set; }` - Nullable group ID.
- `bool StandIn { get; set; }` - Stand-in flag.
- `double MaxAAFRate { get; set; }` - Maximum anti-aliasing filter rate.
- `bool IsFirstUseValid { get; set; }` - Whether first use date is valid.
---
### DASChannelDBRecord
Entity class representing a DAS channel record. Implements `IDASChannelDBRecord`.
**Constants:**
- `const int DEFAULT_SUPPORTED_BRIDGES = 12` - Default bridge bitmask (half + full bridge).
- `const int DEFAULT_SUPPORTED_EXCITATIONS = 16` - Default excitation bitmask (5V).
- `const int DEFAULT_SUPPORTED_DI_MODES = 16` - Default digital input mode bitmask.
- `const int DEFAULT_SQUIB_FIRE_MODES = 16` - Default squib fire mode bitmask.
- `const int DEFAULT_SUPPORTED_DO_MODES = 16` - Default digital output mode bitmask.
**Constructors:**
- `DASChannelDBRecord()` - Default constructor.
- `DASChannelDBRecord(IDataReader reader)` - Constructs from database reader.
- `DASChannelDBRecord(IDASChannelDBRecord copy)` - Copy constructor.
**Properties:**
- `string HardwareId { get; set; }` - Composite ID (serialnumber_dastype).
- `int DaschannelId { get; set; }` - Primary key.
- `int? Dasid { get; set; }` - Foreign key to parent DAS.
- `int ChannelIdx { get; set; }` - Physical channel index.
- `int SupportedBridges { get; set; }` - Bitmask: Bit 0=IEPE, 1=quarter bridge, 2=half bridge, 3=full bridge, 4=digital input, 5=squib fire, 6=digital output, 7=half bridge signal plus, 8=RTC, 9=UART.
- `int SupportedExcitations { get; set; }` - Bitmask: Bit 1=2V, 2=2.5V, 3=3V, 4=5V, 5=10V, 6=1V.
- `int DASDisplayOrder { get; set; }` - Display order (may differ from physical order).
- `bool LocalOnly { get; set; }` - Deprecated; local-only flag.
- `int SupportedDigitalInputModes { get; set; }` - Bitmask: Bit 1=TLH, 2=THL, 3=CCNO, 4=CCNC.
- `int SupportedSquibFireModes { get; set; }` - Bitmask: Bit 1=capacitor discharge, 2=constant current, 3=AC discharge.
- `int SupportedDigitalOutputModes { get; set; }` - Bitmask: Bit 0=FVLH, 1=FVHL, 2=CCNO, 3=CCNC.
- `string ModuleSerialNumber { get; set; }` - Parent module serial number.
- `int SettingId { get; set; }` - Setting identifier.
- `int ModuleArrayIndex { get; set; }` - Module array index.
---
### DASMonitorInfo
Configuration container for DAS monitor information with file persistence. Implements `IDASMonitorInfo`.
**Constructors:**
- `DASMonitorInfo(IDASCommunication das, IsoViewMode mode)` - Constructs from DAS communication interface.
- `DASMonitorInfo(string path)` - Constructs by reading from file.
**Properties:**
- `string SerialNumber { get; }` - DAS serial number.
- `double[] TiltSensorCals { get; }` - 18-element tilt sensor calibration array.
- `short[] TiltSensorDataPre { get; }` - 3-element pre-capture tilt data.
- `DFConstantsAndEnums.TiltAxes TiltAxes { get; }` - Tilt axis configuration.
- `int AxisIgnored { get; }` - Ignored axis flag.
- `double MountOffsetAxisOne { get; }` - Axis one mount offset.
- `double MountOffsetAxisTwo { get; }` - Axis two mount offset.
**Methods:**
- `string GetChannelName(int index)` - Returns channel name or default `"Ch#XX"` format if out of range.
- `double GetOffsetTolerancemVHigh(int index)` - Returns high offset tolerance in mV; returns 0 if out of range.
- `double GetOffsetTolerancemVLow(int index)` - Returns low offset tolerance in mV; returns 0 if out of range.
- `void ReadFromFile(string path)` - Reads configuration from file; silently returns if file doesn't exist.
- `void WriteToFile(string path)` - Writes configuration to file.
---
## Invariants
1. **DASDBRecord.INVALID_DATE** is always `1970-01-01` and serves as the sentinel for unset date fields.
2. **DASDBRecord.ChannelTypes** is parsed from comma-delimited string in `IDataReader` constructor; invalid tokens are silently skipped.
3. **

View File

@@ -0,0 +1,34 @@
---
source_files:
- Common/DTS.CommonCore/Classes/ISO/IsoCode.cs
generated_at: "2026-04-17T16:38:36.632422+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "2d494ff206708de3"
---
# Documentation: IsoCode Class
## 1. Purpose
The `IsoCode` class provides a structured representation of a 16-character ISO code, treating it as a composite identifier with distinct semantic segments. It exists to allow reading and modification of individual code components (such as location, dimension, and classification fields) without manual string manipulation. The class maintains a single internal character array and exposes each segment through typed string properties, handling padding and truncation automatically.
## 2. Public Interface
### Constructor
**`IsoCode(string isoCode)`**
- Initializes a new instance from a string input.
- If `null`, treats as empty string.
- If longer than 16 characters, truncates to first 16.
- If shorter than 16 characters, right-pads with `'?'`.
- Copies each character into the internal `_isoCodeFull` array.
### Properties
| Property | Type | Positions | Description |
|----------|------|-----------|-------------|
| `TestObject` | `string` | 0 | Single character. Getter returns 1-char string. Setter uses `'?'` if null/empty. |
| `Position` | `string` | 1 | Single character. Getter returns 1-char string. Setter uses `'?'` if null/empty. |
| `MainLocation` | `string` | 2-5 | Four characters. Pads with `'?'` if under 4 chars; truncates if over 4. |
| `FineLocation1` | `string` | 6-7 | Two characters. Pads with `'?'` if under 2 chars

View File

@@ -0,0 +1,20 @@
---
source_files:
- Common/DTS.CommonCore/Classes/ISO/ExtraProperties/TextPastedArgs.cs
generated_at: "2026-04-17T16:26:56.248977+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ef070781994ad71a"
---
# ExtraProperties
### Purpose
This module provides event argument classes for clipboard operations within ISO extra property editors. The `TextPastedArgs` class encapsulates information about a text paste event, including the pasted text content, the source extra property, an identifier, and an arbitrary tag, implementing `ITextPastedEventArgs` for consumption by event handlers.
### Public Interface
**`TextPastedArgs`** (class, implements `ITextPastedEventArgs`)
- `TextPastedArgs(string text, IExtraProperty extraProperty, string id, object tag)` — Constructor that captures all event context. The `extraProperty` parameter is stored as `Sender`.
- `string Text { get; }` — The pasted text content.
- `object Sender { get; }` — The `IExtraProperty` that

View File

@@ -0,0 +1,24 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Locking/LockRecord.cs
- Common/DTS.CommonCore/Classes/Locking/LockError.cs
generated_at: "2026-04-17T16:05:42.343101+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "fba1fa1b617963bb"
---
# Locking
### Purpose
This module provides data structures for representing record locks in a multi-user concurrent access system. It captures both the state of an active lock (who holds it, when it was created, what item is locked) and error conditions that can arise during lock operations (stolen locks, lost locks, network failures). This is used to prevent concurrent modifications to shared resources.
### Public Interface
**`LockRecord`** - Immutable record representing an active lock.
| Member | Signature | Description |
|--------|-----------|-------------|
| `LockingUserName` | `string` (get-only) | Username of the lock holder |
| `LockingMachineName` | `string` (get-only) | Machine name where lock was acquired |
| `CreationTime` | `DateTime` (get-only) | When the lock was created |

View File

@@ -0,0 +1,441 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Sensors/DisplayedCalibrationBehavior.cs
- Common/DTS.CommonCore/Classes/Sensors/SensorDbRecord.cs
- Common/DTS.CommonCore/Classes/Sensors/ZeroRef.cs
- Common/DTS.CommonCore/Classes/Sensors/CalMode.cs
- Common/DTS.CommonCore/Classes/Sensors/StreamInputRecord.cs
- Common/DTS.CommonCore/Classes/Sensors/UARTRecord.cs
- Common/DTS.CommonCore/Classes/Sensors/ParseParameters.cs
- Common/DTS.CommonCore/Classes/Sensors/DigitalInputScaleMultiplier.cs
- Common/DTS.CommonCore/Classes/Sensors/DigitalOutDbRecord.cs
- Common/DTS.CommonCore/Classes/Sensors/SensorCalDbRecord.cs
- Common/DTS.CommonCore/Classes/Sensors/StreamOutputRecord.cs
- Common/DTS.CommonCore/Classes/Sensors/ZeroMethod.cs
generated_at: "2026-04-17T15:28:40.781086+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "6acbc1148f00fa7f"
---
# DTS.Common.Classes.Sensors Module Documentation
## 1. Purpose
This module provides data model classes for sensor configuration and calibration within the DTS system. It contains database record classes for persisting sensor metadata, calibration data, and streaming configurations (UDP input/output, UART), along with helper classes for parsing and serializing sensor-specific formats like calibration modes, zero reference methods, and digital input scaling. These classes serve as the data transfer objects between the database layer and business logic for sensor management operations.
---
## 2. Public Interface
### DisplayedCalibrationBehavior
Simple data container for UI display of calibration behaviors.
```csharp
public class DisplayedCalibrationBehavior
{
public DTS.Common.Enums.Sensors.CalibrationBehaviors CalibrationBehavior;
public string DisplayString;
public override string ToString(); // Returns DisplayString
}
```
### SensorDbRecord
Database record for sensor model definitions. Implements `ISensorDbRecord`.
```csharp
public class SensorDbRecord : TagAwareBase, ISensorDbRecord
{
public override TagTypes TagType => TagTypes.SensorModels;
public int id { get; set; }
public short SensorType { get; set; }
public string SerialNumber { get; set; }
public SensorDbRecord(IDataReader reader);
}
```
### ZeroRef
Helper class for zero reference configuration, serialized to string integers.
```csharp
public class ZeroRef
{
public enum ZeroType
{
AverageOverTime,
UsePreEventDiagnostics,
UseZeroMv
}
public ZeroType ZeroMethod { get; }
public ZeroRef(string zeroref); // Parses "0", "1", or "2"
public ZeroRef(ZeroType type);
public override string ToString(); // Returns "0", "1", or "2"
}
```
### CalMode
Helper class for calibration mode, represented as a 3-character sequence (Shunt/Bridge/Filter).
```csharp
public class CalMode
{
public bool ShuntCheck { get; set; }
public bool FullBridge { get; set; }
public bool Filter { get; set; }
public CalMode(string value); // Parses 3-character string
public CalMode();
public override string ToString(); // Returns 3-character string
}
```
### StreamInputRecord
Database record for UDP stream input configuration. Implements `IStreamInputRecord`.
```csharp
public class StreamInputRecord : TagAwareBase, IStreamInputRecord
{
public override TagTypes TagType => TagTypes.Sensors;
public const string DEFAULT_UDP_ADDRESS = "UDP://239.1.2.10:8400";
public int Id { get; set; }
public string SerialNumber { get; set; }
public DateTime LastModified { get; set; }
public string LastUpdatedBy { get; set; }
public bool DoNotUse { get; set; }
public bool Broken { get; set; }
public string StreamInUDPAddress { get; set; }
public StreamInputRecord(ISensorData sd);
public StreamInputRecord(IDataReader reader);
}
```
### UARTRecord
Database record for UART sensor configuration. Implements `IUARTRecord`.
```csharp
public class UARTRecord : TagAwareBase, IUARTRecord
{
public override TagTypes TagType => TagTypes.Sensors;
public const uint UART_BAUDRATE_DEFAULT = 57600;
public const uint UART_DATABITS_DEFAULT = 8;
public const StopBits UART_STOPBITS_DEFAULT = StopBits.None;
public const UartDataFormat UART_DATAFORMAT_DEFAULT = UartDataFormat.Binary;
public const Handshake UART_FLOWCONTROL_DEFAULT = Handshake.None;
public const Parity UART_PARITY_DEFAULT = Parity.None;
public int Id { get; set; }
public string SerialNumber { get; set; }
public uint UartBaudRate { get; set; }
public uint UartDataBits { get; set; }
public StopBits UartStopBits { get; set; }
public Handshake UartFlowControl { get; set; }
public UartDataFormat UartDataFormat { get; set; }
public DateTime LastModified { get; set; }
public string LastUpdatedBy { get; set; }
public bool DoNotUse { get; set; }
public bool Broken { get; set; }
public Parity UartParity { get; set; }
public UARTRecord(ISensorData sensor);
public UARTRecord(IDataReader reader);
}
```
### ParseParameters
Internal helper class to bundle parameters for CSV import operations.
```csharp
public class ParseParameters
{
public ISensorData SensorData { get; set; }
public IFormatProvider ImportCulture { get; set; }
public List<string> Errors { get; set; }
public double IrtraccExponent { get; set; }
public ISensorCalibration SensorCal { get; set; }
public double Sensitivity { get; set; }
public bool SavedIsProportional { get; set; }
public bool SavedRemoveOffset { get; set; }
public bool StripBackslash { get; set; }
public double OriginalOffset { get; set; }
public ZeroMethodType ZeroType { get; set; }
public double ZeroEnd { get; set; }
public double ZeroStart { get; set; }
public ISquibSettingDefaults SquibDefaults { get; set; }
public IDigitalOutDefaults DigitalOutDefaults { get; set; }
public Dictionary<string, string> SensorGroupNameLookup { get; set; }
public Dictionary<string, string> SensorGroupTypeLookup { get; set; }
public Dictionary<string, string> GroupNameToTestObjectLookup { get; set; }
public string SensorTestObject { get; set; }
public bool UseISOCodeFilterMapping { get; set; }
public bool UseZeroForUnfiltered { get; set; }
public Dictionary<string, string> SensorISOCode { get; set; }
public Dictionary<string, string> SensorISOChannelName { get; set; }
public Dictionary<string, string> SensorUserCode { get; set; }
public Dictionary<string, string> SensorUserChannelName { get; set; }
public Dictionary<string, string> SensorDASSerialNumber { get; set; }
public Dictionary<string, int> SensorDASChannelIndex { get; set; }
}
```
### DigitalInputScaleMultiplier
Scaler for digital input transformation. Implements `IDigitalInputScaleMultiplier`.
```csharp
public class DigitalInputScaleMultiplier : IDigitalInputScaleMultiplier
{
public Forms Form { get; set; } = Forms.ArbitraryLowAndHigh;
public double DefaultValue { get; set; } // Value for "OFF" (0)
public double ActiveValue { get; set; } = 1D; // Value for "ON" (1)
public DigitalInputScaleMultiplier();
public DigitalInputScaleMultiplier(DigitalInputScaleMultiplier copy);
public bool SimpleEquals(IDigitalInputScaleMultiplier rhs);
public override bool Equals(object obj);
public override int GetHashCode();
public string ToSerializeDbString();
public void FromDbSerializeString(string s);
}
```
### DigitalOutDbRecord
Database record for digital output configuration. Implements `IDigitalOutDbRecord`.
```csharp
public class DigitalOutDbRecord : BasePropertyChanged, IDigitalOutDbRecord
{
public string SerialNumber { get; set; }
public double DODelay { get; set; }
public double DODuration { get; set; }
public string ModifiedBy { get; set; }
public DateTime LastModified { get; set; }
public int DatabaseId { get; set; }
public string ISOCode { get; set; }
public string ISOChannelName { get; set; }
public string UserCode { get; set; }
public string UserChannelName { get; set; }
public bool Broken { get; set; }
public bool DoNotUse { get; set; }
public DigitalOutputModes DOMode { get; set; }
public bool LimitDuration { get; set; }
public int Version { get; set; }
public byte[] TagsBlobBytes { get; set; }
public DigitalOutDbRecord();
public DigitalOutDbRecord(ISensorData copy, byte[] tagsBlobBytes);
public DigitalOutDbRecord(IDigitalOutDbRecord copy);
public DigitalOutDbRecord(IDataReader reader);
}
```
### SensorCalDbRecord
Database record for sensor calibration data. Implements `ISensorCalDbRecord`.
```csharp
public class SensorCalDbRecord : BasePropertyChanged, ISensorCalDbRecord
{
public bool LinearAdded { get; }
[Key] public int? CalibrationId { get; set; }
public string SerialNumber { get; set; }
[Column(TypeName = "datetime")] public DateTime CalibrationDate { get; set; }
[Required, StringLength(50)] public string Username { get; set; }
public bool LocalOnly { get; set; }
public bool NonLinear { get; set; }
[Required, StringLength(255)] public ICalibrationRecords Records { get; set; }
[Column(TypeName = "datetime")] public DateTime ModifyDate { get; set; }
public bool IsProportional { get; set; }
public bool RemoveOffset { get; set; }
[Required, StringLength(255)] public ZeroMethods ZeroMethods { get; set; }
[Required, StringLength(2048)] public string[] CertificationDocuments { get; set; }
public InitialOffsets InitialOffsets { get; set; }
public SensorCalDbRecord();
public SensorCalDbRecord(ISensorCalDbRecord copy);
public SensorCalDbRecord(IDataReader reader);
}
```
### StreamOutputRecord
Database record for UDP stream output configuration. Implements `IStreamOutputRecord`.
```csharp
public class StreamOutputRecord : TagAwareBase, IStreamOutputRecord
{
public override TagTypes TagType => TagTypes.Sensors;
public const UDPStreamProfile DEFAULT_UDP_PROFILE = UDPStreamProfile.CH10_ANALOG_2HDR;
public const string DEFAULT_UDP_ADDRESS = "UDP://239.1.2.10:8400";
public const ushort MINIMUM_STREAMOUT_TIMECHANNELID = 10;
public const ushort MAXIMUM_STREAMOUT_TIMECHANNELID = 100;
public const ushort DEFAULT_UDP_TIME_CHANNEL_ID = 1;
public const ushort MINIMUM_STREAMOUT_DATACHANNELID = 10;
public const ushort MAXIMUM_STREAMOUT_DATACHANNELID = 100;
public const ushort DEFAULT_UDP_DATA_CHANNEL_ID = 3;
public const string DEFAULT_UDPTMNS_CONFIG = "(1,6,60,0,0,0,0,0)";
public const ushort MINIMUM_STREAMOUT_TDP_INTERVAL_MS = 10;
public const ushort MAXIMUM_STREAMOUT_TDP_INTERVAL_MS = 1000;
public const ushort DEFAULT_IRIG_TIME_DATA_PACKET_INTERVAL_MS = 500;
public const ushort DEFAULT_TMATS_INTERVAL_MS = 1000;
public int Id { get; set; }
public string SerialNumber { get; set; }
public DateTime LastModified { get; set; }
public string LastUpdatedBy { get; set; }
public bool DoNotUse { get; set; }
public bool Broken { get; set; }
public UDPStreamProfile StreamOutUDPProfile { get; set; }
public string StreamOutUDPAddress { get; set; }
public ushort StreamOutUDPTimeChannelId { get; set; }
public ushort StreamOutUDPDataChannelId { get; set; }
public string StreamOutUDPTmNSConfig { get; set; }
public ushort StreamOutIRIGTimeDataPacketIntervalMs { get; set; }
public ushort StreamOutTMATSIntervalMs { get; set; }
public StreamOutputRecord(ISensorData sd);
public StreamOutputRecord(IDataReader reader, int ClientDbVersion, int ConnectionDbVersion);
public static UDPStreamProfile[] AvailableUDPStreamProfiles(int ConnectionDbVersion, bool UseAdvancedStreamingProfiles);
}
```
### ZeroMethod
Configuration for zero reference method with XML serialization support.
```csharp
public class ZeroMethod : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public ZeroMethodType Method { get; set; }
public double Start { get; set; }
public double End { get; set; }
public ZeroMethod(ZeroMethodType zm, double start, double end);
public ZeroMethod(string zm, System.Globalization.CultureInfo culture);
public ZeroMethod(string zm);
public ZeroMethod(ZeroMethod copy);
public ZeroMethod(XElement elem, string prefix, string tblName, string id);
public string ToDbString();
public string ToSerializeString();
public string ToDisplayString(string averageOverTimeFormatString, string diagnosticLevelFormatString, string absoluteZeroFormatString);
internal XElement ToXElement(string prefix);
internal void Update(XElement elem, string prefix);
public override bool Equals(object obj);
public override int GetHashCode();
}
```
### ZeroMethods
Collection of `ZeroMethod` instances. Implements `IZeroMethods`.
```csharp
public class ZeroMethods : IZeroMethods
{
public ZeroMethod[] Methods { get; set; }
public ZeroMethods();
public ZeroMethods(ZeroMethods copy);
public ZeroMethods(ZeroMethod[] copyMethods);
public ZeroMethods(string methods);
public ZeroMethods(ZeroMethod startingMethod);
public void FromSerializedString(string s);
public string ToSerializedString();
public string ToDisplayString(string averageOverTimeFormatString, string diagnosticLevelFormatString, string absoluteZeroFormatString);
public override string ToString();
public override bool Equals(object obj);
}
```
---
## 3. Invariants
### CalMode String Format
- Input string must be exactly 3 characters
- Position 0: `'S'` (ShuntCheck=true) or `'I'` (ShuntCheck=false)
- Position 1: `'D'` (FullBridge=true) or `'S'` (FullBridge=false)
- Position 2: `'F'` (Filter=true) or `'B'` (Filter=false)
### ZeroRef String Format
- Input string must be `"0"`, `"1"`, or `"2"`
- `"0"` maps to `ZeroType.AverageOverTime`
- `"1"` maps to `ZeroType.UsePreEventDiagnostics`
- `"2"` maps to `ZeroType.UseZeroMv`
### DigitalInputScaleMultiplier Serialization
- Uses `CultureInfo.InvariantCulture` for all parsing/formatting
- Serialized format: `{Form}{ListSeparator}{DefaultValue}{ListSeparator}{ActiveValue}`
- Currently only `Forms.ArbitraryLowAndHigh` is supported for serialization
### ZeroMethods Serialization
- Uses separator `"__x__"` between individual `ZeroMethod` entries
- The separator itself is escaped as `"___xx___"` within individual entries
### StreamOutputRecord Channel ID Constraints
- `StreamOutUDPTimeChannelId`: Range `[10, 100]`, default `1`
- `StreamOutUDPDataChannelId`: Range `[10, 100]`, default `3`
- `StreamOutIRIGTimeDataPacketIntervalMs`: Range `[10, 1000]`, default `500`
- `StreamOutTMATSIntervalMs`: Range `[ushort.MinValue, ushort.MaxValue]`, default `1000`
### SensorCalDbRecord NonLinear Behavior
- Setting `NonLinear = true` automatically sets `Records.Records.First().Sensitivity = 1D` and `RemoveOffset = false`
---
## 4. Dependencies
### External Dependencies (Imports)
- `System.Data` - `IDataReader` for database record construction
- `System.IO.Ports` - `StopBits`, `Parity`, `Handshake` enums for UART configuration
- `System.Xml.Linq` - `XElement` for XML serialization in `ZeroMethod`
- `System.ComponentModel` - `INotifyPropertyChanged`, `PropertyChangedEventHandler`
- `System.ComponentModel.DataAnnotations` - `[Key]`, `[Required]`, `[StringLength]`, `[Column]` attributes
- `System.Globalization` - `CultureInfo`, `NumberStyles` for invariant culture parsing
### Internal Dependencies
- `DTS.Common.Base` - `BasePropertyChanged` base class
- `DTS.Common.Enums` - `TagTypes`, `Forms`, `UDPStreamProfile`, `UartDataFormat`, `DigitalOutputModes`
- `DTS.Common.Enums.Sensors` - `CalibrationBehaviors`, `ZeroMethodType`, `NonLinearStyles`
- `DTS.Common.Interface.Tags` - `TagAwareBase`, `TagTypes`
- `DTS.Common.Interface.Sensors` - `ISensorData`, `ISensorDbRecord`, `ISensorCalibration`, `IStreamInputRecord`, `IStreamOutputRecord`, `IUARTRecord`, `IDigitalOutDbRecord`, `ISensorCalDbRecord`, `ICalibrationRecords`, `IZeroMethods`, `IDigitalInputScaleMultiplier`, `ISquibSettingDefaults`, `IDigitalOutDefaults`
- `DTS.Common.Utilities.Logging` - `APILogger.Log()` for exception logging
- `DTS.Common.Classes.Sensors.Utility` - Static helper methods: `GetInt`, `GetShort`, `GetString`, `GetBool`, `GetDateTime`, `GetDouble`, `GetUInt`, `GetUShort`, `GetNullableInt`
- `DTS.Common.Classes.Sensors.SensorConstants` - Default values for zero method
- `DTS.Common.Classes.Sensors.CalibrationRecords` - Calibration record collection
- `DTS.Common.Classes.Sensors.InitialOffsets`, `DTS.Common.Classes.Sensors.InitialOffset` - Initial offset configuration
- `DTS.Common.Strings.Strings` - Localized display strings
---
## 5. Gotchas
### Exception Swallowing in Constructors
`StreamInputRecord(IDataReader)`, `UARTRecord(IDataReader)`, `StreamOutputRecord(IDataReader, int, int)`, and `SensorCalDbRecord(IDataReader)` catch all exceptions, log them via `APILogger.Log()`, and continue execution. This means partially initialized objects can be returned if database columns are missing or malformed.
### CalMode Index-Based Parsing
The `CalMode(string)` constructor accesses string indices directly (`value[0]`, `value[1]`, `value[2]`) without length validation. Passing a string shorter than 3 characters will throw `IndexOutOfRangeException`.
### ZeroMethod Legacy Compatibility
`ZeroMethod` maintains backward compatibility with older TDM format where `"UsePreCalZero"` was used instead of `ZeroMethodType.UsePreEventDiagnosticsZero`. The XML parsing handles both formats.
### DigitalInputScaleMultiplier GetHashCode Collision Handling
The `GetHashCode()` implementation uses different prime multipliers (31, 79, 127) depending on whether values match certain primes to avoid collisions. This is acknowledged as "not perfect but should work in general."
### ParseParameters Location
The XML doc states this class is "needed both in the Wizard CSV import code and in DataPRO CSV import code" and "can probably be moved to only be in Wizard CSV import code when DataPRO CSV import code is removed."
### UARTRecord UartBaudRate Missing Property Change Notification
Unlike most properties in `UARTRecord`, `UartBaudRate` and `UartStopBits` do not call `SetProperty()`—they directly set the backing field without property change notification.
### StreamOutputRecord Conditional Field Loading
`StreamOutputRecord(IDataReader, int, int)` only loads `StreamOutTMATSIntervalMs` if both `ClientDbVersion` and `ConnectionDbVersion` are >= `Constants.TMATS_INTERVAL_VERSION`. The constant `DEFAULT_TMATS_INTERVAL_MS` is defined twice (once as `ushort` literal `1000` and once as `public const ushort`).

View File

@@ -0,0 +1,36 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Sensors/SensorsList/DragAndDropPayload.cs
generated_at: "2026-04-17T16:26:56.245599+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c639cf0d3beb6c6b"
---
# SensorsList
### Purpose
This module provides a data transfer object for drag-and-drop operations within sensor list UI components. The `DragAndDropPayload` class encapsulates an array of draggable items and defines distinct clipboard format identifiers for different modifier key states (standard, Alt, and Ctrl), enabling the system to differentiate between various drag operation modes.
### Public Interface
**`DragAndDropPayload`** (class)
- `DragAndDropPayload(IDragAndDropItem[] items)` — Constructor that accepts an array of items implementing `IDragAndDropItem`. Stores the array in the read-only `Items` property.
- `IDragAndDropItem[] Items { get; }` — Read-only property containing the dragged items.
- `const string FORMAT` — Standard drag format identifier: `"DTS.Common.Classes.Sensors.SensorsList.DragAndDropPayload"`
- `const string ALT_FORMAT` — Alt-modified drag format identifier: `"ALT_DTS.Common.Classes.Sensors.SensorsList.DragAndDropPayload"`
- `const string CTRL_FORMAT` — Ctrl-modified drag format identifier: `"CTRL_DTS.Common.Classes.Sensors.SensorsList.DragAndDropPayload"`
### Invariants
- The `Items` array, once set via constructor, cannot be modified (property is read-only, though the array contents themselves are not immutable).
- All three format constants are distinct strings; they must not be used interchangeably.
### Dependencies
- **Depends on:** `DTS.Common.Interface.Sensors.SensorsList.IDragAndDropItem` (interface for items in the payload)
- **Depended on by:** Not determinable from source alone; likely consumed by UI components handling sensor list drag-and-drop operations.
### Gotchas
- The `Items` property exposes the internal array directly; callers could modify array contents if the array is mutable. Defensive copying is not performed.
- The format string naming convention suggests these are used with Windows clipboard/drag-drop data formats, but the actual registration and usage with `DataObject` is not shown in this source.
---

View File

@@ -0,0 +1,59 @@
---
source_files:
- Common/DTS.CommonCore/Classes/TMAT/TMTTemplate.cs
generated_at: "2026-04-17T16:26:10.767228+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "d946f7637f4d3229"
---
# TMAT
### Purpose
This module provides template processing functionality for TMT (likely Test Management Template) files. It enables reading template files and replacing placeholder patterns with actual values, supporting both global keys (program-level metadata) and channel-specific keys (per-channel configuration). The module uses an attribute-based enum pattern to associate string patterns with strongly-typed keys.
### Public Interface
- **`TMTGlobalKeys` (enum)**
- Enum values: `NameOfProgram`, `TestId`, `DASSerialNumber`, `DASIndex`, `DASSampleRate`, `TestTimeStamp`, `DASBitRate`, `StreamTimeFormat`, `UdpStreamTimeChannelId`, `UdpStreamDataChannelId`, `CreateDate`
- Each value is decorated with `[TMTKey("pattern")]` defining its placeholder pattern.
- **`TMTChannelKeys` (enum)**
- Enum values: `HardwareChannelNumber`, `ChannelName`, `CouplingMode`, `BridgeResistance`, `AAF`, `OffsetMV`, `InputRangeMV`, `MaxRangeEU`, `MinRangeEU`, `EU`, `ScaleFactorEU`, `OffsetEU`
- Patterns include a `{0}` format placeholder for channel number substitution.
- **`TMTKey` (Attribute class)**
- `public string Key { get; set; }` - The pattern string to look for during replacement.
- `public TMTKey(string key)` - Constructor accepting the pattern.
- `public static string GetKey(TMTGlobalKeys o)` - Returns the pattern string for a given global key.
- `public static string GetKey(TMTChannelKeys o, int channelNumber)` - Returns the formatted pattern string for a channel key, with channel number substituted.
- **`ITMTTemplate` (interface)**
- `void UpdateValue(TMTGlobalKeys key, string value)` - Updates all occurrences of the global key pattern with the provided value.
- `void UpdateValue(TMTChannelKeys key, string value, int channelNumber)` - Updates all occurrences of the channel key pattern with the provided value.
- `string[] GetAllLines()` - Returns all lines currently in the template.
- **`TMTTemplate` (class, implements `ITMTTemplate`)**
- `public TMTTemplate(string templateLocation)` - Constructor that reads all lines from the specified file path. Silently produces empty content if file does not exist.
- `public TMTTemplate(string[] lines)` - Constructor that initializes from an existing array of lines.
- `public void UpdateValue(TMTGlobalKeys key, string value)` - Replaces all occurrences of the key's pattern with value across all lines.
- `public void UpdateValue(TMTChannelKeys key, string value, int channelNumber)` - Replaces all occurrences of the channel key's pattern (formatted with channelNumber) with value across all lines.
- `public string[] GetAllLines()` - Returns the current state of all lines as an array.
### Invariants
- Pattern matching uses `string.Contains()` followed by `string.Replace()`, meaning patterns can match anywhere in a line, not just as whole tokens.
- If a file does not exist at `templateLocation`, the `_allLines` list remains empty (no exception is thrown).
- Channel key patterns use composite format strings with `{0}` as the channel number placeholder.
- All updates are performed in-place on the internal line list; the original file is never modified directly.
### Dependencies
- **Depends on:** `System.Collections.Generic` (for `List<string>`), `System.IO.File` (for reading files), `System.Reflection` (via `GetMember`, `GetCustomAttribute`).
- **Depended on by:** Cannot be determined from source alone; likely consumed by test configuration or data acquisition setup components.
### Gotchas
- **Silent failure on missing file:** The constructor `TMTTemplate(string templateLocation)` does not throw or indicate error if the file doesn't exist—it simply results in an empty template. Callers should verify file existence separately if this matters.
- **Multiple replacements per line:** If a pattern appears multiple times in a single line, `string.Replace()` will replace all occurrences. This may or may not be intended behavior.
- **No validation of channelNumber:** The `UpdateValue(TMTChannelKeys, string, int)` method does not validate that `channelNumber` is within any expected range.
- **Pattern collision risk:** Since matching uses `Contains()`, shorter patterns could inadvertently match within longer strings. For example, a pattern `{TEST ID}` could theoretically match inside `{TEST ID EXTRA}`.
- **No write-back to file:** The class only reads from files and returns modified lines via `GetAllLines()`. Persisting changes requires separate file writing logic.
---

View File

@@ -0,0 +1,74 @@
---
source_files:
- Common/DTS.CommonCore/Classes/Tags/TagAssignment.cs
- Common/DTS.CommonCore/Classes/Tags/Tag.cs
- Common/DTS.CommonCore/Classes/Tags/TagAwareBase.cs
- Common/DTS.CommonCore/Classes/Tags/TagsInstance.cs
generated_at: "2026-04-17T15:37:32.096920+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "7b4ffd11137500b0"
---
# Documentation: DTS.Common.Classes.Tags
## 1. Purpose
This module provides a tag management system for the DTS application, enabling objects to be associated with string-based tags. It implements a caching layer for tag lookups, supports database persistence through delegate injection, and provides an abstract base class (`TagAwareBase`) that any entity requiring tag functionality can extend. The system maintains a singleton `TagsInstance` for in-memory tag caching and uses `TagAssignment` records to persist many-to-many relationships between tags and tagged objects.
---
## 2. Public Interface
### TagAssignment Class
**Namespace:** `DTS.Common.Classes.Tags`
**Inherits:** `BasePropertyChanged`
**Implements:** `ITagAssignment`
| Member | Signature | Description |
|--------|-----------|-------------|
| `ObjectID` | `int` property (get/set) | The ID of the object being tagged. Raises property change notification via `SetProperty`. |
| `TagID` | `int` property (get/set) | The ID of the tag being assigned. Raises property change notification via `SetProperty`. |
| `ObjectType` | `TagTypes` property (get/set) | The type of object being tagged. Raises property change notification via `SetProperty`. |
| Constructor | `TagAssignment()` | Default parameterless constructor. |
| Constructor | `TagAssignment(IDataReader reader)` | Constructs from a data reader, mapping columns: `TagID`, `ObjectID`, `ObjectType` (cast from `short`). |
---
### Tag Class
**Namespace:** `DTS.Common.Classes.Tags`
**Inherits:** `BasePropertyChanged`
**Implements:** `ITag`
| Member | Signature | Description |
|--------|-----------|-------------|
| `INVALID_ID` | `const int = -1` | Constant representing an invalid/unset tag ID. |
| `ID` | `int` property (get/set) | The unique identifier for this tag. |
| `Text` | `string` property (get/set) | The display text of the tag. Defaults to empty string. |
| `IsObsolete` | `bool` property (get/set) | Whether the tag is obsolete. Defaults to `false`. |
| Constructor | `Tag(string tagText, int tagId)` | Creates a tag with specified text and ID; sets `IsObsolete` to `false`. |
| Constructor | `Tag(Tag copy)` | Copy constructor. |
| Constructor | `Tag(IDataReader reader)` | Constructs from a data reader, mapping columns: `TagId`, `Obsolete`, `TagText`. |
| Constructor | `Tag()` | Default parameterless constructor. |
| `Clone` | `object Clone()` | Returns a new `Tag` copied from this instance. |
---
### TagAwareBase Class
**Namespace:** `DTS.Common.Classes`
**Inherits:** `BasePropertyChanged`
**Modifiers:** `abstract`
| Member | Signature | Description |
|--------|-----------|-------------|
| `TagType` | `abstract TagTypes` property (get) | Must be implemented by derived classes to specify the entity type. |
| `TagsBlobBytes` | `byte[]` property (get/set) | Serializes `TagIDs` to/from a byte array using `Buffer.BlockCopy`. Setter silently ignores arrays smaller than `sizeof(int)`. |
| `TagIDs` | `int[]` property (get/set) | Array of tag IDs associated with this object. Never null; defaults to empty array. |
| `SetTagsFromCommaSeparatedString` | `void SetTagsFromCommaSeparatedString(string tagText, GetSqlCommandDelegate getSqlCommand, TagsGetDelegate tagsGet, TagsGetIdDelegate tagsGetId, TagsInsertDelegate tagsInsert)` | Splits comma-separated string and delegates to `SetTags`. |
| `SetTags` | `virtual void SetTags(string[] tagsText, ...)` | Adds tags via `TagsInstance.AddRange`, retrieves IDs, sets `TagIDs`, and raises `OnPropertyChanged("TagIDs")`. |
| `GetTagsAsCommaSeparatedString` | `string GetTagsAsCommaSeparatedString(TagsGetDelegate tagsGet)` | Returns tag texts joined by commas. |
| `GetTagsArray` | `virtual string[] GetTagsArray(TagsGetDelegate tagsGet)` | Returns tag texts via `TagsInstance.GetTagTextFromIDs`. |
| `GetTagIDs` | `virtual int[] GetTagIDs()` | Returns the `TagIDs` array. |
| `RemoveTags` | `virtual void RemoveTags(string[] tagsText)` | **Empty implementation** — does nothing. |
| `TagCompatible` | `bool TagCompatible(string tags, TagsGetDelegate tagsGet)` | Returns `true` if any tag in the comma-separated string matches this object's tags. Empty/whitespace strings return `true`. |
| `TagCompatible` | `virtual bool TagCompatible(int[] tags)` | Returns `true` if `tags` is empty or has intersection with `

View File

@@ -0,0 +1,45 @@
---
source_files:
- Common/DTS.CommonCore/Classes/TestMetaData/TestEngineerDetailsDbRecord.cs
- Common/DTS.CommonCore/Classes/TestMetaData/CustomerDetailsDbRecord.cs
- Common/DTS.CommonCore/Classes/TestMetaData/LabratoryDetailsDbRecord.cs
generated_at: "2026-04-17T15:39:20.382536+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "d3f85cf243663e33"
---
# Documentation: Test Metadata DbRecord Classes
## 1. Purpose
This module provides three entity classes—`TestEngineerDetailsDbRecord`, `CustomerDetailsDbRecord`, and `LabratoryDetailsDbRecord`—that model persistent test metadata records for test engineers, customers, and laboratories respectively. Each class serves as a data transfer object (DTO) that implements property change notification, supports instantiation from database readers via `IDataReader`, and provides copy construction for cloning. These records appear to be part of a larger test management system where metadata about test participants is stored and tracked with versioning and audit information.
---
## 2. Public Interface
### TestEngineerDetailsDbRecord
**Namespace:** `DTS.Common.Classes.TestEngineerDetails`
**Implements:** `ITestEngineerDetailsDbRecord`
**Inherits:** `Base.BasePropertyChanged`
#### Constructors
| Signature | Description |
|-----------|-------------|
| `TestEngineerDetailsDbRecord()` | Default parameterless constructor. |
| `TestEngineerDetailsDbRecord(ITestEngineerDetailsDbRecord testEngineerDetailsDbRecord)` | Copy constructor. Copies all properties except `TestEngineerId`. |
| `TestEngineerDetailsDbRecord(IDataReader reader)` | Constructs instance by reading column values from a data reader. |
#### Properties
| Property | Type | Default | Attributes | Description |
|----------|------|---------|------------|-------------|
| `TestEngineerId` | `int` | `-1` | `[Browsable(false)]`, `[ReadOnly(true)]` | Internal identifier. |
| `Name` | `string` | `""` | `[Browsable(false)]`, `[ReadOnly(true)]` | Internal name key. |
| `TestEngineerName` | `string` | `"NOVALUE"` | `[DisplayResource("TestEngineerName")]` | Display name of the test engineer. |
| `TestEngineerPhone` | `string` | `"NOVALUE"` | `[DisplayResource("TestEngineerPhone")]` | Phone number. |
| `TestEngineerFax` | `string` | `"NOVALUE"` | `[DisplayResource("TestEngineerFax")]` | Fax number. |
| `TestEngineerEmail` | `string` | `"NOVALUE"` | `[DisplayResource("TestEngineerEmail")]` | Email address. |
| `LocalOnly` | `bool` | `false` | `[Browsable(false)]`, `[ReadOnly(true)]` | Indicates if record is local-only. |
| `LastModified` | `DateTime` | `DateTime.MinValue` | `[Browsable(false)]`, `[ReadOnly(true)]` | Timestamp of last modification. |
| `LastModifiedBy` | `string` | `""` | `[Browsable(false)]`, `[ReadOnly(true

View File

@@ -0,0 +1,385 @@
---
source_files:
- Common/DTS.CommonCore/Classes/TestSetups/SimpleHardware.cs
- Common/DTS.CommonCore/Classes/TestSetups/TestSetupHelper.cs
- Common/DTS.CommonCore/Classes/TestSetups/ROIPeriodChannelRecord.cs
- Common/DTS.CommonCore/Classes/TestSetups/ExtraProperties.cs
- Common/DTS.CommonCore/Classes/TestSetups/TestSetupHardwareRecord.cs
- Common/DTS.CommonCore/Classes/TestSetups/TestSetupROIsRecord.cs
- Common/DTS.CommonCore/Classes/TestSetups/CalculatedChannelRecord.cs
- Common/DTS.CommonCore/Classes/TestSetups/ISFFile.cs
- Common/DTS.CommonCore/Classes/TestSetups/GraphRecord.cs
- Common/DTS.CommonCore/Classes/TestSetups/RegionOfInterest.cs
- Common/DTS.CommonCore/Classes/TestSetups/ISFSensorRecord.cs
generated_at: "2026-04-17T15:30:52.784383+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ac650a057eb86250"
---
# DTS.Common.Classes.TestSetups Module Documentation
## 1. Purpose
This module provides data structures and utilities for managing test setup configurations in the DTS system. It defines entity classes for hardware records, Regions of Interest (ROI), calculated channels, graph configurations, and sensor records. The module supports both in-memory representation and database persistence through `IDataReader` constructors, and includes functionality for reading/writing ISF (Instrument Setup File) format files used for sensor configuration interchange.
---
## 2. Public Interface
### SimpleHardware
```csharp
public class SimpleHardware : Tuple<string, string, int, int>
```
A lightweight data container representing hardware association.
**Constructor:**
- `SimpleHardware(string serialNumber, string parentDAS, int dasId, int dasType)`
**Properties:**
- `string SerialNumber` — Returns `Item1` from the tuple
- `string ParentDAS` — Returns `Item2` from the tuple
- `int DASId` — Returns `Item3` from the tuple
- `int DASType` — Returns `Item4` from the tuple
---
### TestSetupHelper
```csharp
public abstract class TestSetupHelper
```
Static utility class for managing a process-wide cache of test setup names.
**Static Methods:**
- `void ClearTestSetupNames()` — Clears the internal dictionary
- `void SetTestSetupName(int id, string name)` — Associates a name with an ID (overwrites if exists)
- `string GetTestSetupName(int Id)` — Returns the name for the given ID, or `string.Empty` if not found
---
### ROIPeriodChannelRecord
```csharp
public class ROIPeriodChannelRecord : BasePropertyChanged, IROIPeriodChannelRecord
```
Represents a record from the ROIPeriodChannels table.
**Constructor:**
- `ROIPeriodChannelRecord(IDataReader reader)` — Populates from a stored procedure result (`sp_ROIPeriodChannelsGet`)
**Properties:**
- `int TestSetupROIId` — Foreign key to TestSetupROIs table
- `string ChannelName` — Name of a channel in an ROI period
---
### ExtraProperty
```csharp
public class ExtraProperty : IExtraProperty
```
Represents a key-value property with UI support.
**Constructors:**
- `ExtraProperty()`
- `ExtraProperty(string key, string value)`
- `ExtraProperty(IExtraProperty iep)` — Copy constructor
**Properties:**
- `string Key` — Property identifier
- `string Value` — Property value
- `ICommand PasteCommand` — WPF command binding for paste operations
- `UIItemStatus ItemStatus` — UI state tracking
**Events:**
- `PropertyChangedEventHandler PropertyChanged`
---
### TestSetupHardwareRecord
```csharp
public class TestSetupHardwareRecord : BasePropertyChanged, ITestSetupHardwareRecord
```
Represents hardware configuration for a test setup.
**Constructors:**
- `TestSetupHardwareRecord()`
- `TestSetupHardwareRecord(IDataReader reader)` — Populates from database query
- `TestSetupHardwareRecord(ITestSetupHardwareRecord copy)` — Copy constructor
**Properties:**
- `int DASId` — Default: `-1`
- `int TestSetupId`
- `bool AddDAS` — Default: `true`
- `int SamplesPerSecond`
- `bool IsClockMaster` — Default: `false`
- `byte PTPDomainId` — Default: `0`
- `int AntiAliasFilterRate`
---
### TestSetupROIsRecord
```csharp
public class TestSetupROIsRecord : BasePropertyChanged, ITestSetupROIRecord
```
Represents a Region of Interest period definition.
**Constructor:**
- `TestSetupROIsRecord(IDataReader reader)` — Populates from `sp_TestSetupROIsGet`
**Properties:**
- `int TestSetupROIId`
- `int TestSetupId`
- `string Suffix` — e.g., "_ROI Period 1"
- `double ROIStart` — Default: `-1.0D`
- `double ROIEnd` — Default: `1.0D`
- `bool IsEnabled` — Default: `true`
- `bool IsDefault` — Default: `true`
---
### CalculatedChannelRecord
```csharp
public class CalculatedChannelRecord : BasePropertyChanged, ICalculatedChannelRecord
```
Represents a calculated channel definition.
**Constructors:**
- `CalculatedChannelRecord()`
- `CalculatedChannelRecord(ICalculatedChannelRecord record)` — Copy constructor
- `CalculatedChannelRecord(IDataReader reader)` — Populates from database query
**Properties:**
- `string Name`
- `string TestSetupName`
- `int Id` — Database ID; default: `-1`
- `Operations Operation` — Default: `Operations.SUM`
- `string CalculatedValueCode`
- `string[] InputChannelIds` — Default: `["-1"]`
- `string CFCForInputChannels`
- `string ChannelFilterClassForOutput`
- `int TestSetupId`
- `bool ViewInRealtime`
- `int ClipLength`
---
### GraphRecord
```csharp
public class GraphRecord : BasePropertyChanged, IGraphRecord
```
Represents graph configuration for visualization.
**Constructors:**
- `GraphRecord()`
- `GraphRecord(IGraphRecord copy)` — Copy constructor
- `GraphRecord(IDataReader reader)` — Populates from database query
**Properties:**
- `int GraphId`
- `int TestSetupId`
- `string GraphName` — MaxLength: 50
- `string GraphDescription` — MaxLength: 50
- `string ChannelsString` — MaxLength: 2048
- `bool UseDomainMin`
- `double DomainMin` — Default: `double.MinValue`
- `bool UseDomainMax`
- `double DomainMax` — Default: `double.MaxValue`
- `bool UseRangeMin`
- `double RangeMin` — Default: `double.MinValue`
- `bool UseRangeMax`
- `double RangeMax` — Default: `double.MaxValue`
- `string ThresholdsString` — MaxLength: 2048
- `bool LocalOnly` — Default: `false`; marked as deprecated
---
### RegionOfInterest
```csharp
public class RegionOfInterest : IRegionOfInterest
```
Represents a time-based region of interest with channel assignments.
**Static Properties:**
- `bool Deserializing` — Controls whether property changes trigger notifications (used during deserialization)
**Constructors:**
- `RegionOfInterest()`
- `RegionOfInterest(bool isDefault = false)`
- `RegionOfInterest(string suffix = "", bool isDefault = false, double start = -1D, double end = 1D)`
**Properties:**
- `string Suffix` — Automatically prepends "_" if not present
- `double Start` — Default: `double.MinValue`; constrained to be less than `End`
- `double End` — Default: `double.MaxValue`; constrained to be greater than `Start`
- `bool IsEnabled` — Default: `true`
- `bool IsDefault`
- `string[] ChannelNames`
**Methods:**
- `void ResetSuffix()` — Clears suffix to empty string
- `void SetChannelNamesNoNotify(string[] names)` — Sets channel names without triggering change notifications
**Static Methods:**
- `string GetAnalogChanName(string serialNumber, string hardwareChannelName, string startOfHardware, string originalChannelName = "")`
- `string GetChanName(string serialNumber, string hardwareChannelName, string originalChannelName = "")`
- `string RemoveParentDASName(string entireChannelName)`
- `string RemoveAssignedByIDFromHardwareString(string chHardware)`
**Events:**
- `PropertyChangedEventHandler PropertyChanged`
---
### ISFFile
```csharp
public class ISFFile
```
Handles reading and writing ISF (Instrument Setup File) format files.
**Constructor:**
- `ISFFile()`
**Properties:**
- `char[] HeaderLine1` — 80 characters
- `char[] TestSetupName` — 8 characters starting at position 7
- `char[] NumberOfRecords` — 5 characters starting at position 15
- `char[] TestType` — 22 characters starting at position 20
- `char[] TestDivision` — 30 characters starting at position 42
- `char[] TCFile` — 8 characters starting at position 72
- `IISFSensorRecord[] Records` — Array of sensor records
**Methods:**
- `void AddRecord(IISFSensorRecord record)` — Adds a record and updates count
- `void WriteToFile(string pathToFile)` — Writes the ISF file to disk
- `void AddSensors(ISensorData[] sensors)` — Converts sensors to ISFSensorRecord and adds them
---
### ISFSensorRecord
```csharp
public class ISFSensorRecord : IISFSensorRecord
```
Represents a sensor record in ISF file format (4 records of 80 characters each).
**Constructor:**
- `ISFSensorRecord()` — Initializes with spaces and sets `TOMConfigurationName` to "STANDARD"
**Properties (Record 1):**
- `char[] Record1` — 80 characters
- `char[] Tag` — 2 characters at position 75
- `char[] DataChannelNumber` — 5 characters at position 7
- `bool UserIdSensorIDIsNotSpecified` — 1 character at position 15
- `char[] CapacityCharacters` — 11 characters at position 19
- `char[] SerialNumber` — 12 characters at position 30
- `char[] Sensitivity` — 11 characters at position 42
- `char[] BridgeResistance` — 11 characters at position 53
**Properties (Record 2):**
- `char[] Record2` — 80 characters
- `char[] EngineeringUnits` — 12 characters at position 7
- `char[] C1` — 11 characters at position 20
- `char[] EID` — 17 characters at position 31
- `char[] Unknown1` — 4 characters at position 49
- `char[] Unknown2` — 2 characters at position 53
- `char[] FireDelay` — 11 characters at position 55
- `char[] TOMConfigurationName` — 8 characters at position 66
**Properties (Record 3):**
- `char[] Record3` — 80 characters
- `char[] CommentPart1` — 15 characters at position 14
- `char[] CommentPart2` — 40 characters at position 33
**Properties (Record 4):**
- `char[] Record4` — 80 characters
- `char[] CommentPart3` — 15 characters at position 12
- `char[] SensorType` — 20 characters at position 30
- `char[] C2` — 11 characters at position 50
- `char[] C3` — 11 characters at position 61
**Methods:**
- `void SetDataChannelNumber(short value)`
- `void SetCapacity(double capacity)`
- `double GetCapacity()`
- `void SetSensitivity(double sensitivity)`
- `double GetSensitivity()`
- `void SetC1(double c1)` / `double GetC1()`
- `void SetC2(double c2)`
- `void SetC3(double c3)`
- `void SetFireDelay(double fireDelay)`
- `void SetSensorComment(string s)`
- `void Write(System.IO.BinaryWriter writer)`
- `void SetSensor(ISensorData sensor)`
---
### ArrayExtensions (Static Class)
```csharp
public static class ArrayExtensions
```
Extension methods for array manipulation.
**Methods:**
- `void Fill<T>(this T[] sourceArray, T with)` — Fills entire array with value
- `void SubFill<T>(this T[] source, T with, int startIndex, int finalIndex)` — Fills a range
- `void SetValues<T>(this T[] source, T[] with, int startIndex, int length, T pad)` — Copies values with padding
- `T[] GetValues<T>(this T[] source, int startIndex, int length)` — Extracts a sub-array
---
## 3. Invariants
- **SimpleHardware** is immutable (inherits from `Tuple<...>`).
- **TestSetupHardwareRecord.DASId** defaults to `-1`, indicating an unset/unassigned state.
- **CalculatedChannelRecord.Id** defaults to `-1`, indicating a new/unpersisted record.
- **CalculatedChannelRecord.InputChannelIds** is never null after construction (defaults to `["-1"]`).
- **RegionOfInterest.Start** is always less than `End` (enforced by property setters with 0.01 minimum separation).
- **RegionOfInterest.Suffix** is automatically normalized to start with `_` if non-empty.
- **ISFFile** uses fixed record length of 80 characters (`ConstantsAndEnums.RECORD_LENGTH`).
- **ISFSensorRecord** always consists of exactly 4 records of 80 characters each.
- **ISFSensorRecord.NumberOfRecords** in the file header equals `Records.Length * 4`.
- **GraphRecord.DomainMin/Max** and **RangeMin/Max** have default values of `double.MinValue`/`double.MaxValue` and are only meaningful when their corresponding `Use*` boolean is `true`.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base``BasePropertyChanged` base class
- `DTS.Common.Interface.TestSetups` — Interface contracts (`IROIPeriodChannelRecord`, `ITestSetupHardwareRecord`, `ITestSetupROIRecord`, `ICalculatedChannelRecord`, `IISFSensorRecord`)
- `DTS.Common.Interface.Graphs``IGraphRecord`
- `DTS.Common.Interface.Sensors``ISensorData`
- `DTS.Common.Interface.ISO.ExtraProperties``IExtraProperty`
- `DTS.Common.Interface.RegionOfInterest``IRegionOfInterest`
- `DTS.Common.Enums``Operations` enum, `UIItemStatus` enum
- `DTS.Common.Enums.Sensors``SensorConstants`
- `DTS.Common.Events.RegionOfInterest``RegionOfInterestChangedEvent`
- `Microsoft.Practices.Prism.Events``IEventAggregator`
- `Microsoft.Practices.ServiceLocation``ServiceLocator`
- `System.Data``IDataReader` for database record construction
- `System.ComponentModel``INotifyPropertyChanged`, `PropertyChangedEventHandler`
- `System.Windows.Input``ICommand`
### What depends on this module:
- Not determinable from the source files alone.
---
## 5. Gotchas
### TestSetupROIsRecord Constructor Bug
In `TestSetupROIsRecord(IDataReader reader)`, the `TestSetupId` property is incorrectly assigned from the `TestSetupROIId` column:
```csharp
TestSetupId = Utility.GetInt(reader, "TestSetupROIId"); // Should likely be "TestSetupId"
```
This appears to be a copy-paste error; `TestSetupId` should probably read from the `"TestSetupId"` column.
### RegionOfInterest Static State
`RegionOfInterest.Deserializing` is a **static** property that controls change notifications globally. If multiple threads are deserializing ROIs concurrently, or if the flag is not properly reset, notifications may be incorrectly suppressed or fired.
### RegionOfInterest.NotifyChanged Silent Failures
The `NotifyChanged()` method catches and swallows all exceptions silently. Failures in `ServiceLocator` or `IEventAggregator` resolution will go unnoticed.
### ISFFile Overwrites Without Prompt
`ISFFile.WriteToFile()` will delete an existing file at the target path without user confirmation via `Utils.FileUtils.DeleteFileOrMove()`.
### GraphRecord.LocalOnly Deprecated
The `

View File

@@ -0,0 +1,23 @@
---
source_files:
- Common/DTS.CommonCore/Classes/WinApi/WindowsAPIHelpers.cs
generated_at: "2026-04-17T16:26:10.768750+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "cc8a243ee7ad0716"
---
# WinApi
### Purpose
This module provides Windows API interop helpers for window management and monitor handling. It wraps native Win32 structures and functions to enable proper multi-monitor support and window sizing behavior in WPF applications, particularly for handling maximized window positioning relative to the work area (excluding taskbar).
### Public Interface
- **`POINT` (struct)**
- `public int x` - X coordinate.
- `public int y` - Y coordinate.
- `public POINT(int x, int y)` - Constructor.
- **`MINMAXINFO` (struct)**
- `public POINT ptReserved` - Reserved for system use.
- `public POINT ptMaxSize` - Maximum size

View File

@@ -0,0 +1,65 @@
---
source_files:
- Common/DTS.CommonCore/Classes/WindowsFolder/WindowsFolder.cs
generated_at: "2026-04-17T16:38:34.541099+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "95afd8653b72b5d8"
---
# Documentation: WindowsFolder.cs
## 1. Purpose
`WindowsFolder` is a utility class that provides functionality for opening Windows filesystem folders via the operating system's file explorer. It currently exposes a single method for launching Windows Explorer to display the application's manuals directory. This class exists to centralize folder-opening logic for the DTS Suite application, abstracting away the details of process invocation and path construction.
---
## 2. Public Interface
### `public static void OpenManualsFolder(string path)`
Opens the manuals folder in Windows Explorer.
- **Parameters:**
- `path` (string): The base directory path where the Manuals folder is expected to reside.
- **Behavior:**
1. Constructs the full path to the manuals folder by combining the provided `path` with `Constants.ManualsFolder`.
2. Launches Windows Explorer (`Constants.WindowsExplorer`) with the constructed path as an argument using `Process.Start()`.
- **Example usage:**
```csharp
WindowsFolder.OpenManualsFolder(@"C:\DTS\DTS.Suite\1.0\DataPRO");
```
---
## 3. Invariants
- The `path` parameter must be a valid directory path string; no null/empty validation is performed within the method.
- The `Constants.ManualsFolder` constant must be defined and represent a valid folder name.
- The `Constants.WindowsExplorer` constant must be defined and represent a valid executable path or name (likely `"explorer.exe"`).
- The caller is responsible for ensuring the Manuals folder exists at the constructed location before calling this method.
---
## 4. Dependencies
### This module depends on:
- **System** - Base .NET types
- **System.Diagnostics** - `Process` and `ProcessStartInfo` for launching external processes
- **System.IO** - `Path` for path manipulation
- **Constants** (location unspecified in source) - Provides `ManualsFolder` and `WindowsExplorer` constants
### What depends on this module:
- Cannot be determined from the source alone; no consumers are shown.
---
## 5. Gotchas
- **No existence check:** The method does not verify that the constructed `manualsPath` exists before attempting to open it. If the path is invalid, Windows Explorer behavior is undefined (it may open to a default location or show an error).
- **No error handling:** There is no try/catch block. Exceptions from `Process.Start()` (e.g., if Windows Explorer cannot be launched) will propagate to the caller.
- **No null/empty validation:** Passing `null` or an empty string as `path` will result in `Path.Combine()` producing unexpected results, potentially leading to runtime exceptions.
- **Comment discrepancy:** The XML documentation mentions a default path (`C:\DTS\DTS.Suite\(version)\DataPRO\Manuals`), but the method does not use this default—it relies entirely on the caller-provided `path` parameter. The comment describes context rather than implementation.