init
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/SystemSettings/QASettings/Properties/AssemblyInfo.cs
|
||||
generated_at: "2026-04-16T04:40:01.043674+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "96ed3ef07324540f"
|
||||
---
|
||||
|
||||
# Properties
|
||||
|
||||
## 1. Purpose
|
||||
This module is the `AssemblyInfo` configuration file for the `QASettings` .NET assembly. Its purpose is to define metadata for the assembly—such as title, version, and COM visibility—used by the .NET runtime and build/deployment tooling. It does not contain application logic or runtime behavior; it solely provides declarative assembly-level attributes required for identification, versioning, and interoperability.
|
||||
|
||||
## 2. Public Interface
|
||||
This file contains **no public functions, classes, or methods**. It defines only assembly-level attributes via attributes applied to the assembly itself (e.g., `[assembly: AssemblyTitle(...)]`). These are compile-time metadata directives, not runtime-accessible members.
|
||||
|
||||
## 3. Invariants
|
||||
- The assembly is **not visible to COM** (`ComVisible(false)`), meaning it cannot be consumed by COM clients unless explicitly overridden elsewhere (e.g., on specific types).
|
||||
- The assembly version is fixed at `1.0.0.0` for both `AssemblyVersion` and `AssemblyFileVersion`. No wildcard (`*`) expansion is used for build/revision numbers.
|
||||
- The `Guid` attribute (`7446722e-490d-4f6a-beaf-907947e576d5`) uniquely identifies the typelib for COM interop, though COM visibility is disabled—this GUID is effectively unused unless `ComVisible(true)` is set elsewhere or at type level.
|
||||
- All string attributes (e.g., `AssemblyCompany`, `AssemblyDescription`) are present but empty or minimal; no semantic constraints are enforced beyond syntax.
|
||||
|
||||
## 4. Dependencies
|
||||
- **Dependencies**: None (beyond standard .NET framework assemblies implied by `System.Reflection`, `System.Runtime.CompilerServices`, and `System.Runtime.InteropServices` namespaces—these are part of the base class library and do not constitute external dependencies).
|
||||
- **Dependents**: This file contributes metadata to the `QASettings` assembly, which is presumably referenced by other modules in the `DataPRO` system (e.g., UI or service layers consuming QA settings). However, the `AssemblyInfo.cs` file itself has no direct runtime dependents—its metadata is consumed by tooling (e.g., MSBuild, reflection APIs, Windows registry for COM registration).
|
||||
|
||||
## 5. Gotchas
|
||||
- **Unused GUID**: The `Guid` attribute is set, but since `ComVisible(false)` is applied at the assembly level, the GUID will not be used for COM registration unless specific types within the assembly are marked `[ComVisible(true)]`. This may cause confusion during COM interop setup.
|
||||
- **Static versioning**: Version `1.0.0.0` is hardcoded; no automatic build/revision incrementing occurs (e.g., via `AssemblyVersion("1.0.*")`). This may conflict with CI/CD practices expecting dynamic versioning.
|
||||
- **Empty metadata fields**: Attributes like `AssemblyDescription`, `AssemblyCompany`, and `AssemblyTrademark` are empty strings. This is acceptable but may reduce clarity for support or diagnostics tools that rely on assembly metadata.
|
||||
- **No code logic**: Developers may mistakenly expect this file to contain executable logic; it is purely metadata. No runtime behavior or configuration loading occurs here.
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/SystemSettings/QASettings/View/QASettingsView.xaml.cs
|
||||
generated_at: "2026-04-16T04:40:07.723422+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "15ebc3fce78d948f"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
1. **Purpose**
|
||||
This module defines the WPF view class `QASettingsView`, which serves as the UI layer for the Quality Assurance (QA) settings interface. It implements the `IQASettingsView` interface (from `DTS.Common.Interface`) and is responsible for rendering the XAML-defined UI (`QASettingsView.xaml`) for configuring QA-related application settings. Its role is purely presentational—handling UI initialization and delegating logic to a corresponding view model (not shown here).
|
||||
|
||||
2. **Public Interface**
|
||||
- **`QASettingsView()`**
|
||||
Public parameterless constructor. Calls `InitializeComponent()` to instantiate and wire up the XAML-defined UI elements. No additional initialization logic is present in the provided source.
|
||||
|
||||
3. **Invariants**
|
||||
- The class must be instantiated on the UI thread (as it is a WPF `UserControl`/`Window`-derived type, inferred from `InitializeComponent()` usage), though the exact base type is not visible in this snippet.
|
||||
- `InitializeComponent()` must be called exactly once during construction; calling it multiple times or after construction may cause runtime exceptions or undefined behavior (standard WPF pattern, but not explicitly enforced in this code).
|
||||
- No validation, state mutation, or business logic is present in this class—therefore, no domain-specific invariants apply here.
|
||||
|
||||
4. **Dependencies**
|
||||
- **External dependency**: `DTS.Common.Interface.IQASettingsView` — this interface defines the contract for the QA settings view (e.g., properties/events for data binding or command wiring), but its definition is not included here.
|
||||
- **Internal dependency**: `QASettingsView.xaml` — the partial class relies on the corresponding XAML file for UI definition and element naming.
|
||||
- **Framework dependency**: WPF (`System.Windows`, `System.Windows.Controls`, etc., implicitly via `InitializeComponent()`).
|
||||
- **Inferred consumers**: A view model (likely `QASettingsViewModel`, not shown) that binds to this view via `DataContext`. No direct references to other modules are visible in this file.
|
||||
|
||||
5. **Gotchas**
|
||||
- The class is a minimal stub—no logic, properties, or event handlers are implemented in the provided source. Behavior is entirely defined in `QASettingsView.xaml` and/or a separate view model.
|
||||
- The interface `IQASettingsView` is not defined here; its contract (e.g., required properties or methods) must be consulted separately to understand expected usage.
|
||||
- No null-safety or error handling is present in the constructor; failure in `InitializeComponent()` (e.g., missing XAML resources) will result in a runtime exception.
|
||||
- None identified from source alone.
|
||||
@@ -0,0 +1,147 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/SystemSettings/QASettings/ViewModel/QASettingsViewModel.cs
|
||||
generated_at: "2026-04-16T04:41:41.270479+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "26d85367d0fdc737"
|
||||
---
|
||||
|
||||
# ViewModel
|
||||
|
||||
## Documentation: QASettingsViewModel
|
||||
|
||||
---
|
||||
|
||||
### 1. Purpose
|
||||
The `QASettingsViewModel` serves as the view model for the QA Settings module in the application, implementing the `IQASettingsViewModel` interface and adhering to Prism’s MVVM pattern. It acts as the intermediary between the `IQASettingsView` UI and underlying system services (e.g., event aggregation, region management, dependency injection), enabling UI-driven interactions such as displaying notifications, managing busy state, and exposing configuration-related properties (e.g., counts of sensors, test setups). It also subscribes to global events (`RaiseNotification`, `BusyIndicatorChangeNotification`) to synchronize UI state with application-wide events.
|
||||
|
||||
---
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
#### `QASettingsViewModel` (class)
|
||||
- **`IQASettingsView View { get; }`**
|
||||
Reference to the associated view instance; set during construction and used to bind `DataContext`.
|
||||
|
||||
- **`InteractionRequest<Notification> NotificationRequest { get; }`**
|
||||
Prism interaction request used to trigger notification popups (e.g., informational messages). Raised via `OnRaiseNotification`.
|
||||
|
||||
- **`InteractionRequest<Confirmation> ConfirmationRequest { get; }`**
|
||||
Prism interaction request used to trigger confirmation dialogs (currently declared but not used in the provided source).
|
||||
|
||||
- **`bool IsBusy { get; set; }`**
|
||||
Indicates whether the view/model is currently performing a long-running operation. Bound to a busy indicator in the UI.
|
||||
|
||||
- **`bool IsDirty { get; }`**
|
||||
Property indicating whether changes have been made (currently always `false`; no logic implemented to set it).
|
||||
|
||||
- **`bool IsMenuIncluded { get; set; }`**
|
||||
Controls visibility of the menu in the view (default `false`).
|
||||
|
||||
- **`bool IsNavigationIncluded { get; set; }`**
|
||||
Controls visibility of navigation controls in the view (default `false`).
|
||||
|
||||
- **`string HeaderInfo { get; }`**
|
||||
Returns the literal string `"MainRegion"`; likely used as a header or region identifier.
|
||||
|
||||
- **`string NumberOfSensorModelsText { get; set; }`**
|
||||
String representation of `_numberOfSensorModels` (formatted with thousand separators); setter parses input to `int`.
|
||||
|
||||
- **`string NumberOfTestSetupsText { get; set; }`**
|
||||
String representation of `_numberOfTestSetups`.
|
||||
|
||||
- **`string NumberOfGroupsText { get; set; }`**
|
||||
String representation of `_numberOfGroups`.
|
||||
|
||||
- **`string NumberOfSensorsText { get; set; }`**
|
||||
String representation of `_numberOfSensors`.
|
||||
|
||||
- **`string NumberOfGroupTemplatesText { get; set; }`**
|
||||
String representation of `_numberOfGroupTemplates`.
|
||||
|
||||
- **`DelegateCommand CreateCommand { get; }`**
|
||||
Command bound to a UI action (e.g., a button). Invokes `CreateMethod()` asynchronously (note: `async void`—see *Gotchas*).
|
||||
|
||||
#### Interface Implementations
|
||||
- **`void Cleanup()` / `Task CleanupAsync()`**
|
||||
No-op stubs; no cleanup logic implemented.
|
||||
|
||||
- **`void Initialize()` / `void Initialize(object parameter)` / `void Initialize(object parameter, object model)` / `Task InitializeAsync()` / `Task InitializeAsync(object parameter)`**
|
||||
No-op stubs; no initialization logic implemented.
|
||||
|
||||
- **`void Activated()`**
|
||||
No-op stub; likely part of Prism’s `INavigationAware` or custom lifecycle interface.
|
||||
|
||||
- **`event PropertyChangedEventHandler PropertyChanged`**
|
||||
Standard `INotifyPropertyChanged` implementation; used for data binding.
|
||||
|
||||
- **`void OnPropertyChanged(string propertyName)`**
|
||||
Raises `PropertyChanged` event for the given property.
|
||||
|
||||
- **`bool SetProperty<T>(ref T storage, T value, string propertyName = null)`**
|
||||
Declared but throws `NotImplementedException`; not used.
|
||||
|
||||
- **`void IBasePropertyChanged.OnPropertyChanged(string propertyName)`**
|
||||
Explicit interface implementation of `IBasePropertyChanged.OnPropertyChanged`, delegating to `OnPropertyChanged`.
|
||||
|
||||
---
|
||||
|
||||
### 3. Invariants
|
||||
|
||||
- `View.DataContext` is always set to `this` (the view model instance) during construction.
|
||||
- `_eventAggregator` subscriptions are established in the constructor and persist for the lifetime of the instance.
|
||||
- `IsBusy` is updated synchronously in response to `BusyIndicatorChangeNotification` events.
|
||||
- `NumberOf*Text` properties parse their setters as `int` without validation—invalid input will throw `FormatException`.
|
||||
- `IsDirty` is read-only and never set to `true` in the current implementation.
|
||||
- `NotificationRequest` is raised with a `Notification` object containing a `NotificationContentEventArgs` (with empty strings for unused fields) and the original title.
|
||||
- The class is marked `[PartCreationPolicy(CreationPolicy.Shared)]`, implying a singleton lifetime within the MEF container.
|
||||
|
||||
---
|
||||
|
||||
### 4. Dependencies
|
||||
|
||||
#### Imports / Dependencies
|
||||
- **Prism Framework**:
|
||||
- `Prism.Events.IEventAggregator` (for event pub/sub)
|
||||
- `Prism.Regions.IRegionManager` (for region navigation)
|
||||
- `Prism.Commands.DelegateCommand` (for command binding)
|
||||
- `Prism.Interactivity.InteractionRequest` (for popup notifications)
|
||||
- **Unity Container**: `IUnityContainer` (dependency injection)
|
||||
- **Custom Interfaces/Events**:
|
||||
- `IQASettingsView` (view interface)
|
||||
- `DTS.Common.Events.RaiseNotification`, `DTS.Common.Events.BusyIndicatorChangeNotification` (event types)
|
||||
- `DTS.Common.Base.IBasePropertyChanged` (custom interface)
|
||||
- **System Components**: `System.ComponentModel.INotifyPropertyChanged`, `System.Threading.Tasks.Task`
|
||||
|
||||
#### Exports / Used By
|
||||
- Exported as `IQASettingsView` via `[Export(typeof(IQASettingsView))]`, implying it is consumed by a Prism region or view locator expecting that interface.
|
||||
- Likely consumed by the `QASettingsView` UI (e.g., XAML view bound to this VM).
|
||||
|
||||
---
|
||||
|
||||
### 5. Gotchas
|
||||
|
||||
- **`async void` in `CreateMethod()`**:
|
||||
The `CreateMethod()` handler is `async void`, which is generally discouraged (no way to await or handle exceptions properly). This may lead to unobserved exceptions.
|
||||
|
||||
- **`SetProperty` throws `NotImplementedException`**:
|
||||
The `SetProperty` method (commonly used in MVVM to reduce boilerplate for property setters) is declared but unimplemented. This suggests incomplete refactoring or copy-paste from a base class.
|
||||
|
||||
- **No validation in property setters**:
|
||||
All `NumberOf*Text` setters use `int.Parse(value)` without error handling. Invalid input (e.g., non-numeric strings) will crash the UI thread.
|
||||
|
||||
- **Unused `ConfirmationRequest`**:
|
||||
Declared but never raised—likely leftover from design or future use.
|
||||
|
||||
- **`IsDirty` is always `false`**:
|
||||
No logic tracks changes; this property is effectively dead code.
|
||||
|
||||
- **`HeaderInfo` is hardcoded**:
|
||||
Returns `"MainRegion"` literally—likely a placeholder or misnamed constant.
|
||||
|
||||
- **`IBasePropertyChanged` interface**:
|
||||
Custom interface (not `INotifyPropertyChanged`) is implemented explicitly, but its purpose is unclear from this file alone.
|
||||
|
||||
- **No disposal logic**:
|
||||
`_eventAggregator` subscriptions are not unsubscribed in `Cleanup()`/`CleanupAsync()`—risk of memory leaks if the view model outlives its view.
|
||||
Reference in New Issue
Block a user