material cycle time calculated

This commit is contained in:
Gomathi 2025-06-10 15:03:57 +05:30
parent 365d096d8e
commit a316413e23
2 changed files with 8 additions and 8 deletions

View File

@ -91,13 +91,13 @@ const ThroughputSummary: React.FC = () => {
const [isLoading, setIsLoading] = useState(true); const [isLoading, setIsLoading] = useState(true);
useEffect(() => { useEffect(() => {
// console.log('productionCapacityData > 0: ', productionCapacityData > 0); //
if (productionCapacityData > 0) { if (productionCapacityData > 0) {
setTimeout(() => { setTimeout(() => {
setIsLoading(false); setIsLoading(false);
}, 3000) }, 3000)
console.log("productionCapacityData: ", productionCapacityData);
} else { } else {
setIsLoading(true); setIsLoading(true);
} }

View File

@ -92,7 +92,7 @@ export default function ThroughPutData() {
totalItems += sequence.length; totalItems += sequence.length;
}); });
console.log(totalActiveTime);
setMachineCount(totalItems); setMachineCount(totalItems);
setMachineActiveTime(totalActiveTime); setMachineActiveTime(totalActiveTime);
let arr = process.map((item: any) => ({ let arr = process.map((item: any) => ({
@ -161,7 +161,7 @@ export default function ThroughPutData() {
const allInactive = !anyArmActive && !anyVehicleActive && !anyMachineActive; const allInactive = !anyArmActive && !anyVehicleActive && !anyMachineActive;
if (allInactive && materials.length === 0 && materialHistory.length > 0) { if (allInactive && materials.length === 0 && materialHistory.length > 0) {
console.log("inside allInactive condition");
let totalCycleTimeSum = 0; let totalCycleTimeSum = 0;
let cycleCount = 0; let cycleCount = 0;
@ -190,14 +190,14 @@ export default function ThroughPutData() {
useEffect(() => { useEffect(() => {
if (machineActiveTime > 0 && materialCycleTime > 0 && machineCount > 0) { if (machineActiveTime > 0 && materialCycleTime > 0 && machineCount > 0) {
console.log('machineActiveTime: ', machineActiveTime);
console.log('materialCycleTime: ', materialCycleTime);
console.log('machineCount: ', machineCount);
const utilization = machineActiveTime / 3600; // Active time per hour const utilization = machineActiveTime / 3600; // Active time per hour
const unitsPerMachinePerHour = 3600 / materialCycleTime; const unitsPerMachinePerHour = 3600 / materialCycleTime;
const throughput = unitsPerMachinePerHour * machineCount * utilization; const throughput = unitsPerMachinePerHour * machineCount * utilization;
setThroughputData(Number(throughput.toFixed(2))); // Keep as number setThroughputData(Number(throughput.toFixed(2))); // Keep as number
// console.log('throughput ', Number(throughput.toFixed(2))); //
} }
}, [machineActiveTime, materialCycleTime, machineCount]); }, [machineActiveTime, materialCycleTime, machineCount]);