From bb275dd279c0b58ded1c70d656ebd9b961ddfb7f Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 13 Aug 2025 23:42:34 +0200 Subject: [PATCH] Update application event logging and dataset variable configurations. Removed obsolete PLC connection event, added new application start event, and refined variable definitions for clarity and consistency. --- application_events.json | 20 +++---- config/data/dataset_variables.json | 22 +++---- frontend/src/pages/DashboardNew.jsx | 91 ++++++----------------------- 3 files changed, 36 insertions(+), 97 deletions(-) diff --git a/application_events.json b/application_events.json index 7031b76..14e743d 100644 --- a/application_events.json +++ b/application_events.json @@ -1,16 +1,5 @@ { "events": [ - { - "timestamp": "2025-07-17T15:42:38.052471", - "level": "info", - "event_type": "plc_connection", - "message": "Successfully connected to PLC 10.1.33.11", - "details": { - "ip": "10.1.33.11", - "rack": 0, - "slot": 2 - } - }, { "timestamp": "2025-07-17T15:42:38.053687", "level": "info", @@ -10474,8 +10463,15 @@ "event_type": "application_started", "message": "Application initialization completed successfully", "details": {} + }, + { + "timestamp": "2025-08-13T23:35:44.039580", + "level": "info", + "event_type": "application_started", + "message": "Application initialization completed successfully", + "details": {} } ], - "last_updated": "2025-08-13T23:30:43.779703", + "last_updated": "2025-08-13T23:35:44.039580", "total_entries": 1000 } \ No newline at end of file diff --git a/config/data/dataset_variables.json b/config/data/dataset_variables.json index 3691e38..1106d75 100644 --- a/config/data/dataset_variables.json +++ b/config/data/dataset_variables.json @@ -4,28 +4,28 @@ "dataset_id": "DAR", "variables": [ { + "area": "db", + "db": 1011, "name": "UR29_Brix", - "area": "db", - "db": 1011, "offset": 1322, - "type": "real", - "streaming": true + "streaming": true, + "type": "real" }, { + "area": "db", + "db": 1011, "name": "UR29_ma", - "area": "db", - "db": 1011, "offset": 1296, - "type": "real", - "streaming": true + "streaming": true, + "type": "real" }, { - "name": "fUR29_Brix", "area": "db", "db": 1011, + "name": "fUR29_Brix", "offset": 1322, - "type": "real", - "streaming": true + "streaming": true, + "type": "real" } ] }, diff --git a/frontend/src/pages/DashboardNew.jsx b/frontend/src/pages/DashboardNew.jsx index 32c38c1..46e0d96 100644 --- a/frontend/src/pages/DashboardNew.jsx +++ b/frontend/src/pages/DashboardNew.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react' +import React, { useState, useEffect, useRef, useCallback } from 'react' import { Box, Container, @@ -14,17 +14,11 @@ import { CardHeader, Button, Text, - Grid, Flex, Spacer, HStack, useColorModeValue, useToast, - Accordion, - AccordionItem, - AccordionButton, - AccordionPanel, - AccordionIcon, Alert, AlertIcon, Spinner, @@ -52,7 +46,7 @@ import allWidgets from '../components/widgets/AllWidgets' import LayoutObjectFieldTemplate from '../components/rjsf/LayoutObjectFieldTemplate' import * as api from '../services/api' -// Pure RJSF StatusBar Component +// StatusBar Component - Real-time PLC status with action buttons function StatusBar({ status, onRefresh }) { const plcConnected = !!status?.plc_connected const streaming = !!status?.streaming @@ -255,7 +249,7 @@ function StatusBar({ status, onRefresh }) { ) } -// Pure RJSF Configuration Panel with Full UI Schema Layout Support +// PLC Configuration Panel - Fixed to PLC & UDP settings only function ConfigurationPanel({ schemaData, formData, onFormChange, onSave, saving, message }) { const cardBg = useColorModeValue('white', 'gray.700') const borderColor = useColorModeValue('gray.200', 'gray.600') @@ -316,7 +310,7 @@ function ConfigurationPanel({ schemaData, formData, onFormChange, onSave, saving ) } -// Pure RJSF Dataset Manager +// Dataset Manager - Type 3 Form Pattern implementation function DatasetManager() { const [datasetsConfig, setDatasetsConfig] = useState(null) const [variablesConfig, setVariablesConfig] = useState(null) @@ -395,7 +389,7 @@ function DatasetManager() { } } - // Get filtered variables for selected dataset (Type 3 Form Pattern) + // Get filtered variables for selected dataset const getSelectedDatasetVariables = () => { if (!variablesConfig?.variables || !selectedDatasetId) { return { variables: [] } @@ -405,7 +399,7 @@ function DatasetManager() { return datasetVars || { variables: [] } } - // Update variables for selected dataset (Type 3 Form Pattern) + // Update variables for selected dataset const updateSelectedDatasetVariables = (newVariableData) => { if (!variablesConfig?.variables || !selectedDatasetId) return @@ -499,12 +493,12 @@ function DatasetManager() { - {/* Type 3 Form: Filtered Array Forms with Combo Selectors */} + {/* Dataset Variables Configuration with Combo Selector */} Dataset Variables Configuration - Type 3 Form: Select a dataset, then configure its variables (combo + filtered form pattern) + Select a dataset, then configure its PLC variables and streaming settings @@ -512,7 +506,7 @@ function DatasetManager() { - 🎯 Step 1: Select Dataset + 🎯 Select Dataset