init
This commit is contained in:
42
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS.md
Normal file
42
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/TTSImportModule.cs
|
||||
generated_at: "2026-04-17T16:16:03.437787+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "53eb3457fc360d37"
|
||||
---
|
||||
|
||||
# TTS
|
||||
|
||||
### Purpose
|
||||
This module serves as the Prism module initializer for the TTS (Test Setup) Import feature, responsible for registering multiple views and view models related to hardware scanning, file editing, summary display, channel configuration (analog, digital input, digital output), and level triggers. It provides assembly metadata for the "Prepare" assembly group.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**TTSImportModule**
|
||||
- `TTSImportModule(IUnityContainer unityContainer)` - Constructor accepting the injected Unity container.
|
||||
- `void Initialize()` - Registers the following view/view model pairs with Unity:
|
||||
- `IHardwareScanView` → `HardwareScanView`, `IHardwareScanViewModel` → `HardwareScanViewModel`
|
||||
- `IEditFileView` → `EditFileView`, `IEditFileViewModel` → `EditFileViewModel`
|
||||
- `ISummaryView` → `SummaryView`, `ISummaryViewModel` → `SummaryViewModel`
|
||||
- `IReadFileView` → `ReadFileView`, `IReadFileViewModel` → `ReadFileViewModel`
|
||||
- `ILevelTriggerView` → `LevelTriggerView`, `ILevelTriggerViewModel` → `LevelTriggerViewModel`
|
||||
- `IAnalogChannelsView` → `AnalogChannelsView`, `IAnalogChannelsViewModel` → `AnalogChannelsViewModel`
|
||||
- `ITOMChannelsView` → `TOMChannelsView`, `ITOMChannelsViewModel` → `TOMChannelsViewModel`
|
||||
- `IDigitalInputChannelsView` → `DigitalInputChannelsView`, `IDigitalInputChannelsViewModel` → `DigitalInputChannelsViewModel`
|
||||
- `IDigitalOutputChannelsView` → `DigitalOutputChannelsView`, `IDigitalOutputChannelsViewModel` → `DigitalOutputChannelsViewModel`
|
||||
- `void OnInitialized(IContainerProvider containerProvider)` - **Throws `NotImplementedException`**.
|
||||
- `void RegisterTypes(IContainerRegistry containerRegistry)` - **Throws `NotImplementedException`**.
|
||||
|
||||
**TTSImportModuleNameAttribute** (extends `TextAttribute`)
|
||||
- `string AssemblyName { get; }` - Returns `AssemblyNames.TTSImport.ToString()`.
|
||||
- `Type GetAttributeType()` - Returns `typeof(TextAttribute)`.
|
||||
- `string GetAssemblyName()` - Returns the assembly name.
|
||||
|
||||
**TTSImportModuleImageAttribute** (extends `ImageAttribute`)
|
||||
- `BitmapImage AssemblyImage { get; }` - Loads image via `AssemblyInfo.GetImage(AssemblyNames.TTSImport.ToString())`.
|
||||
- `string AssemblyName { get; }` - Returns `AssemblyNames.TTSImport.ToString()`.
|
||||
- `string AssemblyGroup { get; }` - Returns `eAssemblyGroups.Prepare.ToString()`.
|
||||
- `eAssemblyRegion AssemblyRegion { get; }` - Returns `eAssemblyRegion.TTSImportRegion`.
|
||||
- Accessor methods: `GetAssemblyImage()
|
||||
257
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/Model.md
Normal file
257
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/Model.md
Normal file
@@ -0,0 +1,257 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/WorkFunctionThreadData.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/SummaryChannel.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/ChannelSummary.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/DasSummary.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/HardwareSummaryRecord.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/TTSTestSetup.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/TTSLevelTriggerRecord.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/DASChannel.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Model/TTSChannelRecord.cs
|
||||
generated_at: "2026-04-17T15:50:30.197430+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "aa6e85661fc3946d"
|
||||
---
|
||||
|
||||
# TTS Import Model Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides the data model layer for TTS (Toyota Test Setup) import functionality within the DataPRO test setup system. It contains model classes representing test configurations, channel records, hardware channel assignments, level triggers, and various summary records. These models implement `INotifyPropertyChanged` for WPF data binding, support serialization via `GetBytes()` methods for hash generation, and serve as the bridge between hardware abstraction layers and the UI for test setup import workflows.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### WorkFunctionThreadData
|
||||
**Namespace:** `TTSImport.Model`
|
||||
|
||||
Simple container for thread synchronization events.
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `WorkFunctionThreadData()` | Initializes `CancelEvent` and `DoneEvent` as non-signaled (`false`). |
|
||||
| CancelEvent | `ManualResetEvent { get; }` | Read-only event for signaling thread cancellation. |
|
||||
| DoneEvent | `ManualResetEvent { get; }` | Read-only event for signaling thread completion. |
|
||||
|
||||
---
|
||||
|
||||
### SummaryChannel
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Implements:** `ISummaryChannel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| ChannelType | `string { get; set; }` | Channel type identifier. Raises `PropertyChanged` on set. |
|
||||
| Assigned | `int { get; set; }` | Count of assigned channels. Raises `PropertyChanged` on set. |
|
||||
| Unassigned | `string { get; set; }` | Unassigned channel information. Raises `PropertyChanged` on set. |
|
||||
| PropertyChanged | `event PropertyChangedEventHandler` | Standard property changed event. |
|
||||
| OnPropertyChanged | `void OnPropertyChanged(string propertyName)` | Invokes `PropertyChanged` event if handlers are attached. |
|
||||
|
||||
---
|
||||
|
||||
### ChannelSummary
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Implements:** `IChannelSummary`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| ChannelType | `string { get; set; }` | Channel type identifier. |
|
||||
| Requested | `int { get; set; }` | Number of requested channels. |
|
||||
| Assigned | `int { get; set; }` | Number of assigned channels. |
|
||||
| Unassigned | `int { get; set; }` | Number of unassigned channels. |
|
||||
| PropertyChanged | `event PropertyChangedEventHandler` | Property changed event. |
|
||||
| OnPropertyChanged | `void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event. |
|
||||
|
||||
---
|
||||
|
||||
### DasSummary
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Implements:** `IDasSummary`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| DASSerial | `string { get; set; }` | DAS device serial number. |
|
||||
| EIDFound | `string { get; set; }` | Electronic ID found status. |
|
||||
| BatteryVoltageStatus | `string { get; set; }` | Battery voltage status string. |
|
||||
| BatteryVoltageColor | `System.Windows.Media.SolidColorBrush { get; set; }` | Color indicator for battery voltage status. |
|
||||
| InputVoltageStatus | `string { get; set; }` | Input voltage status string. |
|
||||
| InputVoltageColor | `System.Windows.Media.SolidColorBrush { get; set; }` | Color indicator for input voltage status. |
|
||||
| PropertyChanged | `event PropertyChangedEventHandler` | Property changed event. |
|
||||
| OnPropertyChanged | `void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event. |
|
||||
|
||||
---
|
||||
|
||||
### HardwareSummaryRecord
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Implements:** `IHardwareSummaryRecord`
|
||||
**Base:** `DTS.Common.Base.BasePropertyChanged`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| DOut | `uint { get; set; }` | Digital output count. |
|
||||
| DIn | `uint { get; set; }` | Digital input count. |
|
||||
| Squib | `uint { get; set; }` | Squib channel count. |
|
||||
| Analog | `uint { get; set; }` | Analog channel count. |
|
||||
| SPS | `uint { get; set; }` | SPS device count. |
|
||||
| SPD | `uint { get; set; }` | SPD device count. |
|
||||
| SPT | `uint { get; set; }` | SPT device count. |
|
||||
| ECM | `uint { get; set; }` | ECM device count. |
|
||||
| Rack | `uint { get; set; }` | Rack count. |
|
||||
| G5 | `uint { get; set; }` | G5 device count. |
|
||||
| Total | `uint { get; }` | Sum of `Analog + Squib + DIn + DOut`. Private setter. |
|
||||
| UpdateTotal | `void UpdateTotal()` | Recalculates `Total` from component counts. |
|
||||
| Update | `void Update(uint analog, uint squib, uint din, uint dout, uint ecm, uint sps, uint spt, uint spd, uint g5, uint rack)` | Sets all counts and calls `UpdateTotal()`. |
|
||||
|
||||
---
|
||||
|
||||
### TTSTestSetup
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Implements:** `ITTSSetup`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| SampleRate | `double { get; set; }` | Sample rate for recording. |
|
||||
| Mode | `RecordingModes { get; set; }` | Recording mode enum value. |
|
||||
| TestLength | `double { get; }` | Computed as `PreTrigger + PostTrigger`. |
|
||||
| PreTrigger | `double { get; set; }` | Pre-trigger duration. |
|
||||
| PostTrigger | `double { set; }` | Post-trigger duration. |
|
||||
| ROIStart | `double { get; set; }` | Region of interest start time. |
|
||||
| ROIEnd | `double { get; set; }` | Region of interest end time. |
|
||||
| Filename | `string { get; set; }` | Output filename. |
|
||||
| TestId | `string { get; set; }` | Test identifier. |
|
||||
| Line1–Line4 | `string { get; set; }` | First 4 lines of CSV file for recreation. |
|
||||
| DummyList | `string[] { get; set; }` | Array of 8 dummy strings. |
|
||||
| Channels | `ITTSChannelRecord[] { get; set; }` | Array of channel records. |
|
||||
| LevelTriggers | `ILevelTrigger[] { get; set; }` | Array of 6 level triggers. |
|
||||
| OriginalImportFile | `string { get; set; }` | Path to original import file. |
|
||||
| AllowAdvancedRecordingModes | `bool { get; set; }` | Enables HybridRecorder options. |
|
||||
| AllowActiveRecordingModes | `bool { get; set; }` | Enables Active RAM modes. |
|
||||
| AllowTSRAIRRecordingModes | `bool { get; set; }` | Enables TSRAIR recording modes. |
|
||||
| RequireEIDFound | `bool { get; set; }` | Whether EIDs must be found for sensor use. |
|
||||
| DefaultDigitalInputMode | `string { get; set; }` | Default digital input mode from config. |
|
||||
| SquibDefaults | `ISquibSettingDefaults { get; set; }` | Default squib settings. |
|
||||
| DefaultSquibFireDurationMs | `double { get; set; }` | Default squib fire duration from config. |
|
||||
| PreAssignedSensorIdAndHwId | `Tuple<string, string>[] { get; set; }` | Pre-existing sensor-to-hardware assignments from XML import. |
|
||||
| Constructor | `TTSTestSetup()` | Initializes `DummyList[8]`, empty `Channels`, and 6 `LevelTriggers`. |
|
||||
| GetHashCode | `new string GetHashCode()` | Returns SHA256 hash string of test setup state. **Note:** Uses `new` keyword to hide base method. |
|
||||
|
||||
---
|
||||
|
||||
### TTSLevelTriggerRecord
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Implements:** `ILevelTrigger`
|
||||
**Base:** `DTS.Common.Base.BasePropertyChanged`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Code | `string { get; }` | Channel code from associated channel, or empty string. |
|
||||
| JCode | `string { get; }` | JCODE from associated channel, or empty string. |
|
||||
| ValuePercent | `double { get; set; }` | Threshold as percentage of full scale. Triggers `RecalculateEUValue()`. |
|
||||
| ValueEU | `double { get; set; }` | Threshold in engineering units. Triggers `RecalculatePercent()`. |
|
||||
| EULabel | `string { get; }` | Engineering units label from associated channel. |
|
||||
| HWSerialNumber | `string { get; }` | Hardware channel display string. |
|
||||
| ChannelNumber | `int { get; }` | TTS channel number, or 0 if no channel. |
|
||||
| Channel | `ITTSChannelRecord { get; set; }` | Associated channel record. Setting triggers refresh of all other level triggers. |
|
||||
| TestSetup | `ITTSSetup { get; }` | Parent test setup (set via constructor). |
|
||||
| AvailableChannels | `ITTSChannelRecord[] { get; }` | Channels eligible for level trigger assignment. Enforces max 2 per G5, no duplicate codes/SIMs. |
|
||||
| IsActive | `bool { get; }` | True if `Channel` is set and not an empty record. |
|
||||
| IsModified | `bool { get; set; }` | Dirty flag for tracking changes. |
|
||||
| Constructor | `TTSLevelTriggerRecord(ITTSSetup setup)` | Sets `TestSetup` reference. |
|
||||
| GetBytes | `byte[] GetBytes()` | Serializes trigger state for hashing. Returns empty array if inactive. |
|
||||
| Refresh | `void Refresh()` | Updates `AvailableChannels` and validates current `Channel` assignment. Re-entrancy guarded. |
|
||||
| Add | `void Add(ITTSChannelRecord channel)` | Raises `AvailableChannels` property changed. |
|
||||
| Remove | `void Remove(ITTSChannelRecord channel)` | Unassigns `Channel` if matches parameter; raises `AvailableChannels` changed. |
|
||||
| ToString | `override string ToString()` | Returns `Code`. |
|
||||
|
||||
---
|
||||
|
||||
### DASChannel
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Base:** `System.Windows.DependencyObject`
|
||||
**Implements:** `INotifyPropertyChanged`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Disabled | `bool` (DependencyProperty) | Whether channel is disabled for test execution. |
|
||||
| HardwareChannel | `IHardwareChannel { get; }` | Wrapped hardware channel interface. |
|
||||
| TestSetup | `ITTSSetup { get; }` | Associated test setup (optional). |
|
||||
| Channel | `ITTSChannelRecord { get; private set; }` | Associated TTS channel record. |
|
||||
| DASChannelString | `string { get; }` | String representation of hardware channel. |
|
||||
| ToyotaCode | `string { get; set; }` | Channel code from `Channel.ChannelCode`. |
|
||||
| EID | `string { get; set; }` | Electronic ID on physical channel. |
|
||||
| Name | `string { get; set; }` | JCode or description from channel. |
|
||||
| SerialNumber | `string { get; }` | Sensor serial number. |
|
||||
| Sensitivity | `double { get; }` | Sensor sensitivity. |
|
||||
| SensitivityString | `string { get; }` | Sensitivity formatted to 12 decimal places. |
|
||||
| IsActive | `bool { get; }` | True if `Channel` is set (and for digital out, mode is not `NONE`). |
|
||||
| Capacity | `double { get; }` | Sensor capacity. |
|
||||
| Range | `double { get; set; }` | Channel range. |
|
||||
| CableMultiplier | `double { get; set; }` | Cable multiplier factor. |
|
||||
| Polarity | `string { get; set; }` | `"+"` or `"-"` based on `SensorPolarity`. |
|
||||
| DigitalOutputMode | `DigitalOutputModes { get; set; }` | Digital output mode; setting to/from `NONE` adds/removes from test setup. |
|
||||
| DigitalOutputDelayMs | `double { get; set; }` | Delay between trigger and output. |
|
||||
| DigitalOutputDurationMs | `double { get; set; }` | Output duration (default 100ms). |
|
||||
| SquibFireMode | `SquibFireMode { get; set; }` | Squib firing mode. |
|
||||
| SquibFireDelayMs | `double { get; set; }` | Delay before squib fire. |
|
||||
| SquibFireCurrent | `double { get; set; }` | Current limit in amps. |
|
||||
| SquibFireDurationMs | `double { get; set; }` | Squib fire duration. |
|
||||
| SquibFireResistanceLowOhm | `double { get; set; }` | Low resistance tolerance (default 1Ω). |
|
||||
| SquibFireResistanceHighOhm | `double { get; set; }` | High resistance tolerance (default 8Ω). |
|
||||
| LimitDuration | `bool { get; set; }` | Whether to limit squib fire duration. |
|
||||
| Constructor | `DASChannel(IHardwareChannel channel)` | Wraps hardware channel. |
|
||||
| Constructor | `DASChannel(IHardwareChannel channel, ITTSSetup setup)` | Wraps hardware channel with test setup reference. |
|
||||
| SetITTSChannelRecord | `void SetITTSChannelRecord(ITTSChannelRecord channel)` | Assigns/unassigns channel record to hardware. Updates all UI properties. |
|
||||
| Polarities | `IEnumerable<string>` | Returns `["+", "-"]`. |
|
||||
| SquibFireModes | `IEnumerable<SquibFireMode>` | Returns `[CAP, CONSTANT]`. |
|
||||
| OutputModes | `IEnumerable<DigitalOutputModes>` | Returns available digital output modes. |
|
||||
|
||||
---
|
||||
|
||||
### TTSChannelRecord
|
||||
**Namespace:** `TTSImport.Model`
|
||||
**Implements:** `ITTSChannelRecord`
|
||||
**Base:** `DTS.Common.Base.BasePropertyChanged`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| ChannelNumber | `int { get; set; }` | TTS channel number. |
|
||||
| ChannelCode | `string { get; set; }` | Channel code identifier. |
|
||||
| JCodeOrDescription | `string { get; set; }` | J-code or description. Updates `IsJCodeValid` on set. |
|
||||
| ChannelRange | `double { get; set; }` | Channel range in EU. Updates `IsRangeValid` on set. |
|
||||
| ChannelRangeString | `string { get; set; }` | String representation of range. |
|
||||
| ChannelFilterHz | `int { get; set; }` | Filter frequency in Hz. Updates `IsFilterValid` on set. |
|
||||
| FilterString | `string { get; set; }` | String representation of filter. |
|
||||
| SensorSerialNumber | `string { get; set; }` | Sensor serial number. |
|
||||
| SensorEID | `string { get; set; }` | Sensor electronic ID. |
|
||||
| SensorSensitivity | `double { get; set; }` | Sensor sensitivity. |
|
||||
| SensorExcitationVolts | `double { get; set; }` | Excitation voltage. |
|
||||
| SensorCapacity | `double { get; set; }` | Sensor capacity. |
|
||||
| SensorEU | `string { get; set; }` | Engineering units. |
|
||||
| SensorPolarity | `bool { get; set; }` | Polarity flag. |
|
||||
| ChannelType | `ToyotaBridgeType { get; set; }` | Bridge type enum. |
|
||||
| Description | `string { get; set; }` | Channel description. |
|
||||
| ProportionalToExcitation | `bool { get; set; }` | Whether proportional to excitation. |
|
||||
| BridgeResistance | `double { get; set; }` | Bridge resistance. |
|
||||
| InitialOffsetVoltage | `double { get; set; }` | Initial offset voltage. |
|
||||
| InitialOffsetVoltageTolerance | `double { get; set; }` | Offset voltage tolerance. |
|
||||
| RemoveOffset | `bool { get; set; }` | Whether to remove offset. |
|
||||
| ZeroMethod | `ToyotaZeroMethods { get; set; }` | Zero method enum. |
|
||||
| CableMultiplier | `double { get; set; }` | Cable multiplier. |
|
||||
| InitialEUInMV | `double { get; set; }` | Initial EU in mV. |
|
||||
| InitialEUInEU | `double { get; set; }` | Initial EU value. |
|
||||
| IRTraccExponent | `double { get; set; }` | IRTracc exponent. |
|
||||
| PolynomialConstant | `double { get; set; }` | Polynomial constant term. |
|
||||
| PolynomialCoefficientA–C, Alpha | `double { get; set; }` | Polynomial coefficients. |
|
||||
| ISOCode | `string { get; set; }` | ISO code. |
|
||||
| ISODescription | `string { get; set; }` | ISO description. |
|
||||
| ISOPolarity | `string { get; set; }` | ISO polarity. |
|
||||
| IsSquib | `bool { get; set; }` | Whether this is a squib channel. |
|
||||
| IsDigitalInput | `bool { get; set; }` | Whether this is a digital input. |
|
||||
| IsDigitalOutput | `bool { get; set; }` | Whether this is a digital output. |
|
||||
| HardwareChannel | `IHardwareChannel { get; set; }` | Associated hardware channel. |
|
||||
| IsEmptyRecord | `bool { get; }` | True if `ChannelCode == "NONE"` and no serial number. |
|
||||
| IsChannelCodeValid | `bool { get; set; }` | Channel code validation state. |
|
||||
| IsJCodeValid | `bool { get; set; }`
|
||||
46
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/Properties.md
Normal file
46
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/Properties.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Properties/AssemblyInfo.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Properties/Settings.Designer.cs
|
||||
generated_at: "2026-04-17T16:28:27.909772+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "1ed045fc2814c998"
|
||||
---
|
||||
|
||||
# Properties
|
||||
|
||||
### Purpose
|
||||
This module provides assembly metadata and application settings for the TTSImport assembly, which appears to be a component responsible for importing test setup data. It defines version information, COM visibility settings, and a user-scoped setting for controlling the default test import method.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**`TTSImport.Properties.Settings`** (internal sealed class)
|
||||
- Inherits from `global::System.Configuration.ApplicationSettingsBase`
|
||||
- `static Settings Default { get; }` - Returns the synchronized singleton instance of the settings class.
|
||||
- `int DefaultTestImportMethod { get; set; }` - A user-scoped setting with a default value of `0`. Controls which import method is used by default for test imports.
|
||||
|
||||
**Assembly-level attributes:**
|
||||
- `AssemblyTitle("TTSImport")`
|
||||
- `AssemblyCompany("DTS")`
|
||||
- `AssemblyProduct("TTSImport")`
|
||||
- `AssemblyCopyright("Copyright © 2017")`
|
||||
- `ComVisible(false)`
|
||||
- `Guid("a8ff540f-f22a-45ae-a63b-4984ed74c654")`
|
||||
- `AssemblyVersion("1.0.0.0")`
|
||||
- `AssemblyFileVersion("1.0.0.0")`
|
||||
|
||||
### Invariants
|
||||
- The `Settings` class is a singleton accessed via `Settings.Default`.
|
||||
- `DefaultTestImportMethod` is guaranteed to return `0` if no user setting has been persisted.
|
||||
- The settings instance is thread-safe via `Synchronized()`.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on:** `System.Configuration.ApplicationSettingsBase`, `System.Reflection`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices`.
|
||||
- **Depended on by:** Unclear from source alone; presumably the main TTSImport module accesses `Settings.Default.DefaultTestImportMethod`.
|
||||
|
||||
### Gotchas
|
||||
- `Settings.Designer.cs` is auto-generated by Visual Studio's `SettingsSingleFileGenerator`. Manual changes will be overwritten if the settings are regenerated.
|
||||
- The meaning of `DefaultTestImportMethod` values (what `0` represents vs other values) is not documented in the source.
|
||||
|
||||
---
|
||||
98
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/Resources.md
Normal file
98
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/Resources.md
Normal file
@@ -0,0 +1,98 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Resources/StringResources.ja.Designer.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Resources/TranslateExtension.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/Resources/StringResources.Designer.cs
|
||||
generated_at: "2026-04-17T15:55:43.662597+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "d7d95270db602454"
|
||||
---
|
||||
|
||||
# Documentation: TTS Import Resources Module
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides localization and internationalization support for the TTS (Test Setup) Import functionality within the DataPRO system. It enables XAML-based UI string resolution through a WPF markup extension pattern, and maintains a strongly-typed catalog of localized strings for test setup operations including sensor assignments, channel configurations, DAS (Data Acquisition System) management, and import validation messaging. The module serves as the presentation layer's interface to localized text resources.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `TranslateExtension` (Class)
|
||||
**Namespace:** `TTSImport`
|
||||
**Attribute:** `[MarkupExtensionReturnTypeAttribute(typeof(string))]`
|
||||
|
||||
A WPF markup extension for resolving localized strings in XAML bindings.
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `TranslateExtension(string key)` | Initializes the extension with the resource key to look up. Stores key in readonly field `_key`. |
|
||||
| `NotFound` | `public const string NotFound = "#stringnotfound#"` | Constant returned when a resource key cannot be resolved. |
|
||||
| `ProvideValue` | `public override object ProvideValue(IServiceProvider serviceProvider)` | Returns the localized string for `_key` via `Resources.StringResources.ResourceManager.GetString(_key)`. Returns `NotFound` if `_key` is null or empty. Returns `NotFound + " " + _key` if the lookup returns null. |
|
||||
|
||||
### `StringResources` (Class)
|
||||
**Namespace:** `TTSImport.Resources`
|
||||
**Accessibility:** `internal`
|
||||
**Attributes:** `[GeneratedCode]`, `[DebuggerNonUserCode]`, `[CompilerGenerated]`
|
||||
|
||||
An auto-generated strongly-typed resource class providing access to localized strings.
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `ResourceManager` | `internal static global::System.Resources.ResourceManager ResourceManager { get; }` | Lazy-initialized cached ResourceManager instance for the resource bundle `"TTSImport.Resources.StringResources"`. |
|
||||
| `Culture` | `internal static global::System.Globalization.CultureInfo Culture { get; set; }` | Gets or sets the current UI culture for resource lookups. Defaults to null (uses current thread culture). |
|
||||
|
||||
**Selected Resource String Properties (non-exhaustive):**
|
||||
|
||||
| Property | Sample Value (from comments) |
|
||||
|----------|------------------------------|
|
||||
| `AAF_SLICE` | `"Requested SLICE AAF: {0}"` |
|
||||
| `AAF_TDAS` | `"Requested TDAS AAF: {0}"` |
|
||||
| `Added` | `"Added"` |
|
||||
| `Analog` | `"Analog"` |
|
||||
| `AssignSensorPrompt` | `"Assign sensor? ID on the channel will be applied to the sensor and removed from any other sensors."` |
|
||||
| `ImportTestSetup_MustBeCSVOrXML` | `"TTS import requires either .csv or .xml input file"` |
|
||||
| `ImportTestSetup_DuplicateChannelCode` | `"{0} is a duplicate Channel Code."` |
|
||||
| `ImportTestSetup_DuplicateJCode` | `"JCode {0} is a duplicate"` |
|
||||
| `EmptyChannelCodeWarning` | `"Non empty channel codes are required, please complete channel codes to continue"` |
|
||||
| `ExcitationNotSupportedByChannel` | `"Sensor excitation {0} not supported by channel"` |
|
||||
| `SensorNotFound` | `"Sensor \"{0}\" not found in database"` |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **Key Immutability:** The `_key` field in `TranslateExtension` is `readonly` and set only at construction time.
|
||||
- **Fallback Behavior:** `ProvideValue` will never return null; it always returns either the resolved string, the `NotFound` constant, or `NotFound + " " + _key`.
|
||||
- **Empty Key Handling:** Passing `null` or empty string to `TranslateExtension` returns exactly `NotFound` (without the key suffix).
|
||||
- **Resource Manager Singleton:** `StringResources.ResourceManager` uses lazy initialization with a null-check pattern; once initialized, the same instance is returned on subsequent calls.
|
||||
- **Auto-Generated Code:** `StringResources.Designer.cs` is tool-generated; manual edits will be lost on regeneration.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This Module Depends On:
|
||||
- `System` (core BCL)
|
||||
- `System.Windows.Markup` (for `MarkupExtension` and `MarkupExtensionReturnTypeAttribute`)
|
||||
- `System.Resources` (for `ResourceManager`)
|
||||
- `System.Globalization` (for `CultureInfo`)
|
||||
- `System.CodeDom.Compiler` (for `GeneratedCodeAttribute`)
|
||||
- Embedded `.resx` resource files backing `StringResources`
|
||||
|
||||
### What Depends On This Module:
|
||||
- **Inferred:** XAML views within the `TTSImport` module that use `{tts:Translate KeyName}` markup extension syntax for localized UI strings.
|
||||
- **Inferred:** Code within `TTSImport` namespace that accesses `StringResources` properties directly for error messages, labels, and validation text.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Empty Japanese Resource File:** The file `StringResources.ja.Designer.cs` is present but completely empty (0 bytes). It is unclear whether this is intentional (no Japanese localization needed) or a missing/failed code generation. Developers should verify if Japanese localization is required.
|
||||
|
||||
2. **Namespace Discrepancy:** `TranslateExtension` resides in namespace `TTSImport` but references `Resources.StringResources` which is in `TTSImport.Resources`. The fully qualified resource path `"TTSImport.Resources.StringResources"` is hardcoded in the generated class.
|
||||
|
||||
3. **Debugging Difficulty:** The `NotFound` fallback pattern (`#stringnotfound# keyname`) could appear in production UI if resource keys are misspelled or resources are missing, potentially exposing internal key names to end users.
|
||||
|
||||
4. **No Null Propagation on ResourceManager:** The `ProvideValue` method calls `ResourceManager.GetString(_key)` without null-checking the `ResourceManager` property itself (though the property getter handles this internally).
|
||||
28
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/View.md
Normal file
28
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/View.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/LevelTriggerView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/HardwareScanView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/TOMChannelsView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/AnalogChannelsView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/ReadFileView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/DigitalInputChannelsView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/DigitalOutputChannelsView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/SummaryView.xaml.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/View/EditFileView.xaml.cs
|
||||
generated_at: "2026-04-17T16:11:25.805778+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "9cfebf2414807d61"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
**Purpose:**
|
||||
This module contains the code-behind for various WPF UserControls used in the TTS (Test Setup) import wizard. It acts as the View layer, defining partial classes that interface with XAML definitions. It bridges the UI elements with the application logic by implementing specific View interfaces and handling UI events like text changes.
|
||||
|
||||
**Public Interface:**
|
||||
|
||||
* `LevelTriggerView` (Partial Class): Implements `ILevelTriggerView`. Constructor calls `InitializeComponent`.
|
||||
* `HardwareScanView` (Partial Class): Implements `IHardwareScanView`. Constructor calls `InitializeComponent`.
|
||||
* `TOMChannelsView` (Partial Class): Implements `ITOMChannelsView`. Constructor calls `InitializeComponent`.
|
||||
* `AnalogChannelsView` (Partial
|
||||
177
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/ViewModel.md
Normal file
177
docs/ai/DataPRO/Modules/TestSetups/Imports/TTS/ViewModel.md
Normal file
@@ -0,0 +1,177 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/DigitalOutputChannelsViewModel.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/LevelTriggerViewModel.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/DigitalInputChannelsViewModel.cs
|
||||
- DataPRO/Modules/TestSetups/Imports/TTS/ViewModel/TOMChannelsViewModel.cs
|
||||
generated_at: "2026-04-17T15:49:35.967692+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "038dac49bea7aac0"
|
||||
---
|
||||
|
||||
# TTS Import ViewModels Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides four ViewModel classes for managing channel configuration within a TTS (Test Setup) Import workflow. Each ViewModel handles a specific channel type—Digital Output, Digital Input, Level Triggers, and TOM (Squib) channels—facilitating the mapping between physical hardware channels (`IDASHardware`/`IHardwareChannel`) and logical channel records (`ITTSChannelRecord`) in test setups. The ViewModels coordinate via `IEventAggregator` to respond to hardware scan results, file imports, and channel assignment changes, providing UI binding properties and commands for user interaction.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### DigitalOutputChannelsViewModel
|
||||
|
||||
**Implements:** `IDigitalOutputChannelsViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `View` | `public IDigitalOutputChannelsView View { get; set; }` | The associated view instance; DataContext is set to `this` in constructor. |
|
||||
| `NotificationRequest` | `public InteractionRequest<Notification> NotificationRequest { get; }` | Used to raise notification dialogs. |
|
||||
| `ConfirmationRequest` | `public InteractionRequest<Confirmation> ConfirmationRequest { get; }` | Used to raise confirmation dialogs. |
|
||||
| `DASChannels` | `public ObservableCollection<DASChannel> DASChannels { get; set; }` | Collection of digital output channels from hardware. |
|
||||
| `SelectedDASChannel` | `public DASChannel SelectedDASChannel { get; set; }` | Currently selected DAS channel in UI. |
|
||||
| `EnableOrDisableText` | `public string EnableOrDisableText { get; }` | Returns localized "Enable" or "Disable" text based on `SelectedDASChannel.Channel.Disabled`. |
|
||||
| `IsBusy` | `public bool IsBusy { get; set; }` | Bound to busy indicator state. |
|
||||
| `IsMenuIncluded` | `public bool IsMenuIncluded { get; set; }` | Unclear purpose from source alone. |
|
||||
| `IsNavigationIncluded` | `public bool IsNavigationIncluded { get; set; }` | Unclear purpose from source alone. |
|
||||
| `IsDirty` | `public bool IsDirty { get; private set; }` | Indicates unsaved changes (never set to `true` in visible source). |
|
||||
| `Cleanup()` | `public void Cleanup()` | Empty implementation. |
|
||||
| `CleanupAsync()` | `public Task CleanupAsync()` | Returns `Task.CompletedTask`. |
|
||||
| `Initialize()` | `public void Initialize()` | Empty implementation. |
|
||||
| `Initialize(object)` | `public void Initialize(object parameter)` | Empty implementation. |
|
||||
| `Initialize(object, object)` | `public void Initialize(object parameter, object model)` | Empty implementation. |
|
||||
| `InitializeAsync()` | `public Task InitializeAsync()` | Returns `Task.CompletedTask`. |
|
||||
| `InitializeAsync(object)` | `public Task InitializeAsync(object parameter)` | Returns `Task.CompletedTask`. |
|
||||
| `Activated()` | `public void Activated()` | Empty implementation. |
|
||||
| `OnPropertyChanged(string)` | `public void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event. |
|
||||
| `PropertyChanged` | `public event PropertyChangedEventHandler PropertyChanged` | Standard INotifyPropertyChanged event. |
|
||||
|
||||
---
|
||||
|
||||
### LevelTriggerViewModel
|
||||
|
||||
**Implements:** `ILevelTriggerViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `View` | `public ILevelTriggerView View { get; set; }` | The associated view instance. |
|
||||
| `LevelTriggers` | `public ILevelTrigger[] LevelTriggers { get; }` | Returns `_setup?.LevelTriggers`; provides access to level trigger configurations. |
|
||||
| `IsBusy`, `IsMenuIncluded`, `IsNavigationIncluded`, `IsDirty` | Same as above | Standard state properties. |
|
||||
| `NotificationRequest`, `ConfirmationRequest` | Same as above | Interaction requests. |
|
||||
| Lifecycle methods (`Cleanup`, `Initialize`, etc.) | Same signatures as above | All return empty or `Task.CompletedTask`. |
|
||||
| `OnPropertyChanged(string)` | Same as above | Raises `PropertyChanged` event. |
|
||||
| `PropertyChanged` | Same as above | INotifyPropertyChanged event. |
|
||||
|
||||
---
|
||||
|
||||
### DigitalInputChannelsViewModel
|
||||
|
||||
**Implements:** `IDigitalInputChannelsViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `View` | `public IDigitalInputChannelsView View { get; set; }` | The associated view instance. |
|
||||
| `DASChannels` | `public ObservableCollection<DASChannel> DASChannels { get; set; }` | Physical digital input channels from hardware. |
|
||||
| `RemainingChannels` | `public ObservableCollection<ITTSChannelRecord> RemainingChannels { get; set; }` | Channel records not yet assigned to hardware. |
|
||||
| `SelectedDASChannel` | `public DASChannel SelectedDASChannel { get; set; }` | Currently selected hardware channel. |
|
||||
| `SelectedRemainingChannel` | `public ITTSChannelRecord SelectedRemainingChannel { get; set; }` | Currently selected unassigned channel record. |
|
||||
| `AssignEnabled` | `public bool AssignEnabled { get; set; }` | Enables/disables Assign button in UI. |
|
||||
| `RemoveEnabled` | `public bool RemoveEnabled { get; set; }` | Enables/disables Remove button in UI. |
|
||||
| `EnableOrDisableEnabled` | `public bool EnableOrDisableEnabled { get; set; }` | Enables/disables Enable/Disable button. |
|
||||
| `EnableOrDisableText` | `public string EnableOrDisableText { get; }` | Localized "Enable" or "Disable" text. |
|
||||
| `AssignCommand` | `public DelegateCommand AssignCommand { get; }` | Assigns `SelectedRemainingChannel` to `SelectedDASChannel`. |
|
||||
| `RemoveCommand` | `public DelegateCommand RemoveCommand { get; }` | Removes channel assignment from `SelectedDASChannel`. |
|
||||
| `EnableOrDisableCommand` | `public DelegateCommand EnableOrDisableCommand { get; }` | Toggles `Disabled` state on selected channel. |
|
||||
| Other members | Same as above | `IsBusy`, `IsDirty`, lifecycle methods, `PropertyChanged`. |
|
||||
|
||||
---
|
||||
|
||||
### TOMChannelsViewModel
|
||||
|
||||
**Implements:** `ITOMChannelsViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `View` | `public ITOMChannelsView View { get; set; }` | The associated view instance. |
|
||||
| `DASChannels` | `public ObservableCollection<Model.DASChannel> DASChannels { get; set; }` | Physical squib channels from hardware (every other channel, `i += 2`). |
|
||||
| `RemainingChannels` | `public ObservableCollection<ITTSChannelRecord> RemainingChannels { get; set; }` | Unassigned squib channel records. |
|
||||
| `SelectedDASChannel` | `public Model.DASChannel SelectedDASChannel { get; set; }` | Currently selected squib hardware channel. |
|
||||
| `SelectedRemainingChannel` | `public ITTSChannelRecord SelectedRemainingChannel { get; set; }` | Currently selected unassigned squib record. |
|
||||
| `AssignCommand`, `RemoveCommand`, `EnableOrDisableCommand` | Same as `DigitalInputChannelsViewModel` | Same command implementations for squib channels. |
|
||||
| Other members | Same as above | Standard state properties and lifecycle methods. |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
1. **Singleton Lifetime**: All four ViewModels are decorated with `[PartCreationPolicy(CreationPolicy.Shared)]`, ensuring a single shared instance per container.
|
||||
|
||||
2. **Event Subscription Thread Affinity**: All `IEventAggregator` subscriptions use `ThreadOption.PublisherThread` with `keepSubscriberReferenceAlive = true`, meaning handlers execute on the publisher's thread and subscribers are held strongly.
|
||||
|
||||
3. **UI Thread Requirement**: `OnAssignedChannelsChangedEvent` in `DigitalOutputChannelsViewModel`, `DigitalInputChannelsViewModel`, and `TOMChannelsViewModel` explicitly check `Application.Current.Dispatcher.CheckAccess()` and marshal to the UI thread via `BeginInvoke` if necessary.
|
||||
|
||||
4. **Hardware Channel Filtering**:
|
||||
- `DigitalOutputChannelsViewModel`: Filters for `ch.IsDigitalOut == true`
|
||||
- `DigitalInputChannelsViewModel`: Filters for `ch.IsDigitalIn == true`
|
||||
- `TOMChannelsViewModel`: Filters for `ch.IsSquib == true` and iterates by `i += 2` (squib channels are paired)
|
||||
|
||||
5. **Channel Record Validation**: All ViewModels skip channel records where:
|
||||
- `channelRecord.IsEmptyRecord == true`
|
||||
- `channelRecord.IsChannelCodeValid == false`
|
||||
- `channelRecord.ChannelCode == TTSChannelRecord.NONE`
|
||||
|
||||
6. **EID Mapping**: `DigitalOutputChannelsViewModel` and `LevelTriggerViewModel` maintain a mapping (`_hardwareChannelIdToSensorId` / `_sensorIdToChannelId`) from `EIDMappingEvent` for sensor-to-channel resolution.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### External Dependencies (from imports)
|
||||
- **Prism Framework**: `Prism.Events`, `Prism.Regions`, `Prism.Commands` — Event aggregation, region management, delegate commands.
|
||||
- **Unity**: `Unity` — Dependency injection container (`IUnityContainer`).
|
||||
- **MEF**: `System.ComponentModel.Composition` — Part creation policy.
|
||||
- **WPF**: `System.Windows`, `System.Windows.Data`, `System.Collections.ObjectModel` — UI collections and dispatcher.
|
||||
|
||||
### Internal Dependencies (DTS.* namespaces)
|
||||
- `DTS.Common.Events` / `DTS.Common.Events.TTSImport` — Event types: `RaiseNotification`, `BusyIndicatorChangeNotification`, `AssignedChannelsChangedEvent`, `TTSImportHardwareScanFinishedEvent`, `EIDMappingEvent`, `TTSImportReadFileStatusEvent`, `TTSImportSavedChangesStatusEvent`, `TTSImportTestSetupChangedEvent`.
|
||||
- `DTS.Common.Interface.DataRecorders` — `IDASHardware`, `IHardwareChannel`.
|
||||
- `DTS.Common.Interface.TestSetups.Imports.TTS.*` — `ITTSSetup`, `ITTSChannelRecord`, `ILevelTrigger`, view interfaces.
|
||||
- `DTS.Common.Interactivity` — `InteractionRequest<T>`, `Notification`, `Confirmation`, `NotificationContentEventArgs`.
|
||||
- `DTS.Common.Enums` — `DigitalInputModes`, `ExcitationVoltageOptions`.
|
||||
- `TTSImport.Model` — `DASChannel` model class.
|
||||
- `TTSImport.Resources` — `StringResources` for localized strings.
|
||||
|
||||
### Consumers
|
||||
- Unclear from source alone; these ViewModels are likely resolved by the DI container and bound to their respective Views (`IDigitalOutputChannelsView`, `ILevelTriggerView`, etc.).
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Logic Bug in `DetermineRemoveEnableStatus`** (present in `DigitalInputChannelsViewModel` and `TOMChannelsViewModel`):
|
||||
```csharp
|
||||
if (!string.IsNullOrWhiteSpace(_selectedDASChannel.EID) &&
|
||||
_selectedDASChannel.EID == _selectedDASChannel.Channel.SensorEID)
|
||||
{
|
||||
RemoveEnabled = false;
|
||||
}
|
||||
RemoveEnabled = true; // This always overwrites the above!
|
||||
```
|
||||
The `RemoveEnabled = true` assignment always executes, making the preceding conditional check ineffective.
|
||||
|
||||
2. **Empty Async Lifecycle Methods**: All `InitializeAsync` and `CleanupAsync` methods return `Task.CompletedTask` with no actual async work. This may indicate incomplete implementation or a placeholder pattern.
|
||||
|
||||
3. **`IsDirty` Never Set to `true`**: The `IsDirty` property has a private setter but is never assigned `true` anywhere in the visible source. Its purpose is unclear.
|
||||
|
||||
4. **Historical Bug References in Comments** (`LevelTriggerViewModel.cs`):
|
||||
- Comment references "11245" and "15643" (likely defect tracking IDs) describing edge cases around EID assignment and channel code validation.
|
||||
- A comment notes: *"the below condition I think was missing a not"* indicating past confusion about boolean logic.
|
||||
|
||||
5. **Squib Channel Pairing** (`TOMChannelsViewModel`): Hardware channels are iterated with `i += 2`, implying squib channels are paired (voltage/initiation vs. current). This is not documented elsewhere and could cause confusion if the hardware configuration changes.
|
||||
|
||||
6. **Task.Run for MessageBox** (`DigitalInputChannelsViewModel.Assign` and `TOMChannelsViewModel.Assign`): The code uses `Task.Run(() => MessageBox.Show(...))` followed by `Application.Current.Dispatcher.BeginInvoke` for the actual assignment work. This pattern is unusual—MessageBox is typically shown on the UI thread directly.
|
||||
|
||||
7. **Pre-Assigned Channels Logic** (`LevelTriggerViewModel.UpdateLevelTriggers`): The method modifies `_setup.PreAssignedSensorIdAndHwId` in-place, reassigning it to a filtered list. This mutates shared state that may be observed elsewhere.
|
||||
|
||||
8. **Exception Swallowing** (`LevelTriggerViewModel.VoltageIsValid`): The method contains an empty `catch { }` block that silently ignores exceptions from `GetExcitationVoltageEnumFromMagnitude`, returning `false` for invalid voltages.
|
||||
Reference in New Issue
Block a user