8.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T04:42:28.425769+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 080376d61a35b88d |
Model
Documentation: ISOSettings Module
1. Purpose
This module manages system-wide configuration settings related to ISO code handling within the DataPRO test management system. It provides a centralized model (ISOSettingsModel) for reading, writing, and persisting user-configurable preferences that control how ISO codes, user codes, and related UI elements are displayed and enforced during test setup and execution. It also enforces business rules—such as requiring unique ISO codes or validating test object/position fields—and triggers re-evaluation of test completeness (IsComplete) when certain settings change, ensuring data integrity across test setups.
2. Public Interface
class ISOSettingsModel : IISOSettingsModel
Constructor
public ISOSettingsModel(IEventAggregator eventAggregator)
Initializes the model with anIEventAggregatorinstance for publishing notifications (e.g., on save failure).
Note:IISOSettingsModelinterface is referenced but not defined in the provided source; assumed to be declared elsewhere.
LoadData()
public IISOSettingsData LoadData()
Returns a newISOSettingsDatainstance populated with the current values of the following properties:
ISOViewModeShowISOStringBuilderShowChannelCodeLookupHelperUseISOCodeFilterMappingUniqueISOCodesRequiredValidateTestObjectAndPosition
Note: Does not includeShowISOCodes,ShowUserCodes, orISOSupportLevelin the returned data.
SaveData(IISOSettingsData data)
public void SaveData(IISOSettingsData data)
Updates the model’s internal state from the provideddataobject (assumed to be of concrete typeISOSettingsData).
- Updates
ShowISOCodes,ShowUserCodes,ISOViewMode,ShowISOStringBuilder,ShowChannelCodeLookupHelper,UseISOCodeFilterMapping,UniqueISOCodesRequired, andValidateTestObjectAndPosition.- If
UniqueISOCodesRequiredorValidateTestObjectAndPositionchanges value, callsMarkAllTestsDirty()to re-evaluate test completeness.- On exception, publishes a notification via
EventAggregatorwith message and stack trace.- Sets
IsSaved = trueon success.
OnPropertyChanged(string propertyName)
public void OnPropertyChanged(string propertyName)
Currently a no-op stub. Intended forINotifyPropertyChangedcompliance but not implemented.
IsSaved
public bool IsSaved { get; private set; }
Gets a flag indicating whether the lastSaveDatacall succeeded.
PropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
Declared but unused (no raises observed in source).
Public Properties (Read/Write via SettingsDB)
All properties are backed by SettingsDB.GetGlobalValue* / SetGlobalValue* methods.
| Property | Type | Default | Description |
|---|---|---|---|
ISOSupportLevel |
IsoSupportLevels |
IsoSupportLevels.ISO_ONLY |
Controls overall ISO support behavior (e.g., ISO-only, transitional, non-ISO allowed). |
ShowISOCodes |
bool |
true |
Controls visibility of ISO codes in UI. |
ShowUserCodes |
bool |
false |
Controls visibility of user-defined codes in UI. |
ValidChannelCodes |
bool |
— | Derived: true if either ShowISOCodes or ShowUserCodes is true. |
ISOViewMode |
IsoViewMode |
— | Computed view mode based on ShowISOCodes/ShowUserCodes. Setter updates both flags accordingly. |
ShowISOStringBuilder |
bool |
true |
Controls visibility of the ISO string builder UI component. |
ShowChannelCodeLookupHelper |
bool |
true |
Controls visibility of the channel code lookup helper UI component. |
UseISOCodeFilterMapping |
bool |
true |
Enables/disables ISO code filter mapping logic. |
UniqueISOCodesRequired |
bool |
true |
Enforces uniqueness of ISO codes across test setups. |
AllowTransitional |
bool |
false |
Permits transitional (non-standard) ISO codes. |
AllowNonISO |
bool |
false |
Permits non-ISO codes. |
UseUserCodes |
bool |
false |
Enables use of user-defined codes (distinct from ShowUserCodes). |
ValidateTestObjectAndPosition |
bool |
false |
Enables validation of ISO test object/position fields against test setup rules. |
3. Invariants
- Persistence: All settings are persisted globally via
SettingsDBusing string keys derived fromKeysenum values. - View Mode Consistency:
ISOViewModeis derived fromShowISOCodesandShowUserCodes. SettingISOViewModealways updates both underlying flags to match the requested view. - Dirty Test Re-evaluation: Changing
UniqueISOCodesRequiredorValidateTestObjectAndPositiontriggersMarkAllTestsDirty(), which marks all test setups as incomplete/dirty to force re-validation ofIsComplete. - Validation Scope:
ValidateTestObjectAndPositiononly affects test setup validation logic (not runtime behavior), and its effect is conditional on being enabled at validation time. - Code Visibility:
ValidChannelCodesis a computed property and must equalShowISOCodes || ShowUserCodesat all times.
4. Dependencies
Internal Dependencies
DTS.Common.Settings.SettingsDB: Used for global setting persistence (GetGlobalValue,SetGlobalValue,GetGlobalValueBool,SetGlobalValueBoolean).DTS.Common.Events.IEventAggregator: Used to publishRaiseNotificationevents on save failure.DTS.Common.Enums.IsoSupportLevels,IsoViewMode: Enum types used forISOSupportLevelandISOViewMode.ISOSettingsData: Concrete implementation ofIISOSettingsData, used inLoadData()andSaveData().DbOperations.TestSetupsGet(...)/TestSetupsMarkIsCompleteIsDirty(...): Used byGetAllTests()andMarkTestDirty()to enumerate and mark tests as dirty.
External Dependencies
- Prism.Events: For
IEventAggregator. - System.ComponentModel: For
INotifyPropertyChangedinterface (partially implemented). - System.Linq: For
records.Any(),tests.Any().
Depended Upon
IISOSettingsModelinterface (not shown) is likely consumed by UI/view-layer components (e.g., settings view models or pages).
5. Gotchas
LoadData()omits key properties: The returnedIISOSettingsDatadoes not includeShowISOCodes,ShowUserCodes, orISOSupportLevel, despite these being core settings. This may cause data loss ifSaveData()is called with such an incomplete object (thoughSaveData()explicitly casts toISOSettingsData, implying the consumer is expected to populate all fields).ISOViewModesetter is side-effectful: ChangingISOViewModeoverwritesShowISOCodesandShowUserCodeswithout preserving their prior values. This is non-intuitive if the caller expectsISOViewModeto be a derived-only property.MarkAllTestsDirty()is expensive: Iterates over all test setups in the database and marks each as dirty. This is triggered on any change toUniqueISOCodesRequiredorValidateTestObjectAndPosition, regardless of whether tests are currently complete or relevant.- No change notification:
OnPropertyChangedis a stub; UI bindings relying onINotifyPropertyChangedwill not update automatically when settings change. - Hardcoded defaults: Default values are defined as
constfields (e.g.,ShowISOCodesDefault = true) but are not used inLoadData()—only in property getters/setters. IfISOSettingsDatais constructed externally, defaults may not be applied consistently. - Commented tech debt: The
SaveData()method includes comments referencing internal issue IDs (#14215,#16235,#15457) and notes about future optimization for selective test dirtying. This indicates known performance debt. - No validation in
SaveData(): The method castsdatatoISOSettingsDatawithout checking type safety (will throwInvalidCastExceptionif misused). No validation of input values is performed.
Documentation generated from provided source files. No external behavior or APIs inferred beyond what is explicitly present.