You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With this commit we clean up the usage of ElementRegistry and ElementFactory, and clearly separate their concerns.
Refactor Element Registry, Improve Command Execution, and Enhance GUI Updates
Key Changes:
Refactored ElementRegistry into a Singleton (Registry Role)
Centralizes factory function registrations.
Ensures elements are only registered once in settings.js.
Provides a retrieval interface for element types.
Updated CommandFactory to Dynamically Create Commands (Factory Role)
Registers commands dynamically instead of storing instances.
Commands now instantiate only when needed, reducing memory footprint.
Simplifies command retrieval by dynamically passing parameters.
Refactored CircuitService for a Hybrid Update Approach
Commands now directly modify circuit state.
Events are emitted only for UI updates, preventing unnecessary propagation.
Removed redundant console logs.
Updated GUIAdapter for Better Command Binding
Uses CommandFactory to dynamically register UI commands.
Ensures UI buttons trigger correct command execution.
Improved AddElementCommand Execution
Standardizes position initialization.
Ensures UI updates are triggered correctly.
Expanded and Fixed Tests
Ensures ElementRegistry is initialized before tests.
Improved event-driven testing in CircuitService.
0 commit comments