Files
DP44/enriched-qwen3-coder-next/DataPRO/Modules/SystemSettings/ISOSettings/Classes.md
2026-04-17 14:55:32 -04:00

67 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/Classes/ISOSettingsData.cs
generated_at: "2026-04-16T04:41:58.215647+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "673c2c087dd23a72"
---
# Classes
### **Purpose**
This module defines the data model for system-level ISO-related configuration settings, specifically governing how ISO codes, user codes, and channel names are displayed and validated within the test setup UI. It enables runtime control over view modes (e.g., ISO-only, user-code-only, combined), enforces uniqueness constraints on ISO codes, and optionally validates test object and position fields during test setup validation—behavior that is configurable per site via system settings.
---
### **Public Interface**
#### **Properties**
All properties implement `INotifyPropertyChanged` via inheritance from `BasePropertyChanged`, raising `PropertyChanged` events on change.
| Property | Type | Description |
|---------|------|-------------|
| `ValidateTestObjectAndPosition` | `bool` | Controls whether validation of `TestObject` and `position` ISO fields is performed during test setup validation. Enabled via site-specific system settings (see comment referencing issue #15457). |
| `UniqueISOCodesRequired` | `bool` | If `true`, enforces that all ISO codes in the system must be unique. |
| `UniqueISOCodesRequiredAndShowISOCodes` | `bool` | Computed property: `true` iff both `UniqueISOCodesRequired` and `ShowISOCodes` are `true`. |
| `ShowISOCodes` | `bool` | Controls visibility of ISO codes in the UI. Setting to `true` adjusts `ISOViewMode` to include ISO codes (e.g., `ISOAndUserCode` or `ISOOnly`); setting to `false` removes ISO codes (e.g., `UserCodeOnly` or `ChannelNameOnly`). **Raises `PropertyChanged` for multiple dependent properties** (`ShowISOStringBuilder`, `UniqueISOCodesRequired`, `UseISOCodeFilterMapping`, `UniqueISOCodesRequiredAndShowISOCodes`). |
| `ShowUserCodes` | `bool` | Controls visibility of user codes in the UI. Setting to `true` adjusts `ISOViewMode` to include user codes (e.g., `ISOAndUserCode` or `UserCodeOnly`); setting to `false` removes user codes. |
| `ShowISOStringBuilder` | `bool` | Toggles visibility of the ISO string builder UI component. |
| `ShowChannelCodeLookupHelper` | `bool` | Toggles visibility of the channel code lookup helper UI component. |
| `UseISOCodeFilterMapping` | `bool` | Controls whether ISO code filter mapping logic is applied. |
| `ChannelNamesOnly` | `bool` | If `true`, forces `ISOViewMode` to `IsoViewMode.ChannelNameOnly`. Setting to `false` has no effect (must be toggled via `ShowISOCodes`/`ShowUserCodes`). |
| `ISOViewMode` | `IsoViewMode` | Enumerated view mode controlling which identifiers (ISO, user code, channel name) are displayed. Valid values inferred from usage: `ChannelNameOnly`, `UserCodeOnly`, `ISOOnly`, `ISOAndUserCode`. Changing this property raises `PropertyChanged` for `ShowISOCodes`, `ShowUserCodes`, and `ChannelNamesOnly`. |
---
### **Invariants**
- `ISOViewMode` is the canonical source of truth for UI display mode; all boolean view flags (`ShowISOCodes`, `ShowUserCodes`, `ChannelNamesOnly`) are derived from it.
- `ShowISOCodes` and `ShowUserCodes` are **not independent**:
- `ShowISOCodes == true``ISOViewMode ∈ {IsoViewMode.ISOOnly, IsoViewMode.ISOAndUserCode}`
- `ShowUserCodes == true``ISOViewMode ∈ {IsoViewMode.UserCodeOnly, IsoViewMode.ISOAndUserCode}`
- `UniqueISOCodesRequiredAndShowISOCodes` is logically consistent: `true` only when both operands are `true`.
- Setting `ShowISOCodes` or `ShowUserCodes` may mutate `ISOViewMode` to maintain consistency; the reverse is not true—setting `ISOViewMode` does *not* mutate `ShowISOCodes`/`ShowUserCodes` (they remain independent setters).
- `ChannelNamesOnly = true` unconditionally sets `ISOViewMode = ChannelNameOnly`; `ChannelNamesOnly = false` has no side effect.
---
### **Dependencies**
- **Imports/Usings**:
- `DTS.Common.Enums` → Provides `IsoViewMode` enum.
- `DTS.Common.Interface` → Provides `IISOSettingsData` interface (implementation contract).
- `DTS.Common.Base.BasePropertyChanged` → Base class enabling property change notifications.
- **Implied Consumers**:
- UI components that bind to `ISOSettingsData` (e.g., settings panels, test setup forms).
- Validation logic that checks `ValidateTestObjectAndPosition` during test setup validation.
- Code that enforces `UniqueISOCodesRequired` (e.g., ISO code generation or persistence layers).
- **No internal dependencies** on other modules beyond `DTS.Common.*`.
---
### **Gotchas**
- **Asymmetric mutability**: Setting `ChannelNamesOnly = false` has *no effect*; the only way to exit `ChannelNameOnly` mode is via `ShowISOCodes` or `ShowUserCodes`. This may confuse developers expecting bidirectional control.
- **Side effects in setters**: `ShowISOCodes` and `ShowUserCodes` setters mutate `ISOViewMode` and raise `PropertyChanged` for *multiple* dependent properties. This could cause cascading UI updates or unexpected re-evaluation of computed properties (e.g., `UniqueISOCodesRequiredAndShowISOCodes`).
- **`UniqueISOCodesRequired` dependency**: The property `UniqueISOCodesRequiredAndShowISOCodes` is recomputed on `ShowISOCodes` changes, but `UniqueISOCodesRequired` itself has no validation logic in this class—enforcement must occur elsewhere.
- **Enum assumptions**: `IsoViewMode` is assumed to have at least four values (`ChannelNameOnly`, `UserCodeOnly`, `ISOOnly`, `ISOAndUserCode`), but the enum definition is not included in the source.
- **No validation in setters**: Properties like `UniqueISOCodesRequired` accept arbitrary `bool` values without runtime checks; invalid combinations (e.g., `UniqueISOCodesRequired = true` but `ShowISOCodes = false`) are allowed and must be handled by consumers.
- **Commented issue reference**: The `ValidateTestObjectAndPosition` propertys comment references “site bool in system settings” and issue #15457—suggesting external configuration, but no source-level linkage is visible here.