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.
This commit is contained in:
Miguel 2025-08-22 16:50:53 +02:00
parent 9bbf299826
commit 9dae98bfdc
6 changed files with 1872 additions and 1410 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
"point_radius": 2.5,
"stacked": true,
"stepped": true,
"time_window": 37,
"time_window": 20,
"trigger_enabled": false,
"trigger_on_true": true,
"trigger_variable": null,

View File

@ -0,0 +1,82 @@
{
"events": [
{
"timestamp": "2025-08-22T16:33:02.020381",
"level": "info",
"event_type": "application_started",
"message": "Application initialization completed successfully",
"details": {}
},
{
"timestamp": "2025-08-22T16:36:41.330445",
"level": "info",
"event_type": "udp_streaming_stopped",
"message": "UDP streaming to PlotJuggler stopped (CSV recording continues)",
"details": {}
},
{
"timestamp": "2025-08-22T16:36:41.331526",
"level": "info",
"event_type": "csv_recording_stopped",
"message": "🔥 CRITICAL: CSV recording stopped (dataset threads continue for UDP streaming)",
"details": {
"recording_protection": false,
"performance_monitoring": false
}
},
{
"timestamp": "2025-08-22T16:36:41.331526",
"level": "info",
"event_type": "udp_streaming_stopped",
"message": "UDP streaming to PlotJuggler stopped (CSV recording continues)",
"details": {}
},
{
"timestamp": "2025-08-22T16:36:41.332612",
"level": "info",
"event_type": "plc_disconnection",
"message": "Disconnected from PLC 192.168.1.100 (application shutdown (will auto-reconnect on restart))",
"details": {}
},
{
"timestamp": "2025-08-22T16:36:59.890526",
"level": "info",
"event_type": "application_started",
"message": "Application initialization completed successfully",
"details": {}
},
{
"timestamp": "2025-08-22T16:38:28.043351",
"level": "info",
"event_type": "udp_streaming_stopped",
"message": "UDP streaming to PlotJuggler stopped (CSV recording continues)",
"details": {}
},
{
"timestamp": "2025-08-22T16:38:28.044362",
"level": "info",
"event_type": "csv_recording_stopped",
"message": "🔥 CRITICAL: CSV recording stopped (dataset threads continue for UDP streaming)",
"details": {
"recording_protection": false,
"performance_monitoring": false
}
},
{
"timestamp": "2025-08-22T16:38:28.045373",
"level": "info",
"event_type": "udp_streaming_stopped",
"message": "UDP streaming to PlotJuggler stopped (CSV recording continues)",
"details": {}
},
{
"timestamp": "2025-08-22T16:38:28.045373",
"level": "info",
"event_type": "plc_disconnection",
"message": "Disconnected from PLC 192.168.1.100 (application shutdown (will auto-reconnect on restart))",
"details": {}
}
],
"last_updated": "2025-08-22T16:38:28.045373",
"total_entries": 10
}

View File

@ -72,7 +72,7 @@ export default function PlotRealtimeSession({
const [isRefreshing, setIsRefreshing] = useState(false)
const { isOpen: isFullscreen, onOpen: openFullscreen, onClose: closeFullscreen } = useDisclosure()
const [localConfig, setLocalConfig] = useState({
time_window: plotDefinition.time_window || 60,
time_window: plotDefinition.time_window || 10,
y_min: plotDefinition.y_min,
y_max: plotDefinition.y_max,
trigger_enabled: plotDefinition.trigger_enabled || false,
@ -118,7 +118,7 @@ export default function PlotRealtimeSession({
useEffect(() => {
if (!applyingChangesRef.current) {
setLocalConfig({
time_window: plotDefinition.time_window || 60,
time_window: plotDefinition.time_window || 10,
y_min: plotDefinition.y_min,
y_max: plotDefinition.y_max,
trigger_enabled: plotDefinition.trigger_enabled || false,
@ -216,7 +216,7 @@ export default function PlotRealtimeSession({
browser_tab_id: browserTabId, // Include unique tab identifier
name: plotDefinition.name,
variables: variableNames,
time_window: plotDefinition.time_window || 60,
time_window: plotDefinition.time_window || 10,
trigger_enabled: plotDefinition.trigger_enabled || false,
trigger_variable: plotDefinition.trigger_variable,
trigger_on_true: plotDefinition.trigger_on_true || true,
@ -253,7 +253,7 @@ export default function PlotRealtimeSession({
browser_tab_id: browserTabId, // Include unique tab identifier
name: plotDefinition.name,
variables: plotVariables.map(v => v.variable_name), // Simplified format
time_window: localConfig.time_window,
time_window: localConfig.time_window || 10,
trigger_enabled: localConfig.trigger_enabled,
trigger_variable: localConfig.trigger_variable,
trigger_on_true: localConfig.trigger_on_true,
@ -401,7 +401,7 @@ export default function PlotRealtimeSession({
const resetConfigChanges = () => {
setLocalConfig({
time_window: plotDefinition.time_window || 60,
time_window: plotDefinition.time_window || 10,
y_min: plotDefinition.y_min,
y_max: plotDefinition.y_max,
trigger_enabled: plotDefinition.trigger_enabled || false,
@ -567,16 +567,16 @@ export default function PlotRealtimeSession({
<FormControl>
<FormLabel fontSize="sm">Time Window (seconds)</FormLabel>
<NumberInput
value={localConfig.time_window}
value={localConfig.time_window || ''}
onChange={(valueString) => setLocalConfig(prev => ({
...prev,
time_window: parseInt(valueString) || 60
time_window: valueString === '' ? '' : (parseInt(valueString) || 10)
}))}
min={10}
max={3600}
size="sm"
>
<NumberInputField />
<NumberInputField placeholder="10" />
<NumberInputStepper>
<NumberIncrementStepper />
<NumberDecrementStepper />

View File

@ -0,0 +1,9 @@
{
"last_state": {
"should_connect": false,
"should_stream": false,
"active_datasets": []
},
"auto_recovery_enabled": true,
"last_update": "2025-08-22T16:38:28.045373"
}

View File

@ -3,12 +3,12 @@
"should_connect": true,
"should_stream": false,
"active_datasets": [
"DAR",
"Fast",
"DAR",
"Test"
]
},
"auto_recovery_enabled": true,
"last_update": "2025-08-22T16:17:26.680235",
"last_update": "2025-08-22T16:39:17.693082",
"plotjuggler_path": "C:\\Program Files\\PlotJuggler\\plotjuggler.exe"
}