/** * CV Inspection Overlay — industrial camera monitor style panel. * Shows detection, measurement, and classification data. */ import type { InspectionData } from '../domain/inspectionViewModel'; interface CVInspectionOverlayProps { data: InspectionData; } const SHAPE_ICONS: Record = { box: '▭', cylinder: '⬤', round: '◯', irregular: '◇', unknown: '?', }; export default function CVInspectionOverlay({ data }: CVInspectionOverlayProps) { if (!data.visible) return null; const { phaseLabel, itemTitle, shape, dimensions, roundness, confidence, isLowConfidence, category, command, warning, dimensionsFail, roundnessFail, cPriority, } = data; const confidencePercent = Math.round(confidence * 100); const roundnessPercent = Math.round(roundness * 100); const categoryColors: Record = { B: '#22c55e', C: '#f97316', D: '#8b5cf6', }; return (
📷 CV INSPECTION {phaseLabel}
ITEM {itemTitle}
SHAPE {SHAPE_ICONS[shape]} {shape}
SIZE {dimensions.width} × {dimensions.depth} × {dimensions.height} mm
ROUNDNESS K = {(roundness).toFixed(2)} ({roundnessPercent}%) {roundnessFail && ⚠ ≥0.7}
CONFIDENCE {confidencePercent}% {isLowConfidence && ⚠ LOW}
{category && (
CLASS {category} {cPriority && (C priority)}
)}
CMD {command}
{warning && (
⚠ {warning}
)}
● LIVE 60 FPS
); }