Commit Graph

7 Commits

Author SHA1 Message Date
Miguel 8072f29e12 Base para Refactorizar TSNET a codigo fuente 2025-09-12 10:22:15 +02:00
Miguel c5b980b134 Refactor hydraulic tank implementation and remove unnecessary UI message boxes
- Updated osHydTank class to simplify properties and remove legacy fields.
- Changed properties to focus on essential attributes for hydraulic simulation.
- Adjusted CurrentLevel property to ensure it remains within valid bounds.
- Removed MessageBox calls in MainViewModel during TSNet integration tests, replacing them with debug logging.
- Cleaned up MCPServer by removing screenshot functionality and related methods.
- Added direct execution method for TSNet simulation without Python dependency.
2025-09-12 04:14:20 +02:00
Miguel baed392d90 Enhance TSNet simulation: optimize tank configurations, improve time settings, and extract dynamic tank levels. Update INP generator to utilize real tank data and add methods for tank adapter retrieval. 2025-09-12 02:58:39 +02:00
Miguel 51d0f36187 Refactor TSNet Hydraulic Simulation Integration
- Implemented node name sanitization in TSNetINPGenerator to ensure compatibility with EPANET INP format.
- Enhanced TSNetSimulationManager to manage hydraulic components and elements more robustly, including improved error handling and logging.
- Replaced HydraulicSimulationManager with TSNetSimulationManager in MainViewModel, updating all relevant references and methods.
- Improved handling of IOException tracking in MainViewModel for better debugging and stability during simulation runs.
- Updated osHydPipe, osHydPump, and osHydTank classes to utilize sanitized node names for hydraulic nodes.
- Added new methods for resetting and clearing hydraulic objects in TSNetSimulationManager.
- Enhanced UserControlFactory to support the new TSNetSimulationManager without assigning the old hydraulic simulation manager.
2025-09-11 22:30:37 +02:00
Miguel 1b21f86886 Refactor hydraulic components: Enhance UI elements and add flow indicators
- Updated ucHydPipe.xaml to improve visual representation with drop shadows and flow indicators.
- Modified ucHydPump.xaml to include a background ellipse and improved status indicators.
- Simplified ucHydTank.xaml by removing unnecessary sections and enhancing the fluid level display.
- Added a new method CopyFrom in osBase.cs to facilitate property copying between objects.
2025-09-11 14:52:45 +02:00
Miguel 1df7a24140 Implement threading optimizations and error handling improvements in MCP server and hydraulic components
- Replaced blocking Dispatcher.Invoke() calls with non-blocking Dispatcher.BeginInvoke() in MainViewModel, osBase, and ObjectManipulationManager to enhance responsiveness during simulations.
- Added checks for Dispatcher availability to prevent crashes during application shutdown.
- Implemented comprehensive error handling with try-catch blocks and logging for better debugging.
- Corrected hydraulic connection logic to use component names instead of IDs for better accuracy in osHydPump.
- Introduced methods for safe Dispatcher invocation with timeout handling in MCPServer.
- Enhanced debug logging for better traceability of errors and server status.
- Documented threading improvements and their impact on MCP stability in new markdown files.
2025-09-11 10:28:26 +02:00
Miguel 55b0767685 Add comprehensive test suites for TSNet Phase 2 functionality
- Implemented `tsnet_direct_tests.py` for direct testing of TSNet core functionalities without MCP.
- Created `tsnet_edge_test_suite.py` to handle edge cases and error management in TSNet.
- Developed `tsnet_mcp_test_suite.py` to test TSNet using MCP CtrEditor APIs, ensuring no freezing occurs.
- Introduced `tsnet_simple_verification.py` for a basic connectivity and functionality check of TSNet.
2025-09-10 22:47:07 +02:00