diff --git a/application_events.json b/application_events.json index f38bb17..8f1cf8f 100644 --- a/application_events.json +++ b/application_events.json @@ -7425,8 +7425,144 @@ "trigger_variable": null, "auto_started": true } + }, + { + "timestamp": "2025-08-15T19:41:15.511230", + "level": "info", + "event_type": "plot_session_created", + "message": "Plot session 'UR29' created and started", + "details": { + "session_id": "plot_1_1755279675511_3", + "variables": [ + "UR29_Brix", + "UR29_ma", + "AUX Blink_1.0S", + "AUX Blink_1.6S" + ], + "time_window": 36, + "trigger_variable": null, + "auto_started": true + } + }, + { + "timestamp": "2025-08-15T19:41:35.767669", + "level": "info", + "event_type": "plot_session_created", + "message": "Plot session 'UR29' created and started", + "details": { + "session_id": "plot_1_1755279695767_4", + "variables": [ + "UR29_Brix", + "UR29_ma", + "AUX Blink_1.0S", + "AUX Blink_1.6S" + ], + "time_window": 36, + "trigger_variable": null, + "auto_started": true + } + }, + { + "timestamp": "2025-08-15T19:41:38.863722", + "level": "info", + "event_type": "plot_session_created", + "message": "Plot session 'UR29' created and started", + "details": { + "session_id": "plot_1_1755279698863_5", + "variables": [ + "UR29_Brix", + "UR29_ma", + "AUX Blink_1.0S", + "AUX Blink_1.6S" + ], + "time_window": 36, + "trigger_variable": null, + "auto_started": true + } + }, + { + "timestamp": "2025-08-15T19:49:54.180453", + "level": "info", + "event_type": "application_started", + "message": "Application initialization completed successfully", + "details": {} + }, + { + "timestamp": "2025-08-15T19:49:54.228721", + "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-15T19:49:54.237641", + "level": "info", + "event_type": "dataset_activated", + "message": "Dataset activated: Fast", + "details": { + "dataset_id": "Fast", + "variables_count": 2, + "streaming_count": 1, + "prefix": "fast" + } + }, + { + "timestamp": "2025-08-15T19:49:54.247238", + "level": "info", + "event_type": "csv_recording_started", + "message": "CSV recording started: 2 datasets activated", + "details": { + "activated_datasets": 2, + "total_datasets": 3 + } + }, + { + "timestamp": "2025-08-15T19:53:52.531913", + "level": "info", + "event_type": "application_started", + "message": "Application initialization completed successfully", + "details": {} + }, + { + "timestamp": "2025-08-15T19:53:52.582271", + "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-15T19:53:52.590457", + "level": "info", + "event_type": "dataset_activated", + "message": "Dataset activated: Fast", + "details": { + "dataset_id": "Fast", + "variables_count": 2, + "streaming_count": 1, + "prefix": "fast" + } + }, + { + "timestamp": "2025-08-15T19:53:52.599789", + "level": "info", + "event_type": "csv_recording_started", + "message": "CSV recording started: 2 datasets activated", + "details": { + "activated_datasets": 2, + "total_datasets": 3 + } } ], - "last_updated": "2025-08-15T19:40:55.642005", - "total_entries": 605 + "last_updated": "2025-08-15T19:53:52.599789", + "total_entries": 616 } \ No newline at end of file diff --git a/config/data/plot_definitions.json b/config/data/plot_definitions.json index d95b8e6..862cd9c 100644 --- a/config/data/plot_definitions.json +++ b/config/data/plot_definitions.json @@ -6,7 +6,7 @@ "name": "UR29", "point_hover_radius": 4, "point_radius": 2.5, - "stacked": false, + "stacked": true, "stepped": true, "time_window": 36, "trigger_enabled": false, diff --git a/config/schema/ui/dataset-definitions.uischema.json b/config/schema/ui/dataset-definitions.uischema.json index 8b2d72d..d932de3 100644 --- a/config/schema/ui/dataset-definitions.uischema.json +++ b/config/schema/ui/dataset-definitions.uischema.json @@ -31,7 +31,7 @@ }, "enabled": { "ui:help": "When enabled, this dataset will be actively sampled and recorded", - "ui:widget": "checkbox" + "ui:widget": "switch" }, "sampling_interval": { "ui:help": "Custom sampling interval in seconds (0.01–10). Leave empty to use the global PLC sampling interval.", diff --git a/config/schema/ui/dataset-variables.uischema.json b/config/schema/ui/dataset-variables.uischema.json index 24832ee..1361b6c 100644 --- a/config/schema/ui/dataset-variables.uischema.json +++ b/config/schema/ui/dataset-variables.uischema.json @@ -187,7 +187,7 @@ } }, "streaming": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "📡 Enable real-time streaming to PlotJuggler for visualization" } }, @@ -229,7 +229,7 @@ "ui:help": "🔍 Search and select a symbol from the loaded ASC file" }, "streaming": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "📡 Enable real-time streaming to PlotJuggler for visualization" } } diff --git a/config/schema/ui/plc.uischema.json b/config/schema/ui/plc.uischema.json index 3273ff0..20a7d8b 100644 --- a/config/schema/ui/plc.uischema.json +++ b/config/schema/ui/plc.uischema.json @@ -18,7 +18,7 @@ }, "rotation_enabled": { "ui:column": 3, - "ui:widget": "checkbox" + "ui:widget": "switch" }, "ui:order": [ "max_days", diff --git a/config/schema/ui/plot-definitions.uischema.json b/config/schema/ui/plot-definitions.uischema.json index f6047ea..7ce5334 100644 --- a/config/schema/ui/plot-definitions.uischema.json +++ b/config/schema/ui/plot-definitions.uischema.json @@ -118,11 +118,11 @@ "ui:help": "🎯 Variable name to use as trigger (optional)" }, "trigger_enabled": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "✅ Enable trigger-based recording" }, "trigger_on_true": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "🔄 Trigger when variable becomes true (vs false)" }, "line_tension": { @@ -130,11 +130,11 @@ "ui:help": "📈 Line smoothness: 0=straight lines, 0.4=smooth curves" }, "stepped": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "📊 Enable stepped line style instead of curves" }, "stacked": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "📚 Enable stacked Y-axes for multi-axis visualization" }, "point_radius": { diff --git a/config/schema/ui/plot-variables.uischema.json b/config/schema/ui/plot-variables.uischema.json index dc7fd6e..4608663 100644 --- a/config/schema/ui/plot-variables.uischema.json +++ b/config/schema/ui/plot-variables.uischema.json @@ -101,7 +101,7 @@ "ui:help": "📊 Which Y-axis to use for this variable (left or right)" }, "enabled": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "📊 Enable this variable to be displayed in the real-time plot" } } diff --git a/frontend/src/components/rjsf/widgets.jsx b/frontend/src/components/rjsf/widgets.jsx index 3c46af4..67e574c 100644 --- a/frontend/src/components/rjsf/widgets.jsx +++ b/frontend/src/components/rjsf/widgets.jsx @@ -1,6 +1,6 @@ import React from 'react' import { - FormControl, FormLabel, FormHelperText, Input, Textarea, Select, Checkbox, + FormControl, FormLabel, FormHelperText, Input, Textarea, Select, Checkbox, Switch, NumberInput, NumberInputField, NumberInputStepper, NumberIncrementStepper, NumberDecrementStepper, useColorModeValue } from '@chakra-ui/react' @@ -147,12 +147,30 @@ export const CheckboxWidget = ({ id, label, value, required, disabled, readonly, ) +export const SwitchWidget = ({ id, label, value, required, disabled, readonly, onChange, rawErrors = [] }) => ( + 0}> + + {label} + + onChange(e.target.checked)} + colorScheme="blue" + /> + {rawErrors.length > 0 && ( + {rawErrors[0]} + )} + +) + // Map keys must match RJSF default widget names to override them automatically by type export const widgets = { TextWidget, UpDownWidget, SelectWidget, CheckboxWidget, + SwitchWidget, TextareaWidget, // Custom PLC widgets PlcAreaWidget, diff --git a/frontend/src/components/widgets/AllWidgets.jsx b/frontend/src/components/widgets/AllWidgets.jsx index 27ea409..af3e0ce 100644 --- a/frontend/src/components/widgets/AllWidgets.jsx +++ b/frontend/src/components/widgets/AllWidgets.jsx @@ -20,6 +20,7 @@ export const allWidgets = { textarea: widgets.TextareaWidget, select: widgets.SelectWidget, checkbox: widgets.CheckboxWidget, + switch: widgets.SwitchWidget, // Variable selector aliases - use the advanced version with search and metadata variableSelector: VariableSelectorWidget, diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 0d1f537..bffc438 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -901,7 +901,7 @@ function DatasetManager() { "ui:help": "PLC data type" }, "streaming": { - "ui:widget": "checkbox", + "ui:widget": "switch", "ui:help": "Enable UDP streaming to PlotJuggler" } } diff --git a/system_state.json b/system_state.json index da9fe66..1caccae 100644 --- a/system_state.json +++ b/system_state.json @@ -3,11 +3,11 @@ "should_connect": true, "should_stream": false, "active_datasets": [ - "Fast", "DAR", - "Test" + "Test", + "Fast" ] }, "auto_recovery_enabled": true, - "last_update": "2025-08-15T19:35:23.650095" + "last_update": "2025-08-15T19:53:52.606916" } \ No newline at end of file