Commit Graph

147 Commits

Author SHA1 Message Date
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 88c8eea35e Implement comprehensive tests and solutions for TSNet division by zero issues, including extraction of results, configuration validation, and timestep stability demonstrations. Added multiple test scripts to ensure robustness and correctness of the simulation, along with detailed documentation of identified problems and their resolutions. 2025-09-12 02:16:27 +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 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 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
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 3c9c0e2479 Refactor hydraulic components: Simplify pump and tank logic, remove unused properties, and enhance flow calculations
- Updated osHydPump.cs to replace NPSH and cavitation calculations with a simpler flow check.
- Modified pump status display to indicate whether the pump is pumping or not.
- Streamlined fluid updates in osHydPump.cs to only occur when there is flow.
- Refactored osHydTank.cs to consolidate flow handling and remove unnecessary three-section logic.
- Adjusted UI elements in ucHydTank.xaml to reflect changes in flow representation and removed deprecated visual indicators.
- Enhanced DebugConsoleServer.cs to improve client connection handling with timeout and error management.
2025-09-07 17:06:15 +02:00
Miguel b39c58e6d6 feat: Add three-section tank properties and converters for enhanced fluid management 2025-09-07 09:19:02 +02:00
Miguel 322d335edd feat: Add detailed status properties and margin converter for tank sections in hydraulic components 2025-09-06 23:09:55 +02:00
Miguel 380fb5ba50 refactor: Enhance ucHydTank layout and improve information panel with detailed flow metrics 2025-09-06 22:33:08 +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 10a1617833 feat: Implement Debug Console Server for enhanced logging and remote monitoring 2025-09-06 19:49:03 +02:00
Miguel 749f0f7eff Add comprehensive documentation and technical specifications for Hydraulic Simulator and Fluid Management System
- Introduced detailed documentation for the Hydraulic Simulator, covering architecture, components, usage examples, and integration with graphical objects.
- Added technical specifications for the Fluid Management System, including calculation algorithms, performance specifications, implementation details, and testing strategies.
- Implemented FluidProperties class to encapsulate fluid characteristics and behaviors, including density, viscosity, and mixing capabilities.
- Established enums for FluidType and MixingState to enhance code clarity and maintainability.
2025-09-06 19:10:20 +02:00
Miguel fd57091d73 refactor: Remove connection indicators from hydraulic pipe UI 2025-09-06 17:46:44 +02:00
Miguel 04565d21d0 Implement NPSH verification system in hydraulic simulation
- Added NPSH verification logic to PumpHQ and osHydPump classes.
- Introduced properties for NPSH available, cavitation factor, and operational status.
- Implemented NPSH testing on application startup in MainWindow.xaml.cs.
- Created a console application (NPSHTestConsole) for testing NPSH functionalities.
- Developed NPSHTestExample class to demonstrate original user problem and solutions.
- Enhanced osHydTank and osHydPump classes to support NPSH calculations and conditions.
- Added comprehensive logging for debugging and verification purposes.
2025-09-06 10:32:42 +02:00
Miguel e06efacaaf refactor: Update hydraulic components to implement IHydraulicComponent interface 2025-09-06 03:09:09 +02:00
Miguel e6a8bb8cbe feat: Enhance hydraulic simulation components and integrate new object management
- Updated UserControlFactory to support hydraulic simulation manager in AssignDatos method.
- Introduced new classes for hydraulic simulation objects: simHydraulicBase, simHydraulicPump, simHydraulicTank, and simHydraulicPipe.
- Implemented methods for updating properties and applying simulation results in hydraulic components.
- Enhanced osHydPipe, osHydPump, and osHydTank classes to manage hydraulic simulation objects and their properties.
- Added methods for creating, removing, and clearing hydraulic simulation objects in HydraulicSimulationManager.
- Improved error handling and logging in various components to facilitate debugging.
- Refactored XAML and code-behind files to align with new namespace structure for hydraulic components.
2025-09-06 02:58:18 +02:00
Miguel 8e6d457047 Refactor hydraulic components: Updated osHydPipe and osHydPump to improve code clarity by changing region comments to regular comments. Enhanced osHydTank with a new OnMove method and improved initialization in ucHydTank.xaml. Updated StateSerializer to include default values during serialization. 2025-09-06 01:47:57 +02:00
Miguel 0147e010d3 Refactor hydraulic components: Updated osHydPump and added osHydTank class with dynamic level and pressure management. Enhanced XAML for tank visualization and implemented converters for UI binding. Improved error handling in converters and added tests for hydraulic component detection. 2025-09-05 15:41:17 +02:00
Miguel 70bc74fa7d Fix hydraulic simulation issues: prevent double registration of objects, correct MaxFlow unit conversion, enable verbose output for debugging, and ensure proper convergence of the hydraulic solver. 2025-09-04 18:52:46 +02:00
Miguel de4193dee3 Add unit test for hydraulic component type assignability
- Created a new test class TestItemsSource in test_osBaseItemsSource.cs.
- Implemented TestTypeAssignability method to verify that osHydPipe, osHydDischargeTank, and osHydPump correctly implement the IHydraulicComponent interface.
- Added console output to display results of type checks and comparisons.
2025-09-04 18:25:31 +02:00
Miguel 42c9ab9449 Refactor hydraulic components: removed ucPumpExample, added ucHydDischargeTank and ucHydPipe with corresponding logic and XAML. Introduced new converters for UI bindings and created a simple hydraulic system example with testing capabilities. 2025-09-04 17:29:20 +02:00
Miguel d968aa9a2f Mejorado de HydPump 2025-09-04 15:54:14 +02:00
Miguel 3f21061524 Agregada base Hidraulica 2025-09-04 15:14:47 +02:00
Miguel 091170b70d Agregado de NombreCategoria a los osSimulables 2025-09-04 12:26:24 +02:00
Miguel 6e48539d2e Agregar modo de lectura a ucAnalogTag, permitiendo la lectura condicional del valor. Se implementa la propiedad Read_Mode y se ajusta la lógica de actualización para utilizarla. 2025-09-04 11:59:32 +02:00
Miguel 4f2a109332 Implementar sistema de persistencia de configuración del entorno de trabajo, incluyendo captura y restauración de estado para el GridSplitter, canvas y actualizaciones 3D. Se añade la clase WorkspaceConfiguration y se actualizan varios archivos para integrar esta funcionalidad. 2025-09-03 20:51:51 +02:00
Miguel cad650b3d0 Mejorar la gestión del foco en la interfaz, evitando interferencias con el PLCControl. Se implementaron verificaciones para forzar actualizaciones de bindings sin robar el foco y se añadió un método para buscar controles padres en el árbol visual. 2025-09-02 18:55:48 +02:00
Miguel b44bdc5ece Se implementó un nuevo sistema de limitación de fuerzas para contactos múltiples simultáneos en la simulación de botellas, mejorando la estabilidad y realismo al evitar fuerzas armónicas irreales. Se introdujo un enfoque post-solver para controlar velocidades Z excesivas y se simplificó la lógica de integración de velocidad. Además, se ajustaron los parámetros de fricción y recuperación para optimizar el comportamiento en situaciones de contacto. Se añadieron nuevas funciones para el seguimiento de densidad de contactos y la calibración visual del deslizamiento. 2025-07-09 09:47:39 +02:00
Miguel f7f49d5df0 Se implementó un sistema de fricción dinámica que simula el comportamiento de fricción estática y dinámica en contactos botella-transporte y botella-curva, mejorando el flujo de materiales y reduciendo atascos. Se reemplazó el sistema de presión por un nuevo sistema de calibración visual que permite ajustar las fricciones de cada componente, mostrando el nivel de deslizamiento en las botellas. Además, se realizaron ajustes en la lógica de colisiones y se optimizó la gestión de fricción en la simulación. 2025-07-06 21:07:11 +02:00
Miguel d1ec7f4d12 Se mejoró el sistema de guías curvas para incluir apertura en cono en los extremos, facilitando la entrada y salida de botellas. Se añadió un nuevo parámetro `AnguloAperturaGuias` para ajustar la apertura, optimizando el flujo de materiales. Además, se implementaron nuevas propiedades en `ucBottGenerator` para gestionar la distancia mínima sin botellas y se realizaron ajustes en la lógica de colisiones y visualización en 3D. 2025-07-06 00:07:36 +02:00
Miguel 83fc828a4c Se implementaron mejoras en la visualización y animación de transportes en movimiento, incluyendo un indicador visual que cambia de color según el estado de movimiento. Se añadió un sistema de animaciones automáticas utilizando StoryBoard de WPF, que combina rotación y pulsación de color para los transportes activos. Además, se ajustaron las propiedades de presión en las botellas para mejorar la gestión de fricción y se optimizó la lógica de animación y limpieza de objetos en la simulación. 2025-07-05 20:20:59 +02:00
Miguel eb6ed62d5b Eliminación del archivo "Memoria de evolución" y cambios en la creación de botellas en la simulación. Se reemplazó el método AddCircle por AddBotella en ucBotella y ucBotellaCuello, y se ajustaron propiedades en simBotella para mejorar la gestión de inercia y fricción. Se eliminaron referencias a barreras físicas en BEPU, optimizando la lógica de colisiones y ajustando parámetros de fricción para mejorar la simulación. 2025-07-05 17:04:39 +02:00
Miguel a6cbd8c4ab Se realizaron mejoras en la gestión de barreras en el sistema de simulación. Se eliminó la dependencia de cuerpos físicos para las barreras, implementando un sistema de detección basado en RayCast. Se actualizaron los métodos de creación y actualización de barreras, así como su visualización en 3D, optimizando la representación del haz de luz. Además, se simplificó la lógica de detección y se eliminaron métodos obsoletos relacionados con la geometría de barreras. 2025-07-04 22:45:26 +02:00
Miguel e38adc9f56 Se eliminaron archivos de documentación innecesarios en el proyecto y se realizaron ajustes en la visibilidad de métodos en la clase osBase, cambiando de privado a protegido. Se implementó un nuevo método para verificar las dimensiones de los descartes y se mejoró la lógica de actualización de geometrías en ucDescarte y ucGuia, utilizando un sistema inteligente para optimizar el rendimiento. Además, se corrigieron errores en la conversión de coordenadas y se restauró el factor de conversión de velocidad en BEPU. 2025-07-02 17:19:31 +02:00
Miguel fd215bc677 Intento con LinearAxisMotor 2025-07-02 15:17:50 +02:00
Miguel 3e53a51e8b Se añadió un comando para alternar la actualización 3D en MainViewModel, permitiendo habilitar o deshabilitar esta función para mejorar el rendimiento. Se implementó la lógica correspondiente en la visualización 3D y se eliminaron propiedades redundantes en varias clases, optimizando la gestión de objetos en la simulación. 2025-07-01 23:08:05 +02:00
Miguel 3773da0ee3 Se añadió un nuevo manager para la visualización 3D en MainWindow y se conectó con el simulation manager. Además, se implementaron métodos para manejar cambios de posición en ucTransporteCurvaGuias, actualizando la geometría en BEPU y sincronizando con la visualización 3D. Se mejoró la creación de guías desde dos puntos y se corrigieron errores en la actualización de curvas. 2025-07-01 20:02:23 +02:00
Miguel fbac81ec45 Codigo adaptado base aun errores 2025-07-01 19:47:10 +02:00
Miguel 121e586d53 Inicio de Migracion de 2D a 3D 2025-07-01 19:03:06 +02:00
Miguel d259f53081 Antes de cambiar Motor de Fisica 2025-06-26 19:25:44 +02:00
Miguel 256d86aca5 Se realizaron actualizaciones en múltiples clases para mejorar la legibilidad y la organización de las propiedades. Se añadieron nuevos atributos de descripción y nombre en varias clases, como ucBasicExample, ucTransporteCurva, y ucTransporteGuias, facilitando la identificación de los elementos en la interfaz de usuario. Además, se eliminaron archivos innecesarios del proyecto y se ajustaron las categorías de propiedades para una mejor clasificación. Estas mejoras optimizan la experiencia del usuario y la gestión de los objetos en la simulación. 2025-06-24 21:35:17 +02:00
Miguel 3bc314182c Se realizaron mejoras en la clase MainViewModel al agregar espacios en blanco para mejorar la legibilidad. En TagEditorAttribute, se añadieron nuevos atributos y se implementó la lógica para manejar nombres personalizados de propiedades. En UserControlFactory, se optimizó la obtención de nombres de propiedades y se eliminaron espacios en blanco innecesarios. Finalmente, se añadió un atributo Name en ucTransporteTTop para el coeficiente de fricción, mejorando la claridad en la interfaz de usuario. 2025-06-24 17:45:47 +02:00
Miguel 6928088691 Se añadieron nuevas propiedades y métodos en el control CircularSegment para gestionar guías visuales, incluyendo la distancia, grosor y color de las guías. Se implementó la lógica para dibujar las guías en el segmento circular, mejorando la visualización y personalización del control. 2025-06-24 17:32:17 +02:00
Miguel 81329e4c09 Se añadieron nuevas propiedades y métodos en la clase ucTransporteCurvaGuias para gestionar guías curvas, incluyendo la creación y actualización de segmentos de guías. Se implementaron validaciones para el número de segmentos y se mejoró la lógica de actualización de geometrías al cambiar propiedades relevantes. 2025-06-24 17:07:37 +02:00
Miguel b6f616f6cc Agregado del control TransportCurva con Guias 2025-06-24 16:53:03 +02:00
Miguel 1449544d71 Se actualizaron las propiedades en las clases osBase, ucCustomImage y ucVMmotorSim para utilizar el nuevo atributo [property: JsonIgnore], mejorando la gestión de la serialización JSON. Además, se ajustó la configuración del serializador en StateSerializer.cs para respetar los atributos JsonIgnore, optimizando la deserialización de objetos. 2025-06-24 11:17:34 +02:00