diff --git a/application_events.json b/application_events.json
index b8703b0..ad23ecb 100644
--- a/application_events.json
+++ b/application_events.json
@@ -3726,8 +3726,210 @@
"trigger_variable": null,
"auto_started": true
}
+ },
+ {
+ "timestamp": "2025-08-15T00:22:03.893270",
+ "level": "info",
+ "event_type": "application_started",
+ "message": "Application initialization completed successfully",
+ "details": {}
+ },
+ {
+ "timestamp": "2025-08-15T00:22:03.973434",
+ "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-15T00:22:03.978435",
+ "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-15T00:22:03.984513",
+ "level": "info",
+ "event_type": "csv_recording_started",
+ "message": "CSV recording started: 2 datasets activated",
+ "details": {
+ "activated_datasets": 2,
+ "total_datasets": 3
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:22:03.990721",
+ "level": "info",
+ "event_type": "udp_streaming_started",
+ "message": "UDP streaming to PlotJuggler started",
+ "details": {
+ "udp_host": "127.0.0.1",
+ "udp_port": 9870,
+ "datasets_available": 3
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:22:53.358065",
+ "level": "info",
+ "event_type": "plot_session_created",
+ "message": "Plot session 'UR29' created and started",
+ "details": {
+ "session_id": "plot_1",
+ "variables": [
+ "UR29_Brix",
+ "UR29_ma",
+ "AUX Blink_1.0S"
+ ],
+ "time_window": 20,
+ "trigger_variable": null,
+ "auto_started": true
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:23:20.844836",
+ "level": "info",
+ "event_type": "plot_session_created",
+ "message": "Plot session 'UR29' created and started",
+ "details": {
+ "session_id": "plot_1",
+ "variables": [
+ "UR29_Brix",
+ "UR29_ma",
+ "AUX Blink_1.0S"
+ ],
+ "time_window": 20,
+ "trigger_variable": null,
+ "auto_started": true
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:23:59.638322",
+ "level": "info",
+ "event_type": "udp_streaming_stopped",
+ "message": "UDP streaming to PlotJuggler stopped (CSV recording continues)",
+ "details": {}
+ },
+ {
+ "timestamp": "2025-08-15T00:24:35.808418",
+ "level": "info",
+ "event_type": "plot_session_created",
+ "message": "Plot session 'UR29' created and started",
+ "details": {
+ "session_id": "plot_1",
+ "variables": [
+ "UR29_Brix",
+ "UR29_ma",
+ "AUX Blink_1.0S"
+ ],
+ "time_window": 20,
+ "trigger_variable": null,
+ "auto_started": true
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:26:15.271771",
+ "level": "info",
+ "event_type": "application_started",
+ "message": "Application initialization completed successfully",
+ "details": {}
+ },
+ {
+ "timestamp": "2025-08-15T00:26:15.365923",
+ "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-15T00:26:15.372925",
+ "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-15T00:26:15.377433",
+ "level": "info",
+ "event_type": "csv_recording_started",
+ "message": "CSV recording started: 2 datasets activated",
+ "details": {
+ "activated_datasets": 2,
+ "total_datasets": 3
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:26:31.108086",
+ "level": "info",
+ "event_type": "plot_session_created",
+ "message": "Plot session 'UR29' created and started",
+ "details": {
+ "session_id": "plot_1",
+ "variables": [
+ "UR29_Brix",
+ "UR29_ma",
+ "AUX Blink_1.0S"
+ ],
+ "time_window": 20,
+ "trigger_variable": null,
+ "auto_started": true
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:27:24.396654",
+ "level": "info",
+ "event_type": "plot_session_created",
+ "message": "Plot session 'UR29' created and started",
+ "details": {
+ "session_id": "plot_1",
+ "variables": [
+ "UR29_Brix",
+ "UR29_ma",
+ "AUX Blink_1.0S"
+ ],
+ "time_window": 20,
+ "trigger_variable": null,
+ "auto_started": true
+ }
+ },
+ {
+ "timestamp": "2025-08-15T00:27:40.211134",
+ "level": "info",
+ "event_type": "plot_session_created",
+ "message": "Plot session 'UR29' created and started",
+ "details": {
+ "session_id": "plot_1",
+ "variables": [
+ "UR29_Brix",
+ "UR29_ma",
+ "AUX Blink_1.0S"
+ ],
+ "time_window": 500,
+ "trigger_variable": null,
+ "auto_started": true
+ }
}
],
- "last_updated": "2025-08-15T00:17:19.296417",
- "total_entries": 344
+ "last_updated": "2025-08-15T00:27:40.211134",
+ "total_entries": 360
}
\ No newline at end of file
diff --git a/config/data/plot_definitions.json b/config/data/plot_definitions.json
index b3bca0c..65b829e 100644
--- a/config/data/plot_definitions.json
+++ b/config/data/plot_definitions.json
@@ -7,7 +7,7 @@
"point_hover_radius": 4,
"point_radius": 0,
"stepped": false,
- "time_window": 20,
+ "time_window": 500,
"trigger_enabled": false,
"trigger_on_true": true,
"trigger_variable": null,
diff --git a/frontend/src/components/ChartjsPlot.jsx b/frontend/src/components/ChartjsPlot.jsx
index 50b7544..390c943 100644
--- a/frontend/src/components/ChartjsPlot.jsx
+++ b/frontend/src/components/ChartjsPlot.jsx
@@ -146,6 +146,7 @@ const ChartjsPlot = ({ session, height = '400px' }) => {
const loadHistoricalData = useCallback(async (variables, timeWindow) => {
try {
console.log(`π Loading historical data for ${variables.length} variables (${timeWindow}s window)...`);
+ setIsLoadingHistorical(true);
const response = await fetch('/api/plots/historical', {
method: 'POST',
@@ -160,15 +161,41 @@ const ChartjsPlot = ({ session, height = '400px' }) => {
});
if (!response.ok) {
- throw new Error(`HTTP ${response.status}`);
+ const errorData = await response.json();
+ throw new Error(`HTTP ${response.status}: ${errorData.error || 'Unknown error'}`);
}
const data = await response.json();
- console.log(`π Historical data response:`, data);
+ console.log(`π Historical data loaded:`, {
+ totalPoints: data.total_points || 0,
+ variablesFound: data.variables_found || [],
+ variablesRequested: variables,
+ timeRange: data.time_range,
+ dataPreview: data.data?.slice(0, 3) // Show first 3 points
+ });
+
+ // Show summary in console for debugging
+ if (data.data && data.data.length > 0) {
+ const variableStats = {};
+ data.data.forEach(point => {
+ if (!variableStats[point.variable]) {
+ variableStats[point.variable] = { count: 0, min: point.value, max: point.value };
+ }
+ variableStats[point.variable].count++;
+ variableStats[point.variable].min = Math.min(variableStats[point.variable].min, point.value);
+ variableStats[point.variable].max = Math.max(variableStats[point.variable].max, point.value);
+ });
+ console.log(`π Variable statistics:`, variableStats);
+ }
+
return data.data || [];
} catch (error) {
console.warn('β οΈ Failed to load historical data:', error);
+ // Set error state to show user
+ setError(`Historical data loading failed: ${error.message}`);
return [];
+ } finally {
+ setIsLoadingHistorical(false);
}
}, []);
@@ -1276,6 +1303,42 @@ const ChartjsPlot = ({ session, height = '400px' }) => {
borderColor="gray.200"
position="relative"
>
+ {/* Historical data loading indicator */}
+ {isLoadingHistorical && (
+
+ π Loading historical data...
+
+ )}
+
+ {/* Data points counter */}
+ {dataPointsCount > 0 && (
+
+ π {dataPointsCount} points
+
+ )}
+