Commit Graph

168 Commits

Author SHA1 Message Date
Miguel 9dbc0bb866 feat: Enhance CsvViewer hover effects with dynamic background and text colors 2025-08-31 22:11:17 +02:00
Miguel b36cbf386b feat: Implement CSV Viewer with pagination and sticky header
- Added CsvViewer component to display CSV data with pagination support.
- Integrated API call to fetch CSV data with pagination.
- Enhanced user experience with sticky headers and improved scrolling.
- Implemented search functionality to filter displayed data.
- Added export feature to download current page data as CSV.
- Updated CsvFileBrowser to include a button for viewing CSV files.
- Improved UI with responsive design and better styling for controls.
- Fixed scrolling issues by reverting to traditional Chakra UI table syntax.
- Updated system state to reflect changes in connection settings.
2025-08-31 22:04:12 +02:00
Miguel 550fc78085 feat: Update application events and system state for improved dataset management and logging 2025-08-30 23:29:57 +02:00
Miguel 71746fa326 feat: Enhance PLC status reporting with actual CPU cycle time
- Updated PLCClient to retrieve and report actual CPU cycle time using SZL methods.
- Renamed `cycle_time_ms` to `comm_time_ms` to clarify that it represents communication latency.
- Added detailed cycle time statistics (current, min, max) to the PLC status response.
- Modified Dashboard component to display new cycle time information alongside communication time.
- Documented the new implementation and troubleshooting steps for SZL access in the CPU Cycle Time Implementation Guide.
2025-08-30 22:59:16 +02:00
Miguel 5f73f77618 Refactor VariableSelectorWidget for improved data handling and loading states
- Enhanced handleRefresh to process dataset variables more efficiently.
- Updated useEffect hooks to manage initial loading and refresh triggers separately.
- Removed auto-refresh on focus to streamline user experience.
- Adjusted loading state display logic to only show during initial load.
- Improved StatusBar component layout and responsiveness with flex properties.
- Ensured consistent minimum heights for card elements to enhance UI stability.
- Simplified conditional rendering for performance data and error states.
2025-08-29 20:51:53 +02:00
Miguel 4d41b7b9b3 Refactor plot definitions and variable configurations
- Updated plot definition for DAR_Brix to disable stacking and increase time window from 60 to 120 seconds.
- Changed variable name from "Blink" to "HMI_Instrument.CTS306.PVFiltered" in plot variables configuration.
- Removed console logs related to pending time changes in PlotHistoricalSession component for cleaner code.
- Enhanced VariableSelectorWidget with debug options and improved SSE connection handling.
- Removed unnecessary debug logs from various components including Tooltip, AllWidgets, and TestWidget.
- Implemented automatic reconnection logic for SSE in useCoordinatedSSE hook.
- Added periodic ping messages in stream_variables function to maintain SSE connection.
- Updated system state to enable connection and include active datasets.
2025-08-29 20:31:17 +02:00
Miguel a26a1c7ace Actualizado forma de gestionar las variables de dataset 2025-08-29 16:16:44 +02:00
Miguel 46bc89e14b Refactorizacion de la tabla de variables 2025-08-29 11:19:39 +02:00
Miguel f979817876 Enhance Dashboard UI and Status Indicators
- Added a Popover component to provide information about Backend & Tabs status.
- Improved layout and styling of the System Status section, including connection status indicators.
- Updated PLC connection buttons for better user experience.
- Refactored CPU Status and UDP Streaming cards for consistency and clarity.
- Adjusted performance metrics display with improved loading states and error handling.
- Updated last_update timestamp in system_state.json for accurate tracking.
2025-08-28 15:50:56 +02:00
Miguel 4eed5d2687 feat: Add CPU status retrieval and display in dashboard
- Implemented `get_cpu_status` method in PLCClient to fetch current CPU state, cycle time, and additional CPU info.
- Created a new API endpoint `/api/plc/status` to serve CPU status data.
- Updated frontend to load and display CPU status in the Dashboard, including state and cycle time.
- Added error handling for CPU status retrieval in the frontend.
2025-08-28 13:31:11 +02:00
Miguel dba0ca2528 Enhance variable configuration and UI components
- Updated plot_variables.json to include new variables with proper configurations.
- Modified ConfigManager to ensure expanded and fallback variables retain their names.
- Improved VariableSelectorWidget to handle undefined properties gracefully, displaying 'UNKNOWN' or 'N/A' where applicable.
- Refactored main.py to utilize the proper expansion method for symbolic variables when retrieving dataset variables.
- Updated system_state.json with the latest timestamp for last_update.
2025-08-28 11:47:34 +02:00
Miguel a0a65f563d Update backend manager status, dataset variables, and configuration schemas
- Updated backend manager status with new timestamps and process IDs.
- Modified dataset variables JSON to ensure consistent configuration types and added a new symbolic variable.
- Enhanced dataset variables schema to enforce configuration type and prevent additional properties.
- Adjusted UI schema for dataset variables to improve layout and visibility of fields.
- Refactored config manager to handle expanded dataset variables for PLC communication.
- Updated PLC data streamer and core streamer to utilize expanded dataset variables.
- Simplified DatasetVariableSymbolWidget and SymbolSelectorWidget components, improving toast notifications and layout.
- Removed unnecessary symbol expansion logic from Dashboard component.
- Updated system state JSON with new last update timestamp and added PlotJuggler path.
2025-08-28 11:33:09 +02:00
Miguel 81e5ddec57 Refactor PlotHistoricalSession and TimePointSelector components for improved UI and functionality
- Removed the range display box from PlotHistoricalSession for a cleaner layout.
- Updated TimePointSelector to support fullscreen mode with a more compact design.
- Integrated a Popover for date and time selection in fullscreen mode.
- Enhanced the DataAvailabilityBar and slider functionality for better user experience.
- Added responsive styling adjustments for both normal and fullscreen modes.
- Updated system state with the latest last_update timestamp.
2025-08-27 15:34:01 +02:00
Miguel 61d61d27d1 feat: Enhance Checkbox and Switch widgets for improved layout and error handling 2025-08-27 14:49:43 +02:00
Miguel 42cd1743e8 Enhance alignment and styling for RJSF components
- Updated LayoutObjectFieldTemplate to ensure consistent alignment of grid items with a minimum height and flex properties.
- Improved TooltipFieldTemplate to center-align switch and checkbox widgets, enhancing overall layout consistency.
- Refined CheckboxWidget and SwitchWidget styles for better alignment and text handling, ensuring labels do not overflow and maintain a single line.
2025-08-27 14:45:50 +02:00
Miguel 76c6743537 Add TooltipFieldTemplate for enhanced user experience in forms
- Integrated TooltipFieldTemplate into PlotHistoricalManager, PlotManager, and Dashboard components to provide contextual tooltips for form fields.
- Updated templates in various forms to include the new TooltipFieldTemplate alongside the existing LayoutObjectFieldTemplate.
- Enhanced TooltipFieldTemplate with theme-aware colors and improved styling for better readability.
- Adjusted system state to enable connection and updated the last update timestamp.
2025-08-27 13:04:57 +02:00
Miguel dec3a49836 feat: Enhance application event logging; add tooltips for UI fields and improve PLC configuration descriptions 2025-08-27 12:45:19 +02:00
Miguel cda40ce0ab feat: Update UI schema help texts to descriptions for consistency; add new application event logs and update system state configuration 2025-08-27 12:02:57 +02:00
Miguel 29b6e92284 feat: Enhance get_records_directory function to support optional config_manager for dynamic path retrieval 2025-08-27 10:30:28 +02:00
Miguel 01489aec59 feat: Add Playwright MCP testing suite with various automation scripts
- Implemented test client for Playwright MCP Server in `test-server.js`
- Created global automation script for Playwright MCP-like functionality in `playwright-mcp-global.js`
- Configured Playwright settings in `playwright.config.js`
- Added quick start script for testing setup in `quick-start.sh`
- Developed initial setup script for Playwright MCP configuration in `setup.js`
- Created basic connectivity and configuration tests in `tests/basic.spec.js` and `tests/configuration.spec.js`
- Implemented dashboard and plotting tests in `tests/dashboard.spec.js` and `tests/plotting.spec.js`
- Added data streaming feature tests in `tests/streaming.spec.js`
2025-08-27 10:16:08 +02:00
Miguel 1b6528977a feat: Update PLC configuration to support absolute and relative paths for records and symbols
- Changed records_directory in plc_config.json to an absolute path.
- Enhanced plc.schema.json to allow absolute and relative paths for records_directory and symbols_path with path-browser widget.
- Updated ui schema to reflect changes in records_directory and symbols_path with appropriate help texts.
- Modified ConfigManager to handle symbols_path in PLC configuration updates.
- Added functionality in PLCDataStreamer and schema_manager to manage symbols_path.
- Implemented Load Symbols button in PLCConfigManager and Dashboard components to load symbols from ASC files.
- Created new PathBrowserWidget for browsing files and directories, supporting both absolute and relative paths.
- Added SimpleFilePathWidget for simplified file path selection.
- Introduced DirectoryBrowserWidget for directory selection.
- Updated main.py to handle loading symbols from ASC files and browsing directories.
2025-08-27 09:24:41 +02:00
Miguel c251c76072 Reduce health check interval in InstanceManager to improve responsiveness; adjust font size and line height in ConsoleLogsDisplay for better readability. 2025-08-26 16:54:58 +02:00
Miguel c5cd0494ad Update routing in App component and adjust CORS settings in main.py; add project overview documentation 2025-08-26 11:22:42 +02:00
Miguel 228b0deb24 Improve error handling in PowerShell build script and update icon path in main.py to use resource from public folder. 2025-08-26 10:40:24 +02:00
Miguel ed7ff2d571 Enhance PowerShell build script with improved file handle management and retry logic for compression; add functionality to open destination folder in Explorer after build completion. 2025-08-26 10:09:36 +02:00
Miguel e77a5c3932 Refactor dataset variable schemas and UI handling in Dashboard component for improved clarity and external schema compatibility; streamline variable configuration process. 2025-08-25 18:43:43 +02:00
Miguel 551ec8b4a5 Refactor dataset variable areas to uppercase, update plot definitions and variables, and enhance UI schema for better clarity and consistency
- Changed memory area identifiers in dataset_variables.json and related schemas from lowercase to uppercase (e.g., "db" to "DB").
- Added new plot definition for "CTS306 Conductivimeter" in plot_definitions.json.
- Updated plot_variables.json to include new variables for "HMI_Instrument.QTM306.PVFiltered" and "HMI_Instrument.QTM307.PVFiltered".
- Enhanced dataset-variables.schema.json to enforce required fields based on area and type.
- Improved ui schema for dataset variables to provide clearer guidance on field usage.
- Updated PLC client to utilize new snap7.type module and improved error handling.
- Added support for new data types (DWORD) in PlcDataTypeWidget.
- Updated Dashboard.jsx to reflect changes in memory area identifiers and improve default configurations.
- Upgraded python-snap7 dependency to version 2.0.2 for enhanced functionality.
- Modified system_state.json to reflect changes in connection status and last update timestamp.
- Implemented optimized batch reading logic in optimized_batch_reader.py to support new area mappings.
- Added VSCode configuration files for improved development experience.
- Introduced ConditionalObjectFieldTemplate.jsx for dynamic field visibility based on PLC-specific logic.
2025-08-25 18:02:24 +02:00
Miguel aba83f843a Refactor dataset definitions and variables; update plot configurations and add system tray support
- Updated dataset definitions in `dataset_definitions.json` to change prefix for DAR and removed unused datasets.
- Modified dataset variables in `dataset_variables.json` to update variable names and added a new variable for CTS306_PEW.
- Simplified plot definitions in `plot_definitions.json` by removing old plots and updating the DAR plot configuration.
- Enhanced `main.py` to include system tray functionality using pystray, allowing users to manage the application from the tray.
- Updated `requirements.txt` to include dependencies for system tray support.
- Adjusted `system_state.json` to reflect changes in active datasets and removed references to obsolete datasets.
2025-08-25 16:02:15 +02:00
Miguel 250748446f Enhance PlotHistoricalSession component to update both central time and visible range on pan event; adjust background color opacity for better visibility. Update system state to include 'DAR' dataset and add PlotJuggler path. 2025-08-25 14:39:58 +02:00
Miguel 366cb638e4 Add PowerShell build script for S7 Streamer & Logger with frontend build, conda activation, and compression steps 2025-08-22 18:07:19 +02:00
Miguel cc4888fa18 Refactor disk usage retrieval in PLCDataStreamer for improved Windows compatibility and remove reliance on psutil. Enhance polling mechanism in useCoordinatedConnection to implement exponential backoff on consecutive errors. Update system_state.json to reorder active datasets and adjust last update timestamp. Add comprehensive test_disk_status.py script to validate disk_space functionality via the /api/status endpoint. 2025-08-22 17:39:58 +02:00
Miguel 9dae98bfdc Update plot definitions and frontend configurations for time window adjustments
- Changed the default time window in plot_definitions.json from 37 to 20 seconds.
- Updated the PlotRealtimeSession component to reflect the new default time window of 10 seconds instead of 60 seconds in multiple instances.
- Modified the time window input field to have a placeholder of 10 and adjusted the parsing logic to handle empty values.
- Updated system_state.json to reflect the latest timestamp and reordered active datasets.
- Added application_events.json to log significant application events, including application startup and CSV recording status.
- Created a new system_state.json file to track the last state of the application with relevant flags and timestamps.
2025-08-22 16:50:53 +02:00
Miguel 9bbf299826 fix: Address gap between historical and real-time data in ChartjsPlot
- Updated time_window in plot_definitions.json from 60 to 37 seconds to improve data continuity.
- Compensated for frontend processing delays by adjusting lastPushedX timestamp in ChartjsPlot.jsx.
- Enhanced logging for better visibility into data continuity issues, including filtering and ingestion logs.
- Modified system_state.json to reorder active datasets and updated last_update timestamp.
- Added comprehensive documentation in GAP_FIX_SOLUTION.md detailing the problem, root cause, solution, benefits, and testing procedures.
2025-08-22 16:23:30 +02:00
Miguel aa75a46d84 Enhance disk usage retrieval with multiple fallbacks for Windows compatibility
- Implemented a new method `_get_disk_usage_safe` in `PLCDataStreamer` to safely retrieve disk usage information using `psutil` and `shutil` with fallbacks for different scenarios.
- Updated the disk usage calculation logic to handle potential errors and log warnings when disk usage retrieval fails.
- Modified the `system_state.json` to reorder active datasets and add a new `plotjuggler_path` entry.
- Added a comprehensive test script `test_disk_space.py` to validate the disk space calculation functionality via the API.
2025-08-22 16:04:39 +02:00
Miguel 6302acfc0f Update backend manager and instance management logic
- Modified backend_manager.status to reflect updated timestamps and status.
- Refactored backmanager.py for improved readability and consistency in logging.
- Enhanced instance_manager.py to ensure robust backend instance checks and process management.
- Updated main.py to streamline backend instance verification and improve error handling.
- Adjusted main.spec to consolidate analysis for the main application and backend manager.
- Added a new spec file for comprehensive build configuration.
- Updated system_state.json with new timestamps and dataset order.
- Improved rotating_logger.py to enhance log file cleanup messages.
2025-08-22 15:29:28 +02:00
Miguel 082f8b1790 feat: Implement Backend Manager for PLC S7-315 Streamer Watchdog Service
- Added backmanager.py to monitor backend health and restart if necessary.
- Introduced backend_manager.status to track the state of the backend.
- Updated system_state.json to reflect changes in active datasets.
- Modified rotating_logger.py for improved log messages.
- Enhanced main.spec to support separate executables for main application and backend manager.
- Created backmanager.spec and backmanager_config.json for backend manager configuration.
- Added build_all.bat for streamlined build process.
2025-08-22 14:55:10 +02:00
Miguel ee6918445e feat: Implement robust backend instance management with HTTP health checks and PID verification
- Added InstanceManager class for managing backend instances.
- Introduced double HTTP health checks with configurable intervals.
- Implemented PID-based verification and cleanup of stale processes.
- Enhanced instance initialization and cleanup processes.
- Updated main.py to utilize the new instance management system.
- Modified system_state.json to reflect changes in active datasets and last update timestamp.
2025-08-22 14:13:07 +02:00
Miguel 88a6b805be Refactor: Remove legacy code and tests, update system state configuration
- Deleted legacy route handling in main_cleanup_notes.py.
- Updated system_state.json to reorder active datasets and add PlotJuggler path.
- Removed outdated DB1001 specific value verification test (test_db1001_specific_values.py).
- Removed PlotJuggler path detection test (test_plotjuggler_search.py).
- Removed system_state.json path handling test (test_system_state_paths.py).
- Added new tests for PlotJuggler and system state path handling in .tests directory.
- Introduced a comprehensive user guide for the frontend dashboard tabs in help.md.
2025-08-22 12:42:42 +02:00
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 fce7928a7f Verificacion de Lecturas con Test de sistema Legacy y Optimizado 2025-08-22 11:15:50 +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 a9e4e0d3ae Add comprehensive tests for PE/PA fixed implementation and optimized batch reading
- Introduced `test_optimized_reader.py` to validate the functionality and configuration of `OptimizedBatchReader`.
- Created `test_pe_pa_fixed.py` to test the corrected PE/PA reading functionality using appropriate Snap7 area codes.
- Developed `test_real_plc.py` to assess the performance of optimized batch reading against legacy methods with actual PLC configurations.
- Implemented `test_simple_validation.py` for a final validation of core functionalities, ensuring correct implementation of PE/PA area codes and batch reading.
2025-08-20 00:09:42 +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 bd5b70f044 feat: Update resource path handling for React build directory and clean up main.spec 2025-08-18 00:02:33 +02:00
Miguel 13e7a12b6d Preparacion de PyInstaller 2025-08-17 23:53:58 +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