feat: Add simulation dashboard editor with analyzer and manager components.

This commit is contained in:
2025-12-18 10:08:53 +05:30
parent 97ab47354c
commit 5b9f3f1728
3 changed files with 184 additions and 13 deletions

View File

@@ -426,10 +426,8 @@ function Analyzer() {
// Update historical data
const timestamp = new Date().toISOString();
if (!historicalDataRef.current[vehicle.modelUuid]) {
historicalDataRef.current[vehicle.modelUuid] = [];
}
historicalDataRef.current[vehicle.modelUuid].push({
const currentData = historicalDataRef.current[vehicle.modelUuid] || [];
historicalDataRef.current[vehicle.modelUuid] = [...currentData, {
timestamp,
phase: vehicle.currentPhase,
load: vehicle.currentLoad,
@@ -438,7 +436,7 @@ function Analyzer() {
performance: performance.performanceRate,
speed: vehicle.speed,
tripsCompleted,
});
}].slice(-100);
return {
assetId: vehicle.modelUuid,
@@ -699,10 +697,8 @@ function Analyzer() {
// Update historical data
const timestamp = new Date().toISOString();
if (!historicalDataRef.current[machine.modelUuid]) {
historicalDataRef.current[machine.modelUuid] = [];
}
historicalDataRef.current[machine.modelUuid].push({
const currentData = historicalDataRef.current[machine.modelUuid] || [];
historicalDataRef.current[machine.modelUuid] = [...currentData, {
timestamp,
processTime: actualProcessTime,
partsProcessed,
@@ -710,7 +706,7 @@ function Analyzer() {
state: machine.state,
defectRate,
performance: performance.performanceRate,
});
}].slice(-100);
return {
assetId: machine.modelUuid,
@@ -1340,9 +1336,9 @@ function Analyzer() {
const averageResidenceTime =
materialHistoryRef.current.length > 0
? materialHistoryRef.current.reduce((sum, entry) => {
const residenceTime = new Date(entry.removedAt).getTime() - (entry.material.startTime || 0);
return sum + (residenceTime || 0);
}, 0) / materialHistoryRef.current.length
const residenceTime = new Date(entry.removedAt).getTime() - (entry.material.startTime || 0);
return sum + (residenceTime || 0);
}, 0) / materialHistoryRef.current.length
: 0;
// Bottleneck Identification