diff --git a/application_events.json b/application_events.json index 92ed735..8def7c1 100644 --- a/application_events.json +++ b/application_events.json @@ -450,8 +450,44 @@ "trigger_variable": null, "auto_started": true } + }, + { + "timestamp": "2025-08-14T13:26:50.126159", + "level": "info", + "event_type": "application_started", + "message": "Application initialization completed successfully", + "details": {} + }, + { + "timestamp": "2025-08-14T13:26:50.175938", + "level": "info", + "event_type": "dataset_activated", + "message": "Dataset activated: DAR", + "details": { + "dataset_id": "DAR", + "variables_count": 2, + "streaming_count": 2, + "prefix": "gateway_phoenix" + } + }, + { + "timestamp": "2025-08-14T13:26:50.178048", + "level": "info", + "event_type": "csv_recording_started", + "message": "CSV recording started: 1 datasets activated", + "details": { + "activated_datasets": 1, + "total_datasets": 3 + } + }, + { + "timestamp": "2025-08-14T13:26:50.239908", + "level": "error", + "event_type": "csv_cleanup_failed", + "message": "CSV cleanup failed: 'max_hours'", + "details": {} } ], - "last_updated": "2025-08-14T13:10:18.671577", - "total_entries": 41 + "last_updated": "2025-08-14T13:26:50.239908", + "total_entries": 45 } \ No newline at end of file diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 78fc3bc..bcd7a01 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -2,12 +2,7 @@ import React from 'react' import recLogo from './assets/logo/record.png' import { Routes, Route, Link } from 'react-router-dom' import { Box, Container, Flex, HStack, Select, Button, Heading, Text, useColorMode, useColorModeValue, Stack } from '@chakra-ui/react' -import EventsPage from './pages/Events.jsx' -import ConfigPage from './pages/Config.jsx' -import PlotsPage from './pages/Plots.jsx' -import PLCConfigModal from './components/PLCConfigModal.jsx' import DashboardPage from './pages/DashboardNew.jsx' -import DatasetManager from './components/DatasetManager.jsx' function Home() { return ( @@ -85,10 +80,6 @@ function NavBar() { PLC Streamer - - - - @@ -104,10 +95,7 @@ function App() { } /> - } /> - } /> - } /> - } /> + } /> ) diff --git a/frontend/src/pages/DashboardNew.jsx b/frontend/src/pages/DashboardNew.jsx index 271849e..f9ca69a 100644 --- a/frontend/src/pages/DashboardNew.jsx +++ b/frontend/src/pages/DashboardNew.jsx @@ -4,11 +4,6 @@ import { Container, VStack, Heading, - Tabs, - TabList, - TabPanels, - Tab, - TabPanel, Card, CardBody, CardHeader, @@ -455,188 +450,176 @@ function DatasetManager() { - - - 📋 Dataset Definitions - ⚙️ Dataset Variables - + {/* Dataset Definitions Section */} + {datasetsSchemaData?.schema && datasetsConfig && ( + + + 📋 Dataset Metadata Configuration + + Configure dataset names, prefixes, sampling intervals and enable/disable datasets + + + +
saveDatasets(formData)} + onChange={({ formData }) => setDatasetsConfig(formData)} + > + + + + +
+
+
+ )} - - - {datasetsSchemaData?.schema && datasetsConfig && ( - - - Dataset Metadata Configuration - - Configure dataset names, prefixes, sampling intervals and enable/disable datasets - - - -
saveDatasets(formData)} - onChange={({ formData }) => setDatasetsConfig(formData)} - > - - - - -
-
-
- )} -
- - - {/* Dataset Variables Configuration with Combo Selector */} - - - Dataset Variables Configuration - - Select a dataset, then configure its PLC variables and streaming settings + {/* Dataset Variables Configuration Section */} + + + ⚙️ Dataset Variables Configuration + + Select a dataset, then configure its PLC variables and streaming settings + + + + {/* Step 1: Dataset Selector (Combo) */} + + + + 🎯 Select Dataset + + + {availableDatasets.length === 0 && ( + + ⚠️ No datasets available. Configure datasets first in the "Dataset Definitions" section above. - - - {/* Step 1: Dataset Selector (Combo) */} - - - - 🎯 Select Dataset - - - {availableDatasets.length === 0 && ( - - ⚠️ No datasets available. Configure datasets first in the "Dataset Definitions" tab. - - )} - + )} + - {/* Variables Configuration Form */} - {selectedDatasetId && ( - - - - ⚙️ Configure Variables for Dataset "{selectedDatasetId}" - - - {/* Simplified schema for selected dataset variables */} - {(() => { - const selectedDatasetVars = getSelectedDatasetVariables() - - // Schema for this dataset's variables - const singleDatasetSchema = { + {/* Variables Configuration Form */} + {selectedDatasetId && ( + + + + ⚙️ Configure Variables for Dataset "{selectedDatasetId}" + + + {/* Simplified schema for selected dataset variables */} + {(() => { + const selectedDatasetVars = getSelectedDatasetVariables() + + // Schema for this dataset's variables + const singleDatasetSchema = { + type: "object", + properties: { + variables: { + type: "array", + title: "Variables", + description: `PLC variables to record in dataset ${selectedDatasetId}`, + items: { type: "object", properties: { - variables: { - type: "array", - title: "Variables", - description: `PLC variables to record in dataset ${selectedDatasetId}`, - items: { - type: "object", - properties: { - name: { type: "string", title: "Variable Name" }, - area: { - type: "string", - title: "Memory Area", - enum: ["db", "mw", "m", "pew", "pe", "paw", "pa", "e", "a", "mb"], - default: "db" - }, - db: { type: "integer", title: "DB Number", minimum: 1, maximum: 9999 }, - offset: { type: "integer", title: "Offset", minimum: 0, maximum: 8191 }, - bit: { type: "integer", title: "Bit Position", minimum: 0, maximum: 7 }, - type: { - type: "string", - title: "Data Type", - enum: ["real", "int", "dint", "bool", "word", "byte"], - default: "real" - }, - streaming: { type: "boolean", title: "Stream to UDP", default: false } - }, - required: ["name", "area", "offset", "type"] - } - } - } + name: { type: "string", title: "Variable Name" }, + area: { + type: "string", + title: "Memory Area", + enum: ["db", "mw", "m", "pew", "pe", "paw", "pa", "e", "a", "mb"], + default: "db" + }, + db: { type: "integer", title: "DB Number", minimum: 1, maximum: 9999 }, + offset: { type: "integer", title: "Offset", minimum: 0, maximum: 8191 }, + bit: { type: "integer", title: "Bit Position", minimum: 0, maximum: 7 }, + type: { + type: "string", + title: "Data Type", + enum: ["real", "int", "dint", "bool", "word", "byte"], + default: "real" + }, + streaming: { type: "boolean", title: "Stream to UDP", default: false } + }, + required: ["name", "area", "offset", "type"] } + } + } + } - const singleDatasetUiSchema = { - variables: { - items: { - "ui:layout": [[ - { "name": "name", "width": 3 }, - { "name": "area", "width": 2 }, - { "name": "db", "width": 1 }, - { "name": "offset", "width": 2 }, - { "name": "type", "width": 2 }, - { "name": "streaming", "width": 2 } - ]] - } - } - } + const singleDatasetUiSchema = { + variables: { + items: { + "ui:layout": [[ + { "name": "name", "width": 3 }, + { "name": "area", "width": 2 }, + { "name": "db", "width": 1 }, + { "name": "offset", "width": 2 }, + { "name": "type", "width": 2 }, + { "name": "streaming", "width": 2 } + ]] + } + } + } - return ( -
{ - updateSelectedDatasetVariables(formData) - saveVariables(variablesConfig).then(() => { - // Additional trigger after successful save - triggerVariableRefresh() - }) - }} - onChange={({ formData }) => updateSelectedDatasetVariables(formData)} - > - - - - -
- ) - })()} -
- )} + return ( +
{ + updateSelectedDatasetVariables(formData) + saveVariables(variablesConfig).then(() => { + // Additional trigger after successful save + triggerVariableRefresh() + }) + }} + onChange={({ formData }) => updateSelectedDatasetVariables(formData)} + > + + + + +
+ ) + })()} +
+ )} - {!selectedDatasetId && availableDatasets.length > 0 && ( - - - 👆 Select a dataset above to configure its variables - - - )} -
-
-
-
-
-
+ {!selectedDatasetId && availableDatasets.length > 0 && ( + + + 👆 Select a dataset above to configure its variables + + + )} + + + ) } @@ -853,43 +836,28 @@ function DashboardContent() { - - - 🔧 Configuration - 📊 Datasets - 📈 Plotting - 📋 Events - + {/* Configuration Panel */} + - - - - + {/* Dataset Management */} + - - - + {/* Plot Management */} + - - - - - - - - - + {/* Events Display */} + ) diff --git a/system_state.json b/system_state.json index 6f26a4d..56deda7 100644 --- a/system_state.json +++ b/system_state.json @@ -4,10 +4,10 @@ "should_stream": false, "active_datasets": [ "DAR", - "Test", - "Fast" + "Fast", + "Test" ] }, "auto_recovery_enabled": true, - "last_update": "2025-08-14T13:09:58.767138" + "last_update": "2025-08-14T13:26:50.179055" } \ No newline at end of file