Commit Graph

7 Commits

Author SHA1 Message Date
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 5727c1b376 Refactor TSNet test suites and migrate CtrEditor MCP to CPython
- Updated `tsnet_direct_tests.py` to improve code formatting and consistency.
- Enhanced `tsnet_edge_test_suite.py` with better error handling and logging.
- Refactored `tsnet_mcp_test_suite.py` for improved structure and clarity.
- Revised `tsnet_simple_verification.py` for better readability and error checking.
- Added comprehensive migration summary for CtrEditor from IronPython to CPython.
- Introduced new test scripts (`test_debug.py`, `test_mcp.py`, `test_python.py`) for validating CPython integration.
- Ensured all tests are compatible with the new CPython environment and improved performance metrics.
2025-09-11 07:54:52 +02:00
Miguel 369bcce3d7 feat: Implement circular debug log system with pattern matching and statistics retrieval 2025-09-08 22:49:24 +02:00
Miguel 3153f38068 Implement ScreenshotManager for enhanced screenshot functionality
- Added ScreenshotManager class to centralize screenshot capturing logic.
- Implemented methods to capture specific objects, areas, and full canvas.
- Updated MCPServer to utilize ScreenshotManager for taking screenshots.
- Introduced new API method to take screenshots of specific objects by their IDs.
- Enhanced error handling and result reporting for screenshot operations.
- Refactored TakeScreenshot and added TakeObjectScreenshot methods in MCPServer.
- Updated analyze_screenshots.py to use a relative path for screenshots directory.
- Removed outdated test script for Python execution.
2025-09-08 21:32:04 +02:00
Miguel 181a3db41c Implement Python execution support and enhance hydraulic component management
- Added Python execution capabilities via MCPServer, allowing scripts to interact with CtrEditor objects.
- Introduced methods for executing Python code and retrieving help on available objects.
- Updated osHydPump and osHydTank classes to remove direct hydraulic object management, leveraging the new unified hydraulic simulation system.
- Created documentation for Python integration and usage examples.
- Developed a script for analyzing screenshots to detect circular objects and assess their centering.
- Implemented tests for Python execution functionality to ensure proper integration and response handling.
- Addressed potential freeze issues in MCPServer and StateManager by improving async handling and cancellation support.
2025-09-08 11:52:06 +02:00
Miguel 5c03e19207 Implementación del sistema de pruebas hidráulicas con timing preciso y generación de resultados en formato JSON. Se agregaron clases para tanques, bombas y tuberías, junto con métodos para gestionar la simulación y realizar pruebas de equilibrio de flujo. Se documentaron resultados de pruebas y se identificaron mejoras necesarias en la visualización de datos. Se creó un resumen completo de las pruebas realizadas y se actualizaron las recomendaciones para futuras mejoras del sistema. 2025-09-06 22:18:26 +02:00
Miguel f07e7895f6 Add MCP Server and Proxy for CtrEditor with LLM Integration
- Implemented MCPServer class for TCP communication, allowing remote control of CtrEditor simulations.
- Added JSON-RPC methods for object management, simulation control, and screenshot functionality.
- Created a comprehensive LLM usage guide in MCP_LLM_Guide.md for interacting with the MCP server.
- Developed start_mcp_proxy.bat and start_mcp_proxy.py scripts to facilitate connection between GitHub Copilot and the MCP server.
- Enhanced error handling and logging throughout the MCP server and proxy scripts.
2025-09-06 17:05:59 +02:00