Commit Graph

86 Commits

Author SHA1 Message Date
Miguel 192c83ebce feat: Refactor state file path handling and update application events in JSON 2025-08-22 12:07:14 +02:00
Miguel c5ed02b4a2 feat: Update application events and system state, optimize JSON structure, and add build instructions to README 2025-08-22 11:37:15 +02:00
Miguel b7e491289b Add comprehensive tests for snap7 v2 functionality
- Implemented `test_simple_read_multi_vars.py` to validate read_multi_vars functionality with detailed logging and error handling.
- Created `test_snap7v2_comprehensive.py` for extensive testing of snap7 v2, covering various PLC variable types, performance comparisons, data consistency checks, and stress testing.
- Integrated existing backend components and optimized reading methods, with comprehensive reporting and logging features.
2025-08-21 20:30:41 +02:00
Miguel 12106a9fe9 feat: Implement dataset-specific optimization configuration
- Added `use_optimized_reading` parameter to dataset definitions for per-dataset control over reading methods.
- Updated JSON schema and UI schema to include the new parameter with appropriate descriptions and defaults.
- Modified `ConfigManager`, `PLCClient`, and `PLCDataStreamer` to handle the new optimization setting.
- Enhanced batch reading logic to prioritize dataset-specific settings over global configurations.
- Improved logging to indicate which reading method is being used for each dataset.
- Created comprehensive tests to validate the new functionality and ensure backward compatibility.
- Added documentation detailing the new feature, its benefits, and usage examples.
2025-08-20 00:28:07 +02:00
Miguel 5e89921f05 feat: Implement early instance check and enhance shutdown process
- Added a function to check for a running instance of the application before initializing PLCDataStreamer, providing faster feedback to the user.
- Improved the graceful shutdown process to ensure proper cleanup of resources and instance locks.
- Updated the main execution flow to include early instance checks and handle potential runtime errors more gracefully.
- Modified system_state.json to set "should_connect" to true and updated the active datasets.
2025-08-19 17:07:00 +02:00
Miguel 4a064937d3 Implement OptimizedBatchReader for efficient PLC variable reading
- Added OptimizedBatchReader class to handle batch reading of PLC variables using snap7's read_multi_vars function.
- Introduced automatic chunking to respect S7 PDU limits, allowing for efficient handling of large variable lists.
- Replaced the existing read_variables_batch method in PLCClient with the new optimized implementation.
- Updated system_state.json to reflect the latest last_update timestamp.
- Removed commented-out code related to the previous batch reading method.
2025-08-19 10:41:09 +02:00
Miguel a1c004f11b Update configuration and directory handling
- Increased time_window in plot_definitions.json from 10 to 60.
- Added external_path function in config_manager.py to handle paths for records and logs, ensuring compatibility with both development and PyInstaller executable environments.
- Updated PLCDataStreamer to use the new get_csv_directory_path method for retrieving the records directory.
- Refactored main.py to include get_records_directory function for consistent records directory path retrieval.
- Modified system_state.json to set should_connect to false and updated last_update timestamp.
2025-08-18 18:51:18 +02:00
Miguel 00c021f496 feat: Enhance DataStreamer with critical validation and performance monitoring improvements
- Refactored performance monitoring initialization for better readability.
- Added critical validation to ensure buffered data matches current dataset variables, preventing CSV corruption.
- Implemented logging for data inconsistencies and buffer clearing during variable modifications.
- Improved error handling and logging during CSV flushing and dataset reading.
- Enhanced UDP streaming error handling and logging.
- Updated threading management for CSV flushing and dataset streaming.
- Added comprehensive performance metrics recording for dataset reads and writes.

feat: Localize historical plot management components

- Integrated i18n support in PlotHistoricalManager, PlotHistoricalSession, and TimePointSelector components.
- Translated various UI strings related to historical plots, time selection, and console logs into English, Spanish, and Italian.
- Improved user experience by providing localized messages for actions and statuses.

fix: Update system state configuration

- Changed `should_connect` to true and added active datasets to the system state.
- Updated the last update timestamp and specified the path for PlotJuggler.
2025-08-17 13:01:36 +02:00
Miguel ac87ce2568 feat: Update dataset configurations and improve PLC communication
- Changed sampling interval for "Fast" dataset from 0.1 to 0.5 seconds.
- Updated variable definitions for "Fast" dataset, including renaming and modifying properties for AUX Blink and M50 variables.
- Adjusted plot definitions to reduce time window from 36 to 10 seconds.
- Enhanced plot variables to ensure correct labeling and enablement of variables.
- Increased inter-read delay in PLCClient for improved stability and added batch reading functionality to optimize variable reads.
- Implemented asynchronous CSV writing system in DataStreamer to reduce I/O operations and improve performance.
- Updated ChartjsPlot component to modify refresh rates for real-time data handling.
- Adjusted system state to disable automatic connection and clear active datasets.
2025-08-17 11:41:31 +02:00
Miguel 61365240d6 Update dataset definitions and chart configuration for improved performance
- Changed the sampling interval for the "Fast" dataset from 1 to 0.1 for finer granularity.
- Adjusted the Chart.js plot configuration by setting the delay to 0 for real-time updates.
- Removed "Test" from the active datasets in the system state and updated the last update timestamp.
2025-08-17 11:00:22 +02:00
Miguel 3015fe4391 feat: Enhance coordinated polling with error handling and performance monitoring
- Updated `useCoordinatedPolling` to track connection errors and stop polling after consecutive failures.
- Modified `StatusBar` component to display connection status and performance data, including loading states and error messages.
- Implemented performance data fetching with automatic updates every 10 seconds when conditions are met.
- Added new API functions for retrieving current and historical performance data.
- Adjusted `system_state.json` to change the order of active datasets and updated the last update timestamp.
2025-08-17 10:39:57 +02:00
Miguel 030b691064 feat(i18n): add internationalization support with language detection and translations for English, Spanish, and Italian
- Integrated i18next and react-i18next for localization.
- Added language selector component to switch between English, Spanish, and Italian.
- Updated various components to use translation keys for dynamic text rendering.
- Created translation files for English, Spanish, and Italian with relevant keys.
- Modified the main application entry point to initialize i18n.
- Updated dashboard and configuration components to reflect translated content.
- Adjusted toast messages and dialog texts to support multiple languages.
- Updated system state to include new language settings.
2025-08-17 00:15:44 +02:00
Miguel 1ecb8c71ee feat: Add console logs display and export functionality
- Introduced ConsoleLogsDisplay component to replace EventsDisplay for showing console logs.
- Implemented log export feature to download console logs as a text file.
- Updated API to fetch console logs from the backend.
- Modified DashboardContent to load and display console logs instead of events.
- Adjusted UI elements for better user experience with logs.
- Added new endpoint in the backend to retrieve recent console logs.
- Updated system state and configuration files accordingly.
2025-08-16 23:55:27 +02:00
Miguel ca6d39cb06 feat: Add import/export functionality for configuration and dataset variables
- Implemented reusable ImportExportButtons component for handling JSON file import/export across various components.
- Enhanced PlotManager, Dashboard, and DatasetManager to support importing and exporting configurations and variables.
- Added validation for JSON structure during import to ensure data integrity.
- Updated dataset_variables.json to include new variable UR29_max.
- Modified system_state.json to reorder active datasets and update last_update timestamp.
2025-08-16 22:35:50 +02:00
Miguel c3c55dd3dc Enhance Chart.js dataset visibility management
- Introduced a mechanism to track and save the visibility state of datasets in the Chart.js historical plot component.
- Implemented functions to save, restore, and apply dataset visibility states during chart updates and creations.
- Modified the legend click behavior to update the visibility state in the dataset visibility map.
- Updated system state JSON to reflect changes in active datasets and last update timestamp.
2025-08-16 20:58:01 +02:00
Miguel 7738f1d241 feat: Enhance ChartjsHistoricalPlot with simple and fullscreen modes
- Added `isSimplePlot` prop to toggle simple plot mode for faster navigation.
- Introduced `isFullscreen` prop to enable fullscreen mode for a compact layout.
- Implemented chart resizing on fullscreen toggle.
- Updated dataset configuration to respect simple plot settings.
- Modified chart controls to hide/show based on fullscreen state.
- Added fullscreen modal with navigation controls in PlotHistoricalSession.
- Updated system state JSON to reflect changes in active datasets and last update timestamp.
2025-08-16 20:36:56 +02:00
Miguel 0f928c50e7 feat: Implement data availability visualization in historical plots
- Added DataAvailabilityBar component to visualize data segments on the timeline.
- Integrated DataAvailabilityBar into TimePointSelector and ChartjsHistoricalPlot components.
- Updated PlotHistoricalSession to fetch data segments from the backend.
- Modified API to include endpoint for retrieving historical data segments.
- Refactored date formatting to use 'en-US' locale for consistency.
- Removed reset zoom functionality and associated UI elements from ChartjsHistoricalPlot.
2025-08-16 19:20:42 +02:00
Miguel be2df781cf Implementación del sistema de monitoreo de rendimiento y gestión de prioridades para el recording de PLC
- Se creó el archivo PERFORMANCE_MONITORING.md que detalla el sistema de monitoreo de rendimiento en tiempo real, incluyendo métricas, logs y APIs de monitoreo.
- Se desarrolló el archivo PRIORITY_SYSTEM.md que describe la arquitectura de prioridades para asegurar que el recording de CSV tenga máxima prioridad.
- Se implementó el PerformanceMonitor en core/performance_monitor.py para registrar métricas de rendimiento, incluyendo tiempos de lectura, uso de CPU y errores.
- Se creó el PriorityThreadManager en core/priority_manager.py para gestionar la prioridad de los hilos y asegurar que las operaciones de recording no sean interrumpidas.
- Se implementó un sistema de logging rotativo en core/rotating_logger.py que permite la rotación automática de archivos de log y limpieza de archivos antiguos.
2025-08-16 18:34:31 +02:00
Miguel fe1df15942 feat: Enhance application event logging and improve historical plot components with new data handling and UI updates 2025-08-16 16:53:50 +02:00
Miguel d588574b4f feat: Enhance event logging and improve time navigation synchronization in historical plot components 2025-08-16 16:08:35 +02:00
Miguel 43d125bea1 feat: Add TimePointSelector component for time navigation and selection
- Introduced a new TimePointSelector component to allow users to select a specific date and time using a date picker and a slider.
- Integrated the TimePointSelector into the PlotHistoricalSession component for enhanced time navigation.
- Implemented state management for central time and time range in PlotHistoricalSession.
- Added API endpoint to fetch available date range for historical data.
- Updated ChartjsHistoricalPlot to improve data processing and logging.
- Enhanced error handling and logging in the backend for better debugging.
- Updated frontend dependencies, including the addition of react-datepicker.
2025-08-16 12:45:09 +02:00
Miguel 0f2b9b8fb4 feat: Enhance logging and error handling in symbol processing, update system state and dataset variables, and add symbol data expansion functionality 2025-08-15 21:05:58 +02:00
Miguel e7cee49b1e feat: Enhance PlotJuggler integration by launching with multiple files in a single instance, improve logging for application events, and update system state for active datasets 2025-08-15 20:38:05 +02:00
Miguel 02b622cb20 feat: Add file path copying functionality to CSV File Browser and update PlotJuggler launch command 2025-08-15 20:29:17 +02:00
Miguel 3a830fe100 feat: Add PlotJuggler integration with UDP streaming support, update system state and dataset variables for streaming, and enhance dashboard functionality 2025-08-15 20:23:10 +02:00
Miguel 60db337284 feat: Implement CSV File Browser component, add API endpoints for CSV file management, and update system state for dataset activation 2025-08-15 20:16:05 +02:00
Miguel 4481eb33a7 feat: Enhance logging for plot sessions, update UI widgets to use switches, and reorder active datasets in system state 2025-08-15 19:55:57 +02:00
Miguel 609ae865de feat: Add detailed logging for plot sessions and implement TabCoordinationDemo component for coordination status display 2025-08-15 19:41:01 +02:00
Miguel 696b79ba0d feat: Implement coordinated connection and polling for real-time data updates across tabs
- Introduced `useCoordinatedConnection` and `useCoordinatedPolling` hooks to manage data fetching and state synchronization between tabs.
- Refactored `DatasetCompleteManager`, `PlotRealtimeViewer`, and `VariableSelectorWidget` components to utilize SSE and polling for live data updates.
- Added `TabCoordinationDemo` component to visualize tab coordination status and leadership.
- Updated `Dashboard` to leverage coordinated polling for status updates, improving performance and reducing redundant connections.
- Enhanced `TabCoordinator` utility to manage leadership and data broadcasting between tabs effectively.
2025-08-15 18:55:58 +02:00
Miguel e97cd5260b feat: Implement multi-browser support for plot sessions
- Enhanced session ID generation to include browser tab identifiers, allowing multiple instances of the same plot in different tabs.
- Updated PlotManager to manage sessions more effectively, including cleanup of inactive sessions.
- Modified frontend components to handle dynamic session IDs and ensure independent operation across tabs.
- Added new API endpoints for retrieving sessions by plot ID and manual cleanup of inactive sessions.
- Improved error handling and logging for better debugging and user experience.
2025-08-15 16:56:02 +02:00
Miguel 405edd682e feat: Enhance logging and configuration for plot sessions, update dataset handling, and improve chart rendering logic 2025-08-15 15:49:13 +02:00
Miguel 5caa74fa27 feat: Add detailed logging for plot sessions, update plot configuration, and enhance chart handling 2025-08-15 13:17:08 +02:00
Miguel 6cd5f36c7c feat: Enhance application event logging, add stacked Y-axis support, and update plot session configurations 2025-08-15 13:06:14 +02:00
Miguel 14089cdc2e feat: Add detailed application event logging, enhance plot session configurations, and support stacked Y-axes in Chart.js 2025-08-15 12:55:43 +02:00
Miguel addd9fa6bc feat: Enhance event logging for plot sessions, improve zoom functionality, and update dataset configurations 2025-08-15 11:01:20 +02:00
Miguel 73f743ce7c feat: Add detailed application event logging and enhance Chart.js health monitoring with auto-recovery features 2025-08-15 00:51:18 +02:00
Miguel b864e81aa3 feat: Enhance event logging, improve CSV handling, and optimize Chart.js zoom functionality 2025-08-15 00:42:14 +02:00
Miguel e517f40a5d feat: Enhance application event logging, improve CSV handling, and add CSV validator utility 2025-08-15 00:28:21 +02:00
Miguel 4f7b55bd0d feat: Agregar registro detallado de eventos de aplicación y mejorar la carga de datos históricos desde archivos CSV
- Se añadieron múltiples eventos de inicio de aplicación, activación de datasets y creación de sesiones de gráficos en el archivo application_events.json.
- Se mejoró la función get_historical_data en main.py con un manejo de errores más robusto y mensajes de depuración detallados.
- Se actualizó el estado del sistema en system_state.json para reflejar los cambios en los datasets activos y la última actualización.
- Se documentaron las mejoras en la Memoria de Evolución, destacando la implementación de la carga de datos históricos y la validación de encabezados CSV.
2025-08-15 00:21:41 +02:00
Miguel 91718e7bf7 feat: Implement historical data loading from CSV files, enhance PlotRealtimeViewer component, and improve Chart.js dependency checks 2025-08-14 23:32:07 +02:00
Miguel ea2006666f feat: Enhance application event logging, add CSV header validation, and implement fullscreen mode for charts 2025-08-14 22:57:42 +02:00
Miguel 032959f491 feat: Implement CSV header validation and automatic renaming for dataset files 2025-08-14 22:33:39 +02:00
Miguel bd0e169757 feat: Migrate Chart.js libraries to npm for offline usage and update application setup 2025-08-14 21:39:27 +02:00
Miguel d99d439455 feat: Enhance application event logging and add max_hours configuration option 2025-08-14 18:32:49 +02:00
Miguel fd8efecae4 Enhance dataset variable handling and expand symbolic variables
- Updated dataset_variables.json to include new variables and adjust configurations.
- Modified plot_variables.json to add visualization settings for new variables.
- Enhanced ConfigManager to support expansion of symbolic variables, improving variable management.
- Updated PLCClient to handle additional memory types for variable reading.
- Refactored VariableSelectorWidget to utilize expanded dataset variables for better selection.
- Added new API endpoint to retrieve expanded dataset variables.
- Adjusted system_state.json to reflect changes in active datasets and last update timestamp.
2025-08-14 18:28:37 +02:00
Miguel 31cb5cc515 feat: Enhance dataset variable configuration with manual and symbol-based options
- Updated the dataset variables UI schema to support two configuration types: manual and symbol-based.
- Implemented a new DatasetVariableSymbolWidget for symbol selection with auto-fill capabilities.
- Modified the DatasetManager to handle the new schema structure and UI layout.
- Integrated the new widget into the DatasetVariablesRJSF component for improved user experience.
- Updated the SymbolSelectorWidget to support callbacks for symbol selection.
- Refactored the FormTable component to utilize the new allWidgets import for better widget management.
- Added error handling and loading states for improved user feedback during data fetching.
2025-08-14 17:34:32 +02:00
Miguel e3b1b48556 feat: Add symbol loading functionality from ASC files
- Implemented a new utility class `SymbolLoader` to parse Siemens ASC symbol files and save the output in JSON format.
- Created a `SymbolProcessor` class to handle symbol-based variable processing, including loading symbols and expanding configurations.
- Developed frontend components `FilePathWidget` and `SymbolSelectorWidget` for file selection and symbol selection respectively.
- Added API endpoints for loading symbols and browsing files.
- Introduced test scripts for validating the symbol loader and endpoint functionality.
- Added sample ASC and JSON files for testing purposes.
2025-08-14 16:53:31 +02:00
Miguel 16355c4106 feat: Update application events and system state management with new plot session events, enhanced plot definitions, and improved PlotManager component for better session control and configuration handling. 2025-08-14 16:02:10 +02:00
Miguel a9396ec309 Refactor PlotManager and PlotRealtimeSession components for improved variable handling and session control
- Updated CollapsiblePlotChart to display correct variable count.
- Added getPlotVariables helper function to retrieve plot variables based on plot ID.
- Enhanced PlotManager to log plot data loading and adjust dependencies for useEffect.
- Refactored handleControlClick in PlotRealtimeSession to use useCallback and maintain session state during refresh.
- Implemented logic to restart active plots after configuration refresh in PlotRealtimeSession.
- Removed unused DashboardNew component to streamline codebase.
- Updated system_state.json to reflect changes in active datasets and last update timestamp.
- Deleted validate_schema.py as it is no longer needed for schema validation.
2025-08-14 15:04:47 +02:00
Miguel f5db758698 feat: Implement Plot Manager and Plot Manager Simple components with collapsible forms for plot definitions and variables configuration 2025-08-14 14:48:02 +02:00