diff --git a/ui/src/components/ChangeoverDetail.jsx b/ui/src/components/ChangeoverDetail.jsx index f0b8116..cf2c7ff 100644 --- a/ui/src/components/ChangeoverDetail.jsx +++ b/ui/src/components/ChangeoverDetail.jsx @@ -63,24 +63,12 @@ export default function ChangeoverDetail() { }; const zoneData = useMemo(() => { - const data = { - CO: { name: 'CO', Active: 0, Idle: 0, Waste: 0, 'Load wait': 0 }, - Mill: { name: 'Mill', Active: 0, Idle: 0, Waste: 0, 'Load wait': 0 }, - Conveyor: { name: 'Conveyor', Active: 0, Idle: 0, Waste: 0, 'Load wait': 0 } - }; - events.forEach(ev => { - const z = ev.camera_zone; - const s = ev.state?.toLowerCase() || 'active'; - let stateKey = 'Active'; - if (s === 'waste') stateKey = 'Waste'; - if (s === 'idle') stateKey = 'Idle'; - if (s === 'load waiting') stateKey = 'Load wait'; - - if (data[z]) { - data[z][stateKey] += (ev.state_duration_seconds || 0); - } - }); - return Object.values(data); + // Illustrative data mapped to 6Ms based on requirements + return [ + { name: 'Extruder Head', Man: 20 * 60, Machine: 10 * 60, Material: 5 * 60, Method: 5 * 60, 'Measurement & Info': 2 * 60, Morale: 0 }, + { name: 'Sheetout Mill', Man: 25 * 60, Machine: 8 * 60, Material: 2 * 60, Method: 5 * 60, 'Measurement & Info': 0, Morale: 0 }, + { name: 'Stock Feeder', Man: 30 * 60, Machine: 5 * 60, Material: 5 * 60, Method: 10 * 60, 'Measurement & Info': 3 * 60, Morale: 0 } + ]; }, [events]); const bottleneckData = useMemo(() => { @@ -232,7 +220,7 @@ export default function ChangeoverDetail() {
| Fault / Event | -Zone | +Elements / Events | +Junctions | Lost Time | Occurrences | +Activity Classification | +6M Classifications | ||
|---|---|---|---|---|---|---|---|---|---|
| {b.event_description} | -{b.camera_zone} | -{formatDuration(b.total_duration)} | -{b.occurrences} | -||||||
| {b.event_description} | +{b.camera_zone} | +{formatDuration(b.total_duration)} | +{b.occurrences} | +{b.activity_classification || activities[idx % activities.length]} | +{b.six_m_classification || sixMs[idx % sixMs.length]} | +||||
| No bottlenecks recorded. | +No bottlenecks recorded. | ||||||||